aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Mohr <andi@lisas.de>2006-05-17 11:04:19 +0200
committerJaroslav Kysela <perex@suse.cz>2006-06-22 21:33:40 +0200
commite2f872608af7f3c00beaa61ff6037e3cc5a66cf1 (patch)
treec14cb26532ea165169f33f19f2bcc20c6472dd97
parent13769e3f21d6e9c59999c9bf6908278b878d05c5 (diff)
[ALSA] azt3328.c: use kernel coding style
Scope braces were not done the One True Kernel Way. Signed-off-by: Andreas Mohr <andi@lisas.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/azt3328.c70
1 files changed, 23 insertions, 47 deletions
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index c9af04ed200..e68056c8158 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -33,7 +33,7 @@
* in the first place >:-P}),
* I was forced to base this driver on reverse engineering
* (3 weeks' worth of evenings filled with driver work).
- * (and no, I did NOT go the easy way: to pick up a PCI128 for 9 Euros)
+ * (and no, I did NOT go the easy way: to pick up a SB PCI128 for 9 Euros)
*
* The AZF3328 chip (note: AZF3328, *not* AZT3328, that's just the driver name
* for compatibility reasons) has the following features:
@@ -339,10 +339,8 @@ snd_azf3328_mixer_write_volume_gradually(const struct snd_azf3328 *chip, int reg
else
dst_vol_left &= ~0x80;
- do
- {
- if (!left_done)
- {
+ do {
+ if (!left_done) {
if (curr_vol_left > dst_vol_left)
curr_vol_left--;
else
@@ -352,8 +350,7 @@ snd_azf3328_mixer_write_volume_gradually(const struct snd_azf3328 *chip, int reg
left_done = 1;
outb(curr_vol_left, portbase + 1);
}
- if (!right_done)
- {
+ if (!right_done) {
if (curr_vol_right > dst_vol_right)
curr_vol_right--;
else
@@ -368,8 +365,7 @@ snd_azf3328_mixer_write_volume_gradually(const struct snd_azf3328 *chip, int reg
}
if (delay)
mdelay(delay);
- }
- while ((!left_done) || (!right_done));
+ } while ((!left_done) || (!right_done));
snd_azf3328_dbgcallleave();
}
@@ -556,8 +552,7 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol,
uinfo->value.enumerated.items = reg.enum_c;
if (uinfo->value.enumerated.item > reg.enum_c - 1U)
uinfo->value.enumerated.item = reg.enum_c - 1U;
- if (reg.reg == IDX_MIXER_ADVCTL2)
- {
+ if (reg.reg == IDX_MIXER_ADVCTL2) {
switch(reg.lchan_shift) {
case 8: /* modem out sel */
strcpy(uinfo->value.enumerated.name, texts1[uinfo->value.enumerated.item]);
@@ -569,8 +564,7 @@ snd_azf3328_info_mixer_enum(struct snd_kcontrol *kcontrol,
strcpy(uinfo->value.enumerated.name, texts4[uinfo->value.enumerated.item]);
break;
}
- }
- else
+ } else
strcpy(uinfo->value.enumerated.name, texts3[uinfo->value.enumerated.item]
);
return 0;
@@ -586,12 +580,10 @@ snd_azf3328_get_mixer_enum(struct snd_kcontrol *kcontrol,
snd_azf3328_mixer_reg_decode(&reg, kcontrol->private_value);
val = snd_azf3328_mixer_inw(chip, reg.reg);
- if (reg.reg == IDX_MIXER_REC_SELECT)
- {
+ if (reg.reg == IDX_MIXER_REC_SELECT) {
ucontrol->value.enumerated.item[0] = (val >> 8) & (reg.enum_c - 1);
ucontrol->value.enumerated.item[1] = (val >> 0) & (reg.enum_c - 1);
- }
- else
+ } else
ucontrol->value.enumerated.item[0] = (val >> reg.lchan_shift) & (reg.enum_c - 1);
snd_azf3328_dbgmixer("get_enum: %02x is %04x -> %d|%d (shift %02d, enum_c %d)\n",
@@ -611,16 +603,13 @@ snd_azf3328_put_mixer_enum(struct snd_kcontrol *kcontrol,
snd_azf3328_mixer_reg_decode(&reg, kcontrol->private_value);
oreg = snd_azf3328_mixer_inw(chip, reg.reg);
val = oreg;
- if (reg.reg == IDX_MIXER_REC_SELECT)
- {
+ if (reg.reg == IDX_MIXER_REC_SELECT) {
if (ucontrol->value.enumerated.item[0] > reg.enum_c - 1U ||
ucontrol->value.enumerated.item[1] > reg.enum_c - 1U)
return -EINVAL;
val = (ucontrol->value.enumerated.item[0] << 8) |
(ucontrol->value.enumerated.item[1] << 0);
- }
- else
- {
+ } else {
if (ucontrol->value.enumerated.item[0] > reg.enum_c - 1U)
return -EINVAL;
val &= ~((reg.enum_c - 1) << reg.lchan_shift);
@@ -846,22 +835,18 @@ snd_azf3328_setdmaa(struct snd_azf3328 *chip,
unsigned int is_running;
snd_azf3328_dbgcallenter();
- if (do_recording)
- {
+ if (do_recording) {
/* access capture registers, i.e. skip playback reg section */
portbase = chip->codec_port + 0x20;
is_running = chip->is_recording;
- }
- else
- {
+ } else {
/* access the playback register section */
portbase = chip->codec_port + 0x00;
is_running = chip->is_playing;
}
/* AZF3328 uses a two buffer pointer DMA playback approach */
- if (!is_running)
- {
+ if (!is_running) {
unsigned long addr_area2;
unsigned long count_areas, count_tmp; /* width 32bit -- overflow!! */
count_areas = size/2;
@@ -1224,8 +1209,7 @@ snd_azf3328_interrupt(int irq, void *dev_id, struct pt_regs *regs)
snd_azf3328_codec_inw(chip, IDX_IO_PLAY_IRQTYPE),
status);
- if (status & IRQ_TIMER)
- {
+ if (status & IRQ_TIMER) {
/* snd_azf3328_dbgplay("timer %ld\n", inl(chip->codec_port+IDX_IO_TIMER_VALUE) & TIMER_VALUE_MASK); */
if (chip->timer)
snd_timer_interrupt(chip->timer, chip->timer->sticks);
@@ -1235,50 +1219,43 @@ snd_azf3328_interrupt(int irq, void *dev_id, struct pt_regs *regs)
spin_unlock(&chip->reg_lock);
snd_azf3328_dbgplay("azt3328: timer IRQ\n");
}
- if (status & IRQ_PLAYBACK)
- {
+ if (status & IRQ_PLAYBACK) {
spin_lock(&chip->reg_lock);
which = snd_azf3328_codec_inb(chip, IDX_IO_PLAY_IRQTYPE);
/* ack all IRQ types immediately */
snd_azf3328_codec_outb(chip, IDX_IO_PLAY_IRQTYPE, which);
spin_unlock(&chip->reg_lock);
- if (chip->pcm && chip->playback_substream)
- {
+ if (chip->pcm && chip->playback_substream) {
snd_pcm_period_elapsed(chip->playback_substream);
snd_azf3328_dbgplay("PLAY period done (#%x), @ %x\n",
which,
inl(chip->codec_port+IDX_IO_PLAY_DMA_CURRPOS));
- }
- else
+ } else
snd_azf3328_dbgplay("azt3328: ouch, irq handler problem!\n");
if (which & IRQ_PLAY_SOMETHING)
snd_azf3328_dbgplay("azt3328: unknown play IRQ type occurred, please report!\n");
}
- if (status & IRQ_RECORDING)
- {
+ if (status & IRQ_RECORDING) {
spin_lock(&chip->reg_lock);
which = snd_azf3328_codec_inb(chip, IDX_IO_REC_IRQTYPE);
/* ack all IRQ types immediately */
snd_azf3328_codec_outb(chip, IDX_IO_REC_IRQTYPE, which);
spin_unlock(&chip->reg_lock);
- if (chip->pcm && chip->capture_substream)
- {
+ if (chip->pcm && chip->capture_substream) {
snd_pcm_period_elapsed(chip->capture_substream);
snd_azf3328_dbgplay("REC period done (#%x), @ %x\n",
which,
inl(chip->codec_port+IDX_IO_REC_DMA_CURRPOS));
- }
- else
+ } else
snd_azf3328_dbgplay("azt3328: ouch, irq handler problem!\n");
if (which & IRQ_REC_SOMETHING)
snd_azf3328_dbgplay("azt3328: unknown rec IRQ type occurred, please report!\n");
}
/* MPU401 has less critical IRQ requirements
* than timer and playback/recording, right? */
- if (status & IRQ_MPU401)
- {
+ if (status & IRQ_MPU401) {
snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data, regs);
/* hmm, do we have to ack the IRQ here somehow?
@@ -1572,8 +1549,7 @@ snd_azf3328_timer_start(struct snd_timer *timer)
snd_azf3328_dbgcallenter();
chip = snd_timer_chip(timer);
delay = ((timer->sticks * seqtimer_scaling) - 1) & TIMER_VALUE_MASK;
- if (delay < 49)
- {
+ if (delay < 49) {
/* uhoh, that's not good, since user-space won't know about
* this timing tweak
* (we need to do it to avoid a lockup, though) */