diff options
Diffstat (limited to 'drivers/media/video/cx18/cx18-driver.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-driver.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c index 92026e82e10e..dd0224f328ad 100644 --- a/drivers/media/video/cx18/cx18-driver.c +++ b/drivers/media/video/cx18/cx18-driver.c | |||
@@ -268,6 +268,20 @@ static void cx18_iounmap(struct cx18 *cx) | |||
268 | } | 268 | } |
269 | } | 269 | } |
270 | 270 | ||
271 | static void cx18_eeprom_dump(struct cx18 *cx, unsigned char *eedata, int len) | ||
272 | { | ||
273 | int i; | ||
274 | |||
275 | CX18_INFO("eeprom dump:\n"); | ||
276 | for (i = 0; i < len; i++) { | ||
277 | if (0 == (i % 16)) | ||
278 | CX18_INFO("eeprom %02x:", i); | ||
279 | printk(KERN_CONT " %02x", eedata[i]); | ||
280 | if (15 == (i % 16)) | ||
281 | printk(KERN_CONT "\n"); | ||
282 | } | ||
283 | } | ||
284 | |||
271 | /* Hauppauge card? get values from tveeprom */ | 285 | /* Hauppauge card? get values from tveeprom */ |
272 | void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv) | 286 | void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv) |
273 | { | 287 | { |
@@ -279,8 +293,26 @@ void cx18_read_eeprom(struct cx18 *cx, struct tveeprom *tv) | |||
279 | c.adapter = &cx->i2c_adap[0]; | 293 | c.adapter = &cx->i2c_adap[0]; |
280 | c.addr = 0xA0 >> 1; | 294 | c.addr = 0xA0 >> 1; |
281 | 295 | ||
282 | tveeprom_read(&c, eedata, sizeof(eedata)); | 296 | memset(tv, 0, sizeof(*tv)); |
283 | tveeprom_hauppauge_analog(&c, tv, eedata); | 297 | if (tveeprom_read(&c, eedata, sizeof(eedata))) |
298 | return; | ||
299 | |||
300 | switch (cx->card->type) { | ||
301 | case CX18_CARD_HVR_1600_ESMT: | ||
302 | case CX18_CARD_HVR_1600_SAMSUNG: | ||
303 | tveeprom_hauppauge_analog(&c, tv, eedata); | ||
304 | break; | ||
305 | case CX18_CARD_YUAN_MPC718: | ||
306 | tv->model = 0x718; | ||
307 | cx18_eeprom_dump(cx, eedata, sizeof(eedata)); | ||
308 | CX18_INFO("eeprom PCI ID: %02x%02x:%02x%02x\n", | ||
309 | eedata[2], eedata[1], eedata[4], eedata[3]); | ||
310 | break; | ||
311 | default: | ||
312 | tv->model = 0xffffffff; | ||
313 | cx18_eeprom_dump(cx, eedata, sizeof(eedata)); | ||
314 | break; | ||
315 | } | ||
284 | } | 316 | } |
285 | 317 | ||
286 | static void cx18_process_eeprom(struct cx18 *cx) | 318 | static void cx18_process_eeprom(struct cx18 *cx) |
@@ -298,6 +330,11 @@ static void cx18_process_eeprom(struct cx18 *cx) | |||
298 | case 74000 ... 74999: | 330 | case 74000 ... 74999: |
299 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); | 331 | cx->card = cx18_get_card(CX18_CARD_HVR_1600_ESMT); |
300 | break; | 332 | break; |
333 | case 0x718: | ||
334 | return; | ||
335 | case 0xffffffff: | ||
336 | CX18_INFO("Unknown EEPROM encoding\n"); | ||
337 | return; | ||
301 | case 0: | 338 | case 0: |
302 | CX18_ERR("Invalid EEPROM\n"); | 339 | CX18_ERR("Invalid EEPROM\n"); |
303 | return; | 340 | return; |