diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2011-07-15 19:03:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-27 16:56:08 -0400 |
commit | 7dfff95366f48bf66f77c17cdc9ebd8be696ac5d (patch) | |
tree | c4cb975f5b8b8c3008921d38fa6e4deed9c8dbc9 /drivers/media/video/omap1_camera.c | |
parent | d33b290a149dafe2e3cc2901ec726bea09a2c0f4 (diff) |
[media] V4L: soc-camera: remove soc-camera bus and devices on it
Now that v4l2 subdevices have got their own device objects, having
one more device in soc-camera clients became redundant and confusing.
This patch removes those devices and the soc-camera bus, they used to
reside on.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/omap1_camera.c')
-rw-r--r-- | drivers/media/video/omap1_camera.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/media/video/omap1_camera.c b/drivers/media/video/omap1_camera.c index 9bfe4c121a5c..8a947e603aca 100644 --- a/drivers/media/video/omap1_camera.c +++ b/drivers/media/video/omap1_camera.c | |||
@@ -207,7 +207,7 @@ static int omap1_videobuf_setup(struct videobuf_queue *vq, unsigned int *count, | |||
207 | struct soc_camera_device *icd = vq->priv_data; | 207 | struct soc_camera_device *icd = vq->priv_data; |
208 | int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, | 208 | int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, |
209 | icd->current_fmt->host_fmt); | 209 | icd->current_fmt->host_fmt); |
210 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 210 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
211 | struct omap1_cam_dev *pcdev = ici->priv; | 211 | struct omap1_cam_dev *pcdev = ici->priv; |
212 | 212 | ||
213 | if (bytes_per_line < 0) | 213 | if (bytes_per_line < 0) |
@@ -221,7 +221,7 @@ static int omap1_videobuf_setup(struct videobuf_queue *vq, unsigned int *count, | |||
221 | if (*size * *count > MAX_VIDEO_MEM * 1024 * 1024) | 221 | if (*size * *count > MAX_VIDEO_MEM * 1024 * 1024) |
222 | *count = (MAX_VIDEO_MEM * 1024 * 1024) / *size; | 222 | *count = (MAX_VIDEO_MEM * 1024 * 1024) / *size; |
223 | 223 | ||
224 | dev_dbg(icd->dev.parent, | 224 | dev_dbg(icd->parent, |
225 | "%s: count=%d, size=%d\n", __func__, *count, *size); | 225 | "%s: count=%d, size=%d\n", __func__, *count, *size); |
226 | 226 | ||
227 | return 0; | 227 | return 0; |
@@ -240,7 +240,7 @@ static void free_buffer(struct videobuf_queue *vq, struct omap1_cam_buf *buf, | |||
240 | videobuf_dma_contig_free(vq, vb); | 240 | videobuf_dma_contig_free(vq, vb); |
241 | } else { | 241 | } else { |
242 | struct soc_camera_device *icd = vq->priv_data; | 242 | struct soc_camera_device *icd = vq->priv_data; |
243 | struct device *dev = icd->dev.parent; | 243 | struct device *dev = icd->parent; |
244 | struct videobuf_dmabuf *dma = videobuf_to_dma(vb); | 244 | struct videobuf_dmabuf *dma = videobuf_to_dma(vb); |
245 | 245 | ||
246 | videobuf_dma_unmap(dev, dma); | 246 | videobuf_dma_unmap(dev, dma); |
@@ -257,7 +257,7 @@ static int omap1_videobuf_prepare(struct videobuf_queue *vq, | |||
257 | struct omap1_cam_buf *buf = container_of(vb, struct omap1_cam_buf, vb); | 257 | struct omap1_cam_buf *buf = container_of(vb, struct omap1_cam_buf, vb); |
258 | int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, | 258 | int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, |
259 | icd->current_fmt->host_fmt); | 259 | icd->current_fmt->host_fmt); |
260 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 260 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
261 | struct omap1_cam_dev *pcdev = ici->priv; | 261 | struct omap1_cam_dev *pcdev = ici->priv; |
262 | int ret; | 262 | int ret; |
263 | 263 | ||
@@ -489,7 +489,7 @@ static void omap1_videobuf_queue(struct videobuf_queue *vq, | |||
489 | struct videobuf_buffer *vb) | 489 | struct videobuf_buffer *vb) |
490 | { | 490 | { |
491 | struct soc_camera_device *icd = vq->priv_data; | 491 | struct soc_camera_device *icd = vq->priv_data; |
492 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 492 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
493 | struct omap1_cam_dev *pcdev = ici->priv; | 493 | struct omap1_cam_dev *pcdev = ici->priv; |
494 | struct omap1_cam_buf *buf; | 494 | struct omap1_cam_buf *buf; |
495 | u32 mode; | 495 | u32 mode; |
@@ -518,7 +518,7 @@ static void omap1_videobuf_queue(struct videobuf_queue *vq, | |||
518 | pcdev->active = buf; | 518 | pcdev->active = buf; |
519 | pcdev->ready = NULL; | 519 | pcdev->ready = NULL; |
520 | 520 | ||
521 | dev_dbg(icd->dev.parent, | 521 | dev_dbg(icd->parent, |
522 | "%s: capture not active, setup FIFO, start DMA\n", __func__); | 522 | "%s: capture not active, setup FIFO, start DMA\n", __func__); |
523 | mode = CAM_READ_CACHE(pcdev, MODE) & ~THRESHOLD_MASK; | 523 | mode = CAM_READ_CACHE(pcdev, MODE) & ~THRESHOLD_MASK; |
524 | mode |= THRESHOLD_LEVEL(pcdev->vb_mode) << THRESHOLD_SHIFT; | 524 | mode |= THRESHOLD_LEVEL(pcdev->vb_mode) << THRESHOLD_SHIFT; |
@@ -542,8 +542,8 @@ static void omap1_videobuf_release(struct videobuf_queue *vq, | |||
542 | struct omap1_cam_buf *buf = | 542 | struct omap1_cam_buf *buf = |
543 | container_of(vb, struct omap1_cam_buf, vb); | 543 | container_of(vb, struct omap1_cam_buf, vb); |
544 | struct soc_camera_device *icd = vq->priv_data; | 544 | struct soc_camera_device *icd = vq->priv_data; |
545 | struct device *dev = icd->dev.parent; | 545 | struct device *dev = icd->parent; |
546 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 546 | struct soc_camera_host *ici = to_soc_camera_host(dev); |
547 | struct omap1_cam_dev *pcdev = ici->priv; | 547 | struct omap1_cam_dev *pcdev = ici->priv; |
548 | 548 | ||
549 | switch (vb->state) { | 549 | switch (vb->state) { |
@@ -572,7 +572,7 @@ static void videobuf_done(struct omap1_cam_dev *pcdev, | |||
572 | { | 572 | { |
573 | struct omap1_cam_buf *buf = pcdev->active; | 573 | struct omap1_cam_buf *buf = pcdev->active; |
574 | struct videobuf_buffer *vb; | 574 | struct videobuf_buffer *vb; |
575 | struct device *dev = pcdev->icd->dev.parent; | 575 | struct device *dev = pcdev->icd->parent; |
576 | 576 | ||
577 | if (WARN_ON(!buf)) { | 577 | if (WARN_ON(!buf)) { |
578 | suspend_capture(pcdev); | 578 | suspend_capture(pcdev); |
@@ -798,7 +798,7 @@ out: | |||
798 | static irqreturn_t cam_isr(int irq, void *data) | 798 | static irqreturn_t cam_isr(int irq, void *data) |
799 | { | 799 | { |
800 | struct omap1_cam_dev *pcdev = data; | 800 | struct omap1_cam_dev *pcdev = data; |
801 | struct device *dev = pcdev->icd->dev.parent; | 801 | struct device *dev = pcdev->icd->parent; |
802 | struct omap1_cam_buf *buf = pcdev->active; | 802 | struct omap1_cam_buf *buf = pcdev->active; |
803 | u32 it_status; | 803 | u32 it_status; |
804 | unsigned long flags; | 804 | unsigned long flags; |
@@ -908,7 +908,7 @@ static void sensor_reset(struct omap1_cam_dev *pcdev, bool reset) | |||
908 | */ | 908 | */ |
909 | static int omap1_cam_add_device(struct soc_camera_device *icd) | 909 | static int omap1_cam_add_device(struct soc_camera_device *icd) |
910 | { | 910 | { |
911 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 911 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
912 | struct omap1_cam_dev *pcdev = ici->priv; | 912 | struct omap1_cam_dev *pcdev = ici->priv; |
913 | u32 ctrlclock; | 913 | u32 ctrlclock; |
914 | 914 | ||
@@ -951,14 +951,14 @@ static int omap1_cam_add_device(struct soc_camera_device *icd) | |||
951 | 951 | ||
952 | pcdev->icd = icd; | 952 | pcdev->icd = icd; |
953 | 953 | ||
954 | dev_dbg(icd->dev.parent, "OMAP1 Camera driver attached to camera %d\n", | 954 | dev_dbg(icd->parent, "OMAP1 Camera driver attached to camera %d\n", |
955 | icd->devnum); | 955 | icd->devnum); |
956 | return 0; | 956 | return 0; |
957 | } | 957 | } |
958 | 958 | ||
959 | static void omap1_cam_remove_device(struct soc_camera_device *icd) | 959 | static void omap1_cam_remove_device(struct soc_camera_device *icd) |
960 | { | 960 | { |
961 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 961 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
962 | struct omap1_cam_dev *pcdev = ici->priv; | 962 | struct omap1_cam_dev *pcdev = ici->priv; |
963 | u32 ctrlclock; | 963 | u32 ctrlclock; |
964 | 964 | ||
@@ -984,7 +984,7 @@ static void omap1_cam_remove_device(struct soc_camera_device *icd) | |||
984 | 984 | ||
985 | pcdev->icd = NULL; | 985 | pcdev->icd = NULL; |
986 | 986 | ||
987 | dev_dbg(icd->dev.parent, | 987 | dev_dbg(icd->parent, |
988 | "OMAP1 Camera driver detached from camera %d\n", icd->devnum); | 988 | "OMAP1 Camera driver detached from camera %d\n", icd->devnum); |
989 | } | 989 | } |
990 | 990 | ||
@@ -1069,7 +1069,7 @@ static int omap1_cam_get_formats(struct soc_camera_device *icd, | |||
1069 | unsigned int idx, struct soc_camera_format_xlate *xlate) | 1069 | unsigned int idx, struct soc_camera_format_xlate *xlate) |
1070 | { | 1070 | { |
1071 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | 1071 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); |
1072 | struct device *dev = icd->dev.parent; | 1072 | struct device *dev = icd->parent; |
1073 | int formats = 0, ret; | 1073 | int formats = 0, ret; |
1074 | enum v4l2_mbus_pixelcode code; | 1074 | enum v4l2_mbus_pixelcode code; |
1075 | const struct soc_mbus_pixelfmt *fmt; | 1075 | const struct soc_mbus_pixelfmt *fmt; |
@@ -1221,9 +1221,9 @@ static int omap1_cam_set_crop(struct soc_camera_device *icd, | |||
1221 | struct v4l2_rect *rect = &crop->c; | 1221 | struct v4l2_rect *rect = &crop->c; |
1222 | const struct soc_camera_format_xlate *xlate = icd->current_fmt; | 1222 | const struct soc_camera_format_xlate *xlate = icd->current_fmt; |
1223 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | 1223 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); |
1224 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 1224 | struct device *dev = icd->parent; |
1225 | struct soc_camera_host *ici = to_soc_camera_host(dev); | ||
1225 | struct omap1_cam_dev *pcdev = ici->priv; | 1226 | struct omap1_cam_dev *pcdev = ici->priv; |
1226 | struct device *dev = icd->dev.parent; | ||
1227 | struct v4l2_mbus_framefmt mf; | 1227 | struct v4l2_mbus_framefmt mf; |
1228 | int ret; | 1228 | int ret; |
1229 | 1229 | ||
@@ -1269,8 +1269,8 @@ static int omap1_cam_set_fmt(struct soc_camera_device *icd, | |||
1269 | { | 1269 | { |
1270 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | 1270 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); |
1271 | const struct soc_camera_format_xlate *xlate; | 1271 | const struct soc_camera_format_xlate *xlate; |
1272 | struct device *dev = icd->dev.parent; | 1272 | struct device *dev = icd->parent; |
1273 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 1273 | struct soc_camera_host *ici = to_soc_camera_host(dev); |
1274 | struct omap1_cam_dev *pcdev = ici->priv; | 1274 | struct omap1_cam_dev *pcdev = ici->priv; |
1275 | struct v4l2_pix_format *pix = &f->fmt.pix; | 1275 | struct v4l2_pix_format *pix = &f->fmt.pix; |
1276 | struct v4l2_mbus_framefmt mf; | 1276 | struct v4l2_mbus_framefmt mf; |
@@ -1325,7 +1325,7 @@ static int omap1_cam_try_fmt(struct soc_camera_device *icd, | |||
1325 | 1325 | ||
1326 | xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); | 1326 | xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); |
1327 | if (!xlate) { | 1327 | if (!xlate) { |
1328 | dev_warn(icd->dev.parent, "Format %#x not found\n", | 1328 | dev_warn(icd->parent, "Format %#x not found\n", |
1329 | pix->pixelformat); | 1329 | pix->pixelformat); |
1330 | return -EINVAL; | 1330 | return -EINVAL; |
1331 | } | 1331 | } |
@@ -1361,7 +1361,7 @@ static int omap1_cam_mmap_mapper(struct videobuf_queue *q, | |||
1361 | struct vm_area_struct *vma) | 1361 | struct vm_area_struct *vma) |
1362 | { | 1362 | { |
1363 | struct soc_camera_device *icd = q->priv_data; | 1363 | struct soc_camera_device *icd = q->priv_data; |
1364 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 1364 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
1365 | struct omap1_cam_dev *pcdev = ici->priv; | 1365 | struct omap1_cam_dev *pcdev = ici->priv; |
1366 | int ret; | 1366 | int ret; |
1367 | 1367 | ||
@@ -1376,17 +1376,17 @@ static int omap1_cam_mmap_mapper(struct videobuf_queue *q, | |||
1376 | static void omap1_cam_init_videobuf(struct videobuf_queue *q, | 1376 | static void omap1_cam_init_videobuf(struct videobuf_queue *q, |
1377 | struct soc_camera_device *icd) | 1377 | struct soc_camera_device *icd) |
1378 | { | 1378 | { |
1379 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 1379 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
1380 | struct omap1_cam_dev *pcdev = ici->priv; | 1380 | struct omap1_cam_dev *pcdev = ici->priv; |
1381 | 1381 | ||
1382 | if (!sg_mode) | 1382 | if (!sg_mode) |
1383 | videobuf_queue_dma_contig_init(q, &omap1_videobuf_ops, | 1383 | videobuf_queue_dma_contig_init(q, &omap1_videobuf_ops, |
1384 | icd->dev.parent, &pcdev->lock, | 1384 | icd->parent, &pcdev->lock, |
1385 | V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, | 1385 | V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, |
1386 | sizeof(struct omap1_cam_buf), icd, &icd->video_lock); | 1386 | sizeof(struct omap1_cam_buf), icd, &icd->video_lock); |
1387 | else | 1387 | else |
1388 | videobuf_queue_sg_init(q, &omap1_videobuf_ops, | 1388 | videobuf_queue_sg_init(q, &omap1_videobuf_ops, |
1389 | icd->dev.parent, &pcdev->lock, | 1389 | icd->parent, &pcdev->lock, |
1390 | V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, | 1390 | V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, |
1391 | sizeof(struct omap1_cam_buf), icd, &icd->video_lock); | 1391 | sizeof(struct omap1_cam_buf), icd, &icd->video_lock); |
1392 | 1392 | ||
@@ -1438,9 +1438,9 @@ static int omap1_cam_querycap(struct soc_camera_host *ici, | |||
1438 | static int omap1_cam_set_bus_param(struct soc_camera_device *icd, | 1438 | static int omap1_cam_set_bus_param(struct soc_camera_device *icd, |
1439 | __u32 pixfmt) | 1439 | __u32 pixfmt) |
1440 | { | 1440 | { |
1441 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 1441 | struct device *dev = icd->parent; |
1442 | struct soc_camera_host *ici = to_soc_camera_host(dev); | ||
1442 | struct omap1_cam_dev *pcdev = ici->priv; | 1443 | struct omap1_cam_dev *pcdev = ici->priv; |
1443 | struct device *dev = icd->dev.parent; | ||
1444 | const struct soc_camera_format_xlate *xlate; | 1444 | const struct soc_camera_format_xlate *xlate; |
1445 | const struct soc_mbus_pixelfmt *fmt; | 1445 | const struct soc_mbus_pixelfmt *fmt; |
1446 | unsigned long camera_flags, common_flags; | 1446 | unsigned long camera_flags, common_flags; |