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/mx3_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/mx3_camera.c')
-rw-r--r-- | drivers/media/video/mx3_camera.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c index cdb7dad05c1e..c045b47803ad 100644 --- a/drivers/media/video/mx3_camera.c +++ b/drivers/media/video/mx3_camera.c | |||
@@ -194,7 +194,7 @@ static int mx3_videobuf_setup(struct vb2_queue *vq, | |||
194 | unsigned long sizes[], void *alloc_ctxs[]) | 194 | unsigned long sizes[], void *alloc_ctxs[]) |
195 | { | 195 | { |
196 | struct soc_camera_device *icd = soc_camera_from_vb2q(vq); | 196 | struct soc_camera_device *icd = soc_camera_from_vb2q(vq); |
197 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 197 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
198 | struct mx3_camera_dev *mx3_cam = ici->priv; | 198 | struct mx3_camera_dev *mx3_cam = ici->priv; |
199 | int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, | 199 | int bytes_per_line = soc_mbus_bytes_per_line(icd->user_width, |
200 | icd->current_fmt->host_fmt); | 200 | icd->current_fmt->host_fmt); |
@@ -223,7 +223,7 @@ static int mx3_videobuf_setup(struct vb2_queue *vq, | |||
223 | static int mx3_videobuf_prepare(struct vb2_buffer *vb) | 223 | static int mx3_videobuf_prepare(struct vb2_buffer *vb) |
224 | { | 224 | { |
225 | struct soc_camera_device *icd = soc_camera_from_vb2q(vb->vb2_queue); | 225 | struct soc_camera_device *icd = soc_camera_from_vb2q(vb->vb2_queue); |
226 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 226 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
227 | struct mx3_camera_dev *mx3_cam = ici->priv; | 227 | struct mx3_camera_dev *mx3_cam = ici->priv; |
228 | struct idmac_channel *ichan = mx3_cam->idmac_channel[0]; | 228 | struct idmac_channel *ichan = mx3_cam->idmac_channel[0]; |
229 | struct scatterlist *sg; | 229 | struct scatterlist *sg; |
@@ -241,7 +241,7 @@ static int mx3_videobuf_prepare(struct vb2_buffer *vb) | |||
241 | new_size = bytes_per_line * icd->user_height; | 241 | new_size = bytes_per_line * icd->user_height; |
242 | 242 | ||
243 | if (vb2_plane_size(vb, 0) < new_size) { | 243 | if (vb2_plane_size(vb, 0) < new_size) { |
244 | dev_err(icd->dev.parent, "Buffer too small (%lu < %zu)\n", | 244 | dev_err(icd->parent, "Buffer too small (%lu < %zu)\n", |
245 | vb2_plane_size(vb, 0), new_size); | 245 | vb2_plane_size(vb, 0), new_size); |
246 | return -ENOBUFS; | 246 | return -ENOBUFS; |
247 | } | 247 | } |
@@ -283,7 +283,7 @@ static enum pixel_fmt fourcc_to_ipu_pix(__u32 fourcc) | |||
283 | static void mx3_videobuf_queue(struct vb2_buffer *vb) | 283 | static void mx3_videobuf_queue(struct vb2_buffer *vb) |
284 | { | 284 | { |
285 | struct soc_camera_device *icd = soc_camera_from_vb2q(vb->vb2_queue); | 285 | struct soc_camera_device *icd = soc_camera_from_vb2q(vb->vb2_queue); |
286 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 286 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
287 | struct mx3_camera_dev *mx3_cam = ici->priv; | 287 | struct mx3_camera_dev *mx3_cam = ici->priv; |
288 | struct mx3_camera_buffer *buf = to_mx3_vb(vb); | 288 | struct mx3_camera_buffer *buf = to_mx3_vb(vb); |
289 | struct dma_async_tx_descriptor *txd = buf->txd; | 289 | struct dma_async_tx_descriptor *txd = buf->txd; |
@@ -336,7 +336,7 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) | |||
336 | spin_unlock_irq(&mx3_cam->lock); | 336 | spin_unlock_irq(&mx3_cam->lock); |
337 | 337 | ||
338 | cookie = txd->tx_submit(txd); | 338 | cookie = txd->tx_submit(txd); |
339 | dev_dbg(icd->dev.parent, "Submitted cookie %d DMA 0x%08x\n", | 339 | dev_dbg(icd->parent, "Submitted cookie %d DMA 0x%08x\n", |
340 | cookie, sg_dma_address(&buf->sg)); | 340 | cookie, sg_dma_address(&buf->sg)); |
341 | 341 | ||
342 | if (cookie >= 0) | 342 | if (cookie >= 0) |
@@ -357,13 +357,13 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) | |||
357 | static void mx3_videobuf_release(struct vb2_buffer *vb) | 357 | static void mx3_videobuf_release(struct vb2_buffer *vb) |
358 | { | 358 | { |
359 | struct soc_camera_device *icd = soc_camera_from_vb2q(vb->vb2_queue); | 359 | struct soc_camera_device *icd = soc_camera_from_vb2q(vb->vb2_queue); |
360 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 360 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
361 | struct mx3_camera_dev *mx3_cam = ici->priv; | 361 | struct mx3_camera_dev *mx3_cam = ici->priv; |
362 | struct mx3_camera_buffer *buf = to_mx3_vb(vb); | 362 | struct mx3_camera_buffer *buf = to_mx3_vb(vb); |
363 | struct dma_async_tx_descriptor *txd = buf->txd; | 363 | struct dma_async_tx_descriptor *txd = buf->txd; |
364 | unsigned long flags; | 364 | unsigned long flags; |
365 | 365 | ||
366 | dev_dbg(icd->dev.parent, | 366 | dev_dbg(icd->parent, |
367 | "Release%s DMA 0x%08x, queue %sempty\n", | 367 | "Release%s DMA 0x%08x, queue %sempty\n", |
368 | mx3_cam->active == buf ? " active" : "", sg_dma_address(&buf->sg), | 368 | mx3_cam->active == buf ? " active" : "", sg_dma_address(&buf->sg), |
369 | list_empty(&buf->queue) ? "" : "not "); | 369 | list_empty(&buf->queue) ? "" : "not "); |
@@ -402,7 +402,7 @@ static int mx3_videobuf_init(struct vb2_buffer *vb) | |||
402 | static int mx3_stop_streaming(struct vb2_queue *q) | 402 | static int mx3_stop_streaming(struct vb2_queue *q) |
403 | { | 403 | { |
404 | struct soc_camera_device *icd = soc_camera_from_vb2q(q); | 404 | struct soc_camera_device *icd = soc_camera_from_vb2q(q); |
405 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 405 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
406 | struct mx3_camera_dev *mx3_cam = ici->priv; | 406 | struct mx3_camera_dev *mx3_cam = ici->priv; |
407 | struct idmac_channel *ichan = mx3_cam->idmac_channel[0]; | 407 | struct idmac_channel *ichan = mx3_cam->idmac_channel[0]; |
408 | struct dma_chan *chan; | 408 | struct dma_chan *chan; |
@@ -498,7 +498,7 @@ static void mx3_camera_activate(struct mx3_camera_dev *mx3_cam, | |||
498 | 498 | ||
499 | clk_enable(mx3_cam->clk); | 499 | clk_enable(mx3_cam->clk); |
500 | rate = clk_round_rate(mx3_cam->clk, mx3_cam->mclk); | 500 | rate = clk_round_rate(mx3_cam->clk, mx3_cam->mclk); |
501 | dev_dbg(icd->dev.parent, "Set SENS_CONF to %x, rate %ld\n", conf, rate); | 501 | dev_dbg(icd->parent, "Set SENS_CONF to %x, rate %ld\n", conf, rate); |
502 | if (rate) | 502 | if (rate) |
503 | clk_set_rate(mx3_cam->clk, rate); | 503 | clk_set_rate(mx3_cam->clk, rate); |
504 | } | 504 | } |
@@ -506,7 +506,7 @@ static void mx3_camera_activate(struct mx3_camera_dev *mx3_cam, | |||
506 | /* Called with .video_lock held */ | 506 | /* Called with .video_lock held */ |
507 | static int mx3_camera_add_device(struct soc_camera_device *icd) | 507 | static int mx3_camera_add_device(struct soc_camera_device *icd) |
508 | { | 508 | { |
509 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 509 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
510 | struct mx3_camera_dev *mx3_cam = ici->priv; | 510 | struct mx3_camera_dev *mx3_cam = ici->priv; |
511 | 511 | ||
512 | if (mx3_cam->icd) | 512 | if (mx3_cam->icd) |
@@ -516,7 +516,7 @@ static int mx3_camera_add_device(struct soc_camera_device *icd) | |||
516 | 516 | ||
517 | mx3_cam->icd = icd; | 517 | mx3_cam->icd = icd; |
518 | 518 | ||
519 | dev_info(icd->dev.parent, "MX3 Camera driver attached to camera %d\n", | 519 | dev_info(icd->parent, "MX3 Camera driver attached to camera %d\n", |
520 | icd->devnum); | 520 | icd->devnum); |
521 | 521 | ||
522 | return 0; | 522 | return 0; |
@@ -525,7 +525,7 @@ static int mx3_camera_add_device(struct soc_camera_device *icd) | |||
525 | /* Called with .video_lock held */ | 525 | /* Called with .video_lock held */ |
526 | static void mx3_camera_remove_device(struct soc_camera_device *icd) | 526 | static void mx3_camera_remove_device(struct soc_camera_device *icd) |
527 | { | 527 | { |
528 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 528 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
529 | struct mx3_camera_dev *mx3_cam = ici->priv; | 529 | struct mx3_camera_dev *mx3_cam = ici->priv; |
530 | struct idmac_channel **ichan = &mx3_cam->idmac_channel[0]; | 530 | struct idmac_channel **ichan = &mx3_cam->idmac_channel[0]; |
531 | 531 | ||
@@ -540,7 +540,7 @@ static void mx3_camera_remove_device(struct soc_camera_device *icd) | |||
540 | 540 | ||
541 | mx3_cam->icd = NULL; | 541 | mx3_cam->icd = NULL; |
542 | 542 | ||
543 | dev_info(icd->dev.parent, "MX3 Camera driver detached from camera %d\n", | 543 | dev_info(icd->parent, "MX3 Camera driver detached from camera %d\n", |
544 | icd->devnum); | 544 | icd->devnum); |
545 | } | 545 | } |
546 | 546 | ||
@@ -607,12 +607,12 @@ static int test_platform_param(struct mx3_camera_dev *mx3_cam, | |||
607 | static int mx3_camera_try_bus_param(struct soc_camera_device *icd, | 607 | static int mx3_camera_try_bus_param(struct soc_camera_device *icd, |
608 | const unsigned int depth) | 608 | const unsigned int depth) |
609 | { | 609 | { |
610 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 610 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
611 | struct mx3_camera_dev *mx3_cam = ici->priv; | 611 | struct mx3_camera_dev *mx3_cam = ici->priv; |
612 | unsigned long bus_flags, camera_flags; | 612 | unsigned long bus_flags, camera_flags; |
613 | int ret = test_platform_param(mx3_cam, depth, &bus_flags); | 613 | int ret = test_platform_param(mx3_cam, depth, &bus_flags); |
614 | 614 | ||
615 | dev_dbg(icd->dev.parent, "request bus width %d bit: %d\n", depth, ret); | 615 | dev_dbg(icd->parent, "request bus width %d bit: %d\n", depth, ret); |
616 | 616 | ||
617 | if (ret < 0) | 617 | if (ret < 0) |
618 | return ret; | 618 | return ret; |
@@ -621,7 +621,7 @@ static int mx3_camera_try_bus_param(struct soc_camera_device *icd, | |||
621 | 621 | ||
622 | ret = soc_camera_bus_param_compatible(camera_flags, bus_flags); | 622 | ret = soc_camera_bus_param_compatible(camera_flags, bus_flags); |
623 | if (ret < 0) | 623 | if (ret < 0) |
624 | dev_warn(icd->dev.parent, | 624 | dev_warn(icd->parent, |
625 | "Flags incompatible: camera %lx, host %lx\n", | 625 | "Flags incompatible: camera %lx, host %lx\n", |
626 | camera_flags, bus_flags); | 626 | camera_flags, bus_flags); |
627 | 627 | ||
@@ -675,7 +675,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id | |||
675 | struct soc_camera_format_xlate *xlate) | 675 | struct soc_camera_format_xlate *xlate) |
676 | { | 676 | { |
677 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | 677 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); |
678 | struct device *dev = icd->dev.parent; | 678 | struct device *dev = icd->parent; |
679 | int formats = 0, ret; | 679 | int formats = 0, ret; |
680 | enum v4l2_mbus_pixelcode code; | 680 | enum v4l2_mbus_pixelcode code; |
681 | const struct soc_mbus_pixelfmt *fmt; | 681 | const struct soc_mbus_pixelfmt *fmt; |
@@ -687,7 +687,7 @@ static int mx3_camera_get_formats(struct soc_camera_device *icd, unsigned int id | |||
687 | 687 | ||
688 | fmt = soc_mbus_get_fmtdesc(code); | 688 | fmt = soc_mbus_get_fmtdesc(code); |
689 | if (!fmt) { | 689 | if (!fmt) { |
690 | dev_warn(icd->dev.parent, | 690 | dev_warn(icd->parent, |
691 | "Unsupported format code #%u: %d\n", idx, code); | 691 | "Unsupported format code #%u: %d\n", idx, code); |
692 | return 0; | 692 | return 0; |
693 | } | 693 | } |
@@ -815,7 +815,7 @@ static int mx3_camera_set_crop(struct soc_camera_device *icd, | |||
815 | struct v4l2_crop *a) | 815 | struct v4l2_crop *a) |
816 | { | 816 | { |
817 | struct v4l2_rect *rect = &a->c; | 817 | struct v4l2_rect *rect = &a->c; |
818 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 818 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
819 | struct mx3_camera_dev *mx3_cam = ici->priv; | 819 | struct mx3_camera_dev *mx3_cam = ici->priv; |
820 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | 820 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); |
821 | struct v4l2_mbus_framefmt mf; | 821 | struct v4l2_mbus_framefmt mf; |
@@ -848,7 +848,7 @@ static int mx3_camera_set_crop(struct soc_camera_device *icd, | |||
848 | configure_geometry(mx3_cam, mf.width, mf.height, | 848 | configure_geometry(mx3_cam, mf.width, mf.height, |
849 | icd->current_fmt->host_fmt); | 849 | icd->current_fmt->host_fmt); |
850 | 850 | ||
851 | dev_dbg(icd->dev.parent, "Sensor cropped %dx%d\n", | 851 | dev_dbg(icd->parent, "Sensor cropped %dx%d\n", |
852 | mf.width, mf.height); | 852 | mf.width, mf.height); |
853 | 853 | ||
854 | icd->user_width = mf.width; | 854 | icd->user_width = mf.width; |
@@ -860,7 +860,7 @@ static int mx3_camera_set_crop(struct soc_camera_device *icd, | |||
860 | static int mx3_camera_set_fmt(struct soc_camera_device *icd, | 860 | static int mx3_camera_set_fmt(struct soc_camera_device *icd, |
861 | struct v4l2_format *f) | 861 | struct v4l2_format *f) |
862 | { | 862 | { |
863 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 863 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
864 | struct mx3_camera_dev *mx3_cam = ici->priv; | 864 | struct mx3_camera_dev *mx3_cam = ici->priv; |
865 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); | 865 | struct v4l2_subdev *sd = soc_camera_to_subdev(icd); |
866 | const struct soc_camera_format_xlate *xlate; | 866 | const struct soc_camera_format_xlate *xlate; |
@@ -870,13 +870,13 @@ static int mx3_camera_set_fmt(struct soc_camera_device *icd, | |||
870 | 870 | ||
871 | xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); | 871 | xlate = soc_camera_xlate_by_fourcc(icd, pix->pixelformat); |
872 | if (!xlate) { | 872 | if (!xlate) { |
873 | dev_warn(icd->dev.parent, "Format %x not found\n", | 873 | dev_warn(icd->parent, "Format %x not found\n", |
874 | pix->pixelformat); | 874 | pix->pixelformat); |
875 | return -EINVAL; | 875 | return -EINVAL; |
876 | } | 876 | } |
877 | 877 | ||
878 | stride_align(&pix->width); | 878 | stride_align(&pix->width); |
879 | dev_dbg(icd->dev.parent, "Set format %dx%d\n", pix->width, pix->height); | 879 | dev_dbg(icd->parent, "Set format %dx%d\n", pix->width, pix->height); |
880 | 880 | ||
881 | /* | 881 | /* |
882 | * Might have to perform a complete interface initialisation like in | 882 | * Might have to perform a complete interface initialisation like in |
@@ -912,7 +912,7 @@ static int mx3_camera_set_fmt(struct soc_camera_device *icd, | |||
912 | pix->colorspace = mf.colorspace; | 912 | pix->colorspace = mf.colorspace; |
913 | icd->current_fmt = xlate; | 913 | icd->current_fmt = xlate; |
914 | 914 | ||
915 | dev_dbg(icd->dev.parent, "Sensor set %dx%d\n", pix->width, pix->height); | 915 | dev_dbg(icd->parent, "Sensor set %dx%d\n", pix->width, pix->height); |
916 | 916 | ||
917 | return ret; | 917 | return ret; |
918 | } | 918 | } |
@@ -929,7 +929,7 @@ static int mx3_camera_try_fmt(struct soc_camera_device *icd, | |||
929 | 929 | ||
930 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | 930 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); |
931 | if (pixfmt && !xlate) { | 931 | if (pixfmt && !xlate) { |
932 | dev_warn(icd->dev.parent, "Format %x not found\n", pixfmt); | 932 | dev_warn(icd->parent, "Format %x not found\n", pixfmt); |
933 | return -EINVAL; | 933 | return -EINVAL; |
934 | } | 934 | } |
935 | 935 | ||
@@ -961,7 +961,7 @@ static int mx3_camera_try_fmt(struct soc_camera_device *icd, | |||
961 | case V4L2_FIELD_NONE: | 961 | case V4L2_FIELD_NONE: |
962 | break; | 962 | break; |
963 | default: | 963 | default: |
964 | dev_err(icd->dev.parent, "Field type %d unsupported.\n", | 964 | dev_err(icd->parent, "Field type %d unsupported.\n", |
965 | mf.field); | 965 | mf.field); |
966 | ret = -EINVAL; | 966 | ret = -EINVAL; |
967 | } | 967 | } |
@@ -994,7 +994,7 @@ static int mx3_camera_querycap(struct soc_camera_host *ici, | |||
994 | 994 | ||
995 | static int mx3_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) | 995 | static int mx3_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) |
996 | { | 996 | { |
997 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 997 | struct soc_camera_host *ici = to_soc_camera_host(icd->parent); |
998 | struct mx3_camera_dev *mx3_cam = ici->priv; | 998 | struct mx3_camera_dev *mx3_cam = ici->priv; |
999 | unsigned long bus_flags, camera_flags, common_flags; | 999 | unsigned long bus_flags, camera_flags, common_flags; |
1000 | u32 dw, sens_conf; | 1000 | u32 dw, sens_conf; |
@@ -1002,7 +1002,7 @@ static int mx3_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) | |||
1002 | int buswidth; | 1002 | int buswidth; |
1003 | int ret; | 1003 | int ret; |
1004 | const struct soc_camera_format_xlate *xlate; | 1004 | const struct soc_camera_format_xlate *xlate; |
1005 | struct device *dev = icd->dev.parent; | 1005 | struct device *dev = icd->parent; |
1006 | 1006 | ||
1007 | fmt = soc_mbus_get_fmtdesc(icd->current_fmt->code); | 1007 | fmt = soc_mbus_get_fmtdesc(icd->current_fmt->code); |
1008 | if (!fmt) | 1008 | if (!fmt) |