summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-i2c.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-06-21 13:06:44 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-06-21 13:06:44 +0200
commit5491015f1dde09e8b89d5934d7b76d93f0ac1fe7 (patch)
tree325ebad7453e102612596e90dd0d6e461a5e7b03 /linux/drivers/media/video/cx18/cx18-i2c.c
parent3c5f3e5e6a7adfeecf82503f578547a69e7df19a (diff)
downloadmediapointer-dvb-s2-5491015f1dde09e8b89d5934d7b76d93f0ac1fe7.tar.gz
mediapointer-dvb-s2-5491015f1dde09e8b89d5934d7b76d93f0ac1fe7.tar.bz2
cx18: add support for Conexant Raptor PAL/SECAM card
From: Sri Deevi <Srinivasa.Deevi@conexant.com> Patch provided courtesy of Conexant http://www.conexant.com. Signed-off-by: Srinivasa Deevi <srinivasa.deevi@conexant.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-i2c.c')
-rw-r--r--linux/drivers/media/video/cx18/cx18-i2c.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-i2c.c b/linux/drivers/media/video/cx18/cx18-i2c.c
index 30ec26a61..7333f6001 100644
--- a/linux/drivers/media/video/cx18/cx18-i2c.c
+++ b/linux/drivers/media/video/cx18/cx18-i2c.c
@@ -339,8 +339,12 @@ int cx18_i2c_hw(struct cx18 *cx, u32 hw, unsigned int cmd, void *arg)
{
int addr;
- if (hw == CX18_HW_GPIO || hw == 0)
+ if (hw == 0)
return 0;
+
+ if (hw == CX18_HW_GPIO)
+ return cx18_gpio(cx, cmd, arg);
+
if (hw == CX18_HW_CX23418)
return cx18_av_cmd(cx, cmd, arg);
@@ -378,6 +382,8 @@ void cx18_call_i2c_clients(struct cx18 *cx, unsigned int cmd, void *arg)
cx18_av_cmd(cx, cmd, arg);
i2c_clients_command(&cx->i2c_adap[0], cmd, arg);
i2c_clients_command(&cx->i2c_adap[1], cmd, arg);
+ if (cx->hw_flags & CX18_HW_GPIO)
+ cx18_gpio(cx, cmd, arg);
}
/* init + register i2c algo-bit adapter */
@@ -386,6 +392,18 @@ int init_cx18_i2c(struct cx18 *cx)
int i;
CX18_DEBUG_I2C("i2c init\n");
+ /* Sanity checks for the I2C hardware arrays. They must be the
+ * same size and GPIO/CX23418 must be the last entries.
+ */
+ if (ARRAY_SIZE(hw_driverids) != ARRAY_SIZE(hw_addrs) ||
+ ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs) ||
+ CX18_HW_GPIO != (1 << (ARRAY_SIZE(hw_addrs) - 2)) ||
+ CX18_HW_CX23418 != (1 << (ARRAY_SIZE(hw_addrs) - 1)) ||
+ hw_driverids[ARRAY_SIZE(hw_addrs) - 1]) {
+ CX18_ERR("Mismatched I2C hardware arrays\n");
+ return -ENODEV;
+ }
+
for (i = 0; i < 2; i++) {
memcpy(&cx->i2c_adap[i], &cx18_i2c_adap_template,
sizeof(struct i2c_adapter));