summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-02-23 16:12:58 +0100
committerGuennadi Liakhovetski <g.liakhovetski@gmx.de>2009-02-23 16:12:58 +0100
commit64c5c0e18bea0815ea7a971107b21a6c606bad77 (patch)
tree0723e68e1eb6e9d95e52397e8013f0c5b7f57f8e /linux
parent5f142c1dc4286e15ad35fc32896d12a4badf84b7 (diff)
downloadmediapointer-dvb-s2-64c5c0e18bea0815ea7a971107b21a6c606bad77.tar.gz
mediapointer-dvb-s2-64c5c0e18bea0815ea7a971107b21a6c606bad77.tar.bz2
sh_mobile_ceu: SOCAM flags are not platform dependent
From: Kuninori Morimoto <morimoto.kuninori@renesas.com> 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> --- drivers/media/video/sh_mobile_ceu_camera.c | 28 ++++++++++++++++++++++++++-- include/media/sh_mobile_ceu.h | 5 +++-- 2 files changed, 29 insertions(+), 4 deletions(-)
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/video/sh_mobile_ceu_camera.c28
-rw-r--r--linux/include/media/sh_mobile_ceu.h5
2 files changed, 29 insertions, 4 deletions
diff --git a/linux/drivers/media/video/sh_mobile_ceu_camera.c b/linux/drivers/media/video/sh_mobile_ceu_camera.c
index ee113de47..19b04bfa4 100644
--- a/linux/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/linux/drivers/media/video/sh_mobile_ceu_camera.c
@@ -102,6 +102,30 @@ struct sh_mobile_ceu_dev {
const struct soc_camera_data_format *camera_fmt;
};
+static unsigned long make_bus_param(struct sh_mobile_ceu_dev *pcdev)
+{
+ unsigned long flags;
+
+ flags = SOCAM_MASTER |
+ SOCAM_PCLK_SAMPLE_RISING |
+ SOCAM_HSYNC_ACTIVE_HIGH |
+ SOCAM_HSYNC_ACTIVE_LOW |
+ SOCAM_VSYNC_ACTIVE_HIGH |
+ SOCAM_VSYNC_ACTIVE_LOW |
+ SOCAM_DATA_ACTIVE_HIGH;
+
+ if (pcdev->pdata->flags & SH_CEU_FLAG_USE_8BIT_BUS)
+ flags |= SOCAM_DATAWIDTH_8;
+
+ if (pcdev->pdata->flags & SH_CEU_FLAG_USE_16BIT_BUS)
+ flags |= SOCAM_DATAWIDTH_16;
+
+ if (flags & SOCAM_DATAWIDTH_MASK)
+ return flags;
+
+ return 0;
+}
+
static void ceu_write(struct sh_mobile_ceu_dev *priv,
unsigned long reg_offs, u32 data)
{
@@ -397,7 +421,7 @@ static int sh_mobile_ceu_set_bus_param(struct soc_camera_device *icd,
camera_flags = icd->ops->query_bus_param(icd);
common_flags = soc_camera_bus_param_compatible(camera_flags,
- pcdev->pdata->flags);
+ make_bus_param(pcdev));
if (!common_flags)
return -EINVAL;
@@ -518,7 +542,7 @@ static int sh_mobile_ceu_try_bus_param(struct soc_camera_device *icd)
camera_flags = icd->ops->query_bus_param(icd);
common_flags = soc_camera_bus_param_compatible(camera_flags,
- pcdev->pdata->flags);
+ make_bus_param(pcdev));
if (!common_flags)
return -EINVAL;
diff --git a/linux/include/media/sh_mobile_ceu.h b/linux/include/media/sh_mobile_ceu.h
index b5dbefea3..0f3524cff 100644
--- a/linux/include/media/sh_mobile_ceu.h
+++ b/linux/include/media/sh_mobile_ceu.h
@@ -1,10 +1,11 @@
#ifndef __ASM_SH_MOBILE_CEU_H__
#define __ASM_SH_MOBILE_CEU_H__
-#include <media/soc_camera.h>
+#define SH_CEU_FLAG_USE_8BIT_BUS (1 << 0) /* use 8bit bus width */
+#define SH_CEU_FLAG_USE_16BIT_BUS (1 << 1) /* use 16bit bus width */
struct sh_mobile_ceu_info {
- unsigned long flags; /* SOCAM_... */
+ unsigned long flags;
};
#endif /* __ASM_SH_MOBILE_CEU_H__ */