aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ice1712/juli.c
diff options
context:
space:
mode:
authorVedran Miletic <rivanvx@gmail.com>2008-09-07 06:00:02 -0400
committerJaroslav Kysela <perex@perex.cz>2008-09-09 03:11:44 -0400
commitcc67b7f737103a2985e65e00edfdd1a5f89c3af5 (patch)
tree118a769ef9a5ec964a5d41bc8d69da11071b0961 /sound/pci/ice1712/juli.c
parent07f455f779acfb3eba4921fd1399761559b10fa9 (diff)
ALSA: ice1712/ice1724: Coding style fixes part 1 (more coming up)
Inspired by Alexander Beregalov's patches for wtm and aureon.c, I decided to run checkpatch on some more files. After some work checkpatch.pl-0.23 --no-tree --file --strict <file> reports 0 errors, 0 warnings, 0 checks, n lines checked for: phase.c phase.h juli.c (1 check about unused code, maybe we should comment it) juli.h (no changes necessary) In other files I have just fixed // comments and long lines along the way (but not all of them), more coming up. Signed-off-by: Vedran Miletic <rivanvx@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound/pci/ice1712/juli.c')
-rw-r--r--sound/pci/ice1712/juli.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c
index 21ff4de890b..c51659b9caf 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
37struct juli_spec { 38struct 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
163static void juli_ak4114_write(void *private_data, unsigned char reg, unsigned char val) 164static 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
168static unsigned char juli_ak4114_read(void *private_data, unsigned char reg) 171static 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 */
177static void juli_spdif_in_open(struct snd_ice1712 *ice, 181static 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,
572static int __devinit juli_init(struct snd_ice1712 *ice) 576static 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;