diff options
author | Kuninori Morimoto <morimoto.kuninori@renesas.com> | 2009-02-23 10:12:58 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:52 -0400 |
commit | c354b400c0eac1cc0009958754797538857ce640 (patch) | |
tree | e4fddd3b3c0915377ba2966c71b7e86470fc1625 /drivers | |
parent | 1af1b7a2def2f0936fc95edb5dcb3871934b7852 (diff) |
V4L/DVB (10671): sh_mobile_ceu: SOCAM flags are not platform dependent
sh_mobile_ceu_camera.c support for signal polarity flags isn't platform
dependent, provide them locally. Only the bus width is implementation
specific.
Signed-off-by: Kuninori Morimoto <morimoto.kuninori@renesas.com>
Acked-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/sh_mobile_ceu_camera.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index ddcb81d0b81a..8a1badba70f7 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c | |||
@@ -101,6 +101,30 @@ struct sh_mobile_ceu_dev { | |||
101 | const struct soc_camera_data_format *camera_fmt; | 101 | const struct soc_camera_data_format *camera_fmt; |
102 | }; | 102 | }; |
103 | 103 | ||
104 | static unsigned long make_bus_param(struct sh_mobile_ceu_dev *pcdev) | ||
105 | { | ||
106 | unsigned long flags; | ||
107 | |||
108 | flags = SOCAM_MASTER | | ||
109 | SOCAM_PCLK_SAMPLE_RISING | | ||
110 | SOCAM_HSYNC_ACTIVE_HIGH | | ||
111 | SOCAM_HSYNC_ACTIVE_LOW | | ||
112 | SOCAM_VSYNC_ACTIVE_HIGH | | ||
113 | SOCAM_VSYNC_ACTIVE_LOW | | ||
114 | SOCAM_DATA_ACTIVE_HIGH; | ||
115 | |||
116 | if (pcdev->pdata->flags & SH_CEU_FLAG_USE_8BIT_BUS) | ||
117 | flags |= SOCAM_DATAWIDTH_8; | ||
118 | |||
119 | if (pcdev->pdata->flags & SH_CEU_FLAG_USE_16BIT_BUS) | ||
120 | flags |= SOCAM_DATAWIDTH_16; | ||
121 | |||
122 | if (flags & SOCAM_DATAWIDTH_MASK) | ||
123 | return flags; | ||
124 | |||
125 | return 0; | ||
126 | } | ||
127 | |||
104 | static void ceu_write(struct sh_mobile_ceu_dev *priv, | 128 | static void ceu_write(struct sh_mobile_ceu_dev *priv, |
105 | unsigned long reg_offs, u32 data) | 129 | unsigned long reg_offs, u32 data) |
106 | { | 130 | { |
@@ -396,7 +420,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd, | |||
396 | 420 | ||
397 | camera_flags = icd->ops->query_bus_param(icd); | 421 | camera_flags = icd->ops->query_bus_param(icd); |
398 | common_flags = soc_camera_bus_param_compatible(camera_flags, | 422 | common_flags = soc_camera_bus_param_compatible(camera_flags, |
399 | pcdev->pdata->flags); | 423 | make_bus_param(pcdev)); |
400 | if (!common_flags) | 424 | if (!common_flags) |
401 | return -EINVAL; | 425 | return -EINVAL; |
402 | 426 | ||
@@ -517,7 +541,7 @@ static int sh_mobile_ceu_try_bus_param(struct soc_camera_device *icd) | |||
517 | 541 | ||
518 | camera_flags = icd->ops->query_bus_param(icd); | 542 | camera_flags = icd->ops->query_bus_param(icd); |
519 | common_flags = soc_camera_bus_param_compatible(camera_flags, | 543 | common_flags = soc_camera_bus_param_compatible(camera_flags, |
520 | pcdev->pdata->flags); | 544 | make_bus_param(pcdev)); |
521 | if (!common_flags) | 545 | if (!common_flags) |
522 | return -EINVAL; | 546 | return -EINVAL; |
523 | 547 | ||