diff options
Diffstat (limited to 'sound/pci')
-rw-r--r-- | sound/pci/ice1712/delta.c | 2 | ||||
-rw-r--r-- | sound/pci/ice1712/juli.c | 44 | ||||
-rw-r--r-- | sound/pci/ice1712/phase.c | 244 | ||||
-rw-r--r-- | sound/pci/ice1712/phase.h | 8 | ||||
-rw-r--r-- | sound/pci/ice1712/pontis.c | 5 | ||||
-rw-r--r-- | sound/pci/ice1712/revo.c | 8 |
6 files changed, 183 insertions, 128 deletions
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c index 0ed96c178059..d216362626d0 100644 --- a/sound/pci/ice1712/delta.c +++ b/sound/pci/ice1712/delta.c | |||
@@ -400,7 +400,7 @@ static void delta_setup_spdif(struct snd_ice1712 *ice, int rate) | |||
400 | static int snd_ice1712_delta1010lt_wordclock_status_get(struct snd_kcontrol *kcontrol, | 400 | static int snd_ice1712_delta1010lt_wordclock_status_get(struct snd_kcontrol *kcontrol, |
401 | struct snd_ctl_elem_value *ucontrol) | 401 | struct snd_ctl_elem_value *ucontrol) |
402 | { | 402 | { |
403 | char reg = 0x10; // cs8427 receiver error register | 403 | char reg = 0x10; /* CS8427 receiver error register */ |
404 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 404 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
405 | 405 | ||
406 | if (snd_i2c_sendbytes(ice->cs8427, ®, 1) != 1) | 406 | if (snd_i2c_sendbytes(ice->cs8427, ®, 1) != 1) |
diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index 21ff4de890b4..c51659b9caf6 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c | |||
@@ -21,7 +21,7 @@ | |||
21 | * along with this program; if not, write to the Free Software | 21 | * along with this program; if not, write to the Free Software |
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
23 | * | 23 | * |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include <asm/io.h> | 26 | #include <asm/io.h> |
27 | #include <linux/delay.h> | 27 | #include <linux/delay.h> |
@@ -34,9 +34,10 @@ | |||
34 | #include "ice1712.h" | 34 | #include "ice1712.h" |
35 | #include "envy24ht.h" | 35 | #include "envy24ht.h" |
36 | #include "juli.h" | 36 | #include "juli.h" |
37 | |||
37 | struct juli_spec { | 38 | struct juli_spec { |
38 | struct ak4114 *ak4114; | 39 | struct ak4114 *ak4114; |
39 | unsigned int analog: 1; | 40 | unsigned int analog:1; |
40 | }; | 41 | }; |
41 | 42 | ||
42 | /* | 43 | /* |
@@ -160,14 +161,17 @@ static int get_gpio_val(int rate) | |||
160 | return 0; | 161 | return 0; |
161 | } | 162 | } |
162 | 163 | ||
163 | static void juli_ak4114_write(void *private_data, unsigned char reg, unsigned char val) | 164 | static void juli_ak4114_write(void *private_data, unsigned char reg, |
165 | unsigned char val) | ||
164 | { | 166 | { |
165 | snd_vt1724_write_i2c((struct snd_ice1712 *)private_data, AK4114_ADDR, reg, val); | 167 | snd_vt1724_write_i2c((struct snd_ice1712 *)private_data, AK4114_ADDR, |
168 | reg, val); | ||
166 | } | 169 | } |
167 | 170 | ||
168 | static unsigned char juli_ak4114_read(void *private_data, unsigned char reg) | 171 | static unsigned char juli_ak4114_read(void *private_data, unsigned char reg) |
169 | { | 172 | { |
170 | return snd_vt1724_read_i2c((struct snd_ice1712 *)private_data, AK4114_ADDR, reg); | 173 | return snd_vt1724_read_i2c((struct snd_ice1712 *)private_data, |
174 | AK4114_ADDR, reg); | ||
171 | } | 175 | } |
172 | 176 | ||
173 | /* | 177 | /* |
@@ -175,7 +179,7 @@ static unsigned char juli_ak4114_read(void *private_data, unsigned char reg) | |||
175 | * to the external rate | 179 | * to the external rate |
176 | */ | 180 | */ |
177 | static void juli_spdif_in_open(struct snd_ice1712 *ice, | 181 | static void juli_spdif_in_open(struct snd_ice1712 *ice, |
178 | struct snd_pcm_substream *substream) | 182 | struct snd_pcm_substream *substream) |
179 | { | 183 | { |
180 | struct juli_spec *spec = ice->spec; | 184 | struct juli_spec *spec = ice->spec; |
181 | struct snd_pcm_runtime *runtime = substream->runtime; | 185 | struct snd_pcm_runtime *runtime = substream->runtime; |
@@ -572,10 +576,12 @@ static void juli_ak4114_change(struct ak4114 *ak4114, unsigned char c0, | |||
572 | static int __devinit juli_init(struct snd_ice1712 *ice) | 576 | static int __devinit juli_init(struct snd_ice1712 *ice) |
573 | { | 577 | { |
574 | static const unsigned char ak4114_init_vals[] = { | 578 | static const unsigned char ak4114_init_vals[] = { |
575 | /* AK4117_REG_PWRDN */ AK4114_RST | AK4114_PWN | AK4114_OCKS0 | AK4114_OCKS1, | 579 | /* AK4117_REG_PWRDN */ AK4114_RST | AK4114_PWN | |
580 | AK4114_OCKS0 | AK4114_OCKS1, | ||
576 | /* AK4114_REQ_FORMAT */ AK4114_DIF_I24I2S, | 581 | /* AK4114_REQ_FORMAT */ AK4114_DIF_I24I2S, |
577 | /* AK4114_REG_IO0 */ AK4114_TX1E, | 582 | /* AK4114_REG_IO0 */ AK4114_TX1E, |
578 | /* AK4114_REG_IO1 */ AK4114_EFH_1024 | AK4114_DIT | AK4114_IPS(1), | 583 | /* AK4114_REG_IO1 */ AK4114_EFH_1024 | AK4114_DIT | |
584 | AK4114_IPS(1), | ||
579 | /* AK4114_REG_INT0_MASK */ 0, | 585 | /* AK4114_REG_INT0_MASK */ 0, |
580 | /* AK4114_REG_INT1_MASK */ 0 | 586 | /* AK4114_REG_INT1_MASK */ 0 |
581 | }; | 587 | }; |
@@ -605,12 +611,14 @@ static int __devinit juli_init(struct snd_ice1712 *ice) | |||
605 | spec->ak4114->check_flags = 0; | 611 | spec->ak4114->check_flags = 0; |
606 | 612 | ||
607 | #if 0 | 613 | #if 0 |
608 | /* it seems that the analog doughter board detection does not work | 614 | /* |
609 | reliably, so force the analog flag; it should be very rare | 615 | * it seems that the analog doughter board detection does not work reliably, so |
610 | to use Juli@ without the analog doughter board */ | 616 | * force the analog flag; it should be very rare (if ever) to come at Juli@ |
617 | * used without the analog daughter board | ||
618 | */ | ||
611 | spec->analog = (ice->gpio.get_data(ice) & GPIO_ANALOG_PRESENT) ? 0 : 1; | 619 | spec->analog = (ice->gpio.get_data(ice) & GPIO_ANALOG_PRESENT) ? 0 : 1; |
612 | #else | 620 | #else |
613 | spec->analog = 1; | 621 | spec->analog = 1; |
614 | #endif | 622 | #endif |
615 | 623 | ||
616 | if (spec->analog) { | 624 | if (spec->analog) { |
@@ -618,14 +626,16 @@ static int __devinit juli_init(struct snd_ice1712 *ice) | |||
618 | ice->num_total_dacs = 2; | 626 | ice->num_total_dacs = 2; |
619 | ice->num_total_adcs = 2; | 627 | ice->num_total_adcs = 2; |
620 | 628 | ||
621 | ak = ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); | 629 | ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); |
622 | if (! ak) | 630 | ak = ice->akm; |
631 | if (!ak) | ||
623 | return -ENOMEM; | 632 | return -ENOMEM; |
624 | ice->akm_codecs = 1; | 633 | ice->akm_codecs = 1; |
625 | if ((err = snd_ice1712_akm4xxx_init(ak, &akm_juli_dac, NULL, ice)) < 0) | 634 | err = snd_ice1712_akm4xxx_init(ak, &akm_juli_dac, NULL, ice); |
635 | if (err < 0) | ||
626 | return err; | 636 | return err; |
627 | } | 637 | } |
628 | 638 | ||
629 | /* juli is clocked by Xilinx array */ | 639 | /* juli is clocked by Xilinx array */ |
630 | ice->hw_rates = &juli_rates_info; | 640 | ice->hw_rates = &juli_rates_info; |
631 | ice->is_spdif_master = juli_is_spdif_master; | 641 | ice->is_spdif_master = juli_is_spdif_master; |
diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c index 6a614729280f..de29be8c9657 100644 --- a/sound/pci/ice1712/phase.c +++ b/sound/pci/ice1712/phase.c | |||
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | 38 | ||
39 | /* PHASE 28 overview: | 39 | /* PHASE 28 overview: |
40 | * Audio controller: VIA Envy24HT (full untrimmed version, 8in/8out) | 40 | * Audio controller: VIA Envy24HT (full untrimmed version, 4in/8out) |
41 | * Analog chip: WM8770 (8 channel 192k DAC, 2 channel 96k ADC) | 41 | * Analog chip: WM8770 (8 channel 192k DAC, 2 channel 96k ADC) |
42 | * Digital receiver: CS8414-CS (supported in this release) | 42 | * Digital receiver: CS8414-CS (supported in this release) |
43 | */ | 43 | */ |
@@ -86,18 +86,18 @@ struct phase28_spec { | |||
86 | * Computed as 20 * Log10(255 / x) | 86 | * Computed as 20 * Log10(255 / x) |
87 | */ | 87 | */ |
88 | static const unsigned char wm_vol[256] = { | 88 | static const unsigned char wm_vol[256] = { |
89 | 127, 48, 42, 39, 36, 34, 33, 31, 30, 29, 28, 27, 27, 26, 25, 25, 24, 24, 23, | 89 | 127, 48, 42, 39, 36, 34, 33, 31, 30, 29, 28, 27, 27, 26, 25, 25, 24, |
90 | 23, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 18, 17, 17, 17, | 90 | 24, 23, 23, 22, 22, 21, 21, 21, 20, 20, 20, 19, 19, 19, 18, 18, 18, 18, |
91 | 17, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, 14, 13, 13, 13, | 91 | 17, 17, 17, 17, 16, 16, 16, 16, 15, 15, 15, 15, 15, 15, 14, 14, 14, 14, |
92 | 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, 11, 11, 11, 11, 11, | 92 | 14, 13, 13, 13, 13, 13, 13, 13, 12, 12, 12, 12, 12, 12, 12, 11, 11, 11, |
93 | 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 8, 8, | 93 | 11, 11, 11, 11, 11, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 9, 9, 9, 9, |
94 | 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, | 94 | 9, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 7, 7, 7, 7, 7, 7, |
95 | 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, | 95 | 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 5, 5, |
96 | 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, | 96 | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, |
97 | 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, | 97 | 4, 4, 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, |
98 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | 98 | 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
99 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 99 | 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, |
100 | 0, 0 | 100 | 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
101 | }; | 101 | }; |
102 | 102 | ||
103 | #define WM_VOL_MAX (sizeof(wm_vol) - 1) | 103 | #define WM_VOL_MAX (sizeof(wm_vol) - 1) |
@@ -126,28 +126,31 @@ static int __devinit phase22_init(struct snd_ice1712 *ice) | |||
126 | struct snd_akm4xxx *ak; | 126 | struct snd_akm4xxx *ak; |
127 | int err; | 127 | int err; |
128 | 128 | ||
129 | // Configure DAC/ADC description for generic part of ice1724 | 129 | /* Configure DAC/ADC description for generic part of ice1724 */ |
130 | switch (ice->eeprom.subvendor) { | 130 | switch (ice->eeprom.subvendor) { |
131 | case VT1724_SUBDEVICE_PHASE22: | 131 | case VT1724_SUBDEVICE_PHASE22: |
132 | case VT1724_SUBDEVICE_TS22: | 132 | case VT1724_SUBDEVICE_TS22: |
133 | ice->num_total_dacs = 2; | 133 | ice->num_total_dacs = 2; |
134 | ice->num_total_adcs = 2; | 134 | ice->num_total_adcs = 2; |
135 | ice->vt1720 = 1; // Envy24HT-S have 16 bit wide GPIO | 135 | ice->vt1720 = 1; /* Envy24HT-S have 16 bit wide GPIO */ |
136 | break; | 136 | break; |
137 | default: | 137 | default: |
138 | snd_BUG(); | 138 | snd_BUG(); |
139 | return -EINVAL; | 139 | return -EINVAL; |
140 | } | 140 | } |
141 | 141 | ||
142 | // Initialize analog chips | 142 | /* Initialize analog chips */ |
143 | ak = ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); | 143 | ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); |
144 | if (! ak) | 144 | ak = ice->akm; |
145 | if (!ak) | ||
145 | return -ENOMEM; | 146 | return -ENOMEM; |
146 | ice->akm_codecs = 1; | 147 | ice->akm_codecs = 1; |
147 | switch (ice->eeprom.subvendor) { | 148 | switch (ice->eeprom.subvendor) { |
148 | case VT1724_SUBDEVICE_PHASE22: | 149 | case VT1724_SUBDEVICE_PHASE22: |
149 | case VT1724_SUBDEVICE_TS22: | 150 | case VT1724_SUBDEVICE_TS22: |
150 | if ((err = snd_ice1712_akm4xxx_init(ak, &akm_phase22, &akm_phase22_priv, ice)) < 0) | 151 | err = snd_ice1712_akm4xxx_init(ak, &akm_phase22, |
152 | &akm_phase22_priv, ice); | ||
153 | if (err < 0) | ||
151 | return err; | 154 | return err; |
152 | break; | 155 | break; |
153 | } | 156 | } |
@@ -206,15 +209,16 @@ static unsigned char phase28_eeprom[] __devinitdata = { | |||
206 | /* | 209 | /* |
207 | * write data in the SPI mode | 210 | * write data in the SPI mode |
208 | */ | 211 | */ |
209 | static void phase28_spi_write(struct snd_ice1712 *ice, unsigned int cs, unsigned int data, int bits) | 212 | static void phase28_spi_write(struct snd_ice1712 *ice, unsigned int cs, |
213 | unsigned int data, int bits) | ||
210 | { | 214 | { |
211 | unsigned int tmp; | 215 | unsigned int tmp; |
212 | int i; | 216 | int i; |
213 | 217 | ||
214 | tmp = snd_ice1712_gpio_read(ice); | 218 | tmp = snd_ice1712_gpio_read(ice); |
215 | 219 | ||
216 | snd_ice1712_gpio_set_mask(ice, ~(PHASE28_WM_RW|PHASE28_SPI_MOSI|PHASE28_SPI_CLK| | 220 | snd_ice1712_gpio_set_mask(ice, ~(PHASE28_WM_RW|PHASE28_SPI_MOSI| |
217 | PHASE28_WM_CS)); | 221 | PHASE28_SPI_CLK|PHASE28_WM_CS)); |
218 | tmp |= PHASE28_WM_RW; | 222 | tmp |= PHASE28_WM_RW; |
219 | tmp &= ~cs; | 223 | tmp &= ~cs; |
220 | snd_ice1712_gpio_write(ice, tmp); | 224 | snd_ice1712_gpio_write(ice, tmp); |
@@ -273,14 +277,16 @@ static void wm_put(struct snd_ice1712 *ice, int reg, unsigned short val) | |||
273 | ice->akm[0].images[reg + 1] = val; | 277 | ice->akm[0].images[reg + 1] = val; |
274 | } | 278 | } |
275 | 279 | ||
276 | static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned short vol, unsigned short master) | 280 | static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, |
281 | unsigned short vol, unsigned short master) | ||
277 | { | 282 | { |
278 | unsigned char nvol; | 283 | unsigned char nvol; |
279 | 284 | ||
280 | if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE)) | 285 | if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE)) |
281 | nvol = 0; | 286 | nvol = 0; |
282 | else | 287 | else |
283 | nvol = 127 - wm_vol[(((vol & ~WM_VOL_MUTE) * (master & ~WM_VOL_MUTE)) / 127) & WM_VOL_MAX]; | 288 | nvol = 127 - wm_vol[(((vol & ~WM_VOL_MUTE) * |
289 | (master & ~WM_VOL_MUTE)) / 127) & WM_VOL_MAX]; | ||
284 | 290 | ||
285 | wm_put(ice, index, nvol); | 291 | wm_put(ice, index, nvol); |
286 | wm_put_nocache(ice, index, 0x180 | nvol); | 292 | wm_put_nocache(ice, index, 0x180 | nvol); |
@@ -291,17 +297,20 @@ static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index, unsigned sho | |||
291 | */ | 297 | */ |
292 | #define wm_pcm_mute_info snd_ctl_boolean_mono_info | 298 | #define wm_pcm_mute_info snd_ctl_boolean_mono_info |
293 | 299 | ||
294 | static int wm_pcm_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 300 | static int wm_pcm_mute_get(struct snd_kcontrol *kcontrol, |
301 | struct snd_ctl_elem_value *ucontrol) | ||
295 | { | 302 | { |
296 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 303 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
297 | 304 | ||
298 | mutex_lock(&ice->gpio_mutex); | 305 | mutex_lock(&ice->gpio_mutex); |
299 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_MUTE) & 0x10) ? 0 : 1; | 306 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_MUTE) & 0x10) ? |
307 | 0 : 1; | ||
300 | mutex_unlock(&ice->gpio_mutex); | 308 | mutex_unlock(&ice->gpio_mutex); |
301 | return 0; | 309 | return 0; |
302 | } | 310 | } |
303 | 311 | ||
304 | static int wm_pcm_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 312 | static int wm_pcm_mute_put(struct snd_kcontrol *kcontrol, |
313 | struct snd_ctl_elem_value *ucontrol) | ||
305 | { | 314 | { |
306 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 315 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
307 | unsigned short nval, oval; | 316 | unsigned short nval, oval; |
@@ -310,7 +319,8 @@ static int wm_pcm_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va | |||
310 | snd_ice1712_save_gpio_status(ice); | 319 | snd_ice1712_save_gpio_status(ice); |
311 | oval = wm_get(ice, WM_MUTE); | 320 | oval = wm_get(ice, WM_MUTE); |
312 | nval = (oval & ~0x10) | (ucontrol->value.integer.value[0] ? 0 : 0x10); | 321 | nval = (oval & ~0x10) | (ucontrol->value.integer.value[0] ? 0 : 0x10); |
313 | if ((change = (nval != oval))) | 322 | change = (nval != oval); |
323 | if (change) | ||
314 | wm_put(ice, WM_MUTE, nval); | 324 | wm_put(ice, WM_MUTE, nval); |
315 | snd_ice1712_restore_gpio_status(ice); | 325 | snd_ice1712_restore_gpio_status(ice); |
316 | 326 | ||
@@ -320,7 +330,8 @@ static int wm_pcm_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_va | |||
320 | /* | 330 | /* |
321 | * Master volume attenuation mixer control | 331 | * Master volume attenuation mixer control |
322 | */ | 332 | */ |
323 | static int wm_master_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 333 | static int wm_master_vol_info(struct snd_kcontrol *kcontrol, |
334 | struct snd_ctl_elem_info *uinfo) | ||
324 | { | 335 | { |
325 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 336 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
326 | uinfo->count = 2; | 337 | uinfo->count = 2; |
@@ -329,17 +340,20 @@ static int wm_master_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
329 | return 0; | 340 | return 0; |
330 | } | 341 | } |
331 | 342 | ||
332 | static int wm_master_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 343 | static int wm_master_vol_get(struct snd_kcontrol *kcontrol, |
344 | struct snd_ctl_elem_value *ucontrol) | ||
333 | { | 345 | { |
334 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 346 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
335 | struct phase28_spec *spec = ice->spec; | 347 | struct phase28_spec *spec = ice->spec; |
336 | int i; | 348 | int i; |
337 | for (i=0; i<2; i++) | 349 | for (i = 0; i < 2; i++) |
338 | ucontrol->value.integer.value[i] = spec->master[i] & ~WM_VOL_MUTE; | 350 | ucontrol->value.integer.value[i] = spec->master[i] & |
351 | ~WM_VOL_MUTE; | ||
339 | return 0; | 352 | return 0; |
340 | } | 353 | } |
341 | 354 | ||
342 | static int wm_master_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 355 | static int wm_master_vol_put(struct snd_kcontrol *kcontrol, |
356 | struct snd_ctl_elem_value *ucontrol) | ||
343 | { | 357 | { |
344 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 358 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
345 | struct phase28_spec *spec = ice->spec; | 359 | struct phase28_spec *spec = ice->spec; |
@@ -369,38 +383,38 @@ static int __devinit phase28_init(struct snd_ice1712 *ice) | |||
369 | { | 383 | { |
370 | static const unsigned short wm_inits_phase28[] = { | 384 | static const unsigned short wm_inits_phase28[] = { |
371 | /* These come first to reduce init pop noise */ | 385 | /* These come first to reduce init pop noise */ |
372 | 0x1b, 0x044, /* ADC Mux (AC'97 source) */ | 386 | 0x1b, 0x044, /* ADC Mux (AC'97 source) */ |
373 | 0x1c, 0x00B, /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ | 387 | 0x1c, 0x00B, /* Out Mux1 (VOUT1 = DAC+AUX, VOUT2 = DAC) */ |
374 | 0x1d, 0x009, /* Out Mux2 (VOUT2 = DAC, VOUT3 = DAC) */ | 388 | 0x1d, 0x009, /* Out Mux2 (VOUT2 = DAC, VOUT3 = DAC) */ |
375 | 389 | ||
376 | 0x18, 0x000, /* All power-up */ | 390 | 0x18, 0x000, /* All power-up */ |
377 | 391 | ||
378 | 0x16, 0x122, /* I2S, normal polarity, 24bit */ | 392 | 0x16, 0x122, /* I2S, normal polarity, 24bit */ |
379 | 0x17, 0x022, /* 256fs, slave mode */ | 393 | 0x17, 0x022, /* 256fs, slave mode */ |
380 | 0x00, 0, /* DAC1 analog mute */ | 394 | 0x00, 0, /* DAC1 analog mute */ |
381 | 0x01, 0, /* DAC2 analog mute */ | 395 | 0x01, 0, /* DAC2 analog mute */ |
382 | 0x02, 0, /* DAC3 analog mute */ | 396 | 0x02, 0, /* DAC3 analog mute */ |
383 | 0x03, 0, /* DAC4 analog mute */ | 397 | 0x03, 0, /* DAC4 analog mute */ |
384 | 0x04, 0, /* DAC5 analog mute */ | 398 | 0x04, 0, /* DAC5 analog mute */ |
385 | 0x05, 0, /* DAC6 analog mute */ | 399 | 0x05, 0, /* DAC6 analog mute */ |
386 | 0x06, 0, /* DAC7 analog mute */ | 400 | 0x06, 0, /* DAC7 analog mute */ |
387 | 0x07, 0, /* DAC8 analog mute */ | 401 | 0x07, 0, /* DAC8 analog mute */ |
388 | 0x08, 0x100, /* master analog mute */ | 402 | 0x08, 0x100, /* master analog mute */ |
389 | 0x09, 0xff, /* DAC1 digital full */ | 403 | 0x09, 0xff, /* DAC1 digital full */ |
390 | 0x0a, 0xff, /* DAC2 digital full */ | 404 | 0x0a, 0xff, /* DAC2 digital full */ |
391 | 0x0b, 0xff, /* DAC3 digital full */ | 405 | 0x0b, 0xff, /* DAC3 digital full */ |
392 | 0x0c, 0xff, /* DAC4 digital full */ | 406 | 0x0c, 0xff, /* DAC4 digital full */ |
393 | 0x0d, 0xff, /* DAC5 digital full */ | 407 | 0x0d, 0xff, /* DAC5 digital full */ |
394 | 0x0e, 0xff, /* DAC6 digital full */ | 408 | 0x0e, 0xff, /* DAC6 digital full */ |
395 | 0x0f, 0xff, /* DAC7 digital full */ | 409 | 0x0f, 0xff, /* DAC7 digital full */ |
396 | 0x10, 0xff, /* DAC8 digital full */ | 410 | 0x10, 0xff, /* DAC8 digital full */ |
397 | 0x11, 0x1ff, /* master digital full */ | 411 | 0x11, 0x1ff, /* master digital full */ |
398 | 0x12, 0x000, /* phase normal */ | 412 | 0x12, 0x000, /* phase normal */ |
399 | 0x13, 0x090, /* unmute DAC L/R */ | 413 | 0x13, 0x090, /* unmute DAC L/R */ |
400 | 0x14, 0x000, /* all unmute */ | 414 | 0x14, 0x000, /* all unmute */ |
401 | 0x15, 0x000, /* no deemphasis, no ZFLG */ | 415 | 0x15, 0x000, /* no deemphasis, no ZFLG */ |
402 | 0x19, 0x000, /* -12dB ADC/L */ | 416 | 0x19, 0x000, /* -12dB ADC/L */ |
403 | 0x1a, 0x000, /* -12dB ADC/R */ | 417 | 0x1a, 0x000, /* -12dB ADC/R */ |
404 | (unsigned short)-1 | 418 | (unsigned short)-1 |
405 | }; | 419 | }; |
406 | 420 | ||
@@ -418,17 +432,19 @@ static int __devinit phase28_init(struct snd_ice1712 *ice) | |||
418 | return -ENOMEM; | 432 | return -ENOMEM; |
419 | ice->spec = spec; | 433 | ice->spec = spec; |
420 | 434 | ||
421 | // Initialize analog chips | 435 | /* Initialize analog chips */ |
422 | ak = ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); | 436 | ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL); |
437 | ak = ice->akm; | ||
423 | if (!ak) | 438 | if (!ak) |
424 | return -ENOMEM; | 439 | return -ENOMEM; |
425 | ice->akm_codecs = 1; | 440 | ice->akm_codecs = 1; |
426 | 441 | ||
427 | snd_ice1712_gpio_set_dir(ice, 0x5fffff); /* fix this for the time being */ | 442 | snd_ice1712_gpio_set_dir(ice, 0x5fffff); /* fix this for time being */ |
428 | 443 | ||
429 | /* reset the wm codec as the SPI mode */ | 444 | /* reset the wm codec as the SPI mode */ |
430 | snd_ice1712_save_gpio_status(ice); | 445 | snd_ice1712_save_gpio_status(ice); |
431 | snd_ice1712_gpio_set_mask(ice, ~(PHASE28_WM_RESET|PHASE28_WM_CS|PHASE28_HP_SEL)); | 446 | snd_ice1712_gpio_set_mask(ice, ~(PHASE28_WM_RESET|PHASE28_WM_CS| |
447 | PHASE28_HP_SEL)); | ||
432 | 448 | ||
433 | tmp = snd_ice1712_gpio_read(ice); | 449 | tmp = snd_ice1712_gpio_read(ice); |
434 | tmp &= ~PHASE28_WM_RESET; | 450 | tmp &= ~PHASE28_WM_RESET; |
@@ -460,7 +476,8 @@ static int __devinit phase28_init(struct snd_ice1712 *ice) | |||
460 | /* | 476 | /* |
461 | * DAC volume attenuation mixer control | 477 | * DAC volume attenuation mixer control |
462 | */ | 478 | */ |
463 | static int wm_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 479 | static int wm_vol_info(struct snd_kcontrol *kcontrol, |
480 | struct snd_ctl_elem_info *uinfo) | ||
464 | { | 481 | { |
465 | int voices = kcontrol->private_value >> 8; | 482 | int voices = kcontrol->private_value >> 8; |
466 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 483 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
@@ -470,7 +487,8 @@ static int wm_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info * | |||
470 | return 0; | 487 | return 0; |
471 | } | 488 | } |
472 | 489 | ||
473 | static int wm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 490 | static int wm_vol_get(struct snd_kcontrol *kcontrol, |
491 | struct snd_ctl_elem_value *ucontrol) | ||
474 | { | 492 | { |
475 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 493 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
476 | struct phase28_spec *spec = ice->spec; | 494 | struct phase28_spec *spec = ice->spec; |
@@ -484,7 +502,8 @@ static int wm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value * | |||
484 | return 0; | 502 | return 0; |
485 | } | 503 | } |
486 | 504 | ||
487 | static int wm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 505 | static int wm_vol_put(struct snd_kcontrol *kcontrol, |
506 | struct snd_ctl_elem_value *ucontrol) | ||
488 | { | 507 | { |
489 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 508 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
490 | struct phase28_spec *spec = ice->spec; | 509 | struct phase28_spec *spec = ice->spec; |
@@ -515,7 +534,8 @@ static int wm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value * | |||
515 | /* | 534 | /* |
516 | * WM8770 mute control | 535 | * WM8770 mute control |
517 | */ | 536 | */ |
518 | static int wm_mute_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) { | 537 | static int wm_mute_info(struct snd_kcontrol *kcontrol, |
538 | struct snd_ctl_elem_info *uinfo) { | ||
519 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | 539 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; |
520 | uinfo->count = kcontrol->private_value >> 8; | 540 | uinfo->count = kcontrol->private_value >> 8; |
521 | uinfo->value.integer.min = 0; | 541 | uinfo->value.integer.min = 0; |
@@ -523,7 +543,8 @@ static int wm_mute_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info | |||
523 | return 0; | 543 | return 0; |
524 | } | 544 | } |
525 | 545 | ||
526 | static int wm_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 546 | static int wm_mute_get(struct snd_kcontrol *kcontrol, |
547 | struct snd_ctl_elem_value *ucontrol) | ||
527 | { | 548 | { |
528 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 549 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
529 | struct phase28_spec *spec = ice->spec; | 550 | struct phase28_spec *spec = ice->spec; |
@@ -538,7 +559,8 @@ static int wm_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value | |||
538 | return 0; | 559 | return 0; |
539 | } | 560 | } |
540 | 561 | ||
541 | static int wm_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 562 | static int wm_mute_put(struct snd_kcontrol *kcontrol, |
563 | struct snd_ctl_elem_value *ucontrol) | ||
542 | { | 564 | { |
543 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 565 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
544 | struct phase28_spec *spec = ice->spec; | 566 | struct phase28_spec *spec = ice->spec; |
@@ -553,9 +575,10 @@ static int wm_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value | |||
553 | if (ucontrol->value.integer.value[i] != val) { | 575 | if (ucontrol->value.integer.value[i] != val) { |
554 | spec->vol[ofs + i] &= ~WM_VOL_MUTE; | 576 | spec->vol[ofs + i] &= ~WM_VOL_MUTE; |
555 | spec->vol[ofs + i] |= | 577 | spec->vol[ofs + i] |= |
556 | ucontrol->value.integer.value[i] ? 0 : WM_VOL_MUTE; | 578 | ucontrol->value.integer.value[i] ? 0 : |
579 | WM_VOL_MUTE; | ||
557 | wm_set_vol(ice, ofs + i, spec->vol[ofs + i], | 580 | wm_set_vol(ice, ofs + i, spec->vol[ofs + i], |
558 | spec->master[i]); | 581 | spec->master[i]); |
559 | change = 1; | 582 | change = 1; |
560 | } | 583 | } |
561 | } | 584 | } |
@@ -569,7 +592,8 @@ static int wm_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value | |||
569 | */ | 592 | */ |
570 | #define wm_master_mute_info snd_ctl_boolean_stereo_info | 593 | #define wm_master_mute_info snd_ctl_boolean_stereo_info |
571 | 594 | ||
572 | static int wm_master_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 595 | static int wm_master_mute_get(struct snd_kcontrol *kcontrol, |
596 | struct snd_ctl_elem_value *ucontrol) | ||
573 | { | 597 | { |
574 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 598 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
575 | struct phase28_spec *spec = ice->spec; | 599 | struct phase28_spec *spec = ice->spec; |
@@ -581,7 +605,8 @@ static int wm_master_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
581 | return 0; | 605 | return 0; |
582 | } | 606 | } |
583 | 607 | ||
584 | static int wm_master_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 608 | static int wm_master_mute_put(struct snd_kcontrol *kcontrol, |
609 | struct snd_ctl_elem_value *ucontrol) | ||
585 | { | 610 | { |
586 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 611 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
587 | struct phase28_spec *spec = ice->spec; | 612 | struct phase28_spec *spec = ice->spec; |
@@ -594,11 +619,12 @@ static int wm_master_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
594 | int dac; | 619 | int dac; |
595 | spec->master[i] &= ~WM_VOL_MUTE; | 620 | spec->master[i] &= ~WM_VOL_MUTE; |
596 | spec->master[i] |= | 621 | spec->master[i] |= |
597 | ucontrol->value.integer.value[i] ? 0 : WM_VOL_MUTE; | 622 | ucontrol->value.integer.value[i] ? 0 : |
623 | WM_VOL_MUTE; | ||
598 | for (dac = 0; dac < ice->num_total_dacs; dac += 2) | 624 | for (dac = 0; dac < ice->num_total_dacs; dac += 2) |
599 | wm_set_vol(ice, WM_DAC_ATTEN + dac + i, | 625 | wm_set_vol(ice, WM_DAC_ATTEN + dac + i, |
600 | spec->vol[dac + i], | 626 | spec->vol[dac + i], |
601 | spec->master[i]); | 627 | spec->master[i]); |
602 | change = 1; | 628 | change = 1; |
603 | } | 629 | } |
604 | } | 630 | } |
@@ -611,7 +637,8 @@ static int wm_master_mute_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem | |||
611 | #define PCM_0dB 0xff | 637 | #define PCM_0dB 0xff |
612 | #define PCM_RES 128 /* -64dB */ | 638 | #define PCM_RES 128 /* -64dB */ |
613 | #define PCM_MIN (PCM_0dB - PCM_RES) | 639 | #define PCM_MIN (PCM_0dB - PCM_RES) |
614 | static int wm_pcm_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo) | 640 | static int wm_pcm_vol_info(struct snd_kcontrol *kcontrol, |
641 | struct snd_ctl_elem_info *uinfo) | ||
615 | { | 642 | { |
616 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; | 643 | uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; |
617 | uinfo->count = 1; | 644 | uinfo->count = 1; |
@@ -620,7 +647,8 @@ static int wm_pcm_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_in | |||
620 | return 0; | 647 | return 0; |
621 | } | 648 | } |
622 | 649 | ||
623 | static int wm_pcm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 650 | static int wm_pcm_vol_get(struct snd_kcontrol *kcontrol, |
651 | struct snd_ctl_elem_value *ucontrol) | ||
624 | { | 652 | { |
625 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 653 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
626 | unsigned short val; | 654 | unsigned short val; |
@@ -633,7 +661,8 @@ static int wm_pcm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
633 | return 0; | 661 | return 0; |
634 | } | 662 | } |
635 | 663 | ||
636 | static int wm_pcm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 664 | static int wm_pcm_vol_put(struct snd_kcontrol *kcontrol, |
665 | struct snd_ctl_elem_value *ucontrol) | ||
637 | { | 666 | { |
638 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 667 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
639 | unsigned short ovol, nvol; | 668 | unsigned short ovol, nvol; |
@@ -647,7 +676,8 @@ static int wm_pcm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
647 | ovol = wm_get(ice, WM_DAC_DIG_MASTER_ATTEN) & 0xff; | 676 | ovol = wm_get(ice, WM_DAC_DIG_MASTER_ATTEN) & 0xff; |
648 | if (ovol != nvol) { | 677 | if (ovol != nvol) { |
649 | wm_put(ice, WM_DAC_DIG_MASTER_ATTEN, nvol); /* prelatch */ | 678 | wm_put(ice, WM_DAC_DIG_MASTER_ATTEN, nvol); /* prelatch */ |
650 | wm_put_nocache(ice, WM_DAC_DIG_MASTER_ATTEN, nvol | 0x100); /* update */ | 679 | /* update */ |
680 | wm_put_nocache(ice, WM_DAC_DIG_MASTER_ATTEN, nvol | 0x100); | ||
651 | change = 1; | 681 | change = 1; |
652 | } | 682 | } |
653 | snd_ice1712_restore_gpio_status(ice); | 683 | snd_ice1712_restore_gpio_status(ice); |
@@ -659,18 +689,22 @@ static int wm_pcm_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_val | |||
659 | */ | 689 | */ |
660 | #define phase28_deemp_info snd_ctl_boolean_mono_info | 690 | #define phase28_deemp_info snd_ctl_boolean_mono_info |
661 | 691 | ||
662 | static int phase28_deemp_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 692 | static int phase28_deemp_get(struct snd_kcontrol *kcontrol, |
693 | struct snd_ctl_elem_value *ucontrol) | ||
663 | { | 694 | { |
664 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 695 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
665 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_DAC_CTRL2) & 0xf) == 0xf; | 696 | ucontrol->value.integer.value[0] = (wm_get(ice, WM_DAC_CTRL2) & 0xf) == |
697 | 0xf; | ||
666 | return 0; | 698 | return 0; |
667 | } | 699 | } |
668 | 700 | ||
669 | static int phase28_deemp_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 701 | static int phase28_deemp_put(struct snd_kcontrol *kcontrol, |
702 | struct snd_ctl_elem_value *ucontrol) | ||
670 | { | 703 | { |
671 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 704 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
672 | int temp, temp2; | 705 | int temp, temp2; |
673 | temp2 = temp = wm_get(ice, WM_DAC_CTRL2); | 706 | temp = wm_get(ice, WM_DAC_CTRL2); |
707 | temp2 = temp; | ||
674 | if (ucontrol->value.integer.value[0]) | 708 | if (ucontrol->value.integer.value[0]) |
675 | temp |= 0xf; | 709 | temp |= 0xf; |
676 | else | 710 | else |
@@ -685,7 +719,8 @@ static int phase28_deemp_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_ | |||
685 | /* | 719 | /* |
686 | * ADC Oversampling | 720 | * ADC Oversampling |
687 | */ | 721 | */ |
688 | static int phase28_oversampling_info(struct snd_kcontrol *k, struct snd_ctl_elem_info *uinfo) | 722 | static int phase28_oversampling_info(struct snd_kcontrol *k, |
723 | struct snd_ctl_elem_info *uinfo) | ||
689 | { | 724 | { |
690 | static char *texts[2] = { "128x", "64x" }; | 725 | static char *texts[2] = { "128x", "64x" }; |
691 | 726 | ||
@@ -694,25 +729,31 @@ static int phase28_oversampling_info(struct snd_kcontrol *k, struct snd_ctl_elem | |||
694 | uinfo->value.enumerated.items = 2; | 729 | uinfo->value.enumerated.items = 2; |
695 | 730 | ||
696 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) | 731 | if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items) |
697 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1; | 732 | uinfo->value.enumerated.item = uinfo->value.enumerated.items - |
698 | strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]); | 733 | 1; |
734 | strcpy(uinfo->value.enumerated.name, | ||
735 | texts[uinfo->value.enumerated.item]); | ||
699 | 736 | ||
700 | return 0; | 737 | return 0; |
701 | } | 738 | } |
702 | 739 | ||
703 | static int phase28_oversampling_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 740 | static int phase28_oversampling_get(struct snd_kcontrol *kcontrol, |
741 | struct snd_ctl_elem_value *ucontrol) | ||
704 | { | 742 | { |
705 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 743 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
706 | ucontrol->value.enumerated.item[0] = (wm_get(ice, WM_MASTER) & 0x8) == 0x8; | 744 | ucontrol->value.enumerated.item[0] = (wm_get(ice, WM_MASTER) & 0x8) == |
745 | 0x8; | ||
707 | return 0; | 746 | return 0; |
708 | } | 747 | } |
709 | 748 | ||
710 | static int phase28_oversampling_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) | 749 | static int phase28_oversampling_put(struct snd_kcontrol *kcontrol, |
750 | struct snd_ctl_elem_value *ucontrol) | ||
711 | { | 751 | { |
712 | int temp, temp2; | 752 | int temp, temp2; |
713 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); | 753 | struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol); |
714 | 754 | ||
715 | temp2 = temp = wm_get(ice, WM_MASTER); | 755 | temp = wm_get(ice, WM_MASTER); |
756 | temp2 = temp; | ||
716 | 757 | ||
717 | if (ucontrol->value.enumerated.item[0]) | 758 | if (ucontrol->value.enumerated.item[0]) |
718 | temp |= 0x8; | 759 | temp |= 0x8; |
@@ -885,13 +926,16 @@ static int __devinit phase28_add_controls(struct snd_ice1712 *ice) | |||
885 | 926 | ||
886 | counts = ARRAY_SIZE(phase28_dac_controls); | 927 | counts = ARRAY_SIZE(phase28_dac_controls); |
887 | for (i = 0; i < counts; i++) { | 928 | for (i = 0; i < counts; i++) { |
888 | err = snd_ctl_add(ice->card, snd_ctl_new1(&phase28_dac_controls[i], ice)); | 929 | err = snd_ctl_add(ice->card, |
930 | snd_ctl_new1(&phase28_dac_controls[i], | ||
931 | ice)); | ||
889 | if (err < 0) | 932 | if (err < 0) |
890 | return err; | 933 | return err; |
891 | } | 934 | } |
892 | 935 | ||
893 | for (i = 0; i < ARRAY_SIZE(wm_controls); i++) { | 936 | for (i = 0; i < ARRAY_SIZE(wm_controls); i++) { |
894 | err = snd_ctl_add(ice->card, snd_ctl_new1(&wm_controls[i], ice)); | 937 | err = snd_ctl_add(ice->card, |
938 | snd_ctl_new1(&wm_controls[i], ice)); | ||
895 | if (err < 0) | 939 | if (err < 0) |
896 | return err; | 940 | return err; |
897 | } | 941 | } |
diff --git a/sound/pci/ice1712/phase.h b/sound/pci/ice1712/phase.h index 5f0c4dbf30d5..7fc22d9d442f 100644 --- a/sound/pci/ice1712/phase.h +++ b/sound/pci/ice1712/phase.h | |||
@@ -22,11 +22,11 @@ | |||
22 | * along with this program; if not, write to the Free Software | 22 | * along with this program; if not, write to the Free Software |
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 | * | 24 | * |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #define PHASE_DEVICE_DESC "{Terratec,Phase 22},"\ | 27 | #define PHASE_DEVICE_DESC "{Terratec,Phase 22},"\ |
28 | "{Terratec,Phase 28},"\ | 28 | "{Terratec,Phase 28},"\ |
29 | "{Terrasoniq,TS22}," | 29 | "{Terrasoniq,TS22}," |
30 | 30 | ||
31 | #define VT1724_SUBDEVICE_PHASE22 0x3b155011 | 31 | #define VT1724_SUBDEVICE_PHASE22 0x3b155011 |
32 | #define VT1724_SUBDEVICE_PHASE28 0x3b154911 | 32 | #define VT1724_SUBDEVICE_PHASE28 0x3b154911 |
diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 203cdc1bf8da..6bc3f91b7281 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c | |||
@@ -43,7 +43,8 @@ | |||
43 | /* WM8776 registers */ | 43 | /* WM8776 registers */ |
44 | #define WM_HP_ATTEN_L 0x00 /* headphone left attenuation */ | 44 | #define WM_HP_ATTEN_L 0x00 /* headphone left attenuation */ |
45 | #define WM_HP_ATTEN_R 0x01 /* headphone left attenuation */ | 45 | #define WM_HP_ATTEN_R 0x01 /* headphone left attenuation */ |
46 | #define WM_HP_MASTER 0x02 /* headphone master (both channels), override LLR */ | 46 | #define WM_HP_MASTER 0x02 /* headphone master (both channels) */ |
47 | /* override LLR */ | ||
47 | #define WM_DAC_ATTEN_L 0x03 /* digital left attenuation */ | 48 | #define WM_DAC_ATTEN_L 0x03 /* digital left attenuation */ |
48 | #define WM_DAC_ATTEN_R 0x04 | 49 | #define WM_DAC_ATTEN_R 0x04 |
49 | #define WM_DAC_MASTER 0x05 | 50 | #define WM_DAC_MASTER 0x05 |
@@ -740,7 +741,7 @@ static int __devinit pontis_init(struct snd_ice1712 *ice) | |||
740 | WM_DAC_ATTEN_L, 0x0100, /* DAC 0dB */ | 741 | WM_DAC_ATTEN_L, 0x0100, /* DAC 0dB */ |
741 | WM_DAC_ATTEN_R, 0x0000, /* DAC 0dB */ | 742 | WM_DAC_ATTEN_R, 0x0000, /* DAC 0dB */ |
742 | WM_DAC_ATTEN_R, 0x0100, /* DAC 0dB */ | 743 | WM_DAC_ATTEN_R, 0x0100, /* DAC 0dB */ |
743 | // WM_DAC_MASTER, 0x0100, /* DAC master muted */ | 744 | /* WM_DAC_MASTER, 0x0100, */ /* DAC master muted */ |
744 | WM_PHASE_SWAP, 0x0000, /* phase normal */ | 745 | WM_PHASE_SWAP, 0x0000, /* phase normal */ |
745 | WM_DAC_CTRL2, 0x0000, /* no deemphasis, no ZFLG */ | 746 | WM_DAC_CTRL2, 0x0000, /* no deemphasis, no ZFLG */ |
746 | WM_ADC_ATTEN_L, 0x0000, /* ADC muted */ | 747 | WM_ADC_ATTEN_L, 0x0000, /* ADC muted */ |
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c index d2193913d703..b508bb360b97 100644 --- a/sound/pci/ice1712/revo.c +++ b/sound/pci/ice1712/revo.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * ALSA driver for ICEnsemble ICE1712 (Envy24) | 2 | * ALSA driver for ICEnsemble ICE1712 (Envy24) |
3 | * | 3 | * |
4 | * Lowlevel functions for M-Audio Revolution 7.1 | 4 | * Lowlevel functions for M-Audio Audiophile 192, Revolution 7.1 and 5.1 |
5 | * | 5 | * |
6 | * Copyright (c) 2003 Takashi Iwai <tiwai@suse.de> | 6 | * Copyright (c) 2003 Takashi Iwai <tiwai@suse.de> |
7 | * | 7 | * |
@@ -48,7 +48,7 @@ static void revo_i2s_mclk_changed(struct snd_ice1712 *ice) | |||
48 | } | 48 | } |
49 | 49 | ||
50 | /* | 50 | /* |
51 | * change the rate of envy24HT, AK4355 and AK4381 | 51 | * change the rate of Envy24HT, AK4355 and AK4381 |
52 | */ | 52 | */ |
53 | static void revo_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | 53 | static void revo_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) |
54 | { | 54 | { |
@@ -83,8 +83,8 @@ static void revo_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate) | |||
83 | tmp = snd_akm4xxx_get(ak, 0, reg); | 83 | tmp = snd_akm4xxx_get(ak, 0, reg); |
84 | tmp &= ~(0x03 << shift); | 84 | tmp &= ~(0x03 << shift); |
85 | tmp |= dfs << shift; | 85 | tmp |= dfs << shift; |
86 | // snd_akm4xxx_write(ak, 0, reg, tmp); | 86 | /* snd_akm4xxx_write(ak, 0, reg, tmp); */ |
87 | snd_akm4xxx_set(ak, 0, reg, tmp); /* the value is written in reset(0) */ | 87 | snd_akm4xxx_set(ak, 0, reg, tmp); /* value is written in reset(0) */ |
88 | snd_akm4xxx_reset(ak, 0); | 88 | snd_akm4xxx_reset(ak, 0); |
89 | } | 89 | } |
90 | 90 | ||