Lines Matching refs:sd

518     struct v4l2_subdev *sd;

535 struct v4l2_subdev sd;
543 int (*stream_on)(struct mipidphy_priv *priv, struct v4l2_subdev *sd);
544 int (*stream_off)(struct mipidphy_priv *priv, struct v4l2_subdev *sd);
549 return container_of(subdev, struct mipidphy_priv, sd);
661 static struct v4l2_subdev *get_remote_sensor(struct v4l2_subdev *sd)
666 local = &sd->entity.pads[MIPI_DPHY_RX_PAD_SINK];
669 v4l2_warn(sd, "No link between dphy and sensor\n");
677 static struct mipidphy_sensor *sd_to_sensor(struct mipidphy_priv *priv, struct v4l2_subdev *sd)
682 if (priv->sensors[i].sd == sd) {
690 static int mipidphy_get_sensor_data_rate(struct v4l2_subdev *sd)
692 struct mipidphy_priv *priv = to_dphy_priv(sd);
693 struct v4l2_subdev *sensor_sd = get_remote_sensor(sd);
702 v4l2_warn(sd, "No pixel rate control in subdev\n");
709 v4l2_err(sd, "Failed to get menu item\n");
714 v4l2_err(sd, "Invalid link_freq\n");
719 v4l2_info(sd, "data_rate_mbps %lld\n", priv->data_rate_mbps);
723 static int mipidphy_update_sensor_mbus(struct v4l2_subdev *sd)
725 struct mipidphy_priv *priv = to_dphy_priv(sd);
726 struct v4l2_subdev *sensor_sd = get_remote_sensor(sd);
757 static void rk1126_mipidphy_dphy_sel(struct v4l2_subdev *sd)
759 struct mipidphy_priv *priv = to_dphy_priv(sd);
763 model = sd->v4l2_dev->mdev->model;
791 static int mipidphy_s_stream_start(struct v4l2_subdev *sd)
793 struct mipidphy_priv *priv = to_dphy_priv(sd);
800 ret = mipidphy_get_sensor_data_rate(sd);
806 rk1126_mipidphy_dphy_sel(sd);
809 mipidphy_update_sensor_mbus(sd);
810 priv->stream_on(priv, sd);
817 static int mipidphy_s_stream_stop(struct v4l2_subdev *sd)
819 struct mipidphy_priv *priv = to_dphy_priv(sd);
826 priv->stream_off(priv, sd);
833 static int mipidphy_s_stream(struct v4l2_subdev *sd, int on)
836 struct mipidphy_priv *priv = to_dphy_priv(sd);
841 ret = mipidphy_s_stream_start(sd);
843 ret = mipidphy_s_stream_stop(sd);
849 static int mipidphy_g_frame_interval(struct v4l2_subdev *sd, struct v4l2_subdev_frame_interval *fi)
851 struct v4l2_subdev *sensor = get_remote_sensor(sd);
860 static int mipidphy_g_mbus_config(struct v4l2_subdev *sd, unsigned int pad_id, struct v4l2_mbus_config *config)
862 struct mipidphy_priv *priv = to_dphy_priv(sd);
863 struct v4l2_subdev *sensor_sd = get_remote_sensor(sd);
870 mipidphy_update_sensor_mbus(sd);
876 static int mipidphy_s_power(struct v4l2_subdev *sd, int on)
878 struct mipidphy_priv *priv = to_dphy_priv(sd);
890 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(me);
891 struct mipidphy_priv *priv = to_dphy_priv(sd);
907 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(me);
908 struct mipidphy_priv *priv = to_dphy_priv(sd);
930 static int mipidphy_get_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
933 struct mipidphy_priv *priv = to_dphy_priv(sd);
934 struct v4l2_subdev *sensor_sd = get_remote_sensor(sd);
951 static int mipidphy_get_selection(struct v4l2_subdev *sd, struct v4l2_subdev_pad_config *cfg,
954 struct v4l2_subdev *sensor = get_remote_sensor(sd);
1081 static int mipidphy_rx_stream_on(struct mipidphy_priv *priv, struct v4l2_subdev *sd)
1083 struct v4l2_subdev *sensor_sd = get_remote_sensor(sd);
1171 static int mipidphy_txrx_stream_on(struct mipidphy_priv *priv, struct v4l2_subdev *sd)
1173 struct v4l2_subdev *sensor_sd = get_remote_sensor(sd);
1288 static int csi_mipidphy_stream_on(struct mipidphy_priv *priv, struct v4l2_subdev *sd)
1290 struct v4l2_subdev *sensor_sd = get_remote_sensor(sd);
1398 static int csi_mipidphy_stream_off(struct mipidphy_priv *priv, struct v4l2_subdev *sd)
1503 static int rockchip_mipidphy_notifier_bound(struct v4l2_async_notifier *notifier, struct v4l2_subdev *sd,
1518 sensor->sd = sd;
1519 dev_info(priv->dev, "match %s:bus type %d\n", sd->name, s_asd->mbus.type);
1521 for (pad = 0; pad < sensor->sd->entity.num_pads; pad++) {
1522 if (sensor->sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE) {
1527 if (pad == sensor->sd->entity.num_pads) {
1528 dev_err(priv->dev, "failed to find src pad for %s\n", sensor->sd->name);
1533 ret = media_create_pad_link(&sensor->sd->entity, pad, &priv->sd.entity, MIPI_DPHY_RX_PAD_SINK,
1536 dev_err(priv->dev, "failed to create link for %s\n", sensor->sd->name);
1544 static void rockchip_mipidphy_notifier_unbind(struct v4l2_async_notifier *notifier, struct v4l2_subdev *sd,
1548 struct mipidphy_sensor *sensor = sd_to_sensor(priv, sd);
1550 sensor->sd = NULL;
1608 priv->sd.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE;
1609 ret = media_entity_pads_init(&priv->sd.entity, MIPI_DPHY_RX_PADS_NUM, priv->pads);
1622 priv->sd.subdev_notifier = &priv->notifier;
1624 ret = v4l2_async_subdev_notifier_register(&priv->sd, &priv->notifier);
1631 return v4l2_async_register_subdev(&priv->sd);
1637 struct v4l2_subdev *sd;
1700 sd = &priv->sd;
1702 v4l2_subdev_init(sd, &mipidphy_subdev_ops);
1703 sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
1704 snprintf(sd->name, sizeof(sd->name), "rockchip-mipi-dphy-rx");
1705 sd->dev = dev;
1707 platform_set_drvdata(pdev, &sd->entity);
1726 struct v4l2_subdev *sd = media_entity_to_v4l2_subdev(me);
1729 media_entity_cleanup(&sd->entity);