diff options
Diffstat (limited to 'sound/pci/oxygen/hifier.c')
-rw-r--r-- | sound/pci/oxygen/hifier.c | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/sound/pci/oxygen/hifier.c b/sound/pci/oxygen/hifier.c index 090dd4354a28..7442460583dd 100644 --- a/sound/pci/oxygen/hifier.c +++ b/sound/pci/oxygen/hifier.c | |||
@@ -28,7 +28,7 @@ | |||
28 | 28 | ||
29 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); | 29 | MODULE_AUTHOR("Clemens Ladisch <clemens@ladisch.de>"); |
30 | MODULE_DESCRIPTION("TempoTec HiFier driver"); | 30 | MODULE_DESCRIPTION("TempoTec HiFier driver"); |
31 | MODULE_LICENSE("GPL"); | 31 | MODULE_LICENSE("GPL v2"); |
32 | 32 | ||
33 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | 33 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; |
34 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | 34 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; |
@@ -62,16 +62,28 @@ 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 | ||
65 | static void hifier_init(struct oxygen *chip) | 65 | static 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 | |||
71 | static void hifier_registers_init(struct oxygen *chip) | ||
66 | { | 72 | { |
67 | struct hifier_data *data = chip->model_data; | 73 | struct hifier_data *data = chip->model_data; |
68 | 74 | ||
69 | data->ak4396_ctl2 = AK4396_SMUTE | AK4396_DEM_OFF | AK4396_DFS_NORMAL; | ||
70 | ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN); | 75 | ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN); |
71 | ak4396_write(chip, AK4396_CONTROL_2, data->ak4396_ctl2); | 76 | ak4396_write(chip, AK4396_CONTROL_2, data->ak4396_ctl2); |
72 | ak4396_write(chip, AK4396_CONTROL_3, AK4396_PCM); | 77 | ak4396_write(chip, AK4396_CONTROL_3, AK4396_PCM); |
73 | ak4396_write(chip, AK4396_LCH_ATT, 0); | 78 | update_ak4396_volume(chip); |
74 | ak4396_write(chip, AK4396_RCH_ATT, 0); | 79 | } |
80 | |||
81 | static void hifier_init(struct oxygen *chip) | ||
82 | { | ||
83 | struct hifier_data *data = chip->model_data; | ||
84 | |||
85 | data->ak4396_ctl2 = AK4396_SMUTE | AK4396_DEM_OFF | AK4396_DFS_NORMAL; | ||
86 | hifier_registers_init(chip); | ||
75 | 87 | ||
76 | snd_component_add(chip->card, "AK4396"); | 88 | snd_component_add(chip->card, "AK4396"); |
77 | snd_component_add(chip->card, "CS5340"); | 89 | snd_component_add(chip->card, "CS5340"); |
@@ -100,12 +112,6 @@ static void set_ak4396_params(struct oxygen *chip, | |||
100 | ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN); | 112 | ak4396_write(chip, AK4396_CONTROL_1, AK4396_DIF_24_MSB | AK4396_RSTN); |
101 | } | 113 | } |
102 | 114 | ||
103 | static 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 | |||
109 | static void update_ak4396_mute(struct oxygen *chip) | 115 | static void update_ak4396_mute(struct oxygen *chip) |
110 | { | 116 | { |
111 | struct hifier_data *data = chip->model_data; | 117 | struct hifier_data *data = chip->model_data; |
@@ -140,6 +146,7 @@ static const struct oxygen_model model_hifier = { | |||
140 | .init = hifier_init, | 146 | .init = hifier_init, |
141 | .control_filter = hifier_control_filter, | 147 | .control_filter = hifier_control_filter, |
142 | .cleanup = hifier_cleanup, | 148 | .cleanup = hifier_cleanup, |
149 | .resume = hifier_registers_init, | ||
143 | .set_dac_params = set_ak4396_params, | 150 | .set_dac_params = set_ak4396_params, |
144 | .set_adc_params = set_cs5340_params, | 151 | .set_adc_params = set_cs5340_params, |
145 | .update_dac_volume = update_ak4396_volume, | 152 | .update_dac_volume = update_ak4396_volume, |
@@ -180,6 +187,10 @@ static struct pci_driver hifier_driver = { | |||
180 | .id_table = hifier_ids, | 187 | .id_table = hifier_ids, |
181 | .probe = hifier_probe, | 188 | .probe = hifier_probe, |
182 | .remove = __devexit_p(oxygen_pci_remove), | 189 | .remove = __devexit_p(oxygen_pci_remove), |
190 | #ifdef CONFIG_PM | ||
191 | .suspend = oxygen_pci_suspend, | ||
192 | .resume = oxygen_pci_resume, | ||
193 | #endif | ||
183 | }; | 194 | }; |
184 | 195 | ||
185 | static int __init alsa_card_hifier_init(void) | 196 | static int __init alsa_card_hifier_init(void) |