diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2008-04-16 09:15:45 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2008-04-24 12:00:37 +0200 |
commit | 4972a177fed34036498aee555335f84a70219bc1 (patch) | |
tree | 343c9beb57407db5111d88de2c9c97498bc91777 /sound/pci/oxygen/oxygen.c | |
parent | e983532e446ac7fabe829d9e3aeff8e26b0a277d (diff) | |
download | blackbird-obmc-linux-4972a177fed34036498aee555335f84a70219bc1.tar.gz blackbird-obmc-linux-4972a177fed34036498aee555335f84a70219bc1.zip |
[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/oxygen.c')
-rw-r--r-- | sound/pci/oxygen/oxygen.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/sound/pci/oxygen/oxygen.c b/sound/pci/oxygen/oxygen.c index 636315612c32..63f185c1ed1e 100644 --- a/sound/pci/oxygen/oxygen.c +++ b/sound/pci/oxygen/oxygen.c @@ -249,27 +249,18 @@ static void set_ak5385_params(struct oxygen *chip, static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); -static int ak4396_control_filter(struct snd_kcontrol_new *template) -{ - if (!strcmp(template->name, "Master Playback Volume")) { - template->access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ; - template->tlv.p = ak4396_db_scale; - } - return 0; -} - static const struct oxygen_model model_generic = { .shortname = "C-Media CMI8788", .longname = "C-Media Oxygen HD Audio", .chip = "CMI8788", .owner = THIS_MODULE, .init = generic_init, - .control_filter = ak4396_control_filter, .cleanup = generic_cleanup, .set_dac_params = set_ak4396_params, .set_adc_params = set_wm8785_params, .update_dac_volume = update_ak4396_volume, .update_dac_mute = update_ak4396_mute, + .dac_tlv = ak4396_db_scale, .model_data_size = sizeof(struct generic_data), .pcm_dev_cfg = PLAYBACK_0_TO_I2S | PLAYBACK_1_TO_SPDIF | @@ -291,12 +282,12 @@ static const struct oxygen_model model_meridian = { .chip = "CMI8788", .owner = THIS_MODULE, .init = meridian_init, - .control_filter = ak4396_control_filter, .cleanup = generic_cleanup, .set_dac_params = set_ak4396_params, .set_adc_params = set_ak5385_params, .update_dac_volume = update_ak4396_volume, .update_dac_mute = update_ak4396_mute, + .dac_tlv = ak4396_db_scale, .model_data_size = sizeof(struct generic_data), .pcm_dev_cfg = PLAYBACK_0_TO_I2S | PLAYBACK_1_TO_SPDIF | |