diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-29 22:36:12 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:01:36 -0500 |
commit | 6c362c8e58da972728a3666a0a00b9c2f1574e1f (patch) | |
tree | 7ccf2ea88a4b24c0bfd8324c74d06c1bc324974c /drivers/media/video/em28xx/em28xx-i2c.c | |
parent | 1808a698a87366f9d82945270355c2139df0a16d (diff) |
V4L/DVB (6476): Add support for analog tv on HVR-950
This patch adds USB ID for HVR-950. It also adds the callback for handling
firmware loading.
Thanks to Markus Reichberger for the reset commands.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/em28xx/em28xx-i2c.c')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-i2c.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c index e48191fb1dde..a33878e08799 100644 --- a/drivers/media/video/em28xx/em28xx-i2c.c +++ b/drivers/media/video/em28xx/em28xx-i2c.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/video_decoder.h> | 28 | #include <linux/video_decoder.h> |
29 | 29 | ||
30 | #include "em28xx.h" | 30 | #include "em28xx.h" |
31 | #include "tuner-xc2028.h" | ||
31 | #include <media/v4l2-common.h> | 32 | #include <media/v4l2-common.h> |
32 | #include <media/tuner.h> | 33 | #include <media/tuner.h> |
33 | 34 | ||
@@ -391,6 +392,26 @@ static u32 functionality(struct i2c_adapter *adap) | |||
391 | } | 392 | } |
392 | 393 | ||
393 | 394 | ||
395 | static int em28xx_tuner_callback(void *ptr, int command, int arg) | ||
396 | { | ||
397 | int rc = 0; | ||
398 | struct em28xx *dev = ptr; | ||
399 | |||
400 | if (dev->tuner_type != TUNER_XC2028) | ||
401 | return 0; | ||
402 | |||
403 | switch (command) { | ||
404 | case XC2028_TUNER_RESET: | ||
405 | /* FIXME: This is device-dependent */ | ||
406 | dev->em28xx_write_regs_req(dev, 0x00, 0x48, "\x00", 1); | ||
407 | dev->em28xx_write_regs_req(dev, 0x00, 0x12, "\x67", 1); | ||
408 | |||
409 | msleep(140); | ||
410 | break; | ||
411 | } | ||
412 | return rc; | ||
413 | } | ||
414 | |||
394 | static int em28xx_set_tuner(int check_eeprom, struct i2c_client *client) | 415 | static int em28xx_set_tuner(int check_eeprom, struct i2c_client *client) |
395 | { | 416 | { |
396 | struct em28xx *dev = client->adapter->algo_data; | 417 | struct em28xx *dev = client->adapter->algo_data; |
@@ -400,6 +421,8 @@ static int em28xx_set_tuner(int check_eeprom, struct i2c_client *client) | |||
400 | tun_setup.mode_mask = T_ANALOG_TV | T_RADIO; | 421 | tun_setup.mode_mask = T_ANALOG_TV | T_RADIO; |
401 | tun_setup.type = dev->tuner_type; | 422 | tun_setup.type = dev->tuner_type; |
402 | tun_setup.addr = dev->tuner_addr; | 423 | tun_setup.addr = dev->tuner_addr; |
424 | tun_setup.tuner_callback = em28xx_tuner_callback; | ||
425 | |||
403 | em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup); | 426 | em28xx_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_setup); |
404 | } | 427 | } |
405 | 428 | ||