29 #include <linux/module.h>
31 #include <linux/slab.h>
32 #include <linux/i2c.h>
46 #define LEVEL_ADJUST 0x02
47 #define STEREO_ADJUST 0x03
50 #define TDA9840_SET_MUTE 0x00
51 #define TDA9840_SET_MONO 0x10
52 #define TDA9840_SET_STEREO 0x2a
53 #define TDA9840_SET_LANG1 0x12
54 #define TDA9840_SET_LANG2 0x1e
55 #define TDA9840_SET_BOTH 0x1a
56 #define TDA9840_SET_BOTH_R 0x16
57 #define TDA9840_SET_EXTERNAL 0x7a
76 "i2c_master_recv() failed\n");
82 "TDA9840_DETECT: register contents invalid\n");
86 v4l2_dbg(1,
debug, sd,
"TDA9840_DETECT: byte: 0x%02x\n", byte);
92 int stat = tda9840_status(sd);
98 stat = stat < 0 ? 0 :
stat;
99 if (stat == 0 || stat == 0x60)
101 else if (stat == 0x40)
118 tda9840_write(sd,
SWITCH, byte);
124 int stat = tda9840_status(sd);
131 switch (stat & 0x60) {
150 struct i2c_client *client = v4l2_get_subdevdata(sd);
158 .g_chip_ident = tda9840_g_chip_ident,
162 .s_tuner = tda9840_s_tuner,
163 .g_tuner = tda9840_g_tuner,
167 .core = &tda9840_core_ops,
168 .tuner = &tda9840_tuner_ops,
173 static int tda9840_probe(
struct i2c_client *client,
179 if (!i2c_check_functionality(client->
adapter,
184 v4l_info(client,
"chip found @ 0x%x (%s)\n",
199 static int tda9840_remove(
struct i2c_client *client)
201 struct v4l2_subdev *sd = i2c_get_clientdata(client);
219 .probe = tda9840_probe,
220 .remove = tda9840_remove,
221 .id_table = tda9840_id,