diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2013-04-06 13:28:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-04-08 06:04:30 -0400 |
commit | 34fe2784b4aabeec6d2afbd132d070b20abea132 (patch) | |
tree | 4fa761994df2463b42b04dd90a8fb76d670e7032 /drivers | |
parent | cdcd141c95f0c2b88e0b0869028c320cd031a23b (diff) |
[media] saa7134: Add AverMedia A706 AverTV Satellite Hybrid+FM
Add AverMedia AverTV Satellite Hybrid+FM (A706) card to saa7134 driver.
Working: analog inputs, TV, FM radio and IR remote control.
Untested: DVB-S.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/i2c/ir-kbd-i2c.c | 13 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-cards.c | 53 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-dvb.c | 23 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-i2c.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-input.c | 3 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134-tvaudio.c | 1 | ||||
-rw-r--r-- | drivers/media/pci/saa7134/saa7134.h | 1 |
7 files changed, 94 insertions, 1 deletions
diff --git a/drivers/media/i2c/ir-kbd-i2c.c b/drivers/media/i2c/ir-kbd-i2c.c index 2586e46f14b5..8e2f79cb045e 100644 --- a/drivers/media/i2c/ir-kbd-i2c.c +++ b/drivers/media/i2c/ir-kbd-i2c.c | |||
@@ -230,7 +230,7 @@ static int get_key_avermedia_cardbus(struct IR_i2c *ir, | |||
230 | return 0; | 230 | return 0; |
231 | 231 | ||
232 | dprintk(1, "read key 0x%02x/0x%02x\n", key, keygroup); | 232 | dprintk(1, "read key 0x%02x/0x%02x\n", key, keygroup); |
233 | if (keygroup < 2 || keygroup > 3) { | 233 | if (keygroup < 2 || keygroup > 4) { |
234 | /* Only a warning */ | 234 | /* Only a warning */ |
235 | dprintk(1, "warning: invalid key group 0x%02x for key 0x%02x\n", | 235 | dprintk(1, "warning: invalid key group 0x%02x for key 0x%02x\n", |
236 | keygroup, key); | 236 | keygroup, key); |
@@ -239,6 +239,10 @@ static int get_key_avermedia_cardbus(struct IR_i2c *ir, | |||
239 | 239 | ||
240 | *ir_key = key; | 240 | *ir_key = key; |
241 | *ir_raw = key; | 241 | *ir_raw = key; |
242 | if (!strcmp(ir->ir_codes, RC_MAP_AVERMEDIA_M733A_RM_K6)) { | ||
243 | *ir_key |= keygroup << 8; | ||
244 | *ir_raw |= keygroup << 8; | ||
245 | } | ||
242 | return 1; | 246 | return 1; |
243 | } | 247 | } |
244 | 248 | ||
@@ -332,6 +336,13 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
332 | rc_type = RC_BIT_OTHER; | 336 | rc_type = RC_BIT_OTHER; |
333 | ir_codes = RC_MAP_AVERMEDIA_CARDBUS; | 337 | ir_codes = RC_MAP_AVERMEDIA_CARDBUS; |
334 | break; | 338 | break; |
339 | case 0x41: | ||
340 | name = "AVerMedia EM78P153"; | ||
341 | ir->get_key = get_key_avermedia_cardbus; | ||
342 | rc_type = RC_BIT_OTHER; | ||
343 | /* RM-KV remote, seems to be same as RM-K6 */ | ||
344 | ir_codes = RC_MAP_AVERMEDIA_M733A_RM_K6; | ||
345 | break; | ||
335 | case 0x71: | 346 | case 0x71: |
336 | name = "Hauppauge/Zilog Z8"; | 347 | name = "Hauppauge/Zilog Z8"; |
337 | ir->get_key = get_key_haup_xvr; | 348 | ir->get_key = get_key_haup_xvr; |
diff --git a/drivers/media/pci/saa7134/saa7134-cards.c b/drivers/media/pci/saa7134/saa7134-cards.c index 29fb7a9ac2a4..67e06e178e98 100644 --- a/drivers/media/pci/saa7134/saa7134-cards.c +++ b/drivers/media/pci/saa7134/saa7134-cards.c | |||
@@ -50,6 +50,11 @@ static char name_svideo[] = "S-Video"; | |||
50 | /* ------------------------------------------------------------------ */ | 50 | /* ------------------------------------------------------------------ */ |
51 | /* board config info */ | 51 | /* board config info */ |
52 | 52 | ||
53 | static struct tda18271_std_map aver_a706_std_map = { | ||
54 | .fm_radio = { .if_freq = 5500, .fm_rfn = 0, .agc_mode = 3, .std = 0, | ||
55 | .if_lvl = 0, .rfagc_top = 0x2c, }, | ||
56 | }; | ||
57 | |||
53 | /* If radio_type !=UNSET, radio_addr should be specified | 58 | /* If radio_type !=UNSET, radio_addr should be specified |
54 | */ | 59 | */ |
55 | 60 | ||
@@ -5790,6 +5795,37 @@ struct saa7134_board saa7134_boards[] = { | |||
5790 | .gpio = 0x6010000, | 5795 | .gpio = 0x6010000, |
5791 | } }, | 5796 | } }, |
5792 | }, | 5797 | }, |
5798 | [SAA7134_BOARD_AVERMEDIA_A706] = { | ||
5799 | .name = "AverMedia AverTV Satellite Hybrid+FM A706", | ||
5800 | .audio_clock = 0x00187de7, | ||
5801 | .tuner_type = TUNER_PHILIPS_TDA8290, | ||
5802 | .radio_type = UNSET, | ||
5803 | .tuner_addr = ADDR_UNSET, | ||
5804 | .radio_addr = ADDR_UNSET, | ||
5805 | .tda829x_conf = { .lna_cfg = 0, .no_i2c_gate = 1, | ||
5806 | .tda18271_std_map = &aver_a706_std_map }, | ||
5807 | .gpiomask = 1 << 11, | ||
5808 | .mpeg = SAA7134_MPEG_DVB, | ||
5809 | .inputs = {{ | ||
5810 | .name = name_tv, | ||
5811 | .vmux = 1, | ||
5812 | .amux = TV, | ||
5813 | .tv = 1, | ||
5814 | }, { | ||
5815 | .name = name_comp, | ||
5816 | .vmux = 4, | ||
5817 | .amux = LINE1, | ||
5818 | }, { | ||
5819 | .name = name_svideo, | ||
5820 | .vmux = 8, | ||
5821 | .amux = LINE1, | ||
5822 | } }, | ||
5823 | .radio = { | ||
5824 | .name = name_radio, | ||
5825 | .amux = TV, | ||
5826 | .gpio = 0x0000800, | ||
5827 | }, | ||
5828 | }, | ||
5793 | 5829 | ||
5794 | }; | 5830 | }; |
5795 | 5831 | ||
@@ -7037,6 +7073,12 @@ struct pci_device_id saa7134_pci_tbl[] = { | |||
7037 | .subdevice = 0x0911, | 7073 | .subdevice = 0x0911, |
7038 | .driver_data = SAA7134_BOARD_SENSORAY811_911, | 7074 | .driver_data = SAA7134_BOARD_SENSORAY811_911, |
7039 | }, { | 7075 | }, { |
7076 | .vendor = PCI_VENDOR_ID_PHILIPS, | ||
7077 | .device = PCI_DEVICE_ID_PHILIPS_SAA7133, | ||
7078 | .subvendor = 0x1461, /* Avermedia Technologies Inc */ | ||
7079 | .subdevice = 0x2055, /* AverTV Satellite Hybrid+FM A706 */ | ||
7080 | .driver_data = SAA7134_BOARD_AVERMEDIA_A706, | ||
7081 | }, { | ||
7040 | /* --- boards without eeprom + subsystem ID --- */ | 7082 | /* --- boards without eeprom + subsystem ID --- */ |
7041 | .vendor = PCI_VENDOR_ID_PHILIPS, | 7083 | .vendor = PCI_VENDOR_ID_PHILIPS, |
7042 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, | 7084 | .device = PCI_DEVICE_ID_PHILIPS_SAA7134, |
@@ -7585,6 +7627,17 @@ int saa7134_board_init1(struct saa7134_dev *dev) | |||
7585 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x80040100, 0x80040100); | 7627 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x80040100, 0x80040100); |
7586 | saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x80040100, 0x00040100); | 7628 | saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x80040100, 0x00040100); |
7587 | break; | 7629 | break; |
7630 | case SAA7134_BOARD_AVERMEDIA_A706: | ||
7631 | /* radio antenna select: tristate both as in Windows driver */ | ||
7632 | saa7134_set_gpio(dev, 12, 3); /* TV antenna */ | ||
7633 | saa7134_set_gpio(dev, 13, 3); /* FM antenna */ | ||
7634 | dev->has_remote = SAA7134_REMOTE_I2C; | ||
7635 | /* | ||
7636 | * Disable CE5039 DVB-S tuner now (SLEEP pin high) to prevent | ||
7637 | * it from interfering with analog tuner detection | ||
7638 | */ | ||
7639 | saa7134_set_gpio(dev, 23, 1); | ||
7640 | break; | ||
7588 | case SAA7134_BOARD_VIDEOMATE_S350: | 7641 | case SAA7134_BOARD_VIDEOMATE_S350: |
7589 | dev->has_remote = SAA7134_REMOTE_GPIO; | 7642 | dev->has_remote = SAA7134_REMOTE_GPIO; |
7590 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0000C000, 0x0000C000); | 7643 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0000C000, 0x0000C000); |
diff --git a/drivers/media/pci/saa7134/saa7134-dvb.c b/drivers/media/pci/saa7134/saa7134-dvb.c index 45271390d7fb..4a08ae31df2e 100644 --- a/drivers/media/pci/saa7134/saa7134-dvb.c +++ b/drivers/media/pci/saa7134/saa7134-dvb.c | |||
@@ -1073,6 +1073,10 @@ static struct mt312_config zl10313_compro_s350_config = { | |||
1073 | .demod_address = 0x0e, | 1073 | .demod_address = 0x0e, |
1074 | }; | 1074 | }; |
1075 | 1075 | ||
1076 | static struct mt312_config zl10313_avermedia_a706_config = { | ||
1077 | .demod_address = 0x0e, | ||
1078 | }; | ||
1079 | |||
1076 | static struct lgdt3305_config hcw_lgdt3305_config = { | 1080 | static struct lgdt3305_config hcw_lgdt3305_config = { |
1077 | .i2c_addr = 0x0e, | 1081 | .i2c_addr = 0x0e, |
1078 | .mpeg_mode = LGDT3305_MPEG_SERIAL, | 1082 | .mpeg_mode = LGDT3305_MPEG_SERIAL, |
@@ -1822,6 +1826,25 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1822 | &prohdtv_pro2_tda18271_config); | 1826 | &prohdtv_pro2_tda18271_config); |
1823 | } | 1827 | } |
1824 | break; | 1828 | break; |
1829 | case SAA7134_BOARD_AVERMEDIA_A706: | ||
1830 | /* Enable all DVB-S devices now */ | ||
1831 | /* CE5039 DVB-S tuner SLEEP pin low */ | ||
1832 | saa7134_set_gpio(dev, 23, 0); | ||
1833 | /* CE6313 DVB-S demod SLEEP pin low */ | ||
1834 | saa7134_set_gpio(dev, 9, 0); | ||
1835 | /* CE6313 DVB-S demod RESET# pin high */ | ||
1836 | saa7134_set_gpio(dev, 25, 1); | ||
1837 | msleep(1); | ||
1838 | fe0->dvb.frontend = dvb_attach(mt312_attach, | ||
1839 | &zl10313_avermedia_a706_config, &dev->i2c_adap); | ||
1840 | if (fe0->dvb.frontend) { | ||
1841 | fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL; | ||
1842 | if (dvb_attach(zl10039_attach, fe0->dvb.frontend, | ||
1843 | 0x60, &dev->i2c_adap) == NULL) | ||
1844 | wprintk("%s: No zl10039 found!\n", | ||
1845 | __func__); | ||
1846 | } | ||
1847 | break; | ||
1825 | default: | 1848 | default: |
1826 | wprintk("Huh? unknown DVB card?\n"); | 1849 | wprintk("Huh? unknown DVB card?\n"); |
1827 | break; | 1850 | break; |
diff --git a/drivers/media/pci/saa7134/saa7134-i2c.c b/drivers/media/pci/saa7134/saa7134-i2c.c index a176ec3285e0..c68169d75804 100644 --- a/drivers/media/pci/saa7134/saa7134-i2c.c +++ b/drivers/media/pci/saa7134/saa7134-i2c.c | |||
@@ -256,6 +256,7 @@ static int saa7134_i2c_xfer(struct i2c_adapter *i2c_adap, | |||
256 | addr |= 1; | 256 | addr |= 1; |
257 | if (i > 0 && msgs[i].flags & | 257 | if (i > 0 && msgs[i].flags & |
258 | I2C_M_RD && msgs[i].addr != 0x40 && | 258 | I2C_M_RD && msgs[i].addr != 0x40 && |
259 | msgs[i].addr != 0x41 && | ||
259 | msgs[i].addr != 0x19) { | 260 | msgs[i].addr != 0x19) { |
260 | /* workaround for a saa7134 i2c bug | 261 | /* workaround for a saa7134 i2c bug |
261 | * needed to talk to the mt352 demux | 262 | * needed to talk to the mt352 demux |
diff --git a/drivers/media/pci/saa7134/saa7134-input.c b/drivers/media/pci/saa7134/saa7134-input.c index e761262f7475..6f4312663bdf 100644 --- a/drivers/media/pci/saa7134/saa7134-input.c +++ b/drivers/media/pci/saa7134/saa7134-input.c | |||
@@ -997,6 +997,9 @@ void saa7134_probe_i2c_ir(struct saa7134_dev *dev) | |||
997 | case SAA7134_BOARD_AVERMEDIA_CARDBUS_506: | 997 | case SAA7134_BOARD_AVERMEDIA_CARDBUS_506: |
998 | info.addr = 0x40; | 998 | info.addr = 0x40; |
999 | break; | 999 | break; |
1000 | case SAA7134_BOARD_AVERMEDIA_A706: | ||
1001 | info.addr = 0x41; | ||
1002 | break; | ||
1000 | case SAA7134_BOARD_FLYDVB_TRIO: | 1003 | case SAA7134_BOARD_FLYDVB_TRIO: |
1001 | dev->init_data.name = "FlyDVB Trio"; | 1004 | dev->init_data.name = "FlyDVB Trio"; |
1002 | dev->init_data.get_key = get_key_flydvb_trio; | 1005 | dev->init_data.get_key = get_key_flydvb_trio; |
diff --git a/drivers/media/pci/saa7134/saa7134-tvaudio.c b/drivers/media/pci/saa7134/saa7134-tvaudio.c index b7a99bee2f98..0f34e09d98dc 100644 --- a/drivers/media/pci/saa7134/saa7134-tvaudio.c +++ b/drivers/media/pci/saa7134/saa7134-tvaudio.c | |||
@@ -796,6 +796,7 @@ static int tvaudio_thread_ddep(void *data) | |||
796 | dprintk("FM Radio\n"); | 796 | dprintk("FM Radio\n"); |
797 | if (dev->tuner_type == TUNER_PHILIPS_TDA8290) { | 797 | if (dev->tuner_type == TUNER_PHILIPS_TDA8290) { |
798 | norms = (0x11 << 2) | 0x01; | 798 | norms = (0x11 << 2) | 0x01; |
799 | /* set IF frequency to 5.5 MHz */ | ||
799 | saa_dsp_writel(dev, 0x42c >> 2, 0x729555); | 800 | saa_dsp_writel(dev, 0x42c >> 2, 0x729555); |
800 | } else { | 801 | } else { |
801 | norms = (0x0f << 2) | 0x01; | 802 | norms = (0x0f << 2) | 0x01; |
diff --git a/drivers/media/pci/saa7134/saa7134.h b/drivers/media/pci/saa7134/saa7134.h index b90b48821104..1f6c41ed2a07 100644 --- a/drivers/media/pci/saa7134/saa7134.h +++ b/drivers/media/pci/saa7134/saa7134.h | |||
@@ -335,6 +335,7 @@ struct saa7134_card_ir { | |||
335 | #define SAA7134_BOARD_KWORLD_PC150U 189 | 335 | #define SAA7134_BOARD_KWORLD_PC150U 189 |
336 | #define SAA7134_BOARD_ASUSTeK_PS3_100 190 | 336 | #define SAA7134_BOARD_ASUSTeK_PS3_100 190 |
337 | #define SAA7134_BOARD_HAWELL_HW_9004V1 191 | 337 | #define SAA7134_BOARD_HAWELL_HW_9004V1 191 |
338 | #define SAA7134_BOARD_AVERMEDIA_A706 192 | ||
338 | 339 | ||
339 | #define SAA7134_MAXBOARDS 32 | 340 | #define SAA7134_MAXBOARDS 32 |
340 | #define SAA7134_INPUT_MAX 8 | 341 | #define SAA7134_INPUT_MAX 8 |