diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2009-02-28 15:45:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:43:12 -0400 |
commit | f9996c95623d63de6f5957512976137bbac729f0 (patch) | |
tree | a0f9ba7ce669d11f036eb75c1ed5b9c7db7dc5a4 /drivers/media/video/saa7134/saa7134-cards.c | |
parent | adcc4b3e75c5f0293806766bcc5ed0bb62d5cda0 (diff) |
V4L/DVB (10877): saa7134: add analog support for Hauppauge HVR1110r3 boards
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-cards.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-cards.c | 173 |
1 files changed, 171 insertions, 2 deletions
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 9f69c7c85814..88f0b8f06e10 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <media/v4l2-common.h> | 31 | #include <media/v4l2-common.h> |
32 | #include <media/tveeprom.h> | 32 | #include <media/tveeprom.h> |
33 | #include "tea5767.h" | 33 | #include "tea5767.h" |
34 | #include "tda18271.h" | ||
34 | 35 | ||
35 | /* commly used strings */ | 36 | /* commly used strings */ |
36 | static char name_mute[] = "mute"; | 37 | static char name_mute[] = "mute"; |
@@ -3291,6 +3292,66 @@ struct saa7134_board saa7134_boards[] = { | |||
3291 | .gpio = 0x0200100, | 3292 | .gpio = 0x0200100, |
3292 | }, | 3293 | }, |
3293 | }, | 3294 | }, |
3295 | [SAA7134_BOARD_HAUPPAUGE_HVR1150] = { | ||
3296 | .name = "Hauppauge WinTV-HVR1150", | ||
3297 | .audio_clock = 0x00187de7, | ||
3298 | .tuner_type = TUNER_PHILIPS_TDA8290, | ||
3299 | .radio_type = UNSET, | ||
3300 | .tuner_addr = ADDR_UNSET, | ||
3301 | .radio_addr = ADDR_UNSET, | ||
3302 | .tuner_config = 3, | ||
3303 | .gpiomask = 0x0800100, /* GPIO 21 is an INPUT */ | ||
3304 | .inputs = {{ | ||
3305 | .name = name_tv, | ||
3306 | .vmux = 1, | ||
3307 | .amux = TV, | ||
3308 | .tv = 1, | ||
3309 | .gpio = 0x0000100, | ||
3310 | }, { | ||
3311 | .name = name_comp1, | ||
3312 | .vmux = 3, | ||
3313 | .amux = LINE1, | ||
3314 | }, { | ||
3315 | .name = name_svideo, | ||
3316 | .vmux = 8, | ||
3317 | .amux = LINE1, | ||
3318 | } }, | ||
3319 | .radio = { | ||
3320 | .name = name_radio, | ||
3321 | .amux = TV, | ||
3322 | .gpio = 0x0800100, /* GPIO 23 HI for FM */ | ||
3323 | }, | ||
3324 | }, | ||
3325 | [SAA7134_BOARD_HAUPPAUGE_HVR1110R3] = { | ||
3326 | .name = "Hauppauge WinTV-HVR1110r3", | ||
3327 | .audio_clock = 0x00187de7, | ||
3328 | .tuner_type = TUNER_PHILIPS_TDA8290, | ||
3329 | .radio_type = UNSET, | ||
3330 | .tuner_addr = ADDR_UNSET, | ||
3331 | .radio_addr = ADDR_UNSET, | ||
3332 | .tuner_config = 3, | ||
3333 | .gpiomask = 0x0800100, /* GPIO 21 is an INPUT */ | ||
3334 | .inputs = {{ | ||
3335 | .name = name_tv, | ||
3336 | .vmux = 1, | ||
3337 | .amux = TV, | ||
3338 | .tv = 1, | ||
3339 | .gpio = 0x0000100, | ||
3340 | }, { | ||
3341 | .name = name_comp1, | ||
3342 | .vmux = 3, | ||
3343 | .amux = LINE1, | ||
3344 | }, { | ||
3345 | .name = name_svideo, | ||
3346 | .vmux = 8, | ||
3347 | .amux = LINE1, | ||
3348 | } }, | ||
3349 | .radio = { | ||
3350 | .name = name_radio, | ||
3351 | .amux = TV, | ||
3352 | .gpio = 0x0800100, /* GPIO 23 HI for FM */ | ||
3353 | }, | ||
3354 | }, | ||
3294 | [SAA7134_BOARD_CINERGY_HT_PCMCIA] = { | 3355 | [SAA7134_BOARD_CINERGY_HT_PCMCIA] = { |
3295 | .name = "Terratec Cinergy HT PCMCIA", | 3356 | .name = "Terratec Cinergy HT PCMCIA", |
3296 | .audio_clock = 0x00187de7, | 3357 | .audio_clock = 0x00187de7, |
@@ -5403,6 +5464,36 @@ struct pci_device_id saa7134_pci_tbl[] = { | |||
5403 | },{ | 5464 | },{ |
5404 | .vendor = PCI_VENDOR_ID_PHILIPS, | 5465 | .vendor = PCI_VENDOR_ID_PHILIPS, |
5405 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | 5466 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, |
5467 | .subvendor = 0x0070, | ||
5468 | .subdevice = 0x6706, | ||
5469 | .driver_data = SAA7134_BOARD_HAUPPAUGE_HVR1150, | ||
5470 | },{ | ||
5471 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
5472 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | ||
5473 | .subvendor = 0x0070, | ||
5474 | .subdevice = 0x6707, | ||
5475 | .driver_data = SAA7134_BOARD_HAUPPAUGE_HVR1110R3, | ||
5476 | },{ | ||
5477 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
5478 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | ||
5479 | .subvendor = 0x0070, | ||
5480 | .subdevice = 0x6708, | ||
5481 | .driver_data = SAA7134_BOARD_HAUPPAUGE_HVR1150, | ||
5482 | },{ | ||
5483 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
5484 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | ||
5485 | .subvendor = 0x0070, | ||
5486 | .subdevice = 0x6709, | ||
5487 | .driver_data = SAA7134_BOARD_HAUPPAUGE_HVR1110R3, | ||
5488 | },{ | ||
5489 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
5490 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | ||
5491 | .subvendor = 0x0070, | ||
5492 | .subdevice = 0x670a, | ||
5493 | .driver_data = SAA7134_BOARD_HAUPPAUGE_HVR1110R3, | ||
5494 | },{ | ||
5495 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
5496 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | ||
5406 | .subvendor = 0x153b, | 5497 | .subvendor = 0x153b, |
5407 | .subdevice = 0x1172, | 5498 | .subdevice = 0x1172, |
5408 | .driver_data = SAA7134_BOARD_CINERGY_HT_PCMCIA, | 5499 | .driver_data = SAA7134_BOARD_CINERGY_HT_PCMCIA, |
@@ -5819,8 +5910,8 @@ static int saa7134_xc2028_callback(struct saa7134_dev *dev, | |||
5819 | } | 5910 | } |
5820 | 5911 | ||
5821 | 5912 | ||
5822 | static int saa7134_tda8290_callback(struct saa7134_dev *dev, | 5913 | static int saa7134_tda8290_827x_callback(struct saa7134_dev *dev, |
5823 | int command, int arg) | 5914 | int command, int arg) |
5824 | { | 5915 | { |
5825 | u8 sync_control; | 5916 | u8 sync_control; |
5826 | 5917 | ||
@@ -5846,6 +5937,65 @@ static int saa7134_tda8290_callback(struct saa7134_dev *dev, | |||
5846 | return 0; | 5937 | return 0; |
5847 | } | 5938 | } |
5848 | 5939 | ||
5940 | static inline int saa7134_tda18271_hvr11x0_toggle_agc(struct saa7134_dev *dev, | ||
5941 | enum tda18271_mode mode) | ||
5942 | { | ||
5943 | /* toggle AGC switch through GPIO 26 */ | ||
5944 | switch (mode) { | ||
5945 | case TDA18271_ANALOG: | ||
5946 | saa7134_set_gpio(dev, 26, 0); | ||
5947 | break; | ||
5948 | case TDA18271_DIGITAL: | ||
5949 | saa7134_set_gpio(dev, 26, 1); | ||
5950 | break; | ||
5951 | default: | ||
5952 | return -EINVAL; | ||
5953 | } | ||
5954 | return 0; | ||
5955 | } | ||
5956 | |||
5957 | static int saa7134_tda8290_18271_callback(struct saa7134_dev *dev, | ||
5958 | int command, int arg) | ||
5959 | { | ||
5960 | int ret = 0; | ||
5961 | |||
5962 | switch (command) { | ||
5963 | case TDA18271_CALLBACK_CMD_AGC_ENABLE: /* 0 */ | ||
5964 | switch (dev->board) { | ||
5965 | case SAA7134_BOARD_HAUPPAUGE_HVR1150: | ||
5966 | case SAA7134_BOARD_HAUPPAUGE_HVR1110R3: | ||
5967 | ret = saa7134_tda18271_hvr11x0_toggle_agc(dev, arg); | ||
5968 | break; | ||
5969 | default: | ||
5970 | break; | ||
5971 | } | ||
5972 | break; | ||
5973 | default: | ||
5974 | ret = -EINVAL; | ||
5975 | break; | ||
5976 | } | ||
5977 | return ret; | ||
5978 | } | ||
5979 | |||
5980 | static int saa7134_tda8290_callback(struct saa7134_dev *dev, | ||
5981 | int command, int arg) | ||
5982 | { | ||
5983 | int ret; | ||
5984 | |||
5985 | switch (dev->board) { | ||
5986 | case SAA7134_BOARD_HAUPPAUGE_HVR1150: | ||
5987 | case SAA7134_BOARD_HAUPPAUGE_HVR1110R3: | ||
5988 | /* tda8290 + tda18271 */ | ||
5989 | ret = saa7134_tda8290_18271_callback(dev, command, arg); | ||
5990 | break; | ||
5991 | default: | ||
5992 | /* tda8290 + tda827x */ | ||
5993 | ret = saa7134_tda8290_827x_callback(dev, command, arg); | ||
5994 | break; | ||
5995 | } | ||
5996 | return ret; | ||
5997 | } | ||
5998 | |||
5849 | int saa7134_tuner_callback(void *priv, int component, int command, int arg) | 5999 | int saa7134_tuner_callback(void *priv, int component, int command, int arg) |
5850 | { | 6000 | { |
5851 | struct saa7134_dev *dev = priv; | 6001 | struct saa7134_dev *dev = priv; |
@@ -5876,11 +6026,16 @@ static void hauppauge_eeprom(struct saa7134_dev *dev, u8 *eeprom_data) | |||
5876 | switch (tv.model) { | 6026 | switch (tv.model) { |
5877 | case 67019: /* WinTV-HVR1110 (Retail, IR Blaster, hybrid, FM, SVid/Comp, 3.5mm audio in) */ | 6027 | case 67019: /* WinTV-HVR1110 (Retail, IR Blaster, hybrid, FM, SVid/Comp, 3.5mm audio in) */ |
5878 | case 67109: /* WinTV-HVR1000 (Retail, IR Receive, analog, no FM, SVid/Comp, 3.5mm audio in) */ | 6028 | case 67109: /* WinTV-HVR1000 (Retail, IR Receive, analog, no FM, SVid/Comp, 3.5mm audio in) */ |
6029 | case 67201: /* WinTV-HVR1150 (Retail, IR Receive, hybrid, FM, SVid/Comp, 3.5mm audio in) */ | ||
6030 | case 67301: /* WinTV-HVR1000 (Retail, IR Receive, analog, no FM, SVid/Comp, 3.5mm audio in) */ | ||
6031 | case 67209: /* WinTV-HVR1110 (Retail, IR Receive, hybrid, FM, SVid/Comp, 3.5mm audio in) */ | ||
5879 | case 67559: /* WinTV-HVR1110 (OEM, no IR, hybrid, FM, SVid/Comp, RCA aud) */ | 6032 | case 67559: /* WinTV-HVR1110 (OEM, no IR, hybrid, FM, SVid/Comp, RCA aud) */ |
5880 | case 67569: /* WinTV-HVR1110 (OEM, no IR, hybrid, FM) */ | 6033 | case 67569: /* WinTV-HVR1110 (OEM, no IR, hybrid, FM) */ |
5881 | case 67579: /* WinTV-HVR1110 (OEM, no IR, hybrid, no FM) */ | 6034 | case 67579: /* WinTV-HVR1110 (OEM, no IR, hybrid, no FM) */ |
5882 | case 67589: /* WinTV-HVR1110 (OEM, no IR, hybrid, no FM, SVid/Comp, RCA aud) */ | 6035 | case 67589: /* WinTV-HVR1110 (OEM, no IR, hybrid, no FM, SVid/Comp, RCA aud) */ |
5883 | case 67599: /* WinTV-HVR1110 (OEM, no IR, hybrid, no FM, SVid/Comp, RCA aud) */ | 6036 | case 67599: /* WinTV-HVR1110 (OEM, no IR, hybrid, no FM, SVid/Comp, RCA aud) */ |
6037 | case 67651: /* WinTV-HVR1150 (OEM, no IR, hybrid, FM, SVid/Comp, RCA aud) */ | ||
6038 | case 67659: /* WinTV-HVR1110 (OEM, no IR, hybrid, FM, SVid/Comp, RCA aud) */ | ||
5884 | break; | 6039 | break; |
5885 | default: | 6040 | default: |
5886 | printk(KERN_WARNING "%s: warning: " | 6041 | printk(KERN_WARNING "%s: warning: " |
@@ -6057,6 +6212,16 @@ int saa7134_board_init1(struct saa7134_dev *dev) | |||
6057 | 6212 | ||
6058 | saa_writeb (SAA7134_PRODUCTION_TEST_MODE, 0x00); | 6213 | saa_writeb (SAA7134_PRODUCTION_TEST_MODE, 0x00); |
6059 | break; | 6214 | break; |
6215 | case SAA7134_BOARD_HAUPPAUGE_HVR1150: | ||
6216 | case SAA7134_BOARD_HAUPPAUGE_HVR1110R3: | ||
6217 | /* GPIO 26 high for digital, low for analog */ | ||
6218 | saa7134_set_gpio(dev, 26, 0); | ||
6219 | msleep(1); | ||
6220 | |||
6221 | saa7134_set_gpio(dev, 22, 0); | ||
6222 | msleep(10); | ||
6223 | saa7134_set_gpio(dev, 22, 1); | ||
6224 | break; | ||
6060 | /* i2c remotes */ | 6225 | /* i2c remotes */ |
6061 | case SAA7134_BOARD_PINNACLE_PCTV_110i: | 6226 | case SAA7134_BOARD_PINNACLE_PCTV_110i: |
6062 | case SAA7134_BOARD_PINNACLE_PCTV_310i: | 6227 | case SAA7134_BOARD_PINNACLE_PCTV_310i: |
@@ -6309,6 +6474,10 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
6309 | dev->name, saa7134_boards[dev->board].name); | 6474 | dev->name, saa7134_boards[dev->board].name); |
6310 | } | 6475 | } |
6311 | break; | 6476 | break; |
6477 | case SAA7134_BOARD_HAUPPAUGE_HVR1150: | ||
6478 | case SAA7134_BOARD_HAUPPAUGE_HVR1110R3: | ||
6479 | hauppauge_eeprom(dev, dev->eedata+0x80); | ||
6480 | break; | ||
6312 | case SAA7134_BOARD_HAUPPAUGE_HVR1110: | 6481 | case SAA7134_BOARD_HAUPPAUGE_HVR1110: |
6313 | hauppauge_eeprom(dev, dev->eedata+0x80); | 6482 | hauppauge_eeprom(dev, dev->eedata+0x80); |
6314 | /* break intentionally omitted */ | 6483 | /* break intentionally omitted */ |