aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorRisto Suominen <Risto.Suominen@gmail.com>2008-04-16 13:45:51 -0400
committerTakashi Iwai <tiwai@suse.de>2008-04-24 06:00:38 -0400
commit20861fa7b20a40ca045393df634d4d51e61efa58 (patch)
tree95351029577bc6441c09d7bd6d06aeb45a087a66 /sound
parent44deee129c9af3759d3e5e772b82012742dc57a0 (diff)
[ALSA] snd-powermac: style burgundy.c
Coding style corrections for burgundy.c. Signed-off-by: Risto Suominen <Risto.Suominen@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/ppc/burgundy.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sound/ppc/burgundy.c b/sound/ppc/burgundy.c
index f0c12a97fdbc..f860d39af36b 100644
--- a/sound/ppc/burgundy.c
+++ b/sound/ppc/burgundy.c
@@ -102,7 +102,8 @@ snd_pmac_burgundy_rcw(struct snd_pmac *chip, unsigned addr)
102} 102}
103 103
104static void 104static void
105snd_pmac_burgundy_wcb(struct snd_pmac *chip, unsigned int addr, unsigned int val) 105snd_pmac_burgundy_wcb(struct snd_pmac *chip, unsigned int addr,
106 unsigned int val)
106{ 107{
107 out_le32(&chip->awacs->codec_ctrl, addr + 0x300000 + (val & 0xff)); 108 out_le32(&chip->awacs->codec_ctrl, addr + 0x300000 + (val & 0xff));
108 snd_pmac_burgundy_busy_wait(chip); 109 snd_pmac_burgundy_busy_wait(chip);
@@ -126,8 +127,11 @@ snd_pmac_burgundy_rcb(struct snd_pmac *chip, unsigned int addr)
126 return val; 127 return val;
127} 128}
128 129
130#define BASE2ADDR(base) ((base) << 12)
131#define ADDR2BASE(addr) ((addr) >> 12)
132
129/* 133/*
130 * Burgundy volume: 0 - 100, stereo 134 * Burgundy volume: 0 - 100, stereo, word reg
131 */ 135 */
132static void 136static void
133snd_pmac_burgundy_write_volume(struct snd_pmac *chip, unsigned int address, 137snd_pmac_burgundy_write_volume(struct snd_pmac *chip, unsigned int address,
@@ -168,13 +172,6 @@ snd_pmac_burgundy_read_volume(struct snd_pmac *chip, unsigned int address,
168 volume[1] = 0; 172 volume[1] = 0;
169} 173}
170 174
171
172/*
173 */
174
175#define BASE2ADDR(base) ((base) << 12)
176#define ADDR2BASE(addr) ((addr) >> 12)
177
178static int snd_pmac_burgundy_info_volume(struct snd_kcontrol *kcontrol, 175static int snd_pmac_burgundy_info_volume(struct snd_kcontrol *kcontrol,
179 struct snd_ctl_elem_info *uinfo) 176 struct snd_ctl_elem_info *uinfo)
180{ 177{
@@ -191,8 +188,8 @@ static int snd_pmac_burgundy_get_volume(struct snd_kcontrol *kcontrol,
191 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); 188 struct snd_pmac *chip = snd_kcontrol_chip(kcontrol);
192 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff); 189 unsigned int addr = BASE2ADDR(kcontrol->private_value & 0xff);
193 int shift = (kcontrol->private_value >> 8) & 0xff; 190 int shift = (kcontrol->private_value >> 8) & 0xff;
194 snd_pmac_burgundy_read_volume(chip, addr, ucontrol->value.integer.value, 191 snd_pmac_burgundy_read_volume(chip, addr,
195 shift); 192 ucontrol->value.integer.value, shift);
196 return 0; 193 return 0;
197} 194}
198 195
@@ -204,8 +201,8 @@ static int snd_pmac_burgundy_put_volume(struct snd_kcontrol *kcontrol,
204 int shift = (kcontrol->private_value >> 8) & 0xff; 201 int shift = (kcontrol->private_value >> 8) & 0xff;
205 long nvoices[2]; 202 long nvoices[2];
206 203
207 snd_pmac_burgundy_write_volume(chip, addr, ucontrol->value.integer.value, 204 snd_pmac_burgundy_write_volume(chip, addr,
208 shift); 205 ucontrol->value.integer.value, shift);
209 snd_pmac_burgundy_read_volume(chip, addr, nvoices, shift); 206 snd_pmac_burgundy_read_volume(chip, addr, nvoices, shift);
210 return (nvoices[0] != ucontrol->value.integer.value[0] || 207 return (nvoices[0] != ucontrol->value.integer.value[0] ||
211 nvoices[1] != ucontrol->value.integer.value[1]); 208 nvoices[1] != ucontrol->value.integer.value[1]);
@@ -700,7 +697,8 @@ int __init snd_pmac_burgundy_init(struct snd_pmac *chip)
700 chip->master_sw_ctl = snd_ctl_new1(imac 697 chip->master_sw_ctl = snd_ctl_new1(imac
701 ? &snd_pmac_burgundy_master_sw_imac 698 ? &snd_pmac_burgundy_master_sw_imac
702 : &snd_pmac_burgundy_master_sw_pmac, chip); 699 : &snd_pmac_burgundy_master_sw_pmac, chip);
703 if ((err = snd_ctl_add(chip->card, chip->master_sw_ctl)) < 0) 700 err = snd_ctl_add(chip->card, chip->master_sw_ctl);
701 if (err < 0)
704 return err; 702 return err;
705 chip->master_sw_ctl = snd_ctl_new1(imac 703 chip->master_sw_ctl = snd_ctl_new1(imac
706 ? &snd_pmac_burgundy_line_sw_imac 704 ? &snd_pmac_burgundy_line_sw_imac
@@ -718,10 +716,12 @@ int __init snd_pmac_burgundy_init(struct snd_pmac *chip)
718 chip->speaker_sw_ctl = snd_ctl_new1(imac 716 chip->speaker_sw_ctl = snd_ctl_new1(imac
719 ? &snd_pmac_burgundy_speaker_sw_imac 717 ? &snd_pmac_burgundy_speaker_sw_imac
720 : &snd_pmac_burgundy_speaker_sw_pmac, chip); 718 : &snd_pmac_burgundy_speaker_sw_pmac, chip);
721 if ((err = snd_ctl_add(chip->card, chip->speaker_sw_ctl)) < 0) 719 err = snd_ctl_add(chip->card, chip->speaker_sw_ctl);
720 if (err < 0)
722 return err; 721 return err;
723#ifdef PMAC_SUPPORT_AUTOMUTE 722#ifdef PMAC_SUPPORT_AUTOMUTE
724 if ((err = snd_pmac_add_automute(chip)) < 0) 723 err = snd_pmac_add_automute(chip);
724 if (err < 0)
725 return err; 725 return err;
726 726
727 chip->detect_headphone = snd_pmac_burgundy_detect_headphone; 727 chip->detect_headphone = snd_pmac_burgundy_detect_headphone;