aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Krufky <mkrufky@linuxtv.org>2007-08-28 16:20:42 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:07:30 -0400
commit293197cd0f34eb6bfb5492a63a878575b69e9df4 (patch)
treea83dcc74fe1b507918ab38a32581c8b562506171
parentb930e1d851c3ffbf82127bd0e4d72ffe94d4b7f2 (diff)
V4L/DVB (6126): tuner: add warning for obsolete i2c address range 0x64 thru 0x6f
The tuner module has a rather aggressive range of possible i2c addresses. As per the specs available, it appears as if there are no 4-byte tuners that actually use i2c addresses in the range 0x64 thru 0x6f, yet, tuner-core claims the address range 0x60 thru 0x6f. Allowing tuner.ko to probe these addresses can cause potential damage to certain IR receivers, RTC chips or any other IC's that might otherwise reside on the i2c bus using one of these addresses. The plan is to remove these i2c addresses from the i2c address range of the tuner module. If any devices are discovered that actually do have tuners at one of these addresses, the newer i2c probing methods will be used to handle those cases. In order to collect this information and avoid any potential regressions, the following warning has been added upon successful detection of a tuner using an i2c address in the range 0x64 thru 0x6f: ====================== WARNING! ====================== Support for tuners in i2c address range 0x64 thru 0x6f will soon be dropped. This message indicates that your hardware has a {tuner name} tuner at i2c address {addr}. To ensure continued support for your device, please send a copy of this message, along with full dmesg output to v4l-dvb-maintainer@linuxtv.org Please use subject line: "obsolete tuner i2c address." ====================== WARNING! ====================== Signed-off-by: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/tuner-core.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index baeae28f2836..f505f43bb126 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -145,6 +145,27 @@ static void set_freq(struct i2c_client *c, unsigned long freq)
145 } 145 }
146} 146}
147 147
148static void tuner_i2c_address_check(struct tuner *t)
149{
150 if ((t->type == UNSET || t->type == TUNER_ABSENT) ||
151 ((t->i2c.addr < 0x64) || (t->i2c.addr > 0x6f)))
152 return;
153
154 tuner_warn("====================== WARNING! ======================\n");
155 tuner_warn("Support for tuners in i2c address range 0x64 thru 0x6f\n");
156 tuner_warn("will soon be dropped. This message indicates that your\n");
157 tuner_warn("hardware has a %s tuner at i2c address 0x%02x.\n",
158 t->i2c.name, t->i2c.addr);
159 tuner_warn("To ensure continued support for your device, please\n");
160 tuner_warn("send a copy of this message, along with full dmesg\n");
161 tuner_warn("output to v4l-dvb-maintainer@linuxtv.org\n");
162 tuner_warn("Please use subject line: \"obsolete tuner i2c address.\"\n");
163 tuner_warn("driver: %s, addr: 0x%02x, type: %d (%s)\n",
164 t->i2c.adapter->name, t->i2c.addr, t->type,
165 tuners[t->type].name);
166 tuner_warn("====================== WARNING! ======================\n");
167}
168
148static void set_type(struct i2c_client *c, unsigned int type, 169static void set_type(struct i2c_client *c, unsigned int type,
149 unsigned int new_mode_mask, unsigned int new_config, 170 unsigned int new_mode_mask, unsigned int new_config,
150 int (*tuner_callback) (void *dev, int command,int arg)) 171 int (*tuner_callback) (void *dev, int command,int arg))
@@ -244,6 +265,7 @@ static void set_type(struct i2c_client *c, unsigned int type,
244 tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n", 265 tuner_dbg("%s %s I2C addr 0x%02x with type %d used for 0x%02x\n",
245 c->adapter->name, c->driver->driver.name, c->addr << 1, type, 266 c->adapter->name, c->driver->driver.name, c->addr << 1, type,
246 t->mode_mask); 267 t->mode_mask);
268 tuner_i2c_address_check(t);
247} 269}
248 270
249/* 271/*