diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-07-26 12:19:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-11-03 16:27:31 -0400 |
commit | 022e52cfe846469363e168b6a0095e7873279811 (patch) | |
tree | be1edd19cffdc0ee62dc9467ad2dcbb7036b67da | |
parent | f836c6289b0cfbfaf2f90202d0edcb45f957f7cd (diff) |
[media] V4L: sh_mobile_csi2: support the new mbus-config subdev ops
Extend the driver to also support [gs]_mbus_config() subdevice video
operations.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/video/sh_mobile_csi2.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/media/video/sh_mobile_csi2.c b/drivers/media/video/sh_mobile_csi2.c index 09ef63d912e3..6b4044134113 100644 --- a/drivers/media/video/sh_mobile_csi2.c +++ b/drivers/media/video/sh_mobile_csi2.c | |||
@@ -36,6 +36,7 @@ struct sh_csi2 { | |||
36 | struct v4l2_subdev subdev; | 36 | struct v4l2_subdev subdev; |
37 | struct list_head list; | 37 | struct list_head list; |
38 | unsigned int irq; | 38 | unsigned int irq; |
39 | unsigned long mipi_flags; | ||
39 | void __iomem *base; | 40 | void __iomem *base; |
40 | struct platform_device *pdev; | 41 | struct platform_device *pdev; |
41 | struct sh_csi2_client_config *client; | 42 | struct sh_csi2_client_config *client; |
@@ -128,9 +129,34 @@ static int sh_csi2_s_fmt(struct v4l2_subdev *sd, | |||
128 | return 0; | 129 | return 0; |
129 | } | 130 | } |
130 | 131 | ||
132 | static int sh_csi2_g_mbus_config(struct v4l2_subdev *sd, | ||
133 | struct v4l2_mbus_config *cfg) | ||
134 | { | ||
135 | cfg->flags = V4L2_MBUS_PCLK_SAMPLE_RISING | | ||
136 | V4L2_MBUS_HSYNC_ACTIVE_HIGH | V4L2_MBUS_VSYNC_ACTIVE_HIGH | | ||
137 | V4L2_MBUS_MASTER | V4L2_MBUS_DATA_ACTIVE_HIGH; | ||
138 | cfg->type = V4L2_MBUS_PARALLEL; | ||
139 | |||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | static int sh_csi2_s_mbus_config(struct v4l2_subdev *sd, | ||
144 | const struct v4l2_mbus_config *cfg) | ||
145 | { | ||
146 | struct sh_csi2 *priv = container_of(sd, struct sh_csi2, subdev); | ||
147 | struct soc_camera_device *icd = (struct soc_camera_device *)sd->grp_id; | ||
148 | struct v4l2_subdev *client_sd = soc_camera_to_subdev(icd); | ||
149 | struct v4l2_mbus_config client_cfg = {.type = V4L2_MBUS_CSI2, | ||
150 | .flags = priv->mipi_flags}; | ||
151 | |||
152 | return v4l2_subdev_call(client_sd, video, s_mbus_config, &client_cfg); | ||
153 | } | ||
154 | |||
131 | static struct v4l2_subdev_video_ops sh_csi2_subdev_video_ops = { | 155 | static struct v4l2_subdev_video_ops sh_csi2_subdev_video_ops = { |
132 | .s_mbus_fmt = sh_csi2_s_fmt, | 156 | .s_mbus_fmt = sh_csi2_s_fmt, |
133 | .try_mbus_fmt = sh_csi2_try_fmt, | 157 | .try_mbus_fmt = sh_csi2_try_fmt, |
158 | .g_mbus_config = sh_csi2_g_mbus_config, | ||
159 | .s_mbus_config = sh_csi2_s_mbus_config, | ||
134 | }; | 160 | }; |
135 | 161 | ||
136 | static void sh_csi2_hwinit(struct sh_csi2 *priv) | 162 | static void sh_csi2_hwinit(struct sh_csi2 *priv) |
@@ -251,6 +277,7 @@ static int sh_csi2_client_connect(struct sh_csi2 *priv) | |||
251 | return -EINVAL; | 277 | return -EINVAL; |
252 | 278 | ||
253 | /* All good: camera MIPI configuration supported */ | 279 | /* All good: camera MIPI configuration supported */ |
280 | priv->mipi_flags = common_flags; | ||
254 | priv->client = pdata->clients + i; | 281 | priv->client = pdata->clients + i; |
255 | 282 | ||
256 | priv->set_bus_param = icd->ops->set_bus_param; | 283 | priv->set_bus_param = icd->ops->set_bus_param; |