diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2008-04-16 03:15:45 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 06:00:37 -0400 |
commit | 4972a177fed34036498aee555335f84a70219bc1 (patch) | |
tree | 343c9beb57407db5111d88de2c9c97498bc91777 /sound/pci/oxygen/hifier.c | |
parent | e983532e446ac7fabe829d9e3aeff8e26b0a277d (diff) |
[ALSA] oxygen: generalize DAC volume TLV handling
Add a pointer for DAC volume TLV data to the model structure so that the
model driver do not need to manually assign it in their control filter.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/oxygen/hifier.c')
-rw-r--r-- | sound/pci/oxygen/hifier.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sound/pci/oxygen/hifier.c b/sound/pci/oxygen/hifier.c index dec9073d6ed1..090dd4354a28 100644 --- a/sound/pci/oxygen/hifier.c +++ b/sound/pci/oxygen/hifier.c | |||
@@ -127,12 +127,8 @@ static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); | |||
127 | 127 | ||
128 | static int hifier_control_filter(struct snd_kcontrol_new *template) | 128 | static int hifier_control_filter(struct snd_kcontrol_new *template) |
129 | { | 129 | { |
130 | if (!strcmp(template->name, "Master Playback Volume")) { | 130 | if (!strcmp(template->name, "Stereo Upmixing")) |
131 | template->access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ; | ||
132 | template->tlv.p = ak4396_db_scale; | ||
133 | } else if (!strcmp(template->name, "Stereo Upmixing")) { | ||
134 | return 1; /* stereo only - we don't need upmixing */ | 131 | return 1; /* stereo only - we don't need upmixing */ |
135 | } | ||
136 | return 0; | 132 | return 0; |
137 | } | 133 | } |
138 | 134 | ||
@@ -148,6 +144,7 @@ static const struct oxygen_model model_hifier = { | |||
148 | .set_adc_params = set_cs5340_params, | 144 | .set_adc_params = set_cs5340_params, |
149 | .update_dac_volume = update_ak4396_volume, | 145 | .update_dac_volume = update_ak4396_volume, |
150 | .update_dac_mute = update_ak4396_mute, | 146 | .update_dac_mute = update_ak4396_mute, |
147 | .dac_tlv = ak4396_db_scale, | ||
151 | .model_data_size = sizeof(struct hifier_data), | 148 | .model_data_size = sizeof(struct hifier_data), |
152 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | | 149 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | |
153 | PLAYBACK_1_TO_SPDIF | | 150 | PLAYBACK_1_TO_SPDIF | |