[ALSA] ak4xxx - Remove bogus IPGA controls

Remove IPGA volume controls and merge the IPGA range to ADC volume
controls.  These two volumes are not really independent but connected
simply in different ranges 0-0x7f and 0x80-max.  It doesn't make sense
to provide two controls.
Since both 0x7f and 0x80 specify 0dB, a hack is needed for IPGA range
to skip 0x80 (increment one) for such controls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
This commit is contained in:
Takashi Iwai
2006-09-08 12:27:38 +02:00
committed by Jaroslav Kysela
parent 8f88820ee4
commit 854b66e442
3 changed files with 18 additions and 121 deletions

View File

@@ -48,7 +48,6 @@ struct snd_akm4xxx_dac_channel {
/* ADC labels and channels */
struct snd_akm4xxx_adc_channel {
char *name; /* capture gain volume label */
char *gain_name; /* IPGA */
char *switch_name; /* capture switch */
unsigned int num_channels;
};
@@ -91,13 +90,4 @@ int snd_akm4xxx_build_controls(struct snd_akm4xxx *ak);
#define snd_akm4xxx_set_vol(ak,chip,reg,val) \
((ak)->volumes[(chip) * 16 + (reg)] = (val))
/* Warning: IPGA is tricky - we assume the addr + 4 is unused
* so far, it's OK for all AK codecs with IPGA:
* AK4524, AK4528 and EK5365
*/
#define snd_akm4xxx_get_ipga(ak,chip,reg) \
snd_akm4xxx_get_vol(ak, chip, (reg) + 4)
#define snd_akm4xxx_set_ipga(ak,chip,reg,val) \
snd_akm4xxx_set_vol(ak, chip, (reg) + 4, val)
#endif /* __SOUND_AK4XXX_ADDA_H */