aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/mx2_camera.c
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-07-15 19:03:38 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:56:08 -0400
commit7dfff95366f48bf66f77c17cdc9ebd8be696ac5d (patch)
treec4cb975f5b8b8c3008921d38fa6e4deed9c8dbc9 /drivers/media/video/mx2_camera.c
parentd33b290a149dafe2e3cc2901ec726bea09a2c0f4 (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/mx2_camera.c')
-rw-r--r--drivers/media/video/mx2_camera.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index 55d48442c2e..ec2410c0c80 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -277,7 +277,7 @@ static void mx2_camera_deactivate(struct mx2_camera_dev *pcdev)
277 */ 277 */
278static int mx2_camera_add_device(struct soc_camera_device *icd) 278static int mx2_camera_add_device(struct soc_camera_device *icd)
279{ 279{
280 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 280 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
281 struct mx2_camera_dev *pcdev = ici->priv; 281 struct mx2_camera_dev *pcdev = ici->priv;
282 int ret; 282 int ret;
283 u32 csicr1; 283 u32 csicr1;
@@ -302,7 +302,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
302 302
303 pcdev->icd = icd; 303 pcdev->icd = icd;
304 304
305 dev_info(icd->dev.parent, "Camera driver attached to camera %d\n", 305 dev_info(icd->parent, "Camera driver attached to camera %d\n",
306 icd->devnum); 306 icd->devnum);
307 307
308 return 0; 308 return 0;
@@ -310,12 +310,12 @@ static int mx2_camera_add_device(struct soc_camera_device *icd)
310 310
311static void mx2_camera_remove_device(struct soc_camera_device *icd) 311static void mx2_camera_remove_device(struct soc_camera_device *icd)
312{ 312{
313 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 313 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
314 struct mx2_camera_dev *pcdev = ici->priv; 314 struct mx2_camera_dev *pcdev = ici->priv;
315 315
316 BUG_ON(icd != pcdev->icd); 316 BUG_ON(icd != pcdev->icd);
317 317
318 dev_info(icd->dev.parent, "Camera driver detached from camera %d\n", 318 dev_info(icd->parent, "Camera driver detached from camera %d\n",
319 icd->devnum); 319 icd->devnum);
320 320
321 mx2_camera_deactivate(pcdev); 321 mx2_camera_deactivate(pcdev);
@@ -436,7 +436,7 @@ static int mx2_videobuf_setup(struct videobuf_queue *vq, unsigned int *count,
436 int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, 436 int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width,
437 icd->current_fmt->host_fmt); 437 icd->current_fmt->host_fmt);
438 438
439 dev_dbg(&icd->dev, "count=%d, size=%d\n", *count, *size); 439 dev_dbg(icd->parent, "count=%d, size=%d\n", *count, *size);
440 440
441 if (bytes_per_line < 0) 441 if (bytes_per_line < 0)
442 return bytes_per_line; 442 return bytes_per_line;
@@ -456,7 +456,7 @@ static void free_buffer(struct videobuf_queue *vq, struct mx2_buffer *buf)
456 struct soc_camera_device *icd = vq->priv_data; 456 struct soc_camera_device *icd = vq->priv_data;
457 struct videobuf_buffer *vb = &buf->vb; 457 struct videobuf_buffer *vb = &buf->vb;
458 458
459 dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, 459 dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
460 vb, vb->baddr, vb->bsize); 460 vb, vb->baddr, vb->bsize);
461 461
462 /* 462 /*
@@ -466,7 +466,7 @@ static void free_buffer(struct videobuf_queue *vq, struct mx2_buffer *buf)
466 videobuf_waiton(vq, vb, 0, 0); 466 videobuf_waiton(vq, vb, 0, 0);
467 467
468 videobuf_dma_contig_free(vq, vb); 468 videobuf_dma_contig_free(vq, vb);
469 dev_dbg(&icd->dev, "%s freed\n", __func__); 469 dev_dbg(icd->parent, "%s freed\n", __func__);
470 470
471 vb->state = VIDEOBUF_NEEDS_INIT; 471 vb->state = VIDEOBUF_NEEDS_INIT;
472} 472}
@@ -480,7 +480,7 @@ static int mx2_videobuf_prepare(struct videobuf_queue *vq,
480 icd->current_fmt->host_fmt); 480 icd->current_fmt->host_fmt);
481 int ret = 0; 481 int ret = 0;
482 482
483 dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, 483 dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
484 vb, vb->baddr, vb->bsize); 484 vb, vb->baddr, vb->bsize);
485 485
486 if (bytes_per_line < 0) 486 if (bytes_per_line < 0)
@@ -532,12 +532,12 @@ static void mx2_videobuf_queue(struct videobuf_queue *vq,
532{ 532{
533 struct soc_camera_device *icd = vq->priv_data; 533 struct soc_camera_device *icd = vq->priv_data;
534 struct soc_camera_host *ici = 534 struct soc_camera_host *ici =
535 to_soc_camera_host(icd->dev.parent); 535 to_soc_camera_host(icd->parent);
536 struct mx2_camera_dev *pcdev = ici->priv; 536 struct mx2_camera_dev *pcdev = ici->priv;
537 struct mx2_buffer *buf = container_of(vb, struct mx2_buffer, vb); 537 struct mx2_buffer *buf = container_of(vb, struct mx2_buffer, vb);
538 unsigned long flags; 538 unsigned long flags;
539 539
540 dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, 540 dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
541 vb, vb->baddr, vb->bsize); 541 vb, vb->baddr, vb->bsize);
542 542
543 spin_lock_irqsave(&pcdev->lock, flags); 543 spin_lock_irqsave(&pcdev->lock, flags);
@@ -610,27 +610,27 @@ static void mx2_videobuf_release(struct videobuf_queue *vq,
610 struct videobuf_buffer *vb) 610 struct videobuf_buffer *vb)
611{ 611{
612 struct soc_camera_device *icd = vq->priv_data; 612 struct soc_camera_device *icd = vq->priv_data;
613 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 613 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
614 struct mx2_camera_dev *pcdev = ici->priv; 614 struct mx2_camera_dev *pcdev = ici->priv;
615 struct mx2_buffer *buf = container_of(vb, struct mx2_buffer, vb); 615 struct mx2_buffer *buf = container_of(vb, struct mx2_buffer, vb);
616 unsigned long flags; 616 unsigned long flags;
617 617
618#ifdef DEBUG 618#ifdef DEBUG
619 dev_dbg(&icd->dev, "%s (vb=0x%p) 0x%08lx %d\n", __func__, 619 dev_dbg(icd->parent, "%s (vb=0x%p) 0x%08lx %d\n", __func__,
620 vb, vb->baddr, vb->bsize); 620 vb, vb->baddr, vb->bsize);
621 621
622 switch (vb->state) { 622 switch (vb->state) {
623 case VIDEOBUF_ACTIVE: 623 case VIDEOBUF_ACTIVE:
624 dev_info(&icd->dev, "%s (active)\n", __func__); 624 dev_info(icd->parent, "%s (active)\n", __func__);
625 break; 625 break;
626 case VIDEOBUF_QUEUED: 626 case VIDEOBUF_QUEUED:
627 dev_info(&icd->dev, "%s (queued)\n", __func__); 627 dev_info(icd->parent, "%s (queued)\n", __func__);
628 break; 628 break;
629 case VIDEOBUF_PREPARED: 629 case VIDEOBUF_PREPARED:
630 dev_info(&icd->dev, "%s (prepared)\n", __func__); 630 dev_info(icd->parent, "%s (prepared)\n", __func__);
631 break; 631 break;
632 default: 632 default:
633 dev_info(&icd->dev, "%s (unknown) %d\n", __func__, 633 dev_info(icd->parent, "%s (unknown) %d\n", __func__,
634 vb->state); 634 vb->state);
635 break; 635 break;
636 } 636 }
@@ -677,7 +677,7 @@ static struct videobuf_queue_ops mx2_videobuf_ops = {
677static void mx2_camera_init_videobuf(struct videobuf_queue *q, 677static void mx2_camera_init_videobuf(struct videobuf_queue *q,
678 struct soc_camera_device *icd) 678 struct soc_camera_device *icd)
679{ 679{
680 struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); 680 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
681 struct mx2_camera_dev *pcdev = ici->priv; 681 struct mx2_camera_dev *pcdev = ici->priv;
682 682
683 videobuf_queue_dma_contig_init(q, &mx2_videobuf_ops, pcdev->dev, 683 videobuf_queue_dma_contig_init(q, &mx2_videobuf_ops, pcdev->dev,
@@ -718,7 +718,7 @@ static void mx27_camera_emma_buf_init(struct soc_camera_device *icd,
718 int bytesperline) 718 int bytesperline)
719{ 719{
720 struct soc_camera_host *ici = 720 struct soc_camera_host *ici =
721 to_soc_camera_host(icd->dev.parent); 721 to_soc_camera_host(icd->parent);
722 struct mx2_camera_dev *pcdev = ici->priv; 722 struct mx2_camera_dev *pcdev = ici->priv;
723 723
724 writel(pcdev->discard_buffer_dma, 724 writel(pcdev->discard_buffer_dma,
@@ -771,7 +771,7 @@ static int mx2_camera_set_bus_param(struct soc_camera_device *icd,
771 __u32 pixfmt) 771 __u32 pixfmt)
772{ 772{
773 struct soc_camera_host *ici = 773 struct soc_camera_host *ici =
774 to_soc_camera_host(icd->dev.parent); 774 to_soc_camera_host(icd->parent);
775 struct mx2_camera_dev *pcdev = ici->priv; 775 struct mx2_camera_dev *pcdev = ici->priv;
776 unsigned long camera_flags, common_flags; 776 unsigned long camera_flags, common_flags;
777 int ret = 0; 777 int ret = 0;
@@ -890,7 +890,7 @@ static int mx2_camera_set_crop(struct soc_camera_device *icd,
890 if (ret < 0) 890 if (ret < 0)
891 return ret; 891 return ret;
892 892
893 dev_dbg(icd->dev.parent, "Sensor cropped %dx%d\n", 893 dev_dbg(icd->parent, "Sensor cropped %dx%d\n",
894 mf.width, mf.height); 894 mf.width, mf.height);
895 895
896 icd->user_width = mf.width; 896 icd->user_width = mf.width;
@@ -910,7 +910,7 @@ static int mx2_camera_set_fmt(struct soc_camera_device *icd,
910 910
911 xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); 911 xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat);
912 if (!xlate) { 912 if (!xlate) {
913 dev_warn(icd->dev.parent, "Format %x not found\n", 913 dev_warn(icd->parent, "Format %x not found\n",
914 pix->pixelformat); 914 pix->pixelformat);
915 return -EINVAL; 915 return -EINVAL;
916 } 916 }
@@ -950,7 +950,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
950 950
951 xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); 951 xlate = soc_camera_xlate_by_fourcc(icd, pixfmt);
952 if (pixfmt && !xlate) { 952 if (pixfmt && !xlate) {
953 dev_warn(icd->dev.parent, "Format %x not found\n", pixfmt); 953 dev_warn(icd->parent, "Format %x not found\n", pixfmt);
954 return -EINVAL; 954 return -EINVAL;
955 } 955 }
956 956
@@ -1000,7 +1000,7 @@ static int mx2_camera_try_fmt(struct soc_camera_device *icd,
1000 if (mf.field == V4L2_FIELD_ANY) 1000 if (mf.field == V4L2_FIELD_ANY)
1001 mf.field = V4L2_FIELD_NONE; 1001 mf.field = V4L2_FIELD_NONE;
1002 if (mf.field != V4L2_FIELD_NONE) { 1002 if (mf.field != V4L2_FIELD_NONE) {
1003 dev_err(icd->dev.parent, "Field type %d unsupported.\n", 1003 dev_err(icd->parent, "Field type %d unsupported.\n",
1004 mf.field); 1004 mf.field);
1005 return -EINVAL; 1005 return -EINVAL;
1006 } 1006 }