30 #include <linux/module.h>
42 static unsigned int i2c_scan;
46 static unsigned int i2c_udelay = 5;
49 "(should be 5 or higher). Lower value means higher bus speed.");
51 #define dprintk(level,fmt, arg...) if (i2c_debug >= level) \
52 printk(KERN_DEBUG "%s: " fmt, core->name , ## arg)
56 static void cx8800_bit_setscl(
void *
data,
int state)
68 static void cx8800_bit_setsda(
void *
data,
int state)
80 static int cx8800_bit_getscl(
void *data)
86 return state & 0x02 ? 1 : 0;
89 static int cx8800_bit_getsda(
void *data)
101 .setsda = cx8800_bit_setsda,
102 .setscl = cx8800_bit_setscl,
103 .getsda = cx8800_bit_getsda,
104 .getscl = cx8800_bit_getscl,
111 static const char *
const i2c_devs[128] = {
112 [ 0x1c >> 1 ] =
"lgdt330x",
113 [ 0x86 >> 1 ] =
"tda9887/cx22702",
114 [ 0xa0 >> 1 ] =
"eeprom",
115 [ 0xc0 >> 1 ] =
"tuner (analog)",
116 [ 0xc2 >> 1 ] =
"tuner (analog/dvb)",
117 [ 0xc8 >> 1 ] =
"xc5000",
130 printk(
"%s: i2c scan: found device @ 0x%x [%s]\n",
131 name, i << 1, i2c_devs[i] ? i2c_devs[i] :
"???");
156 cx8800_bit_setscl(core,1);
157 cx8800_bit_setsda(core,1);
161 static u8 tuner_data[] =
162 { 0x0b, 0xdc, 0x86, 0x52 };
163 static struct i2c_msg tuner_msg =
164 { .
flags = 0, .addr = 0xc2 >> 1, .buf = tuner_data, .len = 4 };
166 dprintk(1,
"i2c register ok\n");
171 printk(
"%s: i2c init: enabling analog demod on HVR1300/3000/4000 tuner\n",
181 printk(
"%s: i2c register FAILED\n", core->
name);