aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/oxygen/hifier.c
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2008-05-13 03:21:48 -0400
committerJaroslav Kysela <perex@perex.cz>2008-05-19 07:19:16 -0400
commitbbbfb5526650cb9d01c5c230a4e3cbbc18474c41 (patch)
treee4e210c41214d6018dd2a623b19f65236d634b51 /sound/pci/oxygen/hifier.c
parente58aee95806c9d2bbcfc84cb85ce958e360165ef (diff)
[ALSA] oxygen: simplify DAC volume initialization
When initializing the DAC volume registers, we can just use the generic volume update functions instead of setting the registers manually. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/oxygen/hifier.c')
-rw-r--r--sound/pci/oxygen/hifier.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sound/pci/oxygen/hifier.c b/sound/pci/oxygen/hifier.c
index c5d2c86cacb2..0e425d554505 100644
--- a/sound/pci/oxygen/hifier.c
+++ b/sound/pci/oxygen/hifier.c
@@ -62,6 +62,12 @@ static void ak4396_write(struct oxygen *chip, u8 reg, u8 value)
62 AK4396_WRITE | (reg << 8) | value); 62 AK4396_WRITE | (reg << 8) | value);
63} 63}
64 64
65static void update_ak4396_volume(struct oxygen *chip)
66{
67 ak4396_write(chip, AK4396_LCH_ATT, chip->dac_volume[0]);
68 ak4396_write(chip, AK4396_RCH_ATT, chip->dac_volume[1]);
69}
70
65static void hifier_init(struct oxygen *chip) 71static void hifier_init(struct oxygen *chip)
66{ 72{
67 struct hifier_data *data = chip->model_data; 73 struct hifier_data *data = chip->model_data;
@@ -70,8 +76,7 @@ static void hifier_init(struct oxygen *chip)
70 ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN); 76 ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN);
71 ak4396_write(chip, AK4396_CONTROL_2, data->ak4396_ctl2); 77 ak4396_write(chip, AK4396_CONTROL_2, data->ak4396_ctl2);
72 ak4396_write(chip, AK4396_CONTROL_3, AK4396_PCM); 78 ak4396_write(chip, AK4396_CONTROL_3, AK4396_PCM);
73 ak4396_write(chip, AK4396_LCH_ATT, 0); 79 update_ak4396_volume(chip);
74 ak4396_write(chip, AK4396_RCH_ATT, 0);
75 80
76 snd_component_add(chip->card, "AK4396"); 81 snd_component_add(chip->card, "AK4396");
77 snd_component_add(chip->card, "CS5340"); 82 snd_component_add(chip->card, "CS5340");
@@ -100,12 +105,6 @@ static void set_ak4396_params(struct oxygen *chip,
100 ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN); 105 ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN);
101} 106}
102 107
103static void update_ak4396_volume(struct oxygen *chip)
104{
105 ak4396_write(chip, AK4396_LCH_ATT, chip->dac_volume[0]);
106 ak4396_write(chip, AK4396_RCH_ATT, chip->dac_volume[1]);
107}
108
109static void update_ak4396_mute(struct oxygen *chip) 108static void update_ak4396_mute(struct oxygen *chip)
110{ 109{
111 struct hifier_data *data = chip->model_data; 110 struct hifier_data *data = chip->model_data;