Commit fb7ef983 authored by Stefan Ringel's avatar Stefan Ringel Committed by Mauro Carvalho Chehab

[media] tm6000: change to virtual inputs

change to virtual inputs
Signed-off-by: default avatarStefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 886a3c0b
...@@ -74,8 +74,6 @@ struct tm6000_board { ...@@ -74,8 +74,6 @@ struct tm6000_board {
unsigned eename_pos; /* Position where it appears at ROM */ unsigned eename_pos; /* Position where it appears at ROM */
struct tm6000_capabilities caps; struct tm6000_capabilities caps;
enum tm6000_inaudio aradio;
enum tm6000_inaudio avideo;
enum tm6000_devtype type; /* variant of the chipset */ enum tm6000_devtype type; /* variant of the chipset */
int tuner_type; /* type of the tuner */ int tuner_type; /* type of the tuner */
...@@ -84,6 +82,8 @@ struct tm6000_board { ...@@ -84,6 +82,8 @@ struct tm6000_board {
struct tm6000_gpio gpio; struct tm6000_gpio gpio;
struct tm6000_input vinput[3];
struct tm6000_input rinput;
char *ir_codes; char *ir_codes;
}; };
...@@ -96,6 +96,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -96,6 +96,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = { .gpio = {
.tuner_reset = TM6000_GPIO_1, .tuner_reset = TM6000_GPIO_1,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_ADC1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM5600_BOARD_GENERIC] = { [TM5600_BOARD_GENERIC] = {
.name = "Generic tm5600 board", .name = "Generic tm5600 board",
...@@ -108,6 +122,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -108,6 +122,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = { .gpio = {
.tuner_reset = TM6000_GPIO_1, .tuner_reset = TM6000_GPIO_1,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_ADC1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM6000_BOARD_GENERIC] = { [TM6000_BOARD_GENERIC] = {
.name = "Generic tm6000 board", .name = "Generic tm6000 board",
...@@ -120,6 +148,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -120,6 +148,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = { .gpio = {
.tuner_reset = TM6000_GPIO_1, .tuner_reset = TM6000_GPIO_1,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_ADC1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM6010_BOARD_GENERIC] = { [TM6010_BOARD_GENERIC] = {
.name = "Generic tm6010 board", .name = "Generic tm6010 board",
...@@ -143,6 +185,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -143,6 +185,20 @@ struct tm6000_board tm6000_boards[] = {
.dvb_led = TM6010_GPIO_5, .dvb_led = TM6010_GPIO_5,
.ir = TM6010_GPIO_0, .ir = TM6010_GPIO_0,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_SIF1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM5600_BOARD_10MOONS_UT821] = { [TM5600_BOARD_10MOONS_UT821] = {
.name = "10Moons UT 821", .name = "10Moons UT 821",
...@@ -159,6 +215,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -159,6 +215,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = { .gpio = {
.tuner_reset = TM6000_GPIO_1, .tuner_reset = TM6000_GPIO_1,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_ADC1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM5600_BOARD_10MOONS_UT330] = { [TM5600_BOARD_10MOONS_UT330] = {
.name = "10Moons UT 330", .name = "10Moons UT 330",
...@@ -170,6 +240,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -170,6 +240,20 @@ struct tm6000_board tm6000_boards[] = {
.has_zl10353 = 0, .has_zl10353 = 0,
.has_eeprom = 1, .has_eeprom = 1,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_ADC1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM6000_BOARD_ADSTECH_DUAL_TV] = { [TM6000_BOARD_ADSTECH_DUAL_TV] = {
.name = "ADSTECH Dual TV USB", .name = "ADSTECH Dual TV USB",
...@@ -182,6 +266,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -182,6 +266,20 @@ struct tm6000_board tm6000_boards[] = {
.has_zl10353 = 1, .has_zl10353 = 1,
.has_eeprom = 1, .has_eeprom = 1,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_ADC1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM6000_BOARD_FREECOM_AND_SIMILAR] = { [TM6000_BOARD_FREECOM_AND_SIMILAR] = {
.name = "Freecom Hybrid Stick / Moka DVB-T Receiver Dual", .name = "Freecom Hybrid Stick / Moka DVB-T Receiver Dual",
...@@ -198,6 +296,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -198,6 +296,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = { .gpio = {
.tuner_reset = TM6000_GPIO_4, .tuner_reset = TM6000_GPIO_4,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_ADC1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM6000_BOARD_ADSTECH_MINI_DUAL_TV] = { [TM6000_BOARD_ADSTECH_MINI_DUAL_TV] = {
.name = "ADSTECH Mini Dual TV USB", .name = "ADSTECH Mini Dual TV USB",
...@@ -213,6 +325,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -213,6 +325,20 @@ struct tm6000_board tm6000_boards[] = {
.gpio = { .gpio = {
.tuner_reset = TM6000_GPIO_4, .tuner_reset = TM6000_GPIO_4,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_ADC1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM6010_BOARD_HAUPPAUGE_900H] = { [TM6010_BOARD_HAUPPAUGE_900H] = {
.name = "Hauppauge WinTV HVR-900H / WinTV USB2-Stick", .name = "Hauppauge WinTV HVR-900H / WinTV USB2-Stick",
...@@ -239,6 +365,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -239,6 +365,20 @@ struct tm6000_board tm6000_boards[] = {
.dvb_led = TM6010_GPIO_5, .dvb_led = TM6010_GPIO_5,
.ir = TM6010_GPIO_0, .ir = TM6010_GPIO_0,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_SIF1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM6010_BOARD_BEHOLD_WANDER] = { [TM6010_BOARD_BEHOLD_WANDER] = {
.name = "Beholder Wander DVB-T/TV/FM USB2.0", .name = "Beholder Wander DVB-T/TV/FM USB2.0",
...@@ -246,8 +386,6 @@ struct tm6000_board tm6000_boards[] = { ...@@ -246,8 +386,6 @@ struct tm6000_board tm6000_boards[] = {
.tuner_addr = 0xc2 >> 1, .tuner_addr = 0xc2 >> 1,
.demod_addr = 0x1e >> 1, .demod_addr = 0x1e >> 1,
.type = TM6010, .type = TM6010,
.avideo = TM6000_AIP_SIF1,
.aradio = TM6000_AIP_LINE1,
.caps = { .caps = {
.has_tuner = 1, .has_tuner = 1,
.has_dvb = 1, .has_dvb = 1,
...@@ -263,14 +401,30 @@ struct tm6000_board tm6000_boards[] = { ...@@ -263,14 +401,30 @@ struct tm6000_board tm6000_boards[] = {
.demod_reset = TM6010_GPIO_1, .demod_reset = TM6010_GPIO_1,
.power_led = TM6010_GPIO_6, .power_led = TM6010_GPIO_6,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_SIF1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
.rinput = {
.type = TM6000_INPUT_RADIO,
.amux = TM6000_AMUX_ADC1,
},
}, },
[TM6010_BOARD_BEHOLD_VOYAGER] = { [TM6010_BOARD_BEHOLD_VOYAGER] = {
.name = "Beholder Voyager TV/FM USB2.0", .name = "Beholder Voyager TV/FM USB2.0",
.tuner_type = TUNER_XC5000, .tuner_type = TUNER_XC5000,
.tuner_addr = 0xc2 >> 1, .tuner_addr = 0xc2 >> 1,
.type = TM6010, .type = TM6010,
.avideo = TM6000_AIP_SIF1,
.aradio = TM6000_AIP_LINE1,
.caps = { .caps = {
.has_tuner = 1, .has_tuner = 1,
.has_dvb = 0, .has_dvb = 0,
...@@ -285,6 +439,24 @@ struct tm6000_board tm6000_boards[] = { ...@@ -285,6 +439,24 @@ struct tm6000_board tm6000_boards[] = {
.tuner_reset = TM6010_GPIO_0, .tuner_reset = TM6010_GPIO_0,
.power_led = TM6010_GPIO_6, .power_led = TM6010_GPIO_6,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_SIF1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
.rinput = {
.type = TM6000_INPUT_RADIO,
.amux = TM6000_AMUX_ADC1,
},
}, },
[TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE] = { [TM6010_BOARD_TERRATEC_CINERGY_HYBRID_XE] = {
.name = "Terratec Cinergy Hybrid XE / Cinergy Hybrid-Stick", .name = "Terratec Cinergy Hybrid XE / Cinergy Hybrid-Stick",
...@@ -309,11 +481,39 @@ struct tm6000_board tm6000_boards[] = { ...@@ -309,11 +481,39 @@ struct tm6000_board tm6000_boards[] = {
.ir = TM6010_GPIO_0, .ir = TM6010_GPIO_0,
}, },
.ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS, .ir_codes = RC_MAP_NEC_TERRATEC_CINERGY_XS,
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_SIF1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM5600_BOARD_TERRATEC_GRABSTER] = { [TM5600_BOARD_TERRATEC_GRABSTER] = {
.name = "Terratec Grabster AV 150/250 MX", .name = "Terratec Grabster AV 150/250 MX",
.type = TM5600, .type = TM5600,
.tuner_type = TUNER_ABSENT, .tuner_type = TUNER_ABSENT,
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_ADC1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM6010_BOARD_TWINHAN_TU501] = { [TM6010_BOARD_TWINHAN_TU501] = {
.name = "Twinhan TU501(704D1)", .name = "Twinhan TU501(704D1)",
...@@ -337,6 +537,20 @@ struct tm6000_board tm6000_boards[] = { ...@@ -337,6 +537,20 @@ struct tm6000_board tm6000_boards[] = {
.dvb_led = TM6010_GPIO_5, .dvb_led = TM6010_GPIO_5,
.ir = TM6010_GPIO_0, .ir = TM6010_GPIO_0,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_SIF1,
}, {
.type = TM6000_INPUT_COMPOSITE1,
.vmux = TM6000_VMUX_VIDEO_A,
.amux = TM6000_AMUX_ADC2,
}, {
.type = TM6000_INPUT_SVIDEO,
.vmux = TM6000_VMUX_VIDEO_AB,
.amux = TM6000_AMUX_ADC2,
},
},
}, },
[TM6010_BOARD_BEHOLD_WANDER_LITE] = { [TM6010_BOARD_BEHOLD_WANDER_LITE] = {
.name = "Beholder Wander Lite DVB-T/TV/FM USB2.0", .name = "Beholder Wander Lite DVB-T/TV/FM USB2.0",
...@@ -344,8 +558,6 @@ struct tm6000_board tm6000_boards[] = { ...@@ -344,8 +558,6 @@ struct tm6000_board tm6000_boards[] = {
.tuner_addr = 0xc2 >> 1, .tuner_addr = 0xc2 >> 1,
.demod_addr = 0x1e >> 1, .demod_addr = 0x1e >> 1,
.type = TM6010, .type = TM6010,
.avideo = TM6000_AIP_SIF1,
.aradio = TM6000_AIP_LINE1,
.caps = { .caps = {
.has_tuner = 1, .has_tuner = 1,
.has_dvb = 1, .has_dvb = 1,
...@@ -361,14 +573,22 @@ struct tm6000_board tm6000_boards[] = { ...@@ -361,14 +573,22 @@ struct tm6000_board tm6000_boards[] = {
.demod_reset = TM6010_GPIO_1, .demod_reset = TM6010_GPIO_1,
.power_led = TM6010_GPIO_6, .power_led = TM6010_GPIO_6,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_SIF1,
},
},
.rinput = {
.type = TM6000_INPUT_RADIO,
.amux = TM6000_AMUX_ADC1,
},
}, },
[TM6010_BOARD_BEHOLD_VOYAGER_LITE] = { [TM6010_BOARD_BEHOLD_VOYAGER_LITE] = {
.name = "Beholder Voyager Lite TV/FM USB2.0", .name = "Beholder Voyager Lite TV/FM USB2.0",
.tuner_type = TUNER_XC5000, .tuner_type = TUNER_XC5000,
.tuner_addr = 0xc2 >> 1, .tuner_addr = 0xc2 >> 1,
.type = TM6010, .type = TM6010,
.avideo = TM6000_AIP_SIF1,
.aradio = TM6000_AIP_LINE1,
.caps = { .caps = {
.has_tuner = 1, .has_tuner = 1,
.has_dvb = 0, .has_dvb = 0,
...@@ -383,6 +603,16 @@ struct tm6000_board tm6000_boards[] = { ...@@ -383,6 +603,16 @@ struct tm6000_board tm6000_boards[] = {
.tuner_reset = TM6010_GPIO_0, .tuner_reset = TM6010_GPIO_0,
.power_led = TM6010_GPIO_6, .power_led = TM6010_GPIO_6,
}, },
.vinput = { {
.type = TM6000_INPUT_TV,
.vmux = TM6000_VMUX_VIDEO_B,
.amux = TM6000_AMUX_SIF1,
},
},
.rinput = {
.type = TM6000_INPUT_RADIO,
.amux = TM6000_AMUX_ADC1,
},
}, },
}; };
...@@ -763,8 +993,11 @@ static int fill_board_specific_data(struct tm6000_core *dev) ...@@ -763,8 +993,11 @@ static int fill_board_specific_data(struct tm6000_core *dev)
dev->caps = tm6000_boards[dev->model].caps; dev->caps = tm6000_boards[dev->model].caps;
dev->avideo = tm6000_boards[dev->model].avideo; dev->vinput[0] = tm6000_boards[dev->model].vinput[0];
dev->aradio = tm6000_boards[dev->model].aradio; dev->vinput[1] = tm6000_boards[dev->model].vinput[1];
dev->vinput[2] = tm6000_boards[dev->model].vinput[2];
dev->rinput = tm6000_boards[dev->model].rinput;
/* initialize hardware */ /* initialize hardware */
rc = tm6000_init(dev); rc = tm6000_init(dev);
if (rc < 0) if (rc < 0)
......
...@@ -661,20 +661,25 @@ int tm6000_set_audio_input(struct tm6000_core *dev, enum tm6000_inaudio ainp) ...@@ -661,20 +661,25 @@ int tm6000_set_audio_input(struct tm6000_core *dev, enum tm6000_inaudio ainp)
{ {
if (dev->dev_type == TM6010) { if (dev->dev_type == TM6010) {
/* Audio crossbar setting, default SIF1 */ /* Audio crossbar setting, default SIF1 */
u8 areg_f0 = 0x03; u8 areg_f0;
switch (ainp) { switch (dev->rinput.amux) {
case TM6000_AIP_SIF1: case TM6000_AMUX_SIF1:
case TM6000_AIP_SIF2: case TM6000_AMUX_SIF2:
areg_f0 = 0x03; areg_f0 = 0x03;
break; break;
case TM6000_AIP_LINE1: case TM6000_AMUX_ADC1:
areg_f0 = 0x00; areg_f0 = 0x00;
break; break;
case TM6000_AIP_LINE2: case TM6000_AMUX_ADC2:
areg_f0 = 0x08; areg_f0 = 0x08;
break; break;
case TM6000_AMUX_I2S:
areg_f0 = 0x04;
break;
default: default:
printk(KERN_INFO "%s: audio input dosn't support\n",
dev->name);
return 0; return 0;
break; break;
} }
...@@ -682,17 +687,18 @@ int tm6000_set_audio_input(struct tm6000_core *dev, enum tm6000_inaudio ainp) ...@@ -682,17 +687,18 @@ int tm6000_set_audio_input(struct tm6000_core *dev, enum tm6000_inaudio ainp)
tm6000_set_reg_mask(dev, TM6010_REQ08_RF0_DAUDIO_INPUT_CONFIG, tm6000_set_reg_mask(dev, TM6010_REQ08_RF0_DAUDIO_INPUT_CONFIG,
areg_f0, 0x0f); areg_f0, 0x0f);
} else { } else {
u8 areg_eb;
/* Audio setting, default LINE1 */ /* Audio setting, default LINE1 */
u8 areg_eb = 0x00; switch (dev->rinput.amux) {
case TM6000_AMUX_ADC1:
switch (ainp) {
case TM6000_AIP_LINE1:
areg_eb = 0x00; areg_eb = 0x00;
break; break;
case TM6000_AIP_LINE2: case TM6000_AMUX_ADC2:
areg_eb = 0x04; areg_eb = 0x04;
break; break;
default: default:
printk(KERN_INFO "%s: audio input dosn't support\n",
dev->name);
return 0; return 0;
break; break;
} }
...@@ -736,16 +742,16 @@ void tm6010_set_mute_adc(struct tm6000_core *dev, u8 mute) ...@@ -736,16 +742,16 @@ void tm6010_set_mute_adc(struct tm6000_core *dev, u8 mute)
int tm6000_tvaudio_set_mute(struct tm6000_core *dev, u8 mute) int tm6000_tvaudio_set_mute(struct tm6000_core *dev, u8 mute)
{ {
enum tm6000_inaudio ainp; enum tm6000_mux mux;
if (dev->radio) if (dev->radio)
ainp = dev->aradio; mux = dev->rinput.amux;
else else
ainp = dev->avideo; mux = dev->vinput[dev->input].amux;
switch (ainp) { switch (mux) {
case TM6000_AIP_SIF1: case TM6000_AMUX_SIF1:
case TM6000_AIP_SIF2: case TM6000_AMUX_SIF2:
if (dev->dev_type == TM6010) if (dev->dev_type == TM6010)
tm6010_set_mute_sif(dev, mute); tm6010_set_mute_sif(dev, mute);
else { else {
...@@ -755,8 +761,8 @@ int tm6000_tvaudio_set_mute(struct tm6000_core *dev, u8 mute) ...@@ -755,8 +761,8 @@ int tm6000_tvaudio_set_mute(struct tm6000_core *dev, u8 mute)
return -EINVAL; return -EINVAL;
} }
break; break;
case TM6000_AIP_LINE1: case TM6000_AMUX_ADC1:
case TM6000_AIP_LINE2: case TM6000_AMUX_ADC2:
tm6010_set_mute_adc(dev, mute); tm6010_set_mute_adc(dev, mute);
break; break;
default: default:
...@@ -797,17 +803,17 @@ void tm6010_set_volume_adc(struct tm6000_core *dev, int vol) ...@@ -797,17 +803,17 @@ void tm6010_set_volume_adc(struct tm6000_core *dev, int vol)
void tm6000_set_volume(struct tm6000_core *dev, int vol) void tm6000_set_volume(struct tm6000_core *dev, int vol)
{ {
enum tm6000_inaudio ainp; enum tm6000_mux mux;
if (dev->radio) { if (dev->radio) {
ainp = dev->aradio; mux = dev->rinput.amux;
vol += 8; /* Offset to 0 dB */ vol += 8; /* Offset to 0 dB */
} else } else
ainp = dev->avideo; mux = dev->vinput[dev->input].amux;
switch (ainp) { switch (mux) {
case TM6000_AIP_SIF1: case TM6000_AMUX_SIF1:
case TM6000_AIP_SIF2: case TM6000_AMUX_SIF2:
if (dev->dev_type == TM6010) if (dev->dev_type == TM6010)
tm6010_set_volume_sif(dev, vol); tm6010_set_volume_sif(dev, vol);
else else
...@@ -815,8 +821,8 @@ void tm6000_set_volume(struct tm6000_core *dev, int vol) ...@@ -815,8 +821,8 @@ void tm6000_set_volume(struct tm6000_core *dev, int vol)
" SIF audio inputs. Please check the %s" " SIF audio inputs. Please check the %s"
" configuration.\n", dev->name); " configuration.\n", dev->name);
break; break;
case TM6000_AIP_LINE1: case TM6000_AMUX_ADC1:
case TM6000_AIP_LINE2: case TM6000_AMUX_ADC2:
tm6010_set_volume_adc(dev, vol); tm6010_set_volume_adc(dev, vol);
break; break;
default: default:
......
...@@ -40,11 +40,24 @@ ...@@ -40,11 +40,24 @@
#define TM6000_VERSION KERNEL_VERSION(0, 0, 2) #define TM6000_VERSION KERNEL_VERSION(0, 0, 2)
/* Inputs */ /* Inputs */
enum tm6000_itype { enum tm6000_itype {
TM6000_INPUT_TV = 0, TM6000_INPUT_TV = 1,
TM6000_INPUT_COMPOSITE, TM6000_INPUT_COMPOSITE1,
TM6000_INPUT_COMPOSITE2,
TM6000_INPUT_SVIDEO, TM6000_INPUT_SVIDEO,
TM6000_INPUT_DVB,
TM6000_INPUT_RADIO,
};
enum tm6000_mux {
TM6000_VMUX_VIDEO_A = 1,
TM6000_VMUX_VIDEO_B,
TM6000_VMUX_VIDEO_AB,
TM6000_AMUX_ADC1,
TM6000_AMUX_ADC2,
TM6000_AMUX_SIF1,
TM6000_AMUX_SIF2,
TM6000_AMUX_I2S,
}; };
enum tm6000_devtype { enum tm6000_devtype {
...@@ -53,12 +66,12 @@ enum tm6000_devtype { ...@@ -53,12 +66,12 @@ enum tm6000_devtype {
TM6010, TM6010,
}; };
enum tm6000_inaudio { struct tm6000_input {
TM6000_AIP_UNK = 0, enum tm6000_itype type;
TM6000_AIP_SIF1, enum tm6000_mux vmux;
TM6000_AIP_SIF2, enum tm6000_mux amux;
TM6000_AIP_LINE1, unsigned int v_gpio;
TM6000_AIP_LINE2, unsigned int a_gpio;
}; };
/* ------------------------------------------------------------------ /* ------------------------------------------------------------------
...@@ -214,6 +227,9 @@ struct tm6000_core { ...@@ -214,6 +227,9 @@ struct tm6000_core {
struct v4l2_device v4l2_dev; struct v4l2_device v4l2_dev;
int input; int input;
struct tm6000_input vinput[3]; /* video input */
struct tm6000_input rinput; /* radio input */
int freq; int freq;
unsigned int fourcc; unsigned int fourcc;
...@@ -230,8 +246,6 @@ struct tm6000_core { ...@@ -230,8 +246,6 @@ struct tm6000_core {
struct snd_tm6000_card *adev; struct snd_tm6000_card *adev;
struct work_struct wq_trigger; /* Trigger to start/stop audio for alsa module */ struct work_struct wq_trigger; /* Trigger to start/stop audio for alsa module */
atomic_t stream_started; /* stream should be running if true */ atomic_t stream_started; /* stream should be running if true */
enum tm6000_inaudio avideo;
enum tm6000_inaudio aradio;
struct tm6000_IR *ir; struct tm6000_IR *ir;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment