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/virtuoso.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/virtuoso.c')
-rw-r--r-- | sound/pci/oxygen/virtuoso.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c index fe4e289840b4..7f84fa5deca2 100644 --- a/sound/pci/oxygen/virtuoso.c +++ b/sound/pci/oxygen/virtuoso.c | |||
@@ -502,24 +502,16 @@ static const DECLARE_TLV_DB_SCALE(cs4362a_db_scale, -12700, 100, 0); | |||
502 | 502 | ||
503 | static int xonar_d2_control_filter(struct snd_kcontrol_new *template) | 503 | static int xonar_d2_control_filter(struct snd_kcontrol_new *template) |
504 | { | 504 | { |
505 | if (!strcmp(template->name, "Master Playback Volume")) { | 505 | if (!strncmp(template->name, "CD Capture ", 11)) |
506 | template->access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ; | ||
507 | template->tlv.p = pcm1796_db_scale; | ||
508 | } else if (!strncmp(template->name, "CD Capture ", 11)) { | ||
509 | /* CD in is actually connected to the video in pin */ | 506 | /* CD in is actually connected to the video in pin */ |
510 | template->private_value ^= AC97_CD ^ AC97_VIDEO; | 507 | template->private_value ^= AC97_CD ^ AC97_VIDEO; |
511 | } | ||
512 | return 0; | 508 | return 0; |
513 | } | 509 | } |
514 | 510 | ||
515 | static int xonar_dx_control_filter(struct snd_kcontrol_new *template) | 511 | static int xonar_dx_control_filter(struct snd_kcontrol_new *template) |
516 | { | 512 | { |
517 | if (!strcmp(template->name, "Master Playback Volume")) { | 513 | if (!strncmp(template->name, "CD Capture ", 11)) |
518 | template->access |= SNDRV_CTL_ELEM_ACCESS_TLV_READ; | ||
519 | template->tlv.p = cs4362a_db_scale; | ||
520 | } else if (!strncmp(template->name, "CD Capture ", 11)) { | ||
521 | return 1; /* no CD input */ | 514 | return 1; /* no CD input */ |
522 | } | ||
523 | return 0; | 515 | return 0; |
524 | } | 516 | } |
525 | 517 | ||
@@ -547,6 +539,7 @@ static const struct oxygen_model xonar_models[] = { | |||
547 | .set_adc_params = set_cs53x1_params, | 539 | .set_adc_params = set_cs53x1_params, |
548 | .update_dac_volume = update_pcm1796_volume, | 540 | .update_dac_volume = update_pcm1796_volume, |
549 | .update_dac_mute = update_pcm1796_mute, | 541 | .update_dac_mute = update_pcm1796_mute, |
542 | .dac_tlv = pcm1796_db_scale, | ||
550 | .model_data_size = sizeof(struct xonar_data), | 543 | .model_data_size = sizeof(struct xonar_data), |
551 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | | 544 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | |
552 | PLAYBACK_1_TO_SPDIF | | 545 | PLAYBACK_1_TO_SPDIF | |
@@ -575,6 +568,7 @@ static const struct oxygen_model xonar_models[] = { | |||
575 | .update_dac_volume = update_pcm1796_volume, | 568 | .update_dac_volume = update_pcm1796_volume, |
576 | .update_dac_mute = update_pcm1796_mute, | 569 | .update_dac_mute = update_pcm1796_mute, |
577 | .gpio_changed = xonar_gpio_changed, | 570 | .gpio_changed = xonar_gpio_changed, |
571 | .dac_tlv = pcm1796_db_scale, | ||
578 | .model_data_size = sizeof(struct xonar_data), | 572 | .model_data_size = sizeof(struct xonar_data), |
579 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | | 573 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | |
580 | PLAYBACK_1_TO_SPDIF | | 574 | PLAYBACK_1_TO_SPDIF | |
@@ -604,6 +598,7 @@ static const struct oxygen_model xonar_models[] = { | |||
604 | .update_dac_mute = update_cs43xx_mute, | 598 | .update_dac_mute = update_cs43xx_mute, |
605 | .gpio_changed = xonar_gpio_changed, | 599 | .gpio_changed = xonar_gpio_changed, |
606 | .ac97_switch = xonar_dx_ac97_switch, | 600 | .ac97_switch = xonar_dx_ac97_switch, |
601 | .dac_tlv = cs4362a_db_scale, | ||
607 | .model_data_size = sizeof(struct xonar_data), | 602 | .model_data_size = sizeof(struct xonar_data), |
608 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | | 603 | .pcm_dev_cfg = PLAYBACK_0_TO_I2S | |
609 | PLAYBACK_1_TO_SPDIF | | 604 | PLAYBACK_1_TO_SPDIF | |