aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-09-21 16:52:51 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-06 08:00:23 -0500
commit8843d119eaf1a7a87a2cf8c3eadbd1937b16bc27 (patch)
tree82ab4bb0ca86005d78cdafcea900940c05156936
parent31e582e9263277173e097e5ef8ce8fdfd2e9bc45 (diff)
[media] soc-camera: remove redundant parameter from .set_bus_param()
The "pixfmt" parameter of the struct soc_camera_host_ops::set_bus_param() method is redundant, because at the time, when this method is called, pixfmt is guaranteed to be equal to icd->current_fmt->host_fmt->fourcc. Remove this parameter and update all drivers accordingly. Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/video/atmel-isi.c2
-rw-r--r--drivers/media/video/mx1_camera.c2
-rw-r--r--drivers/media/video/mx2_camera.c3
-rw-r--r--drivers/media/video/mx3_camera.c3
-rw-r--r--drivers/media/video/omap1_camera.c4
-rw-r--r--drivers/media/video/pxa_camera.c3
-rw-r--r--drivers/media/video/sh_mobile_ceu_camera.c11
-rw-r--r--drivers/media/video/soc_camera.c2
-rw-r--r--include/media/soc_camera.h2
9 files changed, 13 insertions, 19 deletions
diff --git a/drivers/media/video/atmel-isi.c b/drivers/media/video/atmel-isi.c
index fbc904f2f6fd..b25bd7bb01db 100644
--- a/drivers/media/video/atmel-isi.c
+++ b/drivers/media/video/atmel-isi.c
@@ -803,7 +803,7 @@ static int isi_camera_querycap(struct soc_camera_host *ici,
803 return 0; 803 return 0;
804} 804}
805 805
806static int isi_camera_set_bus_param(struct soc_camera_device *icd, u32 pixfmt) 806static int isi_camera_set_bus_param(struct soc_camera_device *icd)
807{ 807{
808 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 808 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
809 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 809 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
diff --git a/drivers/media/video/mx1_camera.c b/drivers/media/video/mx1_camera.c
index 18e94c7d2be8..055d11ddb038 100644
--- a/drivers/media/video/mx1_camera.c
+++ b/drivers/media/video/mx1_camera.c
@@ -487,7 +487,7 @@ static int mx1_camera_set_crop(struct soc_camera_device *icd,
487 return v4l2_subdev_call(sd, video, s_crop, a); 487 return v4l2_subdev_call(sd, video, s_crop, a);
488} 488}
489 489
490static int mx1_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) 490static int mx1_camera_set_bus_param(struct soc_camera_device *icd)
491{ 491{
492 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 492 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
493 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 493 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c
index a803d9ea8fd6..ffbfbfe05169 100644
--- a/drivers/media/video/mx2_camera.c
+++ b/drivers/media/video/mx2_camera.c
@@ -766,8 +766,7 @@ static void mx27_camera_emma_buf_init(struct soc_camera_device *icd,
766 pcdev->base_emma + PRP_INTR_CNTL); 766 pcdev->base_emma + PRP_INTR_CNTL);
767} 767}
768 768
769static int mx2_camera_set_bus_param(struct soc_camera_device *icd, 769static int mx2_camera_set_bus_param(struct soc_camera_device *icd)
770 __u32 pixfmt)
771{ 770{
772 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 771 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
773 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 772 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c
index f96f92f00f92..ba004747ff01 100644
--- a/drivers/media/video/mx3_camera.c
+++ b/drivers/media/video/mx3_camera.c
@@ -982,12 +982,13 @@ static int mx3_camera_querycap(struct soc_camera_host *ici,
982 return 0; 982 return 0;
983} 983}
984 984
985static int mx3_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) 985static int mx3_camera_set_bus_param(struct soc_camera_device *icd)
986{ 986{
987 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 987 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
988 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 988 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
989 struct mx3_camera_dev *mx3_cam = ici->priv; 989 struct mx3_camera_dev *mx3_cam = ici->priv;
990 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; 990 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,};
991 u32 pixfmt = icd->current_fmt->host_fmt->fourcc;
991 unsigned long bus_flags, common_flags; 992 unsigned long bus_flags, common_flags;
992 u32 dw, sens_conf; 993 u32 dw, sens_conf;
993 const struct soc_mbus_pixelfmt *fmt; 994 const struct soc_mbus_pixelfmt *fmt;
diff --git a/drivers/media/video/omap1_camera.c b/drivers/media/video/omap1_camera.c
index 6a6cf388bae4..946ee55c018a 100644
--- a/drivers/media/video/omap1_camera.c
+++ b/drivers/media/video/omap1_camera.c
@@ -1436,13 +1436,13 @@ static int omap1_cam_querycap(struct soc_camera_host *ici,
1436 return 0; 1436 return 0;
1437} 1437}
1438 1438
1439static int omap1_cam_set_bus_param(struct soc_camera_device *icd, 1439static int omap1_cam_set_bus_param(struct soc_camera_device *icd)
1440 __u32 pixfmt)
1441{ 1440{
1442 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 1441 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1443 struct device *dev = icd->parent; 1442 struct device *dev = icd->parent;
1444 struct soc_camera_host *ici = to_soc_camera_host(dev); 1443 struct soc_camera_host *ici = to_soc_camera_host(dev);
1445 struct omap1_cam_dev *pcdev = ici->priv; 1444 struct omap1_cam_dev *pcdev = ici->priv;
1445 u32 pixfmt = icd->current_fmt->host_fmt->fourcc;
1446 const struct soc_camera_format_xlate *xlate; 1446 const struct soc_camera_format_xlate *xlate;
1447 const struct soc_mbus_pixelfmt *fmt; 1447 const struct soc_mbus_pixelfmt *fmt;
1448 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; 1448 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,};
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c
index 79fb22c89ae9..2f9ae634b7cf 100644
--- a/drivers/media/video/pxa_camera.c
+++ b/drivers/media/video/pxa_camera.c
@@ -1133,12 +1133,13 @@ static void pxa_camera_setup_cicr(struct soc_camera_device *icd,
1133 __raw_writel(cicr0, pcdev->base + CICR0); 1133 __raw_writel(cicr0, pcdev->base + CICR0);
1134} 1134}
1135 1135
1136static int pxa_camera_set_bus_param(struct soc_camera_device *icd, __u32 pixfmt) 1136static int pxa_camera_set_bus_param(struct soc_camera_device *icd)
1137{ 1137{
1138 struct v4l2_subdev *sd = soc_camera_to_subdev(icd); 1138 struct v4l2_subdev *sd = soc_camera_to_subdev(icd);
1139 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 1139 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
1140 struct pxa_camera_dev *pcdev = ici->priv; 1140 struct pxa_camera_dev *pcdev = ici->priv;
1141 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,}; 1141 struct v4l2_mbus_config cfg = {.type = V4L2_MBUS_PARALLEL,};
1142 u32 pixfmt = icd->current_fmt->host_fmt->fourcc;
1142 unsigned long bus_flags, common_flags; 1143 unsigned long bus_flags, common_flags;
1143 int ret; 1144 int ret;
1144 struct pxa_cam *cam = icd->host_priv; 1145 struct pxa_cam *cam = icd->host_priv;
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c
index c51decfcae19..f854d85a387c 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -786,8 +786,7 @@ static struct v4l2_subdev *find_bus_subdev(struct sh_mobile_ceu_dev *pcdev,
786 V4L2_MBUS_DATA_ACTIVE_HIGH) 786 V4L2_MBUS_DATA_ACTIVE_HIGH)
787 787
788/* Capture is not running, no interrupts, no locking needed */ 788/* Capture is not running, no interrupts, no locking needed */
789static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd, 789static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd)
790 __u32 pixfmt)
791{ 790{
792 struct soc_camera_host *ici = to_soc_camera_host(icd->parent); 791 struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
793 struct sh_mobile_ceu_dev *pcdev = ici->priv; 792 struct sh_mobile_ceu_dev *pcdev = ici->priv;
@@ -925,11 +924,6 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd,
925 ceu_write(pcdev, CDOCR, value); 924 ceu_write(pcdev, CDOCR, value);
926 ceu_write(pcdev, CFWCR, 0); /* keep "datafetch firewall" disabled */ 925 ceu_write(pcdev, CFWCR, 0); /* keep "datafetch firewall" disabled */
927 926
928 dev_dbg(icd->parent, "S_FMT successful for %c%c%c%c %ux%u\n",
929 pixfmt & 0xff, (pixfmt >> 8) & 0xff,
930 (pixfmt >> 16) & 0xff, (pixfmt >> 24) & 0xff,
931 icd->user_width, icd->user_height);
932
933 capture_restore(pcdev, capsr); 927 capture_restore(pcdev, capsr);
934 928
935 /* not in bundle mode: skip CBDSR, CDAYR2, CDACR2, CDBYR2, CDBCR2 */ 929 /* not in bundle mode: skip CBDSR, CDAYR2, CDACR2, CDBYR2, CDBCR2 */
@@ -1966,8 +1960,7 @@ static int sh_mobile_ceu_set_livecrop(struct soc_camera_device *icd,
1966 if (!ret) { 1960 if (!ret) {
1967 icd->user_width = out_width & ~3; 1961 icd->user_width = out_width & ~3;
1968 icd->user_height = out_height & ~3; 1962 icd->user_height = out_height & ~3;
1969 ret = sh_mobile_ceu_set_bus_param(icd, 1963 ret = sh_mobile_ceu_set_bus_param(icd);
1970 icd->current_fmt->host_fmt->fourcc);
1971 } 1964 }
1972 } 1965 }
1973 1966
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 62e4312515cb..a14df27d2552 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -487,7 +487,7 @@ static int soc_camera_set_fmt(struct soc_camera_device *icd,
487 icd->user_width, icd->user_height); 487 icd->user_width, icd->user_height);
488 488
489 /* set physical bus parameters */ 489 /* set physical bus parameters */
490 return ici->ops->set_bus_param(icd, pix->pixelformat); 490 return ici->ops->set_bus_param(icd);
491} 491}
492 492
493static int soc_camera_open(struct file *file) 493static int soc_camera_open(struct file *file)
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 5fb2c3d10c05..b5c2b6cb0d81 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -94,7 +94,7 @@ struct soc_camera_host_ops {
94 struct soc_camera_device *); 94 struct soc_camera_device *);
95 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *); 95 int (*reqbufs)(struct soc_camera_device *, struct v4l2_requestbuffers *);
96 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *); 96 int (*querycap)(struct soc_camera_host *, struct v4l2_capability *);
97 int (*set_bus_param)(struct soc_camera_device *, __u32); 97 int (*set_bus_param)(struct soc_camera_device *);
98 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 98 int (*get_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
99 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *); 99 int (*set_parm)(struct soc_camera_device *, struct v4l2_streamparm *);
100 int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *); 100 int (*enum_fsizes)(struct soc_camera_device *, struct v4l2_frmsizeenum *);