summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/frontends
diff options
context:
space:
mode:
authorAndrew de Quincy <devnull@localhost>2004-01-29 20:42:31 +0000
committerAndrew de Quincy <devnull@localhost>2004-01-29 20:42:31 +0000
commit8da316d74e520eccd877ec90b3341e734363a5ff (patch)
treec519b6d1146cc3a5992df7cb6ee923e75d5b8262 /linux/drivers/media/dvb/frontends
parent7a578435efe06c799ac4c866f7d23fb36cd40c00 (diff)
downloadmediapointer-dvb-s2-8da316d74e520eccd877ec90b3341e734363a5ff.tar.gz
mediapointer-dvb-s2-8da316d74e520eccd877ec90b3341e734363a5ff.tar.bz2
Changed to use full i2c reads in probing instead of i2c pings to be
compatable with ttusb
Diffstat (limited to 'linux/drivers/media/dvb/frontends')
-rw-r--r--linux/drivers/media/dvb/frontends/alps_tdlb7.c13
-rw-r--r--linux/drivers/media/dvb/frontends/alps_tdmb7.c37
2 files changed, 28 insertions, 22 deletions
diff --git a/linux/drivers/media/dvb/frontends/alps_tdlb7.c b/linux/drivers/media/dvb/frontends/alps_tdlb7.c
index 847567abd..3c8549f9e 100644
--- a/linux/drivers/media/dvb/frontends/alps_tdlb7.c
+++ b/linux/drivers/media/dvb/frontends/alps_tdlb7.c
@@ -663,16 +663,19 @@ static int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
static int tdlb7_attach (struct dvb_i2c_bus *i2c, void **data)
{
- struct i2c_msg msg = { addr: 0x71, flags: 0, buf: NULL, len: 0 };
+ u8 b0 [] = { 0x02 , 0x00 };
+ u8 b1 [] = { 0, 0 };
+ struct i2c_msg msg [] = { { addr: 0x71, flags: 0, buf: b0, len: 2 },
+ { addr: 0x71, flags: I2C_M_RD, buf: b1, len: 2 } };
- dprintk ("%s\n", __FUNCTION__);
+ dprintk ("%s\n", __FUNCTION__);
- if (i2c->xfer (i2c, &msg, 1) != 1)
+ if (i2c->xfer (i2c, msg, 2) != 2)
return -ENODEV;
- sp8870_firmware_upload(i2c);
+ sp8870_firmware_upload(i2c);
- return dvb_register_frontend (tdlb7_ioctl, i2c, NULL, &tdlb7_info);
+ return dvb_register_frontend (tdlb7_ioctl, i2c, NULL, &tdlb7_info);
}
diff --git a/linux/drivers/media/dvb/frontends/alps_tdmb7.c b/linux/drivers/media/dvb/frontends/alps_tdmb7.c
index 072bc8907..5376dc909 100644
--- a/linux/drivers/media/dvb/frontends/alps_tdmb7.c
+++ b/linux/drivers/media/dvb/frontends/alps_tdmb7.c
@@ -1,4 +1,4 @@
-/*
+/*
Alps TDMB7 DVB OFDM frontend driver
Copyright (C) 2001-2002 Convergence Integrated Media GmbH
@@ -18,7 +18,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
+*/
#include <linux/kernel.h>
#include <linux/init.h>
@@ -49,7 +49,7 @@ static struct dvb_frontend_info tdmb7_info = {
#endif
.caps = FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 |
FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO |
- FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
+ FE_CAN_QPSK | FE_CAN_QAM_16 | FE_CAN_QAM_64 |
FE_CAN_CLEAN_SETUP | FE_CAN_RECOVER
};
@@ -86,7 +86,7 @@ static int cx22700_writereg (struct dvb_i2c_bus *i2c, u8 reg, u8 data)
ret = i2c->xfer (i2c, &msg, 1);
- if (ret != 1)
+ if (ret != 1)
printk("%s: writereg error (reg == 0x%02x, val == 0x%02x, ret == %i)\n",
__FUNCTION__, reg, data, ret);
@@ -101,12 +101,12 @@ static u8 cx22700_readreg (struct dvb_i2c_bus *i2c, u8 reg)
u8 b1 [] = { 0 };
struct i2c_msg msg [] = { { .addr = 0x43, .flags = 0, .buf = b0, .len = 1 },
{ .addr = 0x43, .flags = I2C_M_RD, .buf = b1, .len = 1 } };
-
+
dprintk ("%s\n", __FUNCTION__);
ret = i2c->xfer (i2c, msg, 2);
-
- if (ret != 2)
+
+ if (ret != 2)
printk("%s: readreg error (ret == %i)\n", __FUNCTION__, ret);
return b1[0];
@@ -130,7 +130,7 @@ static int pll_write (struct dvb_i2c_bus *i2c, u8 data [4])
/**
- * set up the downconverter frequency divisor for a
+ * set up the downconverter frequency divisor for a
* reference clock comparision frequency of 125 kHz.
*/
static int pll_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq)
@@ -160,12 +160,12 @@ static int cx22700_init (struct dvb_i2c_bus *i2c)
cx22700_writereg (i2c, 0x00, 0x00);
dvb_delay(10);
-
+
for (i=0; i<sizeof(init_tab); i+=2)
cx22700_writereg (i2c, init_tab[i], init_tab[i+1]);
cx22700_writereg (i2c, 0x00, 0x01);
-
+
return 0;
}
@@ -358,7 +358,7 @@ static int tdmb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
*((u16*) arg) = ~rs_ber;
break;
}
- case FE_READ_UNCORRECTED_BLOCKS:
+ case FE_READ_UNCORRECTED_BLOCKS:
*((u32*) arg) = cx22700_readreg (i2c, 0x0f);
cx22700_writereg (i2c, 0x0f, 0x00);
break;
@@ -382,7 +382,7 @@ static int tdmb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
{
struct dvb_frontend_parameters *p = arg;
u8 reg09 = cx22700_readreg (i2c, 0x09);
-
+
p->inversion = reg09 & 0x1 ? INVERSION_ON : INVERSION_OFF;
return cx22700_get_tps (i2c, &p->u.ofdm);
}
@@ -404,14 +404,17 @@ static int tdmb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
static int tdmb7_attach (struct dvb_i2c_bus *i2c, void **data)
{
- struct i2c_msg msg = { .addr = 0x43, .flags = 0, .buf = NULL,. len = 0 };
+ u8 b0 [] = { 0x7 };
+ u8 b1 [] = { 0 };
+ struct i2c_msg msg [] = { { .addr = 0x43, .flags = 0, .buf = b0, .len = 1 },
+ { .addr = 0x43, .flags = I2C_M_RD, .buf = b1, .len = 1 } };
- dprintk ("%s\n", __FUNCTION__);
+ dprintk ("%s\n", __FUNCTION__);
- if (i2c->xfer (i2c, &msg, 1) != 1)
- return -ENODEV;
+ if (i2c->xfer (i2c, msg, 2) != 2)
+ return -ENODEV;
- return dvb_register_frontend (tdmb7_ioctl, i2c, NULL, &tdmb7_info);
+ return dvb_register_frontend (tdmb7_ioctl, i2c, NULL, &tdmb7_info);
}