aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/oxygen.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-04-16 03:15:45 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:37 -0400
commit4972a177fed34036498aee555335f84a70219bc1 (patch)
tree343c9beb57407db5111d88de2c9c97498bc91777 /sound/pci/oxygen/oxygen.c
parente983532e446ac7fabe829d9e3aeff8e26b0a277d (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/oxygen.c')
-rw-r--r--sound/pci/oxygen/oxygen.c13
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,
249 249
250static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0); 250static const DECLARE_TLV_DB_LINEAR(ak4396_db_scale, TLV_DB_GAIN_MUTE, 0);
251 251
252static int ak4396_control_filter(struct snd_kcontrol_new *template)
253{
254 if (!strcmp(template->name, "Master Playback Volume")) {
255 template->access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ;
256 template->tlv.p = ak4396_db_scale;
257 }
258 return 0;
259}
260
261static const struct oxygen_model model_generic = { 252static const struct oxygen_model model_generic = {
262 .shortname = "C-Media CMI8788", 253 .shortname = "C-Media CMI8788",
263 .longname = "C-Media Oxygen HD Audio", 254 .longname = "C-Media Oxygen HD Audio",
264 .chip = "CMI8788", 255 .chip = "CMI8788",
265 .owner = THIS_MODULE, 256 .owner = THIS_MODULE,
266 .init = generic_init, 257 .init = generic_init,
267 .control_filter = ak4396_control_filter,
268 .cleanup = generic_cleanup, 258 .cleanup = generic_cleanup,
269 .set_dac_params = set_ak4396_params, 259 .set_dac_params = set_ak4396_params,
270 .set_adc_params = set_wm8785_params, 260 .set_adc_params = set_wm8785_params,
271 .update_dac_volume = update_ak4396_volume, 261 .update_dac_volume = update_ak4396_volume,
272 .update_dac_mute = update_ak4396_mute, 262 .update_dac_mute = update_ak4396_mute,
263 .dac_tlv = ak4396_db_scale,
273 .model_data_size = sizeof(struct generic_data), 264 .model_data_size = sizeof(struct generic_data),
274 .pcm_dev_cfg = PLAYBACK_0_TO_I2S | 265 .pcm_dev_cfg = PLAYBACK_0_TO_I2S |
275 PLAYBACK_1_TO_SPDIF | 266 PLAYBACK_1_TO_SPDIF |
@@ -291,12 +282,12 @@ static const struct oxygen_model model_meridian = {
291 .chip = "CMI8788", 282 .chip = "CMI8788",
292 .owner = THIS_MODULE, 283 .owner = THIS_MODULE,
293 .init = meridian_init, 284 .init = meridian_init,
294 .control_filter = ak4396_control_filter,
295 .cleanup = generic_cleanup, 285 .cleanup = generic_cleanup,
296 .set_dac_params = set_ak4396_params, 286 .set_dac_params = set_ak4396_params,
297 .set_adc_params = set_ak5385_params, 287 .set_adc_params = set_ak5385_params,
298 .update_dac_volume = update_ak4396_volume, 288 .update_dac_volume = update_ak4396_volume,
299 .update_dac_mute = update_ak4396_mute, 289 .update_dac_mute = update_ak4396_mute,
290 .dac_tlv = ak4396_db_scale,
300 .model_data_size = sizeof(struct generic_data), 291 .model_data_size = sizeof(struct generic_data),
301 .pcm_dev_cfg = PLAYBACK_0_TO_I2S | 292 .pcm_dev_cfg = PLAYBACK_0_TO_I2S |
302 PLAYBACK_1_TO_SPDIF | 293 PLAYBACK_1_TO_SPDIF |