diff options
author | Stefan Ringel <stefan.ringel@arcor.de> | 2011-05-09 16:53:51 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 20:01:20 -0300 |
commit | fb7ef9831a432a6ae82587d1477103c18f99be73 (patch) | |
tree | c1423ee109b1bfddb27b9f5da3795595a5705291 /drivers/staging/tm6000/tm6000-core.c | |
parent | 886a3c0b58f4c3d11a8cf723b8f5ee167708ebf5 (diff) |
[media] tm6000: change to virtual inputs
change to virtual inputs
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/staging/tm6000/tm6000-core.c')
-rw-r--r-- | drivers/staging/tm6000/tm6000-core.c | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/drivers/staging/tm6000/tm6000-core.c b/drivers/staging/tm6000/tm6000-core.c index 778e53413afb..f4b9fcd4985e 100644 --- a/drivers/staging/tm6000/tm6000-core.c +++ b/drivers/staging/tm6000/tm6000-core.c @@ -661,20 +661,25 @@ int tm6000_set_audio_input(struct tm6000_core *dev, enum tm6000_inaudio ainp) { if (dev->dev_type == TM6010) { /* Audio crossbar setting, default SIF1 */ - u8 areg_f0 = 0x03; + u8 areg_f0; - switch (ainp) { - case TM6000_AIP_SIF1: - case TM6000_AIP_SIF2: + switch (dev->rinput.amux) { + case TM6000_AMUX_SIF1: + case TM6000_AMUX_SIF2: areg_f0 = 0x03; break; - case TM6000_AIP_LINE1: + case TM6000_AMUX_ADC1: areg_f0 = 0x00; break; - case TM6000_AIP_LINE2: + case TM6000_AMUX_ADC2: areg_f0 = 0x08; break; + case TM6000_AMUX_I2S: + areg_f0 = 0x04; + break; default: + printk(KERN_INFO "%s: audio input dosn't support\n", + dev->name); return 0; break; } @@ -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, areg_f0, 0x0f); } else { + u8 areg_eb; /* Audio setting, default LINE1 */ - u8 areg_eb = 0x00; - - switch (ainp) { - case TM6000_AIP_LINE1: + switch (dev->rinput.amux) { + case TM6000_AMUX_ADC1: areg_eb = 0x00; break; - case TM6000_AIP_LINE2: + case TM6000_AMUX_ADC2: areg_eb = 0x04; break; default: + printk(KERN_INFO "%s: audio input dosn't support\n", + dev->name); return 0; break; } @@ -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) { - enum tm6000_inaudio ainp; + enum tm6000_mux mux; if (dev->radio) - ainp = dev->aradio; + mux = dev->rinput.amux; else - ainp = dev->avideo; + mux = dev->vinput[dev->input].amux; - switch (ainp) { - case TM6000_AIP_SIF1: - case TM6000_AIP_SIF2: + switch (mux) { + case TM6000_AMUX_SIF1: + case TM6000_AMUX_SIF2: if (dev->dev_type == TM6010) tm6010_set_mute_sif(dev, mute); else { @@ -755,8 +761,8 @@ int tm6000_tvaudio_set_mute(struct tm6000_core *dev, u8 mute) return -EINVAL; } break; - case TM6000_AIP_LINE1: - case TM6000_AIP_LINE2: + case TM6000_AMUX_ADC1: + case TM6000_AMUX_ADC2: tm6010_set_mute_adc(dev, mute); break; default: @@ -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) { - enum tm6000_inaudio ainp; + enum tm6000_mux mux; if (dev->radio) { - ainp = dev->aradio; + mux = dev->rinput.amux; vol += 8; /* Offset to 0 dB */ } else - ainp = dev->avideo; + mux = dev->vinput[dev->input].amux; - switch (ainp) { - case TM6000_AIP_SIF1: - case TM6000_AIP_SIF2: + switch (mux) { + case TM6000_AMUX_SIF1: + case TM6000_AMUX_SIF2: if (dev->dev_type == TM6010) tm6010_set_volume_sif(dev, vol); else @@ -815,8 +821,8 @@ void tm6000_set_volume(struct tm6000_core *dev, int vol) " SIF audio inputs. Please check the %s" " configuration.\n", dev->name); break; - case TM6000_AIP_LINE1: - case TM6000_AIP_LINE2: + case TM6000_AMUX_ADC1: + case TM6000_AMUX_ADC2: tm6010_set_volume_adc(dev, vol); break; default: |