diff options
Diffstat (limited to 'sound/pci/ice1712/juli.c')
-rw-r--r-- | sound/pci/ice1712/juli.c | 44 |
1 files changed, 27 insertions, 17 deletions
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; |