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 | |
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>
-rw-r--r-- | drivers/media/video/sh_mobile_ceu_camera.c | 28 | ||||
-rw-r--r-- | include/media/sh_mobile_ceu.h | 5 |
2 files changed, 29 insertions, 4 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 | ||
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h index b5dbefea3740..0f3524cff435 100644 --- a/include/media/sh_mobile_ceu.h +++ b/include/media/sh_mobile_ceu.h | |||
@@ -1,10 +1,11 @@ | |||
1 | #ifndef __ASM_SH_MOBILE_CEU_H__ | 1 | #ifndef __ASM_SH_MOBILE_CEU_H__ |
2 | #define __ASM_SH_MOBILE_CEU_H__ | 2 | #define __ASM_SH_MOBILE_CEU_H__ |
3 | 3 | ||
4 | #include <media/soc_camera.h> | 4 | #define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */ |
5 | #define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */ | ||
5 | 6 | ||
6 | struct sh_mobile_ceu_info { | 7 | struct sh_mobile_ceu_info { |
7 | unsigned long flags; /* SOCAM_... */ | 8 | unsigned long flags; |
8 | }; | 9 | }; |
9 | 10 | ||
10 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ | 11 | #endif /* __ASM_SH_MOBILE_CEU_H__ */ |