aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx88/cx88-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-26 10:55:09 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-29 17:41:32 -0400
commit4bf1226a7018bf79d05e0ce59244d702819529d1 (patch)
treea113ca63819851527db9ae341c6c47b2b64fcad1 /drivers/media/video/cx88/cx88-i2c.c
parent7663c1e2792a9662b23dec6e19bfcd3d55360b8f (diff)
V4L/DVB (7749): cx88: fix tuner setup
Tuner setup were happening during i2c attach callback. This means that it would happen on two conditions: 1) if tuner module weren't load, it will happen at request_module("tuner"); 2) if tuner is not compiled as a module, or it is already loaded (for example, on setups with more than one tuner), it will happen when cx88 registers I2C bus. Due to that, if tuner were loaded, tuner setup will happen _before_ reading the proper values at tuner eeprom. Since set_addr refuses to change for a tuner that were previously defined (except if the tuner_addr is set), this were making eeprom tuner detection useless. This patch removes tuner type setup from cx88-i2c, moving it to the proper place, after taking eeprom into account. Reviewed-by: Gert Vervoort <gert.vervoort@hccnet.nl> Reviewed-by: Ian Pickworth <ian@pickworth.me.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-i2c.c')
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c30
1 files changed, 0 insertions, 30 deletions
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index c6b44732a082..00aa7a3f1105 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -104,37 +104,7 @@ static int attach_inform(struct i2c_client *client)
104 104
105 dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n", 105 dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n",
106 client->driver->driver.name, client->addr, client->name); 106 client->driver->driver.name, client->addr, client->name);
107 if (!client->driver->command)
108 return 0;
109
110 if (core->board.radio_type != UNSET) {
111 if ((core->board.radio_addr==ADDR_UNSET)||(core->board.radio_addr==client->addr)) {
112 tun_setup.mode_mask = T_RADIO;
113 tun_setup.type = core->board.radio_type;
114 tun_setup.addr = core->board.radio_addr;
115 tun_setup.tuner_callback = cx88_tuner_callback;
116 client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup);
117 }
118 }
119 if (core->board.tuner_type != UNSET) {
120 if ((core->board.tuner_addr==ADDR_UNSET)||(core->board.tuner_addr==client->addr)) {
121
122 tun_setup.mode_mask = T_ANALOG_TV;
123 tun_setup.type = core->board.tuner_type;
124 tun_setup.addr = core->board.tuner_addr;
125 tun_setup.tuner_callback = cx88_tuner_callback;
126 client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup);
127 }
128 }
129
130 if (core->board.tda9887_conf) {
131 struct v4l2_priv_tun_config tda9887_cfg;
132 107
133 tda9887_cfg.tuner = TUNER_TDA9887;
134 tda9887_cfg.priv = &core->board.tda9887_conf;
135
136 client->driver->command(client, TUNER_SET_CONFIG, &tda9887_cfg);
137 }
138 return 0; 108 return 0;
139} 109}
140 110