Alsa-devel
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 6 participants
- 51094 discussions

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/pcxhr/pcxhr.c | 44 ++++++++++++++++++++--------------------
sound/pci/pcxhr/pcxhr_core.c | 22 ++++++++++----------
sound/pci/pcxhr/pcxhr_hwdep.c | 16 +++++++-------
sound/pci/pcxhr/pcxhr_mixer.c | 16 +++++++-------
4 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c
index 0e06c6c..bebf866 100644
--- a/sound/pci/pcxhr/pcxhr.c
+++ b/sound/pci/pcxhr/pcxhr.c
@@ -197,7 +197,7 @@ static int pcxhr_get_clock_reg(struct pcxhr_mgr *mgr, unsigned int rate,
if (err < 0) {
snd_printk(KERN_ERR
"error CMD_ACCESS_IO_WRITE for PLL register : %x!\n",
- err );
+ err);
return err;
}
}
@@ -603,12 +603,12 @@ static void pcxhr_trigger_tasklet(unsigned long arg)
/* put the streams into the running state now (increment pointer by interrupt) */
spin_lock_irqsave(&mgr->lock, flags);
- for ( i =0; i < mgr->num_cards; i++) {
+ for (i =0; i < mgr->num_cards; i++) {
struct pcxhr_stream *stream;
chip = mgr->chip[i];
- for(j = 0; j < chip->nb_streams_capt; j++) {
+ for (j = 0; j < chip->nb_streams_capt; j++) {
stream = &chip->capture_stream[j];
- if(stream->status == PCXHR_STREAM_STATUS_STARTED)
+ if (stream->status == PCXHR_STREAM_STATUS_STARTED)
stream->status = PCXHR_STREAM_STATUS_RUNNING;
}
for (j = 0; j < chip->nb_streams_play; j++) {
@@ -723,7 +723,7 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs)
subs->runtime->buffer_size);
/*
- if(subs->runtime->period_size <= PCXHR_GRANULARITY) {
+ if (subs->runtime->period_size <= PCXHR_GRANULARITY) {
snd_printk(KERN_ERR "pcxhr_prepare : error period_size too small (%x)\n",
(unsigned int)subs->runtime->period_size);
return -EINVAL;
@@ -735,11 +735,11 @@ static int pcxhr_prepare(struct snd_pcm_substream *subs)
do {
/* if the stream was stopped before, format and buffer were reset */
/*
- if(stream->status == PCXHR_STREAM_STATUS_STOPPED) {
+ if (stream->status == PCXHR_STREAM_STATUS_STOPPED) {
err = pcxhr_set_format(stream);
- if(err) break;
+ if (err) break;
err = pcxhr_update_r_buffer(stream);
- if(err) break;
+ if (err) break;
}
*/
@@ -790,7 +790,7 @@ static int pcxhr_hw_params(struct snd_pcm_substream *subs,
/* set the format to the board */
/*
err = pcxhr_set_format(stream);
- if(err) {
+ if (err) {
mutex_unlock(&mgr->setup_mutex);
return err;
}
@@ -853,7 +853,7 @@ static int pcxhr_open(struct snd_pcm_substream *subs)
/* copy the struct snd_pcm_hardware struct */
runtime->hw = pcxhr_caps;
- if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK ) {
+ if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK) {
snd_printdd("pcxhr_open playback chip%d subs%d\n",
chip->chip_idx, subs->number);
stream = &chip->playback_stream[subs->number];
@@ -1025,7 +1025,7 @@ static int __devinit pcxhr_create(struct pcxhr_mgr *mgr, struct snd_card *card,
};
mgr->chip[idx] = chip = kzalloc(sizeof(*chip), GFP_KERNEL);
- if (! chip) {
+ if (!chip) {
snd_printk(KERN_ERR "cannot allocate chip\n");
return -ENOMEM;
}
@@ -1078,7 +1078,7 @@ static void pcxhr_proc_info(struct snd_info_entry *entry, struct snd_info_buffer
/* calc cpu load of the dsp */
pcxhr_init_rmh(&rmh, CMD_GET_DSP_RESOURCES);
- if( ! pcxhr_send_msg(mgr, &rmh) ) {
+ if (!pcxhr_send_msg(mgr, &rmh)) {
int cur = rmh.stat[0];
int ref = rmh.stat[1];
if (ref > 0) {
@@ -1108,7 +1108,7 @@ static void pcxhr_proc_info(struct snd_info_entry *entry, struct snd_info_buffer
rmh.stat_len = PCXHR_SIZE_MAX_STATUS;
rmh.dsp_stat = 0;
rmh.cmd_idx = CMD_LAST_INDEX;
- if( ! pcxhr_send_msg(mgr, &rmh) ) {
+ if (!pcxhr_send_msg(mgr, &rmh)) {
int i;
for (i = 0; i < rmh.stat_len; i++)
snd_iprintf(buffer, "debug[%02d] = %06x\n", i, rmh.stat[i]);
@@ -1147,9 +1147,9 @@ static void __devinit pcxhr_proc_init(struct snd_pcxhr *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "info", &entry))
+ if (!snd_card_proc_new(chip->card, "info", &entry))
snd_info_set_text_ops(entry, chip, pcxhr_proc_info);
- if (! snd_card_proc_new(chip->card, "sync", &entry))
+ if (!snd_card_proc_new(chip->card, "sync", &entry))
snd_info_set_text_ops(entry, chip, pcxhr_proc_sync);
}
/* end of proc interface */
@@ -1167,7 +1167,7 @@ static int pcxhr_free(struct pcxhr_mgr *mgr)
}
/* reset board if some firmware was loaded */
- if(mgr->dsp_loaded) {
+ if (mgr->dsp_loaded) {
pcxhr_reset_board(mgr);
snd_printdd("reset pcxhr !\n");
}
@@ -1205,7 +1205,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
if (dev >= SNDRV_CARDS)
return -ENODEV;
- if (! enable[dev]) {
+ if (!enable[dev]) {
dev++;
return -ENOENT;
}
@@ -1224,7 +1224,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
/* alloc card manager */
mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
- if (! mgr) {
+ if (!mgr) {
pci_disable_device(pci);
return -ENOMEM;
}
@@ -1271,15 +1271,15 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
/* init taslket */
tasklet_init(&mgr->msg_taskq, pcxhr_msg_tasklet, (unsigned long) mgr);
tasklet_init(&mgr->trigger_taskq, pcxhr_trigger_tasklet, (unsigned long) mgr);
- mgr->prmh = kmalloc(sizeof(*mgr->prmh) +
+ mgr->prmh = kmalloc(sizeof(*mgr->prmh) +
sizeof(u32) * (PCXHR_SIZE_MAX_LONG_STATUS - PCXHR_SIZE_MAX_STATUS),
GFP_KERNEL);
- if (! mgr->prmh) {
+ if (!mgr->prmh) {
pcxhr_free(mgr);
return -ENOMEM;
}
- for (i=0; i < PCXHR_MAX_CARDS; i++) {
+ for (i = 0; i < PCXHR_MAX_CARDS; i++) {
struct snd_card *card;
char tmpid[16];
int idx;
@@ -1296,7 +1296,7 @@ static int __devinit pcxhr_probe(struct pci_dev *pci, const struct pci_device_id
snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : card_name, i);
card = snd_card_new(idx, tmpid, THIS_MODULE, 0);
- if (! card) {
+ if (!card) {
snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
pcxhr_free(mgr);
return -ENOMEM;
diff --git a/sound/pci/pcxhr/pcxhr_core.c b/sound/pci/pcxhr/pcxhr_core.c
index 7143259..16575f4 100644
--- a/sound/pci/pcxhr/pcxhr_core.c
+++ b/sound/pci/pcxhr/pcxhr_core.c
@@ -23,7 +23,7 @@
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/interrupt.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include "pcxhr.h"
#include "pcxhr_mixer.h"
@@ -246,9 +246,9 @@ void pcxhr_reset_dsp(struct pcxhr_mgr *mgr)
/* let's reset the DSP */
PCXHR_OUTPB(mgr, PCXHR_DSP_RESET, 0);
- msleep( PCXHR_WAIT_DEFAULT ); /* wait 2 msec */
+ msleep(PCXHR_WAIT_DEFAULT); /* wait 2 msec */
PCXHR_OUTPB(mgr, PCXHR_DSP_RESET, 3);
- msleep( PCXHR_WAIT_DEFAULT ); /* wait 2 msec */
+ msleep(PCXHR_WAIT_DEFAULT); /* wait 2 msec */
/* reset mailbox */
PCXHR_OUTPL(mgr, PCXHR_PLX_MBOX0, 0);
@@ -275,7 +275,7 @@ int pcxhr_load_xilinx_binary(struct pcxhr_mgr *mgr, const struct firmware *xilin
chipsc = PCXHR_INPL(mgr, PCXHR_PLX_CHIPSC);
/* REV01 cards do not support the PCXHR_CHIPSC_GPI_USERI bit anymore */
/* this bit will always be 1; no possibility to test presence of first xilinx */
- if(second) {
+ if (second) {
if ((chipsc & PCXHR_CHIPSC_GPI_USERI) == 0) {
snd_printk(KERN_ERR "error loading first xilinx\n");
return -EINVAL;
@@ -283,7 +283,7 @@ int pcxhr_load_xilinx_binary(struct pcxhr_mgr *mgr, const struct firmware *xilin
/* activate second xilinx */
chipsc |= PCXHR_CHIPSC_RESET_XILINX;
PCXHR_OUTPL(mgr, PCXHR_PLX_CHIPSC, chipsc);
- msleep( PCXHR_WAIT_DEFAULT ); /* wait 2 msec */
+ msleep(PCXHR_WAIT_DEFAULT); /* wait 2 msec */
}
image = xilinx->data;
for (i = 0; i < xilinx->size; i++, image++) {
@@ -304,7 +304,7 @@ int pcxhr_load_xilinx_binary(struct pcxhr_mgr *mgr, const struct firmware *xilin
chipsc &= ~(PCXHR_CHIPSC_DATA_CLK | PCXHR_CHIPSC_DATA_IN);
PCXHR_OUTPL(mgr, PCXHR_PLX_CHIPSC, chipsc);
/* wait 2 msec (time to boot the xilinx before any access) */
- msleep( PCXHR_WAIT_DEFAULT );
+ msleep(PCXHR_WAIT_DEFAULT);
return 0;
}
@@ -627,7 +627,7 @@ static int pcxhr_send_msg_nolock(struct pcxhr_mgr *mgr, struct pcxhr_rmh *rmh)
PCXHR_OUTPB(mgr, PCXHR_DSP_TXM, (data>>8)&0xFF);
PCXHR_OUTPB(mgr, PCXHR_DSP_TXL, (data&0xFF));
- for (i=1; i < rmh->cmd_len; i++) {
+ for (i = 1; i < rmh->cmd_len; i++) {
/* send other words */
data = rmh->cmd[i];
#ifdef CONFIG_SND_DEBUG_VERBOSE
@@ -706,7 +706,7 @@ void pcxhr_set_pipe_cmd_params(struct pcxhr_rmh *rmh, int capture,
snd_BUG_ON(param2 > MASK_FIRST_FIELD);
rmh->cmd[0] |= param2;
}
- if(param3) {
+ if (param3) {
snd_BUG_ON(param3 > MASK_DSP_WORD);
rmh->cmd[1] = param3;
rmh->cmd_len = 2;
@@ -841,7 +841,7 @@ static int pcxhr_toggle_pipes(struct pcxhr_mgr *mgr, int audio_mask)
pcxhr_init_rmh(&rmh, CMD_SEND_IRQA);
err = pcxhr_send_msg(mgr, &rmh);
if (err) {
- snd_printk(KERN_ERR "error pipe start (CMD_SEND_IRQA) err=%x!\n", err );
+ snd_printk(KERN_ERR "error pipe start (CMD_SEND_IRQA) err=%x!\n", err);
return err;
}
return 0;
@@ -1154,7 +1154,7 @@ irqreturn_t pcxhr_interrupt(int irq, void *dev_id)
spin_lock(&mgr->lock);
reg = PCXHR_INPL(mgr, PCXHR_PLX_IRQCS);
- if (! (reg & PCXHR_IRQCS_ACTIVE_PCIDB)) {
+ if (!(reg & PCXHR_IRQCS_ACTIVE_PCIDB)) {
spin_unlock(&mgr->lock);
return IRQ_NONE; /* this device did not cause the interrupt */
}
@@ -1211,7 +1211,7 @@ irqreturn_t pcxhr_interrupt(int irq, void *dev_id)
*/
/* better resynchronize all streams next interrupt : */
mgr->dsp_time_last = PCXHR_DSP_TIME_INVALID;
-
+
mgr->src_it_dsp = reg;
tasklet_hi_schedule(&mgr->msg_taskq);
}
diff --git a/sound/pci/pcxhr/pcxhr_hwdep.c b/sound/pci/pcxhr/pcxhr_hwdep.c
index 96640d9..9d04175 100644
--- a/sound/pci/pcxhr/pcxhr_hwdep.c
+++ b/sound/pci/pcxhr/pcxhr_hwdep.c
@@ -24,7 +24,7 @@
#include <linux/vmalloc.h>
#include <linux/firmware.h>
#include <linux/pci.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/hwdep.h>
#include "pcxhr.h"
@@ -104,7 +104,7 @@ static int pcxhr_init_board(struct pcxhr_mgr *mgr)
mgr->board_has_analog = 1; /* analog addon board available */
else
/* analog addon board not available -> no support for instance */
- return -EINVAL;
+ return -EINVAL;
/* unmute inputs */
err = pcxhr_write_io_num_reg_cont(mgr, REG_CONT_UNMUTE_INPUTS,
@@ -144,7 +144,7 @@ void pcxhr_reset_board(struct pcxhr_mgr *mgr)
/*
* allocate a playback/capture pipe (pcmp0/pcmc0)
*/
-static int pcxhr_dsp_allocate_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe,
+static int pcxhr_dsp_allocate_pipe(struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe,
int is_capture, int pin)
{
int stream_count, audio_count;
@@ -166,10 +166,10 @@ static int pcxhr_dsp_allocate_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pi
pipe->first_audio = pin;
/* define pipe (P_PCM_ONLY_MASK (0x020000) is not necessary) */
pcxhr_init_rmh(&rmh, CMD_RES_PIPE);
- pcxhr_set_pipe_cmd_params(&rmh, is_capture, pin, audio_count, stream_count);
+ pcxhr_set_pipe_cmd_params(&rmh, is_capture, pin, audio_count, stream_count);
err = pcxhr_send_msg(mgr, &rmh);
if (err < 0) {
- snd_printk(KERN_ERR "error pipe allocation (CMD_RES_PIPE) err=%x!\n", err );
+ snd_printk(KERN_ERR "error pipe allocation (CMD_RES_PIPE) err=%x!\n", err);
return err;
}
pipe->status = PCXHR_PIPE_DEFINED;
@@ -181,7 +181,7 @@ static int pcxhr_dsp_allocate_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pi
* free playback/capture pipe (pcmp0/pcmc0)
*/
#if 0
-static int pcxhr_dsp_free_pipe( struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe)
+static int pcxhr_dsp_free_pipe(struct pcxhr_mgr *mgr, struct pcxhr_pipe *pipe)
{
struct pcxhr_rmh rmh;
int capture_mask = 0;
@@ -223,7 +223,7 @@ static int pcxhr_config_pipes(struct pcxhr_mgr *mgr)
err = pcxhr_dsp_allocate_pipe( mgr, pipe, 0, i*2);
if (err)
return err;
- for(j = 0; j < chip->nb_streams_play; j++)
+ for (j = 0; j < chip->nb_streams_play; j++)
chip->playback_stream[j].pipe = pipe;
}
for (j = 0; j < chip->nb_streams_capt; j++) {
@@ -392,7 +392,7 @@ static int pcxhr_hwdep_dsp_load(struct snd_hwdep *hw,
fw.size = dsp->length;
fw.data = vmalloc(fw.size);
- if (! fw.data) {
+ if (!fw.data) {
snd_printk(KERN_ERR "pcxhr: cannot allocate dsp image (%lu bytes)\n",
(unsigned long)fw.size);
return -ENOMEM;
diff --git a/sound/pci/pcxhr/pcxhr_mixer.c b/sound/pci/pcxhr/pcxhr_mixer.c
index aabc7bc..fd7e60c 100644
--- a/sound/pci/pcxhr/pcxhr_mixer.c
+++ b/sound/pci/pcxhr/pcxhr_mixer.c
@@ -173,7 +173,7 @@ static int pcxhr_audio_sw_put(struct snd_kcontrol *kcontrol,
struct snd_pcxhr *chip = snd_kcontrol_chip(kcontrol);
int i, changed = 0;
mutex_lock(&chip->mgr->mixer_mutex);
- for(i = 0; i < 2; i++) {
+ for (i = 0; i < 2; i++) {
if (chip->analog_playback_active[i] !=
ucontrol->value.integer.value[i]) {
chip->analog_playback_active[i] =
@@ -284,7 +284,7 @@ static int pcxhr_update_audio_pipe_level(struct snd_pcxhr* chip, int capture, in
rmh.cmd_len = 3;
err = pcxhr_send_msg(chip->mgr, &rmh);
- if(err<0) {
+ if (err<0) {
snd_printk(KERN_DEBUG "error update_audio_level card(%d) err(%x)\n",
chip->chip_idx, err);
return -EINVAL;
@@ -445,7 +445,7 @@ static int pcxhr_monitor_vol_put(struct snd_kcontrol *kcontrol,
ucontrol->value.integer.value[i]) {
chip->monitoring_volume[i] =
!!ucontrol->value.integer.value[i];
- if(chip->monitoring_active[i])
+ if (chip->monitoring_active[i])
/* update monitoring volume and mute */
/* do only when monitoring is unmuted */
pcxhr_update_audio_pipe_level(chip, 0, i);
@@ -566,7 +566,7 @@ static int pcxhr_set_audio_source(struct snd_pcxhr* chip)
rmh.cmd[1] = codec;
rmh.cmd[2] = (CS8420_DATA_FLOW_CTL & CHIP_SIG_AND_MAP_SPI) | (use_src ? 0x41 : 0x54);
err = pcxhr_send_msg(chip->mgr, &rmh);
- if(err)
+ if (err)
return err;
rmh.cmd[2] = (CS8420_CLOCK_SRC_CTL & CHIP_SIG_AND_MAP_SPI) | (use_src ? 0x41 : 0x49);
err = pcxhr_send_msg(chip->mgr, &rmh);
@@ -722,7 +722,7 @@ static int pcxhr_clock_rate_get(struct snd_kcontrol *kcontrol,
int i, err, rate;
mutex_lock(&mgr->mixer_mutex);
- for(i = 0; i < 3 + mgr->capture_chips; i++) {
+ for (i = 0; i < 3 + mgr->capture_chips; i++) {
if (i == PCXHR_CLOCK_TYPE_INTERNAL)
rate = mgr->sample_rate_real;
else {
@@ -802,7 +802,7 @@ static int pcxhr_iec958_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v
int i, err;
mutex_lock(&chip->mgr->mixer_mutex);
- for(i = 0; i < 5; i++) {
+ for (i = 0; i < 5; i++) {
if (kcontrol->private_value == 0) /* playback */
aes_bits = chip->aes_bits[i];
else { /* capture */
@@ -835,7 +835,7 @@ static int pcxhr_iec958_update_byte(struct snd_pcxhr *chip, int aes_idx, unsigne
for (i = 0; i < 8; i++) {
if ((old_bits & 0x01) != (new_bits & 0x01)) {
cmd = chip->chip_idx & 0x03; /* chip index 0..3 */
- if(chip->chip_idx > 3)
+ if (chip->chip_idx > 3)
/* new bit used if chip_idx>3 (PCX1222HR) */
cmd |= 1 << 22;
cmd |= ((aes_idx << 3) + i) << 2; /* add bit offset */
@@ -971,7 +971,7 @@ int pcxhr_create_mixer(struct pcxhr_mgr *mgr)
snd_ctl_new1(&pcxhr_control_output_switch,
chip))) < 0)
return err;
-
+
temp = snd_pcxhr_pcm_vol;
temp.name = "PCM Playback Volume";
temp.count = PCXHR_PLAYBACK_STREAMS;
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/nm256/nm256.c | 66 +++++++++++++++++++++---------------------
sound/pci/nm256/nm256_coef.c | 4 +-
sound/pci/oxygen/oxygen_io.c | 2 +-
3 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/sound/pci/nm256/nm256.c b/sound/pci/nm256/nm256.c
index 50c9f8a..b12e322 100644
--- a/sound/pci/nm256/nm256.c
+++ b/sound/pci/nm256/nm256.c
@@ -1,4 +1,4 @@
-/*
+/*
* Driver for NeoMagic 256AV and 256ZX chipsets.
* Copyright (c) 2000 by Takashi Iwai <tiwai(a)suse.de>
*
@@ -23,8 +23,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
-#include <asm/io.h>
+
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -190,7 +190,7 @@ struct nm256_stream {
struct snd_pcm_substream *substream;
int running;
int suspended;
-
+
u32 buf; /* offset from chip->buffer */
int bufsize; /* buffer size in bytes */
void __iomem *bufptr; /* mapped pointer */
@@ -205,7 +205,7 @@ struct nm256_stream {
};
struct nm256 {
-
+
struct snd_card *card;
void __iomem *cport; /* control port */
@@ -375,11 +375,11 @@ snd_nm256_load_coefficient(struct nm256 *chip, int stream, int number)
if (stream == SNDRV_PCM_STREAM_CAPTURE)
number += 8;
- if (! chip->use_cache) {
+ if (!chip->use_cache) {
snd_nm256_load_one_coefficient(chip, stream, addr, number);
return;
}
- if (! chip->coeffs_current) {
+ if (!chip->coeffs_current) {
snd_nm256_write_buffer(chip, coefficients, chip->all_coeff_buf,
NM_TOTAL_COEFF_COUNT * 4);
chip->coeffs_current = 1;
@@ -400,7 +400,7 @@ static unsigned int samplerates[8] = {
8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000,
};
static struct snd_pcm_hw_constraint_list constraints_rates = {
- .count = ARRAY_SIZE(samplerates),
+ .count = ARRAY_SIZE(samplerates),
.list = samplerates,
.mask = 0,
};
@@ -571,7 +571,7 @@ snd_nm256_playback_trigger(struct snd_pcm_substream *substream, int cmd)
s->suspended = 0;
/* fallthru */
case SNDRV_PCM_TRIGGER_START:
- if (! s->running) {
+ if (!s->running) {
snd_nm256_playback_start(chip, s, substream);
s->running = 1;
}
@@ -607,7 +607,7 @@ snd_nm256_capture_trigger(struct snd_pcm_substream *substream, int cmd)
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
case SNDRV_PCM_TRIGGER_RESUME:
- if (! s->running) {
+ if (!s->running) {
snd_nm256_capture_start(chip, s, substream);
s->running = 1;
}
@@ -680,7 +680,7 @@ snd_nm256_capture_pointer(struct snd_pcm_substream *substream)
if (snd_BUG_ON(!s))
return 0;
curp = snd_nm256_readl(chip, NM_RBUFFER_CURRP) - (unsigned long)s->buf;
- curp %= s->dma_size;
+ curp %= s->dma_size;
return bytes_to_frames(substream->runtime, curp);
}
@@ -956,8 +956,8 @@ snd_nm256_pcm(struct nm256 *chip, int device)
}
-/*
- * Initialize the hardware.
+/*
+ * Initialize the hardware.
*/
static void
snd_nm256_init_chip(struct nm256 *chip)
@@ -966,8 +966,8 @@ snd_nm256_init_chip(struct nm256 *chip)
snd_nm256_writeb(chip, 0x0, 0x11);
snd_nm256_writew(chip, 0x214, 0);
/* stop sounds.. */
- //snd_nm256_playback_stop(chip);
- //snd_nm256_capture_stop(chip);
+ /* snd_nm256_playback_stop(chip); */
+ /* snd_nm256_capture_stop(chip); */
}
@@ -997,8 +997,8 @@ snd_nm256_intr_check(struct nm256 *chip)
return IRQ_NONE;
}
-/*
- * Handle a potential interrupt for the device referred to by DEV_ID.
+/*
+ * Handle a potential interrupt for the device referred to by DEV_ID.
*
* I don't like the cut-n-paste job here either between the two routines,
* but there are sufficient differences between the two interrupt handlers
@@ -1147,8 +1147,8 @@ snd_nm256_ac97_ready(struct nm256 *chip)
testaddr = chip->mixer_status_offset;
testb = chip->mixer_status_mask;
- /*
- * Loop around waiting for the mixer to become ready.
+ /*
+ * Loop around waiting for the mixer to become ready.
*/
while (timeout-- > 0) {
if ((snd_nm256_readw(chip, testaddr) & testb) == 0)
@@ -1158,7 +1158,7 @@ snd_nm256_ac97_ready(struct nm256 *chip)
return 0;
}
-/*
+/*
* Initial register values to be written to the AC97 mixer.
* While most of these are identical to the reset values, we do this
* so that we have most of the register contents cached--this avoids
@@ -1187,7 +1187,7 @@ static struct initialValues nm256_ac97_init_val[] =
{ AC97_REC_SEL, 0x0000 },
{ AC97_REC_GAIN, 0x0B0B },
{ AC97_GENERAL_PURPOSE, 0x0000 },
- { AC97_3D_CONTROL, 0x8000 },
+ { AC97_3D_CONTROL, 0x8000 },
{ AC97_VENDOR_ID1, 0x8384 },
{ AC97_VENDOR_ID2, 0x7609 },
};
@@ -1217,7 +1217,7 @@ snd_nm256_ac97_read(struct snd_ac97 *ac97, unsigned short reg)
return chip->ac97_regs[idx];
}
-/*
+/*
*/
static void
snd_nm256_ac97_write(struct snd_ac97 *ac97,
@@ -1273,16 +1273,16 @@ snd_nm256_ac97_reset(struct snd_ac97 *ac97)
/* Reset the mixer. 'Tis magic! */
snd_nm256_writeb(chip, 0x6c0, 1);
- if (! chip->reset_workaround) {
+ if (!chip->reset_workaround) {
/* Dell latitude LS will lock up by this */
snd_nm256_writeb(chip, 0x6cc, 0x87);
}
- if (! chip->reset_workaround_2) {
+ if (!chip->reset_workaround_2) {
/* Dell latitude CSx will lock up by this */
snd_nm256_writeb(chip, 0x6cc, 0x80);
snd_nm256_writeb(chip, 0x6cc, 0x0);
}
- if (! chip->in_resume) {
+ if (!chip->in_resume) {
int i;
for (i = 0; i < ARRAY_SIZE(nm256_ac97_init_val); i++) {
/* preload the cache, so as to avoid even a single
@@ -1309,7 +1309,7 @@ snd_nm256_mixer(struct nm256 *chip)
chip->ac97_regs = kcalloc(ARRAY_SIZE(nm256_ac97_init_val),
sizeof(short), GFP_KERNEL);
- if (! chip->ac97_regs)
+ if (!chip->ac97_regs)
return -ENOMEM;
if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0)
@@ -1323,14 +1323,14 @@ snd_nm256_mixer(struct nm256 *chip)
err = snd_ac97_mixer(pbus, &ac97, &chip->ac97);
if (err < 0)
return err;
- if (! (chip->ac97->id & (0xf0000000))) {
+ if (!(chip->ac97->id & (0xf0000000))) {
/* looks like an invalid id */
sprintf(chip->card->mixername, "%s AC97", chip->card->driver);
}
return 0;
}
-/*
+/*
* See if the signature left by the NM256 BIOS is intact; if so, we use
* the associated address as the end of our audio buffer in the video
* RAM.
@@ -1498,7 +1498,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
chip->streams[SNDRV_PCM_STREAM_PLAYBACK].bufsize = playback_bufsize * 1024;
chip->streams[SNDRV_PCM_STREAM_CAPTURE].bufsize = capture_bufsize * 1024;
- /*
+ /*
* The NM256 has two memory ports. The first port is nothing
* more than a chunk of video RAM, which is used as the I/O ring
* buffer. The second port has the actual juicy stuff (like the
@@ -1529,7 +1529,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
/* Ok, try to see if this is a non-AC97 version of the hardware. */
pval = snd_nm256_readw(chip, NM_MIXER_PRESENCE);
if ((pval & NM_PRESENCE_MASK) != NM_PRESENCE_VALUE) {
- if (! force_ac97) {
+ if (!force_ac97) {
printk(KERN_ERR "nm256: no ac97 is found!\n");
printk(KERN_ERR " force the driver to load by "
"passing in the module parameter\n");
@@ -1555,7 +1555,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
chip->mixer_status_offset = NM2_MIXER_STATUS_OFFSET;
chip->mixer_status_mask = NM2_MIXER_READY_MASK;
}
-
+
chip->buffer_size = chip->streams[SNDRV_PCM_STREAM_PLAYBACK].bufsize +
chip->streams[SNDRV_PCM_STREAM_CAPTURE].bufsize;
if (chip->use_cache)
@@ -1614,8 +1614,8 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
snd_nm256_init_chip(chip);
- // pci_set_master(pci); /* needed? */
-
+ /* pci_set_master(pci); needed? */
+
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0)
goto __error;
diff --git a/sound/pci/nm256/nm256_coef.c b/sound/pci/nm256/nm256_coef.c
index 747d5d6..a75e037 100644
--- a/sound/pci/nm256/nm256_coef.c
+++ b/sound/pci/nm256/nm256_coef.c
@@ -1,6 +1,6 @@
#define NM_TOTAL_COEFF_COUNT 0x3158
-static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
+static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
0xFF, 0xFF, 0x2F, 0x00, 0x4B, 0xFF, 0xA5, 0x01, 0xEF, 0xFC, 0x21,
0x05, 0x87, 0xF7, 0x62, 0x11, 0xE9, 0x45, 0x5E, 0xF9, 0xB5, 0x01,
0xDE, 0xFF, 0xA4, 0xFF, 0x60, 0x00, 0xCA, 0xFF, 0x0D, 0x00, 0xFD,
@@ -4594,7 +4594,7 @@ static char coefficients[NM_TOTAL_COEFF_COUNT * 4] = {
0x9A, 0xFF, 0x0B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0xAD,
0xFF, 0x48, 0x01, 0xE2, 0xFC, 0xDA, 0x05, 0x97, 0xF6, 0x0B, 0x0F,
0x79, 0x42, 0xC7, 0x03, 0x9E, 0xFA, 0x71, 0x04, 0x28, 0xFD, 0x63,
- 0x01, 0x8D, 0xFF, 0x0F, 0x00
+ 0x01, 0x8D, 0xFF, 0x0F, 0x00
};
static u16
diff --git a/sound/pci/oxygen/oxygen_io.c b/sound/pci/oxygen/oxygen_io.c
index 83f135f..17618c1 100644
--- a/sound/pci/oxygen/oxygen_io.c
+++ b/sound/pci/oxygen/oxygen_io.c
@@ -20,7 +20,7 @@
#include <linux/delay.h>
#include <linux/sched.h>
#include <sound/core.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "oxygen.h"
u8 oxygen_read8(struct oxygen *chip, unsigned int reg)
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/mixart/mixart.c | 148 +++++++++++++++++++-------------------
sound/pci/mixart/mixart_core.c | 100 +++++++++++++-------------
sound/pci/mixart/mixart_hwdep.c | 128 +++++++++++++++++-----------------
sound/pci/mixart/mixart_hwdep.h | 28 ++++----
sound/pci/mixart/mixart_mixer.c | 56 +++++++-------
5 files changed, 230 insertions(+), 230 deletions(-)
diff --git a/sound/pci/mixart/mixart.c b/sound/pci/mixart/mixart.c
index 2d0dce6..9db4225 100644
--- a/sound/pci/mixart/mixart.c
+++ b/sound/pci/mixart/mixart.c
@@ -80,10 +80,10 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
switch(pipe->status) {
case PIPE_RUNNING:
case PIPE_CLOCK_SET:
- if(start) return 0; /* already started */
+ if (start) return 0; /* already started */
break;
case PIPE_STOPPED:
- if(!start) return 0; /* already stopped */
+ if (!start) return 0; /* already stopped */
break;
default:
snd_printk(KERN_ERR "error mixart_set_pipe_state called with wrong pipe->status!\n");
@@ -100,7 +100,7 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
request.size = sizeof(system_msg_uid);
err = snd_mixart_send_msg_wait_notif(mgr, &request, system_msg_uid);
- if(err) {
+ if (err) {
snd_printk(KERN_ERR "error : MSG_SYSTEM_WAIT_SYNCHRO_CMD was not notified !\n");
return err;
}
@@ -111,7 +111,7 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
group_state.pipe_count = 1;
group_state.pipe_uid[0] = pipe->group_uid;
- if(start)
+ if (start)
request.message_id = MSG_STREAM_START_STREAM_GRP_PACKET;
else
request.message_id = MSG_STREAM_STOP_STREAM_GRP_PACKET;
@@ -126,7 +126,7 @@ static int mixart_set_pipe_state(struct mixart_mgr *mgr,
return -EINVAL;
}
- if(start) {
+ if (start) {
u32 stat;
group_state.pipe_count = 0; /* in case of start same command once again with pipe_count=0 */
@@ -171,10 +171,10 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
case PIPE_CLOCK_SET:
break;
case PIPE_RUNNING:
- if(rate != 0)
+ if (rate != 0)
break;
default:
- if(rate == 0)
+ if (rate == 0)
return 0; /* nothing to do */
else {
snd_printk(KERN_ERR "error mixart_set_clock(%d) called with wrong pipe->status !\n", rate);
@@ -202,7 +202,7 @@ static int mixart_set_clock(struct mixart_mgr *mgr,
return -EINVAL;
}
- if(rate) pipe->status = PIPE_CLOCK_SET;
+ if (rate) pipe->status = PIPE_CLOCK_SET;
else pipe->status = PIPE_RUNNING;
return 0;
@@ -220,7 +220,7 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
struct mixart_pipe *pipe;
struct mixart_msg request;
- if(capture) {
+ if (capture) {
if (pcm_number == MIXART_PCM_ANALOG) {
pipe = &(chip->pipe_in_ana); /* analog inputs */
} else {
@@ -239,12 +239,12 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
}
/* a new stream is opened and there are already all streams in use */
- if( (monitoring == 0) && (pipe->references >= stream_count) ) {
+ if ((monitoring == 0) && (pipe->references >= stream_count)) {
return NULL;
}
/* pipe is not yet defined */
- if( pipe->status == PIPE_UNDEFINED ) {
+ if (pipe->status == PIPE_UNDEFINED) {
int err, i;
struct {
struct mixart_streaming_group_req sgroup_req;
@@ -268,11 +268,11 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
buf->sgroup_req.latency = 256;
buf->sgroup_req.connector = pipe->uid_left_connector; /* the left connector */
- for (i=0; i<stream_count; i++) {
+ for (i = 0; i < stream_count; i++) {
int j;
struct mixart_flowinfo *flowinfo;
struct mixart_bufferinfo *bufferinfo;
-
+
/* we don't yet know the format, so config 16 bit pcm audio for instance */
buf->sgroup_req.stream_info[i].size_max_byte_frame = 1024;
buf->sgroup_req.stream_info[i].size_max_sample_frame = 256;
@@ -280,7 +280,7 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
/* find the right bufferinfo_array */
j = (chip->chip_idx * MIXART_MAX_STREAM_PER_CARD) + (pcm_number * (MIXART_PLAYBACK_STREAMS + MIXART_CAPTURE_STREAMS)) + i;
- if(capture) j += MIXART_PLAYBACK_STREAMS; /* in the array capture is behind playback */
+ if (capture) j += MIXART_PLAYBACK_STREAMS; /* in the array capture is behind playback */
buf->sgroup_req.flow_entry[i] = j;
@@ -294,13 +294,13 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
/* construct the identifier of the stream buffer received in the interrupts ! */
bufferinfo[j].buffer_id = (chip->chip_idx << MIXART_NOTIFY_CARD_OFFSET) + (pcm_number << MIXART_NOTIFY_PCM_OFFSET ) + i;
- if(capture) {
+ if (capture) {
bufferinfo[j].buffer_id |= MIXART_NOTIFY_CAPT_MASK;
}
}
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(buf->sgroup_resp), &buf->sgroup_resp);
- if((err < 0) || (buf->sgroup_resp.status != 0)) {
+ if ((err < 0) || (buf->sgroup_resp.status != 0)) {
snd_printk(KERN_ERR "error MSG_STREAM_ADD_**PUT_GROUP err=%x stat=%x !\n", err, buf->sgroup_resp.status);
kfree(buf);
return NULL;
@@ -314,7 +314,7 @@ snd_mixart_add_ref_pipe(struct snd_mixart *chip, int pcm_number, int capture,
kfree(buf);
}
- if(monitoring) pipe->monitoring = 1;
+ if (monitoring) pipe->monitoring = 1;
else pipe->references++;
return pipe;
@@ -326,28 +326,28 @@ int snd_mixart_kill_ref_pipe(struct mixart_mgr *mgr,
{
int err = 0;
- if(pipe->status == PIPE_UNDEFINED)
+ if (pipe->status == PIPE_UNDEFINED)
return 0;
- if(monitoring)
+ if (monitoring)
pipe->monitoring = 0;
else
pipe->references--;
- if((pipe->references <= 0) && (pipe->monitoring == 0)) {
+ if ((pipe->references <= 0) && (pipe->monitoring == 0)) {
struct mixart_msg request;
struct mixart_delete_group_resp delete_resp;
/* release the clock */
err = mixart_set_clock( mgr, pipe, 0);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "mixart_set_clock(0) return error!\n");
}
/* stop the pipe */
err = mixart_set_pipe_state(mgr, pipe, 0);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error stopping pipe!\n");
}
@@ -376,7 +376,7 @@ static int mixart_set_stream_state(struct mixart_stream *stream, int start)
struct mixart_stream_state_req stream_state_req;
struct mixart_msg request;
- if(!stream->substream)
+ if (!stream->substream)
return -EINVAL;
memset(&stream_state_req, 0, sizeof(stream_state_req));
@@ -416,7 +416,7 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
snd_printdd("SNDRV_PCM_TRIGGER_START\n");
/* START_STREAM */
- if( mixart_set_stream_state(stream, 1) )
+ if (mixart_set_stream_state(stream, 1))
return -EINVAL;
stream->status = MIXART_STREAM_STATUS_RUNNING;
@@ -425,7 +425,7 @@ static int snd_mixart_trigger(struct snd_pcm_substream *subs, int cmd)
case SNDRV_PCM_TRIGGER_STOP:
/* STOP_STREAM */
- if( mixart_set_stream_state(stream, 0) )
+ if (mixart_set_stream_state(stream, 0))
return -EINVAL;
stream->status = MIXART_STREAM_STATUS_OPEN;
@@ -479,12 +479,12 @@ static int snd_mixart_prepare(struct snd_pcm_substream *subs)
/* only the first stream can choose the sample rate */
/* the further opened streams will be limited to its frequency (see open) */
- if(chip->mgr->ref_count_rate == 1)
+ if (chip->mgr->ref_count_rate == 1)
chip->mgr->sample_rate = subs->runtime->rate;
/* set the clock only once (first stream) on the same pipe */
- if(stream->pipe->references == 1) {
- if( mixart_set_clock(chip->mgr, stream->pipe, subs->runtime->rate) )
+ if (stream->pipe->references == 1) {
+ if (mixart_set_clock(chip->mgr, stream->pipe, subs->runtime->rate))
return -EINVAL;
}
@@ -508,7 +508,7 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form
stream_param.number_of_channel = stream->channels;
stream_param.sampling_freq = chip->mgr->sample_rate;
- if(stream_param.sampling_freq == 0)
+ if (stream_param.sampling_freq == 0)
stream_param.sampling_freq = 44100; /* if frequency not yet defined, use some default */
switch(format){
@@ -564,7 +564,7 @@ static int mixart_set_format(struct mixart_stream *stream, snd_pcm_format_t form
request.size = sizeof(stream_param);
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
- if((err < 0) || resp.error_code) {
+ if ((err < 0) || resp.error_code) {
snd_printk(KERN_ERR "MSG_STREAM_SET_INPUT_STAGE_PARAM err=%x; resp=%x\n", err, resp.error_code);
return -EINVAL;
}
@@ -594,9 +594,9 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
mutex_lock(&mgr->setup_mutex);
/* update the stream levels */
- if( stream->pcm_number <= MIXART_PCM_DIGITAL ) {
+ if (stream->pcm_number <= MIXART_PCM_DIGITAL) {
int is_aes = stream->pcm_number > MIXART_PCM_ANALOG;
- if( subs->stream == SNDRV_PCM_STREAM_PLAYBACK )
+ if (subs->stream == SNDRV_PCM_STREAM_PLAYBACK)
mixart_update_playback_stream_level(chip, is_aes, subs->number);
else
mixart_update_capture_stream_level( chip, is_aes);
@@ -606,7 +606,7 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
/* set the format to the board */
err = mixart_set_format(stream, format);
- if(err < 0) {
+ if (err < 0) {
return err;
}
@@ -616,10 +616,10 @@ static int snd_mixart_hw_params(struct snd_pcm_substream *subs,
if (err > 0) {
struct mixart_bufferinfo *bufferinfo;
int i = (chip->chip_idx * MIXART_MAX_STREAM_PER_CARD) + (stream->pcm_number * (MIXART_PLAYBACK_STREAMS+MIXART_CAPTURE_STREAMS)) + subs->number;
- if( subs->stream == SNDRV_PCM_STREAM_CAPTURE ) {
+ if (subs->stream == SNDRV_PCM_STREAM_CAPTURE) {
i += MIXART_PLAYBACK_STREAMS; /* in array capture is behind playback */
}
-
+
bufferinfo = (struct mixart_bufferinfo *)chip->mgr->bufferinfo.area;
bufferinfo[i].buffer_address = subs->runtime->dma_addr;
bufferinfo[i].available_length = subs->runtime->dma_bytes;
@@ -704,7 +704,7 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
mutex_lock(&mgr->setup_mutex);
- if ( pcm == chip->pcm ) {
+ if (pcm == chip->pcm) {
pcm_number = MIXART_PCM_ANALOG;
runtime->hw = snd_mixart_analog_caps;
} else {
@@ -734,7 +734,7 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
/* start the pipe if necessary */
err = mixart_set_pipe_state(chip->mgr, pipe, 1);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error starting pipe!\n");
snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0);
err = -EINVAL;
@@ -753,13 +753,13 @@ static int snd_mixart_playback_open(struct snd_pcm_substream *subs)
snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64);
/* if a sample rate is already used, another stream cannot change */
- if(mgr->ref_count_rate++) {
- if(mgr->sample_rate) {
+ if (mgr->ref_count_rate++) {
+ if (mgr->sample_rate) {
runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate;
}
}
- _exit_open:
+_exit_open:
mutex_unlock(&mgr->setup_mutex);
return err;
@@ -779,7 +779,7 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
mutex_lock(&mgr->setup_mutex);
- if ( pcm == chip->pcm ) {
+ if (pcm == chip->pcm) {
pcm_number = MIXART_PCM_ANALOG;
runtime->hw = snd_mixart_analog_caps;
} else {
@@ -812,7 +812,7 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
/* start the pipe if necessary */
err = mixart_set_pipe_state(chip->mgr, pipe, 1);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error starting pipe!\n");
snd_mixart_kill_ref_pipe(chip->mgr, pipe, 0);
err = -EINVAL;
@@ -831,13 +831,13 @@ static int snd_mixart_capture_open(struct snd_pcm_substream *subs)
snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 64);
/* if a sample rate is already used, another stream cannot change */
- if(mgr->ref_count_rate++) {
- if(mgr->sample_rate) {
+ if (mgr->ref_count_rate++) {
+ if (mgr->sample_rate) {
runtime->hw.rate_min = runtime->hw.rate_max = mgr->sample_rate;
}
}
- _exit_open:
+_exit_open:
mutex_unlock(&mgr->setup_mutex);
return err;
@@ -856,7 +856,7 @@ static int snd_mixart_close(struct snd_pcm_substream *subs)
snd_printdd("snd_mixart_close C%d/P%d/Sub%d\n", chip->chip_idx, stream->pcm_number, subs->number);
/* sample rate released */
- if(--mgr->ref_count_rate == 0) {
+ if (--mgr->ref_count_rate == 0) {
mgr->sample_rate = 0;
}
@@ -1011,7 +1011,7 @@ static int __devinit snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *
};
mgr->chip[idx] = chip = kzalloc(sizeof(*chip), GFP_KERNEL);
- if (! chip) {
+ if (!chip) {
snd_printk(KERN_ERR "cannot allocate chip\n");
return -ENOMEM;
}
@@ -1038,7 +1038,7 @@ int snd_mixart_create_pcm(struct snd_mixart* chip)
if (err < 0)
return err;
- if(chip->mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
+ if (chip->mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
err = snd_mixart_pcm_digital(chip);
if (err < 0)
@@ -1068,7 +1068,7 @@ static int snd_mixart_free(struct mixart_mgr *mgr)
free_irq(mgr->irq, mgr);
/* reset board if some firmware was loaded */
- if(mgr->dsp_loaded) {
+ if (mgr->dsp_loaded) {
snd_mixart_reset_board(mgr);
snd_printdd("reset miXart !\n");
}
@@ -1081,12 +1081,12 @@ static int snd_mixart_free(struct mixart_mgr *mgr)
pci_release_regions(mgr->pci);
/* free flowarray */
- if(mgr->flowinfo.area) {
+ if (mgr->flowinfo.area) {
snd_dma_free_pages(&mgr->flowinfo);
mgr->flowinfo.area = NULL;
}
/* free bufferarray */
- if(mgr->bufferinfo.area) {
+ if (mgr->bufferinfo.area) {
snd_dma_free_pages(&mgr->bufferinfo);
mgr->bufferinfo.area = NULL;
}
@@ -1120,7 +1120,7 @@ static long long snd_mixart_BA0_llseek(struct snd_info_entry *entry,
default:
return -EINVAL;
}
- if(file->f_pos > MIXART_BA0_SIZE)
+ if (file->f_pos > MIXART_BA0_SIZE)
file->f_pos = MIXART_BA0_SIZE;
return file->f_pos;
}
@@ -1146,7 +1146,7 @@ static long long snd_mixart_BA1_llseek(struct snd_info_entry *entry,
default:
return -EINVAL;
}
- if(file->f_pos > MIXART_BA1_SIZE)
+ if (file->f_pos > MIXART_BA1_SIZE)
file->f_pos = MIXART_BA1_SIZE;
return file->f_pos;
}
@@ -1161,11 +1161,11 @@ static long snd_mixart_BA0_read(struct snd_info_entry *entry, void *file_private
struct mixart_mgr *mgr = entry->private_data;
count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
- if(count <= 0)
+ if (count <= 0)
return 0;
- if(pos + count > MIXART_BA0_SIZE)
+ if (pos + count > MIXART_BA0_SIZE)
count = (long)(MIXART_BA0_SIZE - pos);
- if(copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count))
+ if (copy_to_user_fromio(buf, MIXART_MEM( mgr, pos ), count))
return -EFAULT;
return count;
}
@@ -1180,11 +1180,11 @@ static long snd_mixart_BA1_read(struct snd_info_entry *entry, void *file_private
struct mixart_mgr *mgr = entry->private_data;
count = count & ~3; /* make sure the read size is a multiple of 4 bytes */
- if(count <= 0)
+ if (count <= 0)
return 0;
- if(pos + count > MIXART_BA1_SIZE)
+ if (pos + count > MIXART_BA1_SIZE)
count = (long)(MIXART_BA1_SIZE - pos);
- if(copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count))
+ if (copy_to_user_fromio(buf, MIXART_REG( mgr, pos ), count))
return -EFAULT;
return count;
}
@@ -1200,25 +1200,25 @@ static struct snd_info_entry_ops snd_mixart_proc_ops_BA1 = {
};
-static void snd_mixart_proc_read(struct snd_info_entry *entry,
+static void snd_mixart_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
- struct snd_mixart *chip = entry->private_data;
- u32 ref;
+ struct snd_mixart *chip = entry->private_data;
+ u32 ref;
snd_iprintf(buffer, "Digigram miXart (alsa card %d)\n\n", chip->chip_idx);
/* stats available when embedded OS is running */
if (chip->mgr->dsp_loaded & ( 1 << MIXART_MOTHERBOARD_ELF_INDEX)) {
snd_iprintf(buffer, "- hardware -\n");
- switch (chip->mgr->board_type ) {
+ switch (chip->mgr->board_type) {
case MIXART_DAUGHTER_TYPE_NONE : snd_iprintf(buffer, "\tmiXart8 (no daughter board)\n\n"); break;
case MIXART_DAUGHTER_TYPE_AES : snd_iprintf(buffer, "\tmiXart8 AES/EBU\n\n"); break;
case MIXART_DAUGHTER_TYPE_COBRANET : snd_iprintf(buffer, "\tmiXart8 Cobranet\n\n"); break;
default: snd_iprintf(buffer, "\tUNKNOWN!\n\n"); break;
}
- snd_iprintf(buffer, "- system load -\n");
+ snd_iprintf(buffer, "- system load -\n");
/* get perf reference */
@@ -1241,18 +1241,18 @@ static void __devinit snd_mixart_proc_init(struct snd_mixart *chip)
struct snd_info_entry *entry;
/* text interface to read perf and temp meters */
- if (! snd_card_proc_new(chip->card, "board_info", &entry)) {
+ if (!snd_card_proc_new(chip->card, "board_info", &entry)) {
entry->private_data = chip;
entry->c.text.read = snd_mixart_proc_read;
}
- if (! snd_card_proc_new(chip->card, "mixart_BA0", &entry)) {
+ if (!snd_card_proc_new(chip->card, "mixart_BA0", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
- entry->private_data = chip->mgr;
+ entry->private_data = chip->mgr;
entry->c.ops = &snd_mixart_proc_ops_BA0;
entry->size = MIXART_BA0_SIZE;
}
- if (! snd_card_proc_new(chip->card, "mixart_BA1", &entry)) {
+ if (!snd_card_proc_new(chip->card, "mixart_BA1", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip->mgr;
entry->c.ops = &snd_mixart_proc_ops_BA1;
@@ -1278,7 +1278,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
*/
if (dev >= SNDRV_CARDS)
return -ENODEV;
- if (! enable[dev]) {
+ if (!enable[dev]) {
dev++;
return -ENOENT;
}
@@ -1298,7 +1298,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
/*
*/
mgr = kzalloc(sizeof(*mgr), GFP_KERNEL);
- if (! mgr) {
+ if (!mgr) {
pci_disable_device(pci);
return -ENOMEM;
}
@@ -1367,7 +1367,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
snprintf(tmpid, sizeof(tmpid), "%s-%d", id[dev] ? id[dev] : "MIXART", i);
card = snd_card_new(idx, tmpid, THIS_MODULE, 0);
- if (! card) {
+ if (!card) {
snd_printk(KERN_ERR "cannot allocate the card %d\n", i);
snd_mixart_free(mgr);
return -ENOMEM;
@@ -1382,7 +1382,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
return err;
}
- if(i==0) {
+ if (i==0) {
/* init proc interface only for chip0 */
snd_mixart_proc_init(mgr->chip[i]);
}
@@ -1398,7 +1398,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
/* create array of streaminfo */
size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS *
- sizeof(struct mixart_flowinfo)) );
+ sizeof(struct mixart_flowinfo)));
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
size, &mgr->flowinfo) < 0) {
snd_mixart_free(mgr);
@@ -1409,7 +1409,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci,
/* create array of bufferinfo */
size = PAGE_ALIGN( (MIXART_MAX_STREAM_PER_CARD * MIXART_MAX_CARDS *
- sizeof(struct mixart_bufferinfo)) );
+ sizeof(struct mixart_bufferinfo)));
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
size, &mgr->bufferinfo) < 0) {
snd_mixart_free(mgr);
diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c
index b9a06c2..26b5f46 100644
--- a/sound/pci/mixart/mixart_core.c
+++ b/sound/pci/mixart/mixart_core.c
@@ -23,7 +23,7 @@
#include <linux/interrupt.h>
#include <linux/mutex.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include "mixart.h"
#include "mixart_hwdep.h"
@@ -65,7 +65,7 @@ static int retrieve_msg_frame(struct mixart_mgr *mgr, u32 *msg_frame)
/* increment the tail index */
tailptr += 4;
- if( tailptr >= (MSG_OUTBOUND_POST_STACK+MSG_BOUND_STACK_SIZE) )
+ if (tailptr >= (MSG_OUTBOUND_POST_STACK+MSG_BOUND_STACK_SIZE))
tailptr = MSG_OUTBOUND_POST_STACK;
writel_be(tailptr, MIXART_MEM(mgr, MSG_OUTBOUND_POST_TAIL));
@@ -73,7 +73,7 @@ static int retrieve_msg_frame(struct mixart_mgr *mgr, u32 *msg_frame)
}
static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
- u32 msg_frame_address )
+ u32 msg_frame_address)
{
unsigned long flags;
u32 headptr;
@@ -92,7 +92,7 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
resp->uid.object_id = readl_be(MIXART_MEM(mgr, msg_frame_address + 8)); /* uidDest */
resp->uid.desc = readl_be(MIXART_MEM(mgr, msg_frame_address + 12)); /* */
- if( (size < MSG_DESCRIPTOR_SIZE) || (resp->size < (size - MSG_DESCRIPTOR_SIZE))) {
+ if ((size < MSG_DESCRIPTOR_SIZE) || (resp->size < (size - MSG_DESCRIPTOR_SIZE))) {
err = -EINVAL;
snd_printk(KERN_ERR "problem with response size = %d\n", size);
goto _clean_exit;
@@ -105,7 +105,7 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
/* swap if necessary */
#ifndef __BIG_ENDIAN
size /= 4; /* u32 size */
- for(i=0; i < size; i++) {
+ for (i = 0; i < size; i++) {
((u32*)resp->data)[i] = be32_to_cpu(((u32*)resp->data)[i]);
}
#endif
@@ -115,7 +115,7 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
*/
headptr = readl_be(MIXART_MEM(mgr, MSG_OUTBOUND_FREE_HEAD));
- if( (headptr < MSG_OUTBOUND_FREE_STACK) || ( headptr >= (MSG_OUTBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))) {
+ if ((headptr < MSG_OUTBOUND_FREE_STACK) || ( headptr >= (MSG_OUTBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))) {
err = -EINVAL;
goto _clean_exit;
}
@@ -125,12 +125,12 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
/* increment the outbound free head */
headptr += 4;
- if( headptr >= (MSG_OUTBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE) )
+ if (headptr >= (MSG_OUTBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))
headptr = MSG_OUTBOUND_FREE_STACK;
writel_be(headptr, MIXART_MEM(mgr, MSG_OUTBOUND_FREE_HEAD));
- _clean_exit:
+_clean_exit:
spin_unlock_irqrestore(&mgr->msg_lock, flags);
return err;
@@ -141,7 +141,7 @@ static int get_msg(struct mixart_mgr *mgr, struct mixart_msg *resp,
* send a message to miXart. return: the msg_frame used for this message
*/
/* call with mgr->msg_lock held! */
-static int send_msg( struct mixart_mgr *mgr,
+static int send_msg(struct mixart_mgr *mgr,
struct mixart_msg *msg,
int max_answersize,
int mark_pending,
@@ -165,7 +165,7 @@ static int send_msg( struct mixart_mgr *mgr,
return -EBUSY;
}
- if( (tailptr < MSG_INBOUND_FREE_STACK) || (tailptr >= (MSG_INBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))) {
+ if ((tailptr < MSG_INBOUND_FREE_STACK) || (tailptr >= (MSG_INBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))) {
return -EINVAL;
}
@@ -174,7 +174,7 @@ static int send_msg( struct mixart_mgr *mgr,
/* increment the inbound free tail */
tailptr += 4;
- if( tailptr >= (MSG_INBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE) )
+ if (tailptr >= (MSG_INBOUND_FREE_STACK+MSG_BOUND_STACK_SIZE))
tailptr = MSG_INBOUND_FREE_STACK;
writel_be(tailptr, MIXART_MEM(mgr, MSG_INBOUND_FREE_TAIL));
@@ -182,24 +182,24 @@ static int send_msg( struct mixart_mgr *mgr,
/* TODO : use memcpy_toio() with intermediate buffer to copy the message */
/* copy message descriptor to card memory */
- writel_be( msg->size + MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address) ); /* size of descriptor + request */
- writel_be( msg->message_id , MIXART_MEM(mgr, msg_frame_address + 4) ); /* dwMessageID */
- writel_be( msg->uid.object_id, MIXART_MEM(mgr, msg_frame_address + 8) ); /* uidDest */
- writel_be( msg->uid.desc, MIXART_MEM(mgr, msg_frame_address + 12) ); /* */
- writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 16) ); /* SizeHeader */
- writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 20) ); /* OffsetDLL_T16 */
- writel_be( msg->size, MIXART_MEM(mgr, msg_frame_address + 24) ); /* SizeDLL_T16 */
- writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 28) ); /* OffsetDLL_DRV */
- writel_be( 0, MIXART_MEM(mgr, msg_frame_address + 32) ); /* SizeDLL_DRV */
- writel_be( MSG_DESCRIPTOR_SIZE + max_answersize, MIXART_MEM(mgr, msg_frame_address + 36) ); /* dwExpectedAnswerSize */
+ writel_be( msg->size + MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address)); /* size of descriptor + request */
+ writel_be( msg->message_id , MIXART_MEM(mgr, msg_frame_address + 4)); /* dwMessageID */
+ writel_be( msg->uid.object_id, MIXART_MEM(mgr, msg_frame_address + 8)); /* uidDest */
+ writel_be( msg->uid.desc, MIXART_MEM(mgr, msg_frame_address + 12)); /* */
+ writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 16)); /* SizeHeader */
+ writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 20)); /* OffsetDLL_T16 */
+ writel_be( msg->size, MIXART_MEM(mgr, msg_frame_address + 24)); /* SizeDLL_T16 */
+ writel_be( MSG_DESCRIPTOR_SIZE, MIXART_MEM(mgr, msg_frame_address + 28)); /* OffsetDLL_DRV */
+ writel_be( 0, MIXART_MEM(mgr, msg_frame_address + 32)); /* SizeDLL_DRV */
+ writel_be( MSG_DESCRIPTOR_SIZE + max_answersize, MIXART_MEM(mgr, msg_frame_address + 36)); /* dwExpectedAnswerSize */
/* copy message data to card memory */
- for( i=0; i < msg->size; i+=4 ) {
- writel_be( *(u32*)(msg->data + i), MIXART_MEM(mgr, MSG_HEADER_SIZE + msg_frame_address + i) );
+ for (i = 0; i < msg->size; i += 4) {
+ writel_be( *(u32*)(msg->data + i), MIXART_MEM(mgr, MSG_HEADER_SIZE + msg_frame_address + i) );
}
- if( mark_pending ) {
- if( *msg_event ) {
+ if (mark_pending) {
+ if (*msg_event) {
/* the pending event is the notification we wait for ! */
mgr->pending_event = *msg_event;
}
@@ -218,7 +218,7 @@ static int send_msg( struct mixart_mgr *mgr,
/* post the frame */
headptr = readl_be(MIXART_MEM(mgr, MSG_INBOUND_POST_HEAD));
- if( (headptr < MSG_INBOUND_POST_STACK) || (headptr >= (MSG_INBOUND_POST_STACK+MSG_BOUND_STACK_SIZE))) {
+ if ((headptr < MSG_INBOUND_POST_STACK) || (headptr >= (MSG_INBOUND_POST_STACK+MSG_BOUND_STACK_SIZE))) {
return -EINVAL;
}
@@ -226,7 +226,7 @@ static int send_msg( struct mixart_mgr *mgr,
/* increment the inbound post head */
headptr += 4;
- if( headptr >= (MSG_INBOUND_POST_STACK+MSG_BOUND_STACK_SIZE) )
+ if (headptr >= (MSG_INBOUND_POST_STACK+MSG_BOUND_STACK_SIZE))
headptr = MSG_INBOUND_POST_STACK;
writel_be(headptr, MIXART_MEM(mgr, MSG_INBOUND_POST_HEAD));
@@ -262,7 +262,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int
timeout = schedule_timeout(MSG_TIMEOUT_JIFFIES);
remove_wait_queue(&mgr->msg_sleep, &wait);
- if (! timeout) {
+ if (!timeout) {
/* error - no ack */
mutex_unlock(&mgr->msg_mutex);
snd_printk(KERN_ERR "error: no reponse on msg %x\n", msg_frame);
@@ -277,7 +277,7 @@ int snd_mixart_send_msg(struct mixart_mgr *mgr, struct mixart_msg *request, int
err = get_msg(mgr, &resp, msg_frame);
- if( request->message_id != resp.message_id )
+ if (request->message_id != resp.message_id)
snd_printk(KERN_ERR "REPONSE ERROR!\n");
mutex_unlock(&mgr->msg_mutex);
@@ -306,7 +306,7 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr,
spin_lock_irq(&mgr->msg_lock);
/* send the message */
err = send_msg(mgr, request, MSG_DEFAULT_SIZE, 1, ¬if_event); /* send and mark the notification event pending */
- if(err) {
+ if (err) {
spin_unlock_irq(&mgr->msg_lock);
mutex_unlock(&mgr->msg_mutex);
return err;
@@ -318,7 +318,7 @@ int snd_mixart_send_msg_wait_notif(struct mixart_mgr *mgr,
timeout = schedule_timeout(MSG_TIMEOUT_JIFFIES);
remove_wait_queue(&mgr->msg_sleep, &wait);
- if (! timeout) {
+ if (!timeout) {
/* error - no ack */
mutex_unlock(&mgr->msg_mutex);
snd_printk(KERN_ERR "error: notification %x not received\n", notif_event);
@@ -354,7 +354,7 @@ static u32 mixart_msg_data[MSG_DEFAULT_SIZE / 4];
void snd_mixart_msg_tasklet(unsigned long arg)
{
- struct mixart_mgr *mgr = ( struct mixart_mgr*)(arg);
+ struct mixart_mgr *mgr = (struct mixart_mgr*)(arg);
struct mixart_msg resp;
u32 msg, addr, type;
int err;
@@ -377,7 +377,7 @@ void snd_mixart_msg_tasklet(unsigned long arg)
resp.data = mixart_msg_data;
resp.size = sizeof(mixart_msg_data);
err = get_msg(mgr, &resp, addr);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "tasklet: error(%d) reading mf %x\n", err, msg);
break;
}
@@ -387,7 +387,7 @@ void snd_mixart_msg_tasklet(unsigned long arg)
case MSG_STREAM_START_OUTPUT_STAGE_PACKET:
case MSG_STREAM_STOP_INPUT_STAGE_PACKET:
case MSG_STREAM_STOP_OUTPUT_STAGE_PACKET:
- if(mixart_msg_data[0])
+ if (mixart_msg_data[0])
snd_printk(KERN_ERR "tasklet : error MSG_STREAM_ST***_***PUT_STAGE_PACKET status=%x\n", mixart_msg_data[0]);
break;
default:
@@ -425,7 +425,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
spin_lock(&mgr->lock);
it_reg = readl_le(MIXART_REG(mgr, MIXART_PCI_OMISR_OFFSET));
- if( !(it_reg & MIXART_OIDI) ) {
+ if (!(it_reg & MIXART_OIDI)) {
/* this device did not cause the interrupt */
spin_unlock(&mgr->lock);
return IRQ_NONE;
@@ -439,7 +439,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
writel(it_reg, MIXART_REG(mgr, MIXART_PCI_ODBR_OFFSET));
/* clear interrupt */
- writel_le( MIXART_OIDI, MIXART_REG(mgr, MIXART_PCI_OMISR_OFFSET) );
+ writel_le( MIXART_OIDI, MIXART_REG(mgr, MIXART_PCI_OMISR_OFFSET));
/* process interrupt */
while (retrieve_msg_frame(mgr, &msg)) {
@@ -450,17 +450,17 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
resp.data = mixart_msg_data;
resp.size = sizeof(mixart_msg_data);
err = get_msg(mgr, &resp, msg & ~MSG_TYPE_MASK);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "interrupt: error(%d) reading mf %x\n", err, msg);
break;
}
- if(resp.message_id == MSG_SERVICES_TIMER_NOTIFY) {
+ if (resp.message_id == MSG_SERVICES_TIMER_NOTIFY) {
int i;
struct mixart_timer_notify *notify;
notify = (struct mixart_timer_notify *)mixart_msg_data;
- for(i=0; i<notify->stream_count; i++) {
+ for (i = 0; i < notify->stream_count; i++) {
u32 buffer_id = notify->streams[i].buffer_id;
unsigned int chip_number = (buffer_id & MIXART_NOTIFY_CARD_MASK) >> MIXART_NOTIFY_CARD_OFFSET; /* card0 to 3 */
@@ -503,9 +503,9 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
stream->abs_period_elapsed = new_elapse_pos;
}
}
- stream->buf_period_frag = (u32)( sample_count - stream->abs_period_elapsed );
+ stream->buf_period_frag = (u32)(sample_count - stream->abs_period_elapsed);
- if(elapsed) {
+ if (elapsed) {
spin_unlock(&mgr->lock);
snd_pcm_period_elapsed(stream->substream);
spin_lock(&mgr->lock);
@@ -514,12 +514,12 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
}
break;
}
- if(resp.message_id == MSG_SERVICES_REPORT_TRACES) {
- if(resp.size > 1) {
+ if (resp.message_id == MSG_SERVICES_REPORT_TRACES) {
+ if (resp.size > 1) {
#ifndef __BIG_ENDIAN
/* Traces are text: the swapped msg_data has to be swapped back ! */
int i;
- for(i=0; i<(resp.size/4); i++) {
+ for (i = 0; i < (resp.size/4); i++) {
(mixart_msg_data)[i] = cpu_to_be32((mixart_msg_data)[i]);
}
#endif
@@ -533,7 +533,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
break;
case MSG_TYPE_NOTIFY:
- if(msg & MSG_CANCEL_NOTIFY_MASK) {
+ if (msg & MSG_CANCEL_NOTIFY_MASK) {
msg &= ~MSG_CANCEL_NOTIFY_MASK;
snd_printk(KERN_ERR "canceled notification %x !\n", msg);
}
@@ -541,7 +541,7 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
case MSG_TYPE_ANSWER:
/* answer or notification to a message we are waiting for*/
spin_lock(&mgr->msg_lock);
- if( (msg & ~MSG_TYPE_MASK) == mgr->pending_event ) {
+ if ((msg & ~MSG_TYPE_MASK) == mgr->pending_event) {
wake_up(&mgr->msg_sleep);
mgr->pending_event = 0;
}
@@ -573,11 +573,11 @@ irqreturn_t snd_mixart_interrupt(int irq, void *dev_id)
void snd_mixart_init_mailbox(struct mixart_mgr *mgr)
{
- writel( 0, MIXART_MEM( mgr, MSG_HOST_RSC_PROTECTION ) );
- writel( 0, MIXART_MEM( mgr, MSG_AGENT_RSC_PROTECTION ) );
+ writel( 0, MIXART_MEM( mgr, MSG_HOST_RSC_PROTECTION ));
+ writel( 0, MIXART_MEM( mgr, MSG_AGENT_RSC_PROTECTION ));
/* allow outbound messagebox to generate interrupts */
- if(mgr->irq >= 0) {
+ if (mgr->irq >= 0) {
writel_le( MIXART_ALLOW_OUTBOUND_DOORBELL, MIXART_REG( mgr, MIXART_PCI_OMIMR_OFFSET));
}
return;
@@ -593,6 +593,6 @@ void snd_mixart_exit_mailbox(struct mixart_mgr *mgr)
void snd_mixart_reset_board(struct mixart_mgr *mgr)
{
/* reset miXart */
- writel_be( 1, MIXART_REG(mgr, MIXART_BA1_BRUTAL_RESET_OFFSET) );
+ writel_be( 1, MIXART_REG(mgr, MIXART_BA1_BRUTAL_RESET_OFFSET));
return;
}
diff --git a/sound/pci/mixart/mixart_hwdep.c b/sound/pci/mixart/mixart_hwdep.c
index 3782b52..18639aa 100644
--- a/sound/pci/mixart/mixart_hwdep.c
+++ b/sound/pci/mixart/mixart_hwdep.c
@@ -24,7 +24,7 @@
#include <linux/pci.h>
#include <linux/firmware.h>
#include <linux/vmalloc.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include "mixart.h"
#include "mixart_mixer.h"
@@ -53,20 +53,20 @@ static int mixart_wait_nice_for_register_value(struct mixart_mgr *mgr,
cond_resched();
read = readl_be( MIXART_MEM( mgr, offset ));
- if(is_egal) {
- if(read == value) return 0;
+ if (is_egal) {
+ if (read == value) return 0;
}
else { /* wait for different value */
- if(read != value) return 0;
+ if (read != value) return 0;
}
- } while ( time_after_eq(end_time, jiffies) );
+ } while ( time_after_eq(end_time, jiffies));
return -EBUSY;
}
/*
- structures needed to upload elf code packets
+ structures needed to upload elf code packets
*/
struct snd_mixart_elf32_ehdr {
u8 e_ident[16];
@@ -96,27 +96,27 @@ struct snd_mixart_elf32_phdr {
u32 p_align;
};
-static int mixart_load_elf(struct mixart_mgr *mgr, const struct firmware *dsp )
+static int mixart_load_elf(struct mixart_mgr *mgr, const struct firmware *dsp)
{
char elf32_magic_number[4] = {0x7f,'E','L','F'};
struct snd_mixart_elf32_ehdr *elf_header;
int i;
elf_header = (struct snd_mixart_elf32_ehdr *)dsp->data;
- for( i=0; i<4; i++ )
- if ( elf32_magic_number[i] != elf_header->e_ident[i] )
+ for (i = 0; i < 4; i++)
+ if (elf32_magic_number[i] != elf_header->e_ident[i])
return -EINVAL;
- if( elf_header->e_phoff != 0 ) {
+ if (elf_header->e_phoff != 0) {
struct snd_mixart_elf32_phdr elf_programheader;
- for( i=0; i < be16_to_cpu(elf_header->e_phnum); i++ ) {
+ for (i = 0; i < be16_to_cpu(elf_header->e_phnum); i++) {
u32 pos = be32_to_cpu(elf_header->e_phoff) + (u32)(i * be16_to_cpu(elf_header->e_phentsize));
- memcpy( &elf_programheader, dsp->data + pos, sizeof(elf_programheader) );
+ memcpy( &elf_programheader, dsp->data + pos, sizeof(elf_programheader));
- if(elf_programheader.p_type != 0) {
- if( elf_programheader.p_filesz != 0 ) {
+ if (elf_programheader.p_type != 0) {
+ if (elf_programheader.p_filesz != 0) {
memcpy_toio( MIXART_MEM( mgr, be32_to_cpu(elf_programheader.p_vaddr)),
dsp->data + be32_to_cpu( elf_programheader.p_offset ),
be32_to_cpu( elf_programheader.p_filesz ));
@@ -147,7 +147,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
connector = kmalloc(sizeof(*connector), GFP_KERNEL);
audio_info_req = kmalloc(sizeof(*audio_info_req), GFP_KERNEL);
audio_info = kmalloc(sizeof(*audio_info), GFP_KERNEL);
- if (! connector || ! audio_info_req || ! audio_info) {
+ if (!connector || !audio_info_req || !audio_info) {
err = -ENOMEM;
goto __error;
}
@@ -162,21 +162,21 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
request.size = 0;
err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector);
- if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
+ if ((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PLAY_CONNECTOR\n");
err = -EINVAL;
goto __error;
}
- for(k=0; k < connector->uid_count; k++) {
+ for (k=0; k < connector->uid_count; k++) {
struct mixart_pipe *pipe;
- if(k < MIXART_FIRST_DIG_AUDIO_ID) {
+ if (k < MIXART_FIRST_DIG_AUDIO_ID) {
pipe = &mgr->chip[k/2]->pipe_out_ana;
} else {
pipe = &mgr->chip[(k-MIXART_FIRST_DIG_AUDIO_ID)/2]->pipe_out_dig;
}
- if(k & 1) {
+ if (k & 1) {
pipe->uid_right_connector = connector->uid[k]; /* odd */
} else {
pipe->uid_left_connector = connector->uid[k]; /* even */
@@ -191,7 +191,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
request.size = sizeof(*audio_info_req);
err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n");
goto __error;
}
@@ -204,21 +204,21 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
request.size = 0;
err = snd_mixart_send_msg(mgr, &request, sizeof(*connector), connector);
- if((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
+ if ((err < 0) || (connector->error_code) || (connector->uid_count > MIXART_MAX_PHYS_CONNECTORS)) {
snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_RECORD_CONNECTOR\n");
err = -EINVAL;
goto __error;
}
- for(k=0; k < connector->uid_count; k++) {
+ for (k=0; k < connector->uid_count; k++) {
struct mixart_pipe *pipe;
- if(k < MIXART_FIRST_DIG_AUDIO_ID) {
+ if (k < MIXART_FIRST_DIG_AUDIO_ID) {
pipe = &mgr->chip[k/2]->pipe_in_ana;
} else {
pipe = &mgr->chip[(k-MIXART_FIRST_DIG_AUDIO_ID)/2]->pipe_in_dig;
}
- if(k & 1) {
+ if (k & 1) {
pipe->uid_right_connector = connector->uid[k]; /* odd */
} else {
pipe->uid_left_connector = connector->uid[k]; /* even */
@@ -233,7 +233,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
request.size = sizeof(*audio_info_req);
err = snd_mixart_send_msg(mgr, &request, sizeof(*audio_info), audio_info);
- if( err < 0 ) {
+ if (err < 0) {
snd_printk(KERN_ERR "error MSG_CONNECTOR_GET_AUDIO_INFO\n");
goto __error;
}
@@ -241,7 +241,7 @@ static int mixart_enum_connectors(struct mixart_mgr *mgr)
}
err = 0;
- __error:
+__error:
kfree(connector);
kfree(audio_info_req);
kfree(audio_info);
@@ -269,7 +269,7 @@ static int mixart_enum_physio(struct mixart_mgr *mgr)
err = snd_mixart_send_msg(mgr, &request, sizeof(console_mgr), &console_mgr);
- if( (err < 0) || (console_mgr.error_code != 0) ) {
+ if ((err < 0) || (console_mgr.error_code != 0)) {
snd_printk(KERN_DEBUG "error MSG_CONSOLE_GET_CLOCK_UID : err=%x\n", console_mgr.error_code);
return -EINVAL;
}
@@ -283,8 +283,8 @@ static int mixart_enum_physio(struct mixart_mgr *mgr)
request.size = sizeof(console_mgr.uid);
err = snd_mixart_send_msg(mgr, &request, sizeof(phys_io), &phys_io);
- if( (err < 0) || ( phys_io.error_code != 0 ) ) {
- snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n", err, phys_io.error_code );
+ if ((err < 0) || ( phys_io.error_code != 0 )) {
+ snd_printk(KERN_ERR "error MSG_SYSTEM_ENUM_PHYSICAL_IO err(%x) error_code(%x)\n", err, phys_io.error_code);
return -EINVAL;
}
@@ -292,9 +292,9 @@ static int mixart_enum_physio(struct mixart_mgr *mgr)
if (phys_io.nb_uid < MIXART_MAX_CARDS * 2)
return -EINVAL;
- for(k=0; k<mgr->num_cards; k++) {
+ for (k=0; k<mgr->num_cards; k++) {
mgr->chip[k]->uid_in_analog_physio = phys_io.uid[k];
- mgr->chip[k]->uid_out_analog_physio = phys_io.uid[phys_io.nb_uid/2 + k];
+ mgr->chip[k]->uid_out_analog_physio = phys_io.uid[phys_io.nb_uid/2 + k];
}
return 0;
@@ -307,9 +307,9 @@ static int mixart_first_init(struct mixart_mgr *mgr)
int err;
struct mixart_msg request;
- if((err = mixart_enum_connectors(mgr)) < 0) return err;
+ if ((err = mixart_enum_connectors(mgr)) < 0) return err;
- if((err = mixart_enum_physio(mgr)) < 0) return err;
+ if ((err = mixart_enum_physio(mgr)) < 0) return err;
/* send a synchro command to card (necessary to do this before first MSG_STREAM_START_STREAM_GRP_PACKET) */
/* though why not here */
@@ -319,7 +319,7 @@ static int mixart_first_init(struct mixart_mgr *mgr)
request.size = 0;
/* this command has no data. response is a 32 bit status */
err = snd_mixart_send_msg(mgr, &request, sizeof(k), &k);
- if( (err < 0) || (k != 0) ) {
+ if ((err < 0) || (k != 0)) {
snd_printk(KERN_ERR "error MSG_SYSTEM_SEND_SYNCHRO_CMD\n");
return err == 0 ? -EINVAL : err;
}
@@ -345,22 +345,22 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
status_daught = readl_be( MIXART_MEM( mgr,MIXART_PSEUDOREG_DXLX_STATUS_OFFSET ));
/* motherboard xilinx status 5 will say that the board is performing a reset */
- if( status_xilinx == 5 ) {
- snd_printk( KERN_ERR "miXart is resetting !\n");
+ if (status_xilinx == 5) {
+ snd_printk(KERN_ERR "miXart is resetting !\n");
return -EAGAIN; /* try again later */
}
switch (index) {
case MIXART_MOTHERBOARD_XLX_INDEX:
- /* xilinx already loaded ? */
- if( status_xilinx == 4 ) {
- snd_printk( KERN_DEBUG "xilinx is already loaded !\n");
+ /* xilinx already loaded ? */
+ if (status_xilinx == 4) {
+ snd_printk(KERN_DEBUG "xilinx is already loaded !\n");
return 0;
}
/* the status should be 0 == "idle" */
- if( status_xilinx != 0 ) {
- snd_printk( KERN_ERR "xilinx load error ! status = %d\n", status_xilinx);
+ if (status_xilinx != 0) {
+ snd_printk(KERN_ERR "xilinx load error ! status = %d\n", status_xilinx);
return -EIO; /* modprob -r may help ? */
}
@@ -380,7 +380,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* copy xilinx code */
memcpy_toio( MIXART_MEM( mgr, MIXART_MOTHERBOARD_XLX_BASE_ADDRESS), dsp->data, dsp->size);
-
+
/* set xilinx status to copy finished */
writel_be( 2, MIXART_MEM( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET ));
@@ -389,33 +389,33 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
case MIXART_MOTHERBOARD_ELF_INDEX:
- if( status_elf == 4 ) {
- snd_printk( KERN_DEBUG "elf file already loaded !\n");
+ if (status_elf == 4) {
+ snd_printk(KERN_DEBUG "elf file already loaded !\n");
return 0;
}
/* the status should be 0 == "idle" */
- if( status_elf != 0 ) {
- snd_printk( KERN_ERR "elf load error ! status = %d\n", status_elf);
+ if (status_elf != 0) {
+ snd_printk(KERN_ERR "elf load error ! status = %d\n", status_elf);
return -EIO; /* modprob -r may help ? */
}
/* wait for xilinx status == 4 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_MXLX_STATUS_OFFSET, 1, 4, 500); /* 5sec */
if (err < 0) {
- snd_printk( KERN_ERR "xilinx was not loaded or could not be started\n");
+ snd_printk(KERN_ERR "xilinx was not loaded or could not be started\n");
return err;
}
/* init some data on the card */
- writel_be( 0, MIXART_MEM( mgr, MIXART_PSEUDOREG_BOARDNUMBER ) ); /* set miXart boardnumber to 0 */
- writel_be( 0, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR ) ); /* reset pointer to flow table on miXart */
+ writel_be( 0, MIXART_MEM( mgr, MIXART_PSEUDOREG_BOARDNUMBER )); /* set miXart boardnumber to 0 */
+ writel_be( 0, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR )); /* reset pointer to flow table on miXart */
/* set elf status to copying */
writel_be( 1, MIXART_MEM( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET ));
/* process the copying of the elf packets */
- err = mixart_load_elf( mgr, dsp );
+ err = mixart_load_elf( mgr, dsp);
if (err < 0) return err;
/* set elf status to copy finished */
@@ -424,12 +424,12 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for elf status == 4 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_ELF_STATUS_OFFSET, 1, 4, 300); /* 3sec */
if (err < 0) {
- snd_printk( KERN_ERR "elf could not be started\n");
+ snd_printk(KERN_ERR "elf could not be started\n");
return err;
}
/* miXart waits at this point on the pointer to the flow table */
- writel_be( (u32)mgr->flowinfo.addr, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR ) ); /* give pointer of flow table to miXart */
+ writel_be( (u32)mgr->flowinfo.addr, MIXART_MEM( mgr, MIXART_FLOWTABLE_PTR )); /* give pointer of flow table to miXart */
return 0; /* return, another xilinx file has to be loaded before */
@@ -437,15 +437,15 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
default:
/* elf and xilinx should be loaded */
- if( (status_elf != 4) || (status_xilinx != 4) ) {
- printk( KERN_ERR "xilinx or elf not successfully loaded\n");
+ if ((status_elf != 4) || (status_xilinx != 4)) {
+ printk(KERN_ERR "xilinx or elf not successfully loaded\n");
return -EIO; /* modprob -r may help ? */
}
/* wait for daughter detection != 0 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET, 0, 0, 30); /* 300msec */
if (err < 0) {
- snd_printk( KERN_ERR "error starting elf file\n");
+ snd_printk(KERN_ERR "error starting elf file\n");
return err;
}
@@ -455,16 +455,16 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
if (mgr->board_type == MIXART_DAUGHTER_TYPE_NONE)
break; /* no daughter board; the file does not have to be loaded, continue after the switch */
- /* only if aesebu daughter board presence (elf code must run) */
- if (mgr->board_type != MIXART_DAUGHTER_TYPE_AES )
+ /* only if aesebu daughter board presence (elf code must run) */
+ if (mgr->board_type != MIXART_DAUGHTER_TYPE_AES)
return -EINVAL;
/* daughter should be idle */
- if( status_daught != 0 ) {
- printk( KERN_ERR "daughter load error ! status = %d\n", status_daught);
+ if (status_daught != 0) {
+ printk(KERN_ERR "daughter load error ! status = %d\n", status_daught);
return -EIO; /* modprob -r may help ? */
}
-
+
/* check daughterboard xilinx validity */
if (((u32*)(dsp->data))[0] == 0xffffffff)
return -EINVAL;
@@ -480,7 +480,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for status == 2 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 2, 30); /* 300msec */
if (err < 0) {
- snd_printk( KERN_ERR "daughter board load error\n");
+ snd_printk(KERN_ERR "daughter board load error\n");
return err;
}
@@ -502,7 +502,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* wait for daughter status == 3 */
err = mixart_wait_nice_for_register_value( mgr, MIXART_PSEUDOREG_DXLX_STATUS_OFFSET, 1, 3, 300); /* 3sec */
if (err < 0) {
- snd_printk( KERN_ERR "daughter board could not be initialised\n");
+ snd_printk(KERN_ERR "daughter board could not be initialised\n");
return err;
}
@@ -512,7 +512,7 @@ static int mixart_dsp_load(struct mixart_mgr* mgr, int index, const struct firmw
/* first communication with embedded */
err = mixart_first_init(mgr);
if (err < 0) {
- snd_printk( KERN_ERR "miXart could not be set up\n");
+ snd_printk(KERN_ERR "miXart could not be set up\n");
return err;
}
@@ -615,7 +615,7 @@ static int mixart_hwdep_dsp_load(struct snd_hwdep *hw,
fw.size = dsp->length;
fw.data = vmalloc(dsp->length);
- if (! fw.data) {
+ if (!fw.data) {
snd_printk(KERN_ERR "miXart: cannot allocate image size %d\n",
(int)dsp->length);
return -ENOMEM;
diff --git a/sound/pci/mixart/mixart_hwdep.h b/sound/pci/mixart/mixart_hwdep.h
index a46f508..ce1f109 100644
--- a/sound/pci/mixart/mixart_hwdep.h
+++ b/sound/pci/mixart/mixart_hwdep.h
@@ -36,12 +36,12 @@
/* Daughter board Type */
-#define DAUGHTER_TYPE_MASK 0x0F
-#define DAUGHTER_VER_MASK 0xF0
+#define DAUGHTER_TYPE_MASK 0x0F
+#define DAUGHTER_VER_MASK 0xF0
#define DAUGHTER_TYPEVER_MASK (DAUGHTER_TYPE_MASK|DAUGHTER_VER_MASK)
-
-#define MIXART_DAUGHTER_TYPE_NONE 0x00
-#define MIXART_DAUGHTER_TYPE_COBRANET 0x08
+
+#define MIXART_DAUGHTER_TYPE_NONE 0x00
+#define MIXART_DAUGHTER_TYPE_COBRANET 0x08
#define MIXART_DAUGHTER_TYPE_AES 0x0E
@@ -63,28 +63,28 @@
#define MIXART_PSEUDOREG_PERF_INTERR_LOAD_OFFSET MIXART_PSEUDOREG+0x74 /* interrupt handling load */
/* motherboard xilinx loader info */
-#define MIXART_PSEUDOREG_MXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x9C /* 0x00600000 */
-#define MIXART_PSEUDOREG_MXLX_SIZE_OFFSET MIXART_PSEUDOREG+0xA0 /* xilinx size in bytes */
-#define MIXART_PSEUDOREG_MXLX_STATUS_OFFSET MIXART_PSEUDOREG+0xA4 /* status = EMBEBBED_STAT_XXX */
+#define MIXART_PSEUDOREG_MXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x9C /* 0x00600000 */
+#define MIXART_PSEUDOREG_MXLX_SIZE_OFFSET MIXART_PSEUDOREG+0xA0 /* xilinx size in bytes */
+#define MIXART_PSEUDOREG_MXLX_STATUS_OFFSET MIXART_PSEUDOREG+0xA4 /* status = EMBEBBED_STAT_XXX */
/* elf loader info */
-#define MIXART_PSEUDOREG_ELF_STATUS_OFFSET MIXART_PSEUDOREG+0xB0 /* status = EMBEBBED_STAT_XXX */
+#define MIXART_PSEUDOREG_ELF_STATUS_OFFSET MIXART_PSEUDOREG+0xB0 /* status = EMBEBBED_STAT_XXX */
-/*
+/*
* after the elf code is loaded, and the flowtable info was passed to it,
* the driver polls on this address, until it shows 1 (presence) or 2 (absence)
* once it is non-zero, the daughter board type may be read
*/
-#define MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET MIXART_PSEUDOREG+0x990
+#define MIXART_PSEUDOREG_DBRD_PRESENCE_OFFSET MIXART_PSEUDOREG+0x990
/* Global info structure */
#define MIXART_PSEUDOREG_DBRD_TYPE_OFFSET MIXART_PSEUDOREG+0x994 /* Type and version of daughterboard */
/* daughterboard xilinx loader info */
-#define MIXART_PSEUDOREG_DXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x998 /* get the address here where to write the file */
-#define MIXART_PSEUDOREG_DXLX_SIZE_OFFSET MIXART_PSEUDOREG+0x99C /* xilinx size in bytes */
-#define MIXART_PSEUDOREG_DXLX_STATUS_OFFSET MIXART_PSEUDOREG+0x9A0 /* status = EMBEBBED_STAT_XXX */
+#define MIXART_PSEUDOREG_DXLX_BASE_ADDR_OFFSET MIXART_PSEUDOREG+0x998 /* get the address here where to write the file */
+#define MIXART_PSEUDOREG_DXLX_SIZE_OFFSET MIXART_PSEUDOREG+0x99C /* xilinx size in bytes */
+#define MIXART_PSEUDOREG_DXLX_STATUS_OFFSET MIXART_PSEUDOREG+0x9A0 /* status = EMBEBBED_STAT_XXX */
/* */
#define MIXART_FLOWTABLE_PTR 0x3000 /* pointer to flow table */
diff --git a/sound/pci/mixart/mixart_mixer.c b/sound/pci/mixart/mixart_mixer.c
index 3ba6174..388c257 100644
--- a/sound/pci/mixart/mixart_mixer.c
+++ b/sound/pci/mixart/mixart_mixer.c
@@ -310,25 +310,25 @@ static int mixart_update_analog_audio_level(struct snd_mixart* chip, int is_capt
memset(&io_level, 0, sizeof(io_level));
io_level.channel = -1; /* left and right */
- for(i=0; i<2; i++) {
- if(is_capture) {
+ for (i = 0; i < 2; i++) {
+ if (is_capture) {
io_level.level[i].analog_level = mixart_analog_level[chip->analog_capture_volume[i]];
} else {
- if(chip->analog_playback_active[i])
+ if (chip->analog_playback_active[i])
io_level.level[i].analog_level = mixart_analog_level[chip->analog_playback_volume[i]];
else
io_level.level[i].analog_level = mixart_analog_level[MIXART_ANALOG_PLAYBACK_LEVEL_MIN];
}
}
- if(is_capture) request.uid = chip->uid_in_analog_physio;
+ if (is_capture) request.uid = chip->uid_in_analog_physio;
else request.uid = chip->uid_out_analog_physio;
request.message_id = MSG_PHYSICALIO_SET_LEVEL;
request.data = &io_level;
request.size = sizeof(io_level);
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
- if((err<0) || (resp.error_code)) {
+ if ((err<0) || (resp.error_code)) {
snd_printk(KERN_DEBUG "error MSG_PHYSICALIO_SET_LEVEL card(%d) is_capture(%d) error_code(%x)\n", chip->chip_idx, is_capture, resp.error_code);
return -EINVAL;
}
@@ -342,7 +342,7 @@ static int mixart_analog_vol_info(struct snd_kcontrol *kcontrol, struct snd_ctl_
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
- if(kcontrol->private_value == 0) { /* playback */
+ if (kcontrol->private_value == 0) { /* playback */
uinfo->value.integer.min = MIXART_ANALOG_PLAYBACK_LEVEL_MIN; /* -96 dB */
uinfo->value.integer.max = MIXART_ANALOG_PLAYBACK_LEVEL_MAX; /* 0 dB */
} else { /* capture */
@@ -356,7 +356,7 @@ static int mixart_analog_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_e
{
struct snd_mixart *chip = snd_kcontrol_chip(kcontrol);
mutex_lock(&chip->mgr->mixer_mutex);
- if(kcontrol->private_value == 0) { /* playback */
+ if (kcontrol->private_value == 0) { /* playback */
ucontrol->value.integer.value[0] = chip->analog_playback_volume[0];
ucontrol->value.integer.value[1] = chip->analog_playback_volume[1];
} else { /* capture */
@@ -731,7 +731,7 @@ int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int
set_level.nb_of_stream = 1;
set_level.stream_level.desc.stream_idx = idx;
- if(is_aes) {
+ if (is_aes) {
pipe = &chip->pipe_out_dig; /* AES playback */
idx += MIXART_PLAYBACK_STREAMS;
} else {
@@ -739,13 +739,13 @@ int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int
}
/* only when pipe exists ! */
- if(pipe->status == PIPE_UNDEFINED)
+ if (pipe->status == PIPE_UNDEFINED)
return 0;
set_level.stream_level.desc.uid_pipe = pipe->group_uid;
- for(i=0; i<2; i++) {
- if(chip->digital_playback_active[idx][i])
+ for (i = 0; i < 2; i++) {
+ if (chip->digital_playback_active[idx][i])
volume[i] = chip->digital_playback_volume[idx][i];
else
volume[i] = MIXART_DIGITAL_LEVEL_MIN;
@@ -761,7 +761,7 @@ int mixart_update_playback_stream_level(struct snd_mixart* chip, int is_aes, int
request.size = sizeof(set_level);
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status);
- if((err<0) || status) {
+ if ((err<0) || status) {
snd_printk(KERN_DEBUG "error MSG_STREAM_SET_OUT_STREAM_LEVEL card(%d) status(%x)\n", chip->chip_idx, status);
return -EINVAL;
}
@@ -776,7 +776,7 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
struct mixart_set_in_audio_level_req set_level;
u32 status;
- if(is_aes) {
+ if (is_aes) {
idx = 1;
pipe = &chip->pipe_in_dig;
} else {
@@ -785,7 +785,7 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
}
/* only when pipe exists ! */
- if(pipe->status == PIPE_UNDEFINED)
+ if (pipe->status == PIPE_UNDEFINED)
return 0;
memset(&set_level, 0, sizeof(set_level));
@@ -793,7 +793,7 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
set_level.level[0].connector = pipe->uid_left_connector;
set_level.level[1].connector = pipe->uid_right_connector;
- for(i=0; i<2; i++) {
+ for (i = 0; i < 2; i++) {
set_level.level[i].valid_mask1 = MIXART_AUDIO_LEVEL_DIGITAL_MASK;
set_level.level[i].digital_level = mixart_digital_level[chip->digital_capture_volume[idx][i]];
}
@@ -804,7 +804,7 @@ int mixart_update_capture_stream_level(struct snd_mixart* chip, int is_aes)
request.size = sizeof(set_level);
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(status), &status);
- if((err<0) || status) {
+ if ((err<0) || status) {
snd_printk(KERN_DEBUG "error MSG_STREAM_SET_IN_AUDIO_LEVEL card(%d) status(%x)\n", chip->chip_idx, status);
return -EINVAL;
}
@@ -833,12 +833,12 @@ static int mixart_pcm_vol_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
int is_capture = kcontrol->private_value & MIXART_VOL_REC_MASK;
int is_aes = kcontrol->private_value & MIXART_VOL_AES_MASK;
mutex_lock(&chip->mgr->mixer_mutex);
- if(is_capture) {
- if(is_aes) stored_volume = chip->digital_capture_volume[1]; /* AES capture */
+ if (is_capture) {
+ if (is_aes) stored_volume = chip->digital_capture_volume[1]; /* AES capture */
else stored_volume = chip->digital_capture_volume[0]; /* analog capture */
} else {
snd_BUG_ON(idx >= MIXART_PLAYBACK_STREAMS);
- if(is_aes) stored_volume = chip->digital_playback_volume[MIXART_PLAYBACK_STREAMS + idx]; /* AES playback */
+ if (is_aes) stored_volume = chip->digital_playback_volume[MIXART_PLAYBACK_STREAMS + idx]; /* AES playback */
else stored_volume = chip->digital_playback_volume[idx]; /* analog playback */
}
ucontrol->value.integer.value[0] = stored_volume[0];
@@ -911,7 +911,7 @@ static int mixart_pcm_sw_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_
int idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); /* index */
snd_BUG_ON(idx >= MIXART_PLAYBACK_STREAMS);
mutex_lock(&chip->mgr->mixer_mutex);
- if(kcontrol->private_value & MIXART_VOL_AES_MASK) /* AES playback */
+ if (kcontrol->private_value & MIXART_VOL_AES_MASK) /* AES playback */
idx += MIXART_PLAYBACK_STREAMS;
ucontrol->value.integer.value[0] = chip->digital_playback_active[idx][0];
ucontrol->value.integer.value[1] = chip->digital_playback_active[idx][1];
@@ -961,10 +961,10 @@ static int mixart_update_monitoring(struct snd_mixart* chip, int channel)
struct mixart_set_out_audio_level audio_level;
u32 resp;
- if(chip->pipe_out_ana.status == PIPE_UNDEFINED)
+ if (chip->pipe_out_ana.status == PIPE_UNDEFINED)
return -EINVAL; /* no pipe defined */
- if(!channel) request.uid = chip->pipe_out_ana.uid_left_connector;
+ if (!channel) request.uid = chip->pipe_out_ana.uid_left_connector;
else request.uid = chip->pipe_out_ana.uid_right_connector;
request.message_id = MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL;
request.data = &audio_level;
@@ -976,7 +976,7 @@ static int mixart_update_monitoring(struct snd_mixart* chip, int channel)
audio_level.monitor_mute1 = !chip->monitoring_active[channel!=0];
err = snd_mixart_send_msg(chip->mgr, &request, sizeof(resp), &resp);
- if((err<0) || resp) {
+ if ((err<0) || resp) {
snd_printk(KERN_DEBUG "error MSG_CONNECTOR_SET_OUT_AUDIO_LEVEL card(%d) resp(%x)\n", chip->chip_idx, resp);
return -EINVAL;
}
@@ -1097,7 +1097,7 @@ static void mixart_reset_audio_levels(struct snd_mixart *chip)
/* analog volumes can be set even if there is no pipe */
mixart_update_analog_audio_level(chip, 0);
/* analog levels for capture only on the first two chips */
- if(chip->chip_idx < 2) {
+ if (chip->chip_idx < 2) {
mixart_update_analog_audio_level(chip, 1);
}
return;
@@ -1111,7 +1111,7 @@ int snd_mixart_create_mixer(struct mixart_mgr *mgr)
mutex_init(&mgr->mixer_mutex); /* can be in another place */
- for(i=0; i<mgr->num_cards; i++) {
+ for (i = 0; i < mgr->num_cards; i++) {
struct snd_kcontrol_new temp;
chip = mgr->chip[i];
@@ -1126,7 +1126,7 @@ int snd_mixart_create_mixer(struct mixart_mgr *mgr)
return err;
/* analog input level control only on first two chips !*/
- if(i<2) {
+ if (i<2) {
temp = mixart_control_analog_level;
temp.name = "Master Capture Volume";
temp.private_value = 1; /* capture */
@@ -1147,7 +1147,7 @@ int snd_mixart_create_mixer(struct mixart_mgr *mgr)
if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&temp, chip))) < 0)
return err;
- if(mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
+ if (mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
temp.name = "AES Playback Volume";
temp.count = MIXART_PLAYBACK_STREAMS;
temp.private_value = MIXART_VOL_AES_MASK; /* playback AES/EBU */
@@ -1166,7 +1166,7 @@ int snd_mixart_create_mixer(struct mixart_mgr *mgr)
if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&temp, chip))) < 0)
return err;
- if(mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
+ if (mgr->board_type == MIXART_DAUGHTER_TYPE_AES) {
temp.name = "AES Playback Switch";
temp.private_value = MIXART_VOL_AES_MASK; /* playback AES/EBU */
if ((err = snd_ctl_add(chip->card, snd_ctl_new1(&temp, chip))) < 0)
1
0

[alsa-devel] [PATCH 14/24] sound/pci: coding style fixes: maestro3
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/maestro3.c | 130 +++++++++++++++++++++++++-------------------------
1 files changed, 65 insertions(+), 65 deletions(-)
diff --git a/sound/pci/maestro3.c b/sound/pci/maestro3.c
index 9ff3f9e..0aae83b 100644
--- a/sound/pci/maestro3.c
+++ b/sound/pci/maestro3.c
@@ -27,11 +27,11 @@
* - Added Canyon3D-2 support by Rob Riggs <rob(a)pangalactic.org>
*
*/
-
+
#define CARD_NAME "ESS Maestro3/Allegro/Canyon3D-2"
#define DRIVER_NAME "Maestro3"
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -569,7 +569,7 @@ MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)");
#define KDATA_ADC2_LEFT_SUR_VOL (KDATA_BASE_ADDR + 0x0045)
#define KDATA_ADC2_RIGHT_SUR_VOL (KDATA_BASE_ADDR + 0x0046)
-#define KDATA_CD_XFER0 (KDATA_BASE_ADDR + 0x0047)
+#define KDATA_CD_XFER0 (KDATA_BASE_ADDR + 0x0047)
#define KDATA_CD_XFER_ENDMARK (KDATA_BASE_ADDR + 0x0048)
#define KDATA_CD_LEFT_VOLUME (KDATA_BASE_ADDR + 0x0049)
#define KDATA_CD_RIGHT_VOLUME (KDATA_BASE_ADDR + 0x004A)
@@ -727,9 +727,9 @@ MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)");
#define SRC3_TEMP_INBUF_ADDR_OFFSET (CDATA_HEADER_LEN + 16)
#define SRC3_TEMP_OUTBUF_ADDR_OFFSET (CDATA_HEADER_LEN + 17)
-#define MINISRC_IN_BUFFER_SIZE ( 0x50 * 2 )
+#define MINISRC_IN_BUFFER_SIZE ( 0x50 * 2)
#define MINISRC_OUT_BUFFER_SIZE ( 0x50 * 2 * 2)
-#define MINISRC_TMP_BUFFER_SIZE ( 112 + ( MINISRC_BIQUAD_STAGE * 3 + 4 ) * 2 * 2 )
+#define MINISRC_TMP_BUFFER_SIZE ( 112 + ( MINISRC_BIQUAD_STAGE * 3 + 4 ) * 2 * 2)
#define MINISRC_BIQUAD_STAGE 2
#define MINISRC_COEF_LOC 0x175
@@ -762,10 +762,10 @@ MODULE_PARM_DESC(amp_gpio, "GPIO pin number for external amp. (default = -1)");
/*
* an arbitrary volume we set the internal
* volume settings to so that the ac97 volume
- * range is a little less insane. 0x7fff is
+ * range is a little less insane. 0x7fff is
* max.
*/
-#define ARB_VOLUME ( 0x6800 )
+#define ARB_VOLUME ( 0x6800)
/*
*/
@@ -798,13 +798,13 @@ struct m3_dma {
struct m3_list *index_list[3];
int in_lists;
-
+
struct list_head list;
};
-
+
struct snd_m3 {
-
+
struct snd_card *card;
unsigned long iobase;
@@ -1077,7 +1077,7 @@ static void snd_m3_remove_list(struct snd_m3 *chip, struct m3_list *list, int in
static void snd_m3_inc_timer_users(struct snd_m3 *chip)
{
chip->timer_users++;
- if (chip->timer_users != 1)
+ if (chip->timer_users != 1)
return;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
@@ -1096,7 +1096,7 @@ static void snd_m3_inc_timer_users(struct snd_m3 *chip)
static void snd_m3_dec_timer_users(struct snd_m3 *chip)
{
chip->timer_users--;
- if (chip->timer_users > 0)
+ if (chip->timer_users > 0)
return;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
@@ -1120,7 +1120,7 @@ static void snd_m3_dec_timer_users(struct snd_m3 *chip)
static int snd_m3_pcm_start(struct snd_m3 *chip, struct m3_dma *s,
struct snd_pcm_substream *subs)
{
- if (! s || ! subs)
+ if (!s || !subs)
return -EINVAL;
snd_m3_inc_timer_users(chip);
@@ -1147,7 +1147,7 @@ static int snd_m3_pcm_start(struct snd_m3 *chip, struct m3_dma *s,
static int snd_m3_pcm_stop(struct snd_m3 *chip, struct m3_dma *s,
struct snd_pcm_substream *subs)
{
- if (! s || ! subs)
+ if (!s || !subs)
return -EINVAL;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
@@ -1157,7 +1157,7 @@ static int snd_m3_pcm_stop(struct snd_m3 *chip, struct m3_dma *s,
case SNDRV_PCM_STREAM_PLAYBACK:
chip->dacs_active--;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
- KDATA_MIXER_TASK_NUMBER,
+ KDATA_MIXER_TASK_NUMBER,
chip->dacs_active);
break;
case SNDRV_PCM_STREAM_CAPTURE:
@@ -1191,7 +1191,7 @@ snd_m3_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
- if (! s->running)
+ if (!s->running)
err = 0; /* should return error? */
else {
s->running = 0;
@@ -1206,7 +1206,7 @@ snd_m3_pcm_trigger(struct snd_pcm_substream *subs, int cmd)
/*
* setup
*/
-static void
+static void
snd_m3_pcm_setup1(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substream *subs)
{
int dsp_in_size, dsp_out_size, dsp_in_buffer, dsp_out_buffer;
@@ -1270,7 +1270,7 @@ snd_m3_pcm_setup1(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_substrea
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + CDATA_IN_BUF_HEAD,
dsp_in_buffer);
-
+
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + CDATA_IN_BUF_TAIL,
dsp_in_buffer);
@@ -1297,10 +1297,10 @@ static void snd_m3_pcm_setup2(struct snd_m3 *chip, struct m3_dma *s,
{
u32 freq;
- /*
+ /*
* put us in the lists if we're not already there
*/
- if (! s->in_lists) {
+ if (!s->in_lists) {
s->index[0] = snd_m3_add_list(chip, s->index_list[0],
s->inst.data >> DP_SHIFT_COUNT);
s->index[1] = snd_m3_add_list(chip, s->index_list[1],
@@ -1312,16 +1312,16 @@ static void snd_m3_pcm_setup2(struct snd_m3 *chip, struct m3_dma *s,
/* write to 'mono' word */
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
- s->inst.data + SRC3_DIRECTION_OFFSET + 1,
+ s->inst.data + SRC3_DIRECTION_OFFSET + 1,
runtime->channels == 2 ? 0 : 1);
/* write to '8bit' word */
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
- s->inst.data + SRC3_DIRECTION_OFFSET + 2,
+ s->inst.data + SRC3_DIRECTION_OFFSET + 2,
snd_pcm_format_width(runtime->format) == 16 ? 0 : 1);
/* set up dac/adc rate */
freq = ((runtime->rate << 15) + 24000 ) / 48000;
- if (freq)
+ if (freq)
freq--;
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
@@ -1380,7 +1380,7 @@ snd_m3_playback_setup(struct snd_m3 *chip, struct m3_dma *s,
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + SRC3_DIRECTION_OFFSET + 22,
subs->runtime->rate > 45000 ? 0xff : 0);
-
+
/* tell it which way dma is going? */
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + CDATA_DMA_CONTROL,
@@ -1389,13 +1389,13 @@ snd_m3_playback_setup(struct snd_m3 *chip, struct m3_dma *s,
/*
* set an armload of static initializers
*/
- for (i = 0; i < ARRAY_SIZE(pv); i++)
+ for (i = 0; i < ARRAY_SIZE(pv); i++)
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + pv[i].addr, pv[i].val);
}
/*
- * Native record driver
+ * Native record driver
*/
static const struct rec_vals {
u16 addr, val;
@@ -1441,13 +1441,13 @@ snd_m3_capture_setup(struct snd_m3 *chip, struct m3_dma *s, struct snd_pcm_subst
/* tell it which way dma is going? */
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + CDATA_DMA_CONTROL,
- DMACONTROL_DIRECTION + DMACONTROL_AUTOREPEAT +
+ DMACONTROL_DIRECTION + DMACONTROL_AUTOREPEAT +
DMAC_PAGE3_SELECTOR + DMAC_BLOCKF_SELECTOR);
/*
* set an armload of static initializers
*/
- for (i = 0; i < ARRAY_SIZE(rv); i++)
+ for (i = 0; i < ARRAY_SIZE(rv); i++)
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
s->inst.data + rv[i].addr, rv[i].val);
}
@@ -1472,7 +1472,7 @@ static int snd_m3_pcm_hw_params(struct snd_pcm_substream *substream,
static int snd_m3_pcm_hw_free(struct snd_pcm_substream *substream)
{
struct m3_dma *s;
-
+
if (substream->runtime->private_data == NULL)
return 0;
s = substream->runtime->private_data;
@@ -1567,7 +1567,7 @@ static void snd_m3_update_ptr(struct snd_m3 *chip, struct m3_dma *s)
unsigned int hwptr;
int diff;
- if (! s->running)
+ if (!s->running)
return;
hwptr = snd_m3_get_pointer(chip, s, subs);
@@ -1764,7 +1764,7 @@ snd_m3_substream_open(struct snd_m3 *chip, struct snd_pcm_substream *subs)
spin_lock_irq(&chip->reg_lock);
for (i = 0; i < chip->num_substreams; i++) {
s = &chip->substreams[i];
- if (! s->opened)
+ if (!s->opened)
goto __found;
}
spin_unlock_irq(&chip->reg_lock);
@@ -1885,7 +1885,7 @@ static struct snd_pcm_ops snd_m3_capture_ops = {
};
static int __devinit
-snd_m3_pcm(struct snd_m3 * chip, int device)
+snd_m3_pcm(struct snd_m3 *chip, int device)
{
struct snd_pcm *pcm;
int err;
@@ -1902,7 +1902,7 @@ snd_m3_pcm(struct snd_m3 * chip, int device)
pcm->info_flags = 0;
strcpy(pcm->name, chip->card->driver);
chip->pcm = pcm;
-
+
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(chip->pci), 64*1024, 64*1024);
@@ -1923,7 +1923,7 @@ static int snd_m3_ac97_wait(struct snd_m3 *chip)
int i = 10000;
do {
- if (! (snd_m3_inb(chip, 0x30) & 1))
+ if (!(snd_m3_inb(chip, 0x30) & 1))
return 0;
cpu_relax();
} while (i-- > 0);
@@ -1979,8 +1979,8 @@ static void snd_m3_remote_codec_config(int io, int isremote)
io + SDO_IN_DEST_CTRL);
}
-/*
- * hack, returns non zero on err
+/*
+ * hack, returns non zero on err
*/
static int snd_m3_try_read_vendor(struct snd_m3 *chip)
{
@@ -2007,9 +2007,9 @@ static void snd_m3_ac97_reset(struct snd_m3 *chip)
if (chip->allegro_flag) {
/*
- * the onboard codec on the allegro seems
+ * the onboard codec on the allegro seems
* to want to wait a very long time before
- * coming back to life
+ * coming back to life
*/
delay1 = 50;
delay2 = 800;
@@ -2044,7 +2044,7 @@ static void snd_m3_ac97_reset(struct snd_m3 *chip)
schedule_timeout_uninterruptible(msecs_to_jiffies(delay2));
- if (! snd_m3_try_read_vendor(chip))
+ if (!snd_m3_try_read_vendor(chip))
break;
delay1 += 10;
@@ -2079,7 +2079,7 @@ static int __devinit snd_m3_mixer(struct snd_m3 *chip)
if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0)
return err;
-
+
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip;
if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97)) < 0)
@@ -2120,7 +2120,7 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
/* zero kernel data */
for (i = 0; i < (REV_B_DATA_MEMORY_UNIT_LENGTH * NUM_UNITS_KERNEL_DATA) / 2; i++)
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
KDATA_BASE_ADDR + i, 0);
/* zero mixer data? */
@@ -2135,8 +2135,8 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
/* write kernel into code memory.. */
data = (const u16 *)chip->assp_kernel_image->data;
- for (i = 0 ; i * 2 < chip->assp_kernel_image->size; i++) {
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
+ for (i = 0; i * 2 < chip->assp_kernel_image->size; i++) {
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
REV_B_CODE_MEMORY_BEGIN + i,
le16_to_cpu(data[i]));
}
@@ -2149,14 +2149,14 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
*/
data = (const u16 *)chip->assp_minisrc_image->data;
for (i = 0; i * 2 < chip->assp_minisrc_image->size; i++) {
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
0x400 + i, le16_to_cpu(data[i]));
}
/*
* write the coefficients for the low pass filter?
*/
- for (i = 0; i < MINISRC_LPF_LEN ; i++) {
+ for (i = 0; i < MINISRC_LPF_LEN; i++) {
snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE,
0x400 + MINISRC_COEF_LOC + i,
minisrc_lpf[i]);
@@ -2170,7 +2170,7 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
* the minisrc is the only thing on
* our task list..
*/
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
KDATA_TASK0,
0x400);
@@ -2206,14 +2206,14 @@ static void snd_m3_assp_init(struct snd_m3 *chip)
static int __devinit snd_m3_assp_client_init(struct snd_m3 *chip, struct m3_dma *s, int index)
{
- int data_bytes = 2 * ( MINISRC_TMP_BUFFER_SIZE / 2 +
+ int data_bytes = 2 * ( MINISRC_TMP_BUFFER_SIZE / 2 +
MINISRC_IN_BUFFER_SIZE / 2 +
- 1 + MINISRC_OUT_BUFFER_SIZE / 2 + 1 );
+ 1 + MINISRC_OUT_BUFFER_SIZE / 2 + 1);
int address, i;
/*
* the revb memory map has 0x1100 through 0x1c00
- * free.
+ * free.
*/
/*
@@ -2243,7 +2243,7 @@ static int __devinit snd_m3_assp_client_init(struct snd_m3 *chip, struct m3_dma
}
-/*
+/*
* this works for the reference board, have to find
* out about others
*
@@ -2255,7 +2255,7 @@ snd_m3_amp_enable(struct snd_m3 *chip, int enable)
int io = chip->iobase;
u16 gpo, polarity;
- if (! chip->external_amp)
+ if (!chip->external_amp)
return;
polarity = enable ? 0 : 1;
@@ -2323,10 +2323,10 @@ snd_m3_chip_init(struct snd_m3 *chip)
pci_read_config_dword(pcidev, PCI_ALLEGRO_CONFIG, &n);
n &= ~INT_CLK_SELECT;
if (!chip->allegro_flag) {
- n &= ~INT_CLK_MULT_ENABLE;
+ n &= ~INT_CLK_MULT_ENABLE;
n |= INT_CLK_SRC_NOT_PCI;
}
- n &= ~( CLK_MULT_MODE_SELECT | CLK_MULT_MODE_SELECT_2 );
+ n &= ~( CLK_MULT_MODE_SELECT | CLK_MULT_MODE_SELECT_2);
pci_write_config_dword(pcidev, PCI_ALLEGRO_CONFIG, n);
if (chip->allegro_flag) {
@@ -2338,11 +2338,11 @@ snd_m3_chip_init(struct snd_m3 *chip)
t = inb(chip->iobase + ASSP_CONTROL_A);
t &= ~( DSP_CLK_36MHZ_SELECT | ASSP_CLK_49MHZ_SELECT);
t |= ASSP_CLK_49MHZ_SELECT;
- t |= ASSP_0_WS_ENABLE;
+ t |= ASSP_0_WS_ENABLE;
outb(t, chip->iobase + ASSP_CONTROL_A);
snd_m3_assp_init(chip); /* download DSP code before starting ASSP below */
- outb(RUN_ASSP, chip->iobase + ASSP_CONTROL_B);
+ outb(RUN_ASSP, chip->iobase + ASSP_CONTROL_B);
outb(0x00, io + HARDWARE_VOL_CTRL);
outb(0x88, io + SHADOW_MIX_REG_VOICE);
@@ -2351,7 +2351,7 @@ snd_m3_chip_init(struct snd_m3 *chip)
outb(0x88, io + HW_VOL_COUNTER_MASTER);
return 0;
-}
+}
static void
snd_m3_enable_ints(struct snd_m3 *chip)
@@ -2437,7 +2437,7 @@ static int m3_suspend(struct pci_dev *pci, pm_message_t state)
for (i = REV_B_CODE_MEMORY_BEGIN; i <= REV_B_CODE_MEMORY_END; i++)
chip->suspend_mem[dsp_index++] =
snd_m3_assp_read(chip, MEMTYPE_INTERNAL_CODE, i);
- for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
+ for (i = REV_B_DATA_MEMORY_BEGIN; i <= REV_B_DATA_MEMORY_END; i++)
chip->suspend_mem[dsp_index++] =
snd_m3_assp_read(chip, MEMTYPE_INTERNAL_DATA, i);
@@ -2477,14 +2477,14 @@ static int m3_resume(struct pci_dev *pci)
/* restore dsp image */
dsp_index = 0;
for (i = REV_B_CODE_MEMORY_BEGIN; i <= REV_B_CODE_MEMORY_END; i++)
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE, i,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_CODE, i,
chip->suspend_mem[dsp_index++]);
- for (i = REV_B_DATA_MEMORY_BEGIN ; i <= REV_B_DATA_MEMORY_END; i++)
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA, i,
+ for (i = REV_B_DATA_MEMORY_BEGIN; i <= REV_B_DATA_MEMORY_END; i++)
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA, i,
chip->suspend_mem[dsp_index++]);
/* tell the dma engine to restart itself */
- snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
+ snd_m3_assp_write(chip, MEMTYPE_INTERNAL_DATA,
KDATA_DMA_ACTIVE, 0);
/* restore ac97 registers */
@@ -2614,7 +2614,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
return err;
}
chip->iobase = pci_resource_start(pci, 0);
-
+
/* just to be sure */
pci_set_master(pci);
@@ -2659,7 +2659,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
if ((err = snd_m3_pcm(chip, 0)) < 0)
return err;
-
+
snd_m3_enable_ints(chip);
snd_m3_assp_continue(chip);
@@ -2667,7 +2667,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
*chip_ret = chip;
- return 0;
+ return 0;
}
/*
@@ -2758,7 +2758,7 @@ static struct pci_driver driver = {
.resume = m3_resume,
#endif
};
-
+
static int __init alsa_card_m3_init(void)
{
return pci_register_driver(&driver);
1
0

[alsa-devel] [PATCH 13/24] sound/pci: coding style fixes: korg1212
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/korg1212/korg1212.c | 492 ++++++++++++++++++++--------------------
1 files changed, 246 insertions(+), 246 deletions(-)
diff --git a/sound/pci/korg1212/korg1212.c b/sound/pci/korg1212/korg1212.c
index 5f8006b..d4c7dd7 100644
--- a/sound/pci/korg1212/korg1212.c
+++ b/sound/pci/korg1212/korg1212.c
@@ -36,7 +36,7 @@
#include <sound/pcm_params.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
// ----------------------------------------------------------------------------
// Debug Stuff
@@ -54,7 +54,7 @@
#endif
// ----------------------------------------------------------------------------
-// Record/Play Buffer Allocation Method. If K1212_LARGEALLOC is defined all
+// Record/Play Buffer Allocation Method. If K1212_LARGEALLOC is defined all
// buffers are alocated as a large piece inside KorgSharedBuffer.
// ----------------------------------------------------------------------------
//#define K1212_LARGEALLOC 1
@@ -63,21 +63,21 @@
// Valid states of the Korg 1212 I/O card.
// ----------------------------------------------------------------------------
enum CardState {
- K1212_STATE_NONEXISTENT, // there is no card here
- K1212_STATE_UNINITIALIZED, // the card is awaiting DSP download
- K1212_STATE_DSP_IN_PROCESS, // the card is currently downloading its DSP code
- K1212_STATE_DSP_COMPLETE, // the card has finished the DSP download
- K1212_STATE_READY, // the card can be opened by an application. Any application
- // requests prior to this state should fail. Only an open
- // request can be made at this state.
- K1212_STATE_OPEN, // an application has opened the card
- K1212_STATE_SETUP, // the card has been setup for play
- K1212_STATE_PLAYING, // the card is playing
- K1212_STATE_MONITOR, // the card is in the monitor mode
- K1212_STATE_CALIBRATING, // the card is currently calibrating
- K1212_STATE_ERRORSTOP, // the card has stopped itself because of an error and we
- // are in the process of cleaning things up.
- K1212_STATE_MAX_STATE // state values of this and beyond are invalid
+ K1212_STATE_NONEXISTENT, /* there is no card here */
+ K1212_STATE_UNINITIALIZED, /* the card is awaiting DSP download */
+ K1212_STATE_DSP_IN_PROCESS, /* the card is currently downloading its DSP code */
+ K1212_STATE_DSP_COMPLETE, /* the card has finished the DSP download */
+ K1212_STATE_READY, /* the card can be opened by an application. Any application */
+ /* requests prior to this state should fail. Only an open */
+ /* request can be made at this state. */
+ K1212_STATE_OPEN, /* an application has opened the card */
+ K1212_STATE_SETUP, /* the card has been setup for play */
+ K1212_STATE_PLAYING, /* the card is playing */
+ K1212_STATE_MONITOR, /* the card is in the monitor mode */
+ K1212_STATE_CALIBRATING, /* the card is currently calibrating */
+ K1212_STATE_ERRORSTOP, /* the card has stopped itself because of an error and we */
+ /* are in the process of cleaning things up. */
+ K1212_STATE_MAX_STATE /* state values of this and beyond are invalid */
};
// ----------------------------------------------------------------------------
@@ -85,48 +85,48 @@ enum CardState {
// host-to-card doorbell to initiate a command.
// ----------------------------------------------------------------------------
enum korg1212_dbcnst {
- K1212_DB_RequestForData = 0, // sent by the card to request a buffer fill.
- K1212_DB_TriggerPlay = 1, // starts playback/record on the card.
- K1212_DB_SelectPlayMode = 2, // select monitor, playback setup, or stop.
- K1212_DB_ConfigureBufferMemory = 3, // tells card where the host audio buffers are.
- K1212_DB_RequestAdatTimecode = 4, // asks the card for the latest ADAT timecode value.
- K1212_DB_SetClockSourceRate = 5, // sets the clock source and rate for the card.
- K1212_DB_ConfigureMiscMemory = 6, // tells card where other buffers are.
- K1212_DB_TriggerFromAdat = 7, // tells card to trigger from Adat at a specific
- // timecode value.
- K1212_DB_DMAERROR = 0x80, // DMA Error - the PCI bus is congestioned.
- K1212_DB_CARDSTOPPED = 0x81, // Card has stopped by user request.
- K1212_DB_RebootCard = 0xA0, // instructs the card to reboot.
- K1212_DB_BootFromDSPPage4 = 0xA4, // instructs the card to boot from the DSP microcode
- // on page 4 (local page to card).
- K1212_DB_DSPDownloadDone = 0xAE, // sent by the card to indicate the download has
- // completed.
- K1212_DB_StartDSPDownload = 0xAF // tells the card to download its DSP firmware.
+ K1212_DB_RequestForData = 0, /* sent by the card to request a buffer fill. */
+ K1212_DB_TriggerPlay = 1, /* starts playback/record on the card. */
+ K1212_DB_SelectPlayMode = 2, /* select monitor, playback setup, or stop. */
+ K1212_DB_ConfigureBufferMemory = 3, /* tells card where the host audio buffers are. */
+ K1212_DB_RequestAdatTimecode = 4, /* asks the card for the latest ADAT timecode value. */
+ K1212_DB_SetClockSourceRate = 5, /* sets the clock source and rate for the card. */
+ K1212_DB_ConfigureMiscMemory = 6, /* tells card where other buffers are. */
+ K1212_DB_TriggerFromAdat = 7, /* tells card to trigger from Adat at a specific */
+ /* timecode value. */
+ K1212_DB_DMAERROR = 0x80, /* DMA Error - the PCI bus is congestioned. */
+ K1212_DB_CARDSTOPPED = 0x81, /* Card has stopped by user request. */
+ K1212_DB_RebootCard = 0xA0, /* instructs the card to reboot. */
+ K1212_DB_BootFromDSPPage4 = 0xA4, /* instructs the card to boot from the DSP microcode */
+ /* on page 4 (local page to card). */
+ K1212_DB_DSPDownloadDone = 0xAE, /* sent by the card to indicate the download has */
+ /* completed. */
+ K1212_DB_StartDSPDownload = 0xAF /* tells the card to download its DSP firmware. */
};
// ----------------------------------------------------------------------------
-// The following enumeration defines return codes
+// The following enumeration defines return codes
// to the Korg 1212 I/O driver.
// ----------------------------------------------------------------------------
enum snd_korg1212rc {
- K1212_CMDRET_Success = 0, // command was successfully placed
- K1212_CMDRET_DIOCFailure, // the DeviceIoControl call failed
- K1212_CMDRET_PMFailure, // the protected mode call failed
- K1212_CMDRET_FailUnspecified, // unspecified failure
- K1212_CMDRET_FailBadState, // the specified command can not be given in
- // the card's current state. (or the wave device's
- // state)
- K1212_CMDRET_CardUninitialized, // the card is uninitialized and cannot be used
- K1212_CMDRET_BadIndex, // an out of range card index was specified
- K1212_CMDRET_BadHandle, // an invalid card handle was specified
- K1212_CMDRET_NoFillRoutine, // a play request has been made before a fill routine set
- K1212_CMDRET_FillRoutineInUse, // can't set a new fill routine while one is in use
- K1212_CMDRET_NoAckFromCard, // the card never acknowledged a command
- K1212_CMDRET_BadParams, // bad parameters were provided by the caller
-
- K1212_CMDRET_BadDevice, // the specified wave device was out of range
- K1212_CMDRET_BadFormat // the specified wave format is unsupported
+ K1212_CMDRET_Success = 0, /* command was successfully placed */
+ K1212_CMDRET_DIOCFailure, /* the DeviceIoControl call failed */
+ K1212_CMDRET_PMFailure, /* the protected mode call failed */
+ K1212_CMDRET_FailUnspecified, /* unspecified failure */
+ K1212_CMDRET_FailBadState, /* the specified command can not be given in */
+ /* the card's current state. (or the wave device's */
+ /* state) */
+ K1212_CMDRET_CardUninitialized, /* the card is uninitialized and cannot be used */
+ K1212_CMDRET_BadIndex, /* an out of range card index was specified */
+ K1212_CMDRET_BadHandle, /* an invalid card handle was specified */
+ K1212_CMDRET_NoFillRoutine, /* a play request has been made before a fill routine set */
+ K1212_CMDRET_FillRoutineInUse, /* can't set a new fill routine while one is in use */
+ K1212_CMDRET_NoAckFromCard, /* the card never acknowledged a command */
+ K1212_CMDRET_BadParams, /* bad parameters were provided by the caller */
+
+ K1212_CMDRET_BadDevice, /* the specified wave device was out of range */
+ K1212_CMDRET_BadFormat /* the specified wave format is unsupported */
};
// ----------------------------------------------------------------------------
@@ -134,10 +134,10 @@ enum snd_korg1212rc {
// mode for the card in the SelectPlayMode command.
// ----------------------------------------------------------------------------
enum PlayModeSelector {
- K1212_MODE_SetupPlay = 0x00000001, // provides card with pre-play information
- K1212_MODE_MonitorOn = 0x00000002, // tells card to turn on monitor mode
- K1212_MODE_MonitorOff = 0x00000004, // tells card to turn off monitor mode
- K1212_MODE_StopPlay = 0x00000008 // stops playback on the card
+ K1212_MODE_SetupPlay = 0x00000001, /* provides card with pre-play information */
+ K1212_MODE_MonitorOn = 0x00000002, /* tells card to turn on monitor mode */
+ K1212_MODE_MonitorOff = 0x00000004, /* tells card to turn off monitor mode */
+ K1212_MODE_StopPlay = 0x00000008 /* stops playback on the card */
};
// ----------------------------------------------------------------------------
@@ -145,28 +145,28 @@ enum PlayModeSelector {
// mode for the card in the SetMonitorMode command.
// ----------------------------------------------------------------------------
enum MonitorModeSelector {
- K1212_MONMODE_Off = 0, // tells card to turn off monitor mode
- K1212_MONMODE_On // tells card to turn on monitor mode
+ K1212_MONMODE_Off = 0, /* tells card to turn off monitor mode */
+ K1212_MONMODE_On /* tells card to turn on monitor mode */
};
-#define MAILBOX0_OFFSET 0x40 // location of mailbox 0 relative to base address
-#define MAILBOX1_OFFSET 0x44 // location of mailbox 1 relative to base address
-#define MAILBOX2_OFFSET 0x48 // location of mailbox 2 relative to base address
-#define MAILBOX3_OFFSET 0x4c // location of mailbox 3 relative to base address
-#define OUT_DOORBELL_OFFSET 0x60 // location of PCI to local doorbell
-#define IN_DOORBELL_OFFSET 0x64 // location of local to PCI doorbell
-#define STATUS_REG_OFFSET 0x68 // location of interrupt control/status register
-#define PCI_CONTROL_OFFSET 0x6c // location of the EEPROM, PCI, User I/O, init control
- // register
-#define SENS_CONTROL_OFFSET 0x6e // location of the input sensitivity setting register.
- // this is the upper word of the PCI control reg.
-#define DEV_VEND_ID_OFFSET 0x70 // location of the device and vendor ID register
-
-#define MAX_COMMAND_RETRIES 5 // maximum number of times the driver will attempt
- // to send a command before giving up.
-#define COMMAND_ACK_MASK 0x8000 // the MSB is set in the command acknowledgment from
- // the card.
-#define DOORBELL_VAL_MASK 0x00FF // the doorbell value is one byte
+#define MAILBOX0_OFFSET 0x40 /* location of mailbox 0 relative to base address */
+#define MAILBOX1_OFFSET 0x44 /* location of mailbox 1 relative to base address */
+#define MAILBOX2_OFFSET 0x48 /* location of mailbox 2 relative to base address */
+#define MAILBOX3_OFFSET 0x4c /* location of mailbox 3 relative to base address */
+#define OUT_DOORBELL_OFFSET 0x60 /* location of PCI to local doorbell */
+#define IN_DOORBELL_OFFSET 0x64 /* location of local to PCI doorbell */
+#define STATUS_REG_OFFSET 0x68 /* location of interrupt control/status register */
+#define PCI_CONTROL_OFFSET 0x6c /* location of the EEPROM, PCI, User I/O, init control */
+ /* register */
+#define SENS_CONTROL_OFFSET 0x6e /* location of the input sensitivity setting register. */
+ /* this is the upper word of the PCI control reg. */
+#define DEV_VEND_ID_OFFSET 0x70 /* location of the device and vendor ID register */
+
+#define MAX_COMMAND_RETRIES 5 /* maximum number of times the driver will attempt */
+ /* to send a command before giving up. */
+#define COMMAND_ACK_MASK 0x8000 /* the MSB is set in the command acknowledgment from */
+ /* the card. */
+#define DOORBELL_VAL_MASK 0x00FF /* the doorbell value is one byte */
#define CARD_BOOT_DELAY_IN_MS 10
#define CARD_BOOT_TIMEOUT 10
@@ -255,25 +255,25 @@ enum MonitorModeSelector {
#define SENSCLKPULSE_WIDTH 4
#define LOADSHIFT_DELAY 4
#define INTERCOMMAND_DELAY 40
-#define STOPCARD_DELAY 300 // max # RTC ticks for the card to stop once we write
- // the command register. (could be up to 180 us)
-#define COMMAND_ACK_DELAY 13 // number of RTC ticks to wait for an acknowledgement
- // from the card after sending a command.
+#define STOPCARD_DELAY 300 /* max # RTC ticks for the card to stop once we write */
+ /* the command register. (could be up to 180 us) */
+#define COMMAND_ACK_DELAY 13 /* number of RTC ticks to wait for an acknowledgement */
+ /* from the card after sending a command. */
enum ClockSourceIndex {
- K1212_CLKIDX_AdatAt44_1K = 0, // selects source as ADAT at 44.1 kHz
- K1212_CLKIDX_AdatAt48K, // selects source as ADAT at 48 kHz
- K1212_CLKIDX_WordAt44_1K, // selects source as S/PDIF at 44.1 kHz
- K1212_CLKIDX_WordAt48K, // selects source as S/PDIF at 48 kHz
- K1212_CLKIDX_LocalAt44_1K, // selects source as local clock at 44.1 kHz
- K1212_CLKIDX_LocalAt48K, // selects source as local clock at 48 kHz
- K1212_CLKIDX_Invalid // used to check validity of the index
+ K1212_CLKIDX_AdatAt44_1K = 0, /* selects source as ADAT at 44.1 kHz */
+ K1212_CLKIDX_AdatAt48K, /* selects source as ADAT at 48 kHz */
+ K1212_CLKIDX_WordAt44_1K, /* selects source as S/PDIF at 44.1 kHz */
+ K1212_CLKIDX_WordAt48K, /* selects source as S/PDIF at 48 kHz */
+ K1212_CLKIDX_LocalAt44_1K, /* selects source as local clock at 44.1 kHz */
+ K1212_CLKIDX_LocalAt48K, /* selects source as local clock at 48 kHz */
+ K1212_CLKIDX_Invalid /* used to check validity of the index */
};
enum ClockSourceType {
- K1212_CLKIDX_Adat = 0, // selects source as ADAT
- K1212_CLKIDX_Word, // selects source as S/PDIF
- K1212_CLKIDX_Local // selects source as local clock
+ K1212_CLKIDX_Adat = 0, /* selects source as ADAT */
+ K1212_CLKIDX_Word, /* selects source as S/PDIF */
+ K1212_CLKIDX_Local /* selects source as local clock */
};
struct KorgAudioFrame {
@@ -294,7 +294,7 @@ struct KorgSharedBuffer {
short volumeData[kAudioChannels];
u32 cardCommand;
u16 routeData [kAudioChannels];
- u32 AdatTimeCode; // ADAT timecode value
+ u32 AdatTimeCode; /* ADAT timecode value */
};
struct SensBits {
@@ -354,16 +354,16 @@ struct snd_korg1212 {
u32 RoutingTablePhy;
u32 AdatTimeCodePhy;
- u32 __iomem * statusRegPtr; // address of the interrupt status/control register
- u32 __iomem * outDoorbellPtr; // address of the host->card doorbell register
- u32 __iomem * inDoorbellPtr; // address of the card->host doorbell register
- u32 __iomem * mailbox0Ptr; // address of mailbox 0 on the card
- u32 __iomem * mailbox1Ptr; // address of mailbox 1 on the card
- u32 __iomem * mailbox2Ptr; // address of mailbox 2 on the card
- u32 __iomem * mailbox3Ptr; // address of mailbox 3 on the card
- u32 __iomem * controlRegPtr; // address of the EEPROM, PCI, I/O, Init ctrl reg
- u16 __iomem * sensRegPtr; // address of the sensitivity setting register
- u32 __iomem * idRegPtr; // address of the device and vendor ID registers
+ u32 __iomem * statusRegPtr; /* address of the interrupt status/control register */
+ u32 __iomem * outDoorbellPtr; /* address of the host->card doorbell register */
+ u32 __iomem * inDoorbellPtr; /* address of the card->host doorbell register */
+ u32 __iomem * mailbox0Ptr; /* address of mailbox 0 on the card */
+ u32 __iomem * mailbox1Ptr; /* address of mailbox 1 on the card */
+ u32 __iomem * mailbox2Ptr; /* address of mailbox 2 on the card */
+ u32 __iomem * mailbox3Ptr; /* address of mailbox 3 on the card */
+ u32 __iomem * controlRegPtr; /* address of the EEPROM, PCI, I/O, Init ctrl reg */
+ u16 __iomem * sensRegPtr; /* address of the sensitivity setting register */
+ u32 __iomem * idRegPtr; /* address of the device and vendor ID registers */
size_t periodsize;
int channels;
@@ -377,24 +377,24 @@ struct snd_korg1212 {
enum CardState cardState;
int running;
- int idleMonitorOn; // indicates whether the card is in idle monitor mode.
- u32 cmdRetryCount; // tracks how many times we have retried sending to the card.
+ int idleMonitorOn; /* indicates whether the card is in idle monitor mode. */
+ u32 cmdRetryCount; /* tracks how many times we have retried sending to the card. */
- enum ClockSourceIndex clkSrcRate; // sample rate and clock source
+ enum ClockSourceIndex clkSrcRate; /* sample rate and clock source */
- enum ClockSourceType clkSource; // clock source
- int clkRate; // clock rate
+ enum ClockSourceType clkSource; /* clock source */
+ int clkRate; /* clock rate */
int volumePhase[kAudioChannels];
- u16 leftADCInSens; // ADC left channel input sensitivity
- u16 rightADCInSens; // ADC right channel input sensitivity
+ u16 leftADCInSens; /* ADC left channel input sensitivity */
+ u16 rightADCInSens; /* ADC right channel input sensitivity */
- int opencnt; // Open/Close count
- int setcnt; // SetupForPlay count
- int playcnt; // TriggerPlay count
- int errorcnt; // Error Count
- unsigned long totalerrorcnt; // Total Error Count
+ int opencnt; /* Open/Close count */
+ int setcnt; /* SetupForPlay count */
+ int playcnt; /* TriggerPlay count */
+ int errorcnt; /* Error Count */
+ unsigned long totalerrorcnt; /* Total Error Count */
int dsp_is_loaded;
int dsp_stop_is_processed;
@@ -471,12 +471,12 @@ static char *channelName[] = {
};
static u16 ClockSourceSelector[] = {
- 0x8000, // selects source as ADAT at 44.1 kHz
- 0x0000, // selects source as ADAT at 48 kHz
- 0x8001, // selects source as S/PDIF at 44.1 kHz
- 0x0001, // selects source as S/PDIF at 48 kHz
- 0x8002, // selects source as local clock at 44.1 kHz
- 0x0002 // selects source as local clock at 48 kHz
+ 0x8000, /* selects source as ADAT at 44.1 kHz */
+ 0x0000, /* selects source as ADAT at 48 kHz */
+ 0x8001, /* selects source as S/PDIF at 44.1 kHz */
+ 0x0001, /* selects source as S/PDIF at 48 kHz */
+ 0x8002, /* selects source as local clock at 44.1 kHz */
+ 0x0002 /* selects source as local clock at 48 kHz */
};
union swap_u32 { unsigned char c[4]; u32 i; };
@@ -541,23 +541,23 @@ static int snd_korg1212_Send1212Command(struct snd_korg1212 *korg1212,
writel(mailBox2Val, korg1212->mailbox2Ptr);
writel(mailBox1Val, korg1212->mailbox1Ptr);
writel(mailBox0Val, korg1212->mailbox0Ptr);
- writel(doorbellVal, korg1212->outDoorbellPtr); // interrupt the card
+ writel(doorbellVal, korg1212->outDoorbellPtr); /* interrupt the card */
- // --------------------------------------------------------------
- // the reboot command will not give an acknowledgement.
- // --------------------------------------------------------------
- if ( doorbellVal == K1212_DB_RebootCard ||
+ /* -------------------------------------------------------------- */
+ /* the reboot command will not give an acknowledgement. */
+ /* -------------------------------------------------------------- */
+ if (doorbellVal == K1212_DB_RebootCard ||
doorbellVal == K1212_DB_BootFromDSPPage4 ||
- doorbellVal == K1212_DB_StartDSPDownload ) {
+ doorbellVal == K1212_DB_StartDSPDownload) {
rc = K1212_CMDRET_Success;
break;
}
- // --------------------------------------------------------------
- // See if the card acknowledged the command. Wait a bit, then
- // read in the low word of mailbox3. If the MSB is set and the
- // low byte is equal to the doorbell value, then it ack'd.
- // --------------------------------------------------------------
+ /* -------------------------------------------------------------- */
+ /* See if the card acknowledged the command. Wait a bit, then */
+ /* read in the low word of mailbox3. If the MSB is set and the */
+ /* low byte is equal to the doorbell value, then it ack'd. */
+ /* -------------------------------------------------------------- */
udelay(COMMAND_ACK_DELAY);
mailBox3Lo = readl(korg1212->mailbox3Ptr);
if (mailBox3Lo & COMMAND_ACK_MASK) {
@@ -581,7 +581,7 @@ static int snd_korg1212_Send1212Command(struct snd_korg1212 *korg1212,
/* spinlock already held */
static void snd_korg1212_SendStop(struct snd_korg1212 *korg1212)
{
- if (! korg1212->stop_pending_cnt) {
+ if (!korg1212->stop_pending_cnt) {
korg1212->sharedBufferPtr->cardCommand = 0xffffffff;
/* program the timer */
korg1212->stop_pending_cnt = HZ;
@@ -605,7 +605,7 @@ static void snd_korg1212_timer_func(unsigned long data)
{
struct snd_korg1212 *korg1212 = (struct snd_korg1212 *) data;
unsigned long flags;
-
+
spin_lock_irqsave(&korg1212->lock, flags);
if (korg1212->sharedBufferPtr->cardCommand == 0) {
/* ack'ed */
@@ -757,7 +757,7 @@ static int snd_korg1212_StopPlay(struct snd_korg1212 * korg1212)
K1212_DEBUG_PRINTK("K1212_DEBUG: StopPlay [%s] %d\n",
stateName[korg1212->cardState], korg1212->playcnt);
- if (--(korg1212->playcnt))
+ if (--(korg1212->playcnt))
return 0;
korg1212->setcnt = 0;
@@ -897,24 +897,24 @@ static int snd_korg1212_WriteADCSensitivity(struct snd_korg1212 *korg1212)
int channel;
int clkIs48K;
int monModeSet;
- u16 controlValue; // this keeps the current value to be written to
- // the card's eeprom control register.
+ u16 controlValue; /* this keeps the current value to be written to */
+ /* the card's eeprom control register. */
u16 count;
unsigned long flags;
K1212_DEBUG_PRINTK("K1212_DEBUG: WriteADCSensivity [%s]\n",
stateName[korg1212->cardState]);
- // ----------------------------------------------------------------------------
- // initialize things. The local init bit is always set when writing to the
- // card's control register.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* initialize things. The local init bit is always set when writing to the */
+ /* card's control register. */
+ /* ---------------------------------------------------------------------------- */
controlValue = 0;
- SetBitInWord(&controlValue, SET_SENS_LOCALINIT_BITPOS); // init the control value
+ SetBitInWord(&controlValue, SET_SENS_LOCALINIT_BITPOS); /* init the control value */
- // ----------------------------------------------------------------------------
- // make sure the card is not in monitor mode when we do this update.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* make sure the card is not in monitor mode when we do this update. */
+ /* ---------------------------------------------------------------------------- */
if (korg1212->cardState == K1212_STATE_MONITOR || korg1212->idleMonitorOn) {
monModeSet = 1;
snd_korg1212_SendStopAndWait(korg1212);
@@ -923,17 +923,17 @@ static int snd_korg1212_WriteADCSensitivity(struct snd_korg1212 *korg1212)
spin_lock_irqsave(&korg1212->lock, flags);
- // ----------------------------------------------------------------------------
- // we are about to send new values to the card, so clear the new values queued
- // flag. Also, clear out mailbox 3, so we don't lockup.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* we are about to send new values to the card, so clear the new values queued */
+ /* flag. Also, clear out mailbox 3, so we don't lockup. */
+ /* ---------------------------------------------------------------------------- */
writel(0, korg1212->mailbox3Ptr);
udelay(LOADSHIFT_DELAY);
- // ----------------------------------------------------------------------------
- // determine whether we are running a 48K or 44.1K clock. This info is used
- // later when setting the SPDIF FF after the volume has been shifted in.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* determine whether we are running a 48K or 44.1K clock. This info is used */
+ /* later when setting the SPDIF FF after the volume has been shifted in. */
+ /* ---------------------------------------------------------------------------- */
switch (korg1212->clkSrcRate) {
case K1212_CLKIDX_AdatAt44_1K:
case K1212_CLKIDX_WordAt44_1K:
@@ -949,76 +949,76 @@ static int snd_korg1212_WriteADCSensitivity(struct snd_korg1212 *korg1212)
break;
}
- // ----------------------------------------------------------------------------
- // start the update. Setup the bit structure and then shift the bits.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* start the update. Setup the bit structure and then shift the bits. */
+ /* ---------------------------------------------------------------------------- */
sensVals.l.v.leftChanId = SET_SENS_LEFTCHANID;
sensVals.r.v.rightChanId = SET_SENS_RIGHTCHANID;
sensVals.l.v.leftChanVal = korg1212->leftADCInSens;
sensVals.r.v.rightChanVal = korg1212->rightADCInSens;
- // ----------------------------------------------------------------------------
- // now start shifting the bits in. Start with the left channel then the right.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* now start shifting the bits in. Start with the left channel then the right. */
+ /* ---------------------------------------------------------------------------- */
for (channel = 0; channel < 2; channel++) {
- // ----------------------------------------------------------------------------
- // Bring the load/shift line low, then wait - the spec says >150ns from load/
- // shift low to the first rising edge of the clock.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* Bring the load/shift line low, then wait - the spec says >150ns from load/ */
+ /* shift low to the first rising edge of the clock. */
+ /* ---------------------------------------------------------------------------- */
ClearBitInWord(&controlValue, SET_SENS_LOADSHIFT_BITPOS);
ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // load/shift goes low
+ writew(controlValue, korg1212->sensRegPtr); /* load/shift goes low */
udelay(LOADSHIFT_DELAY);
- for (bitPosition = 15; bitPosition >= 0; bitPosition--) { // for all the bits
+ for (bitPosition = 15; bitPosition >= 0; bitPosition--) { /* for all the bits */
if (channel == 0) {
if (sensVals.l.leftSensBits & (0x0001 << bitPosition))
- SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS); // data bit set high
+ SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS); /* data bit set high */
else
- ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS); // data bit set low
+ ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS); /* data bit set low */
} else {
if (sensVals.r.rightSensBits & (0x0001 << bitPosition))
- SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS); // data bit set high
+ SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS); /* data bit set high */
else
- ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS); // data bit set low
+ ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS); /* data bit set low */
}
ClearBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // clock goes low
+ writew(controlValue, korg1212->sensRegPtr); /* clock goes low */
udelay(SENSCLKPULSE_WIDTH);
SetBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // clock goes high
+ writew(controlValue, korg1212->sensRegPtr); /* clock goes high */
udelay(SENSCLKPULSE_WIDTH);
}
- // ----------------------------------------------------------------------------
- // finish up SPDIF for left. Bring the load/shift line high, then write a one
- // bit if the clock rate is 48K otherwise write 0.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* finish up SPDIF for left. Bring the load/shift line high, then write a one */
+ /* bit if the clock rate is 48K otherwise write 0. */
+ /* ---------------------------------------------------------------------------- */
ClearBitInWord(&controlValue, SET_SENS_DATA_BITPOS);
ClearBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
SetBitInWord(&controlValue, SET_SENS_LOADSHIFT_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // load shift goes high - clk low
+ writew(controlValue, korg1212->sensRegPtr); /* load shift goes high - clk low */
udelay(SENSCLKPULSE_WIDTH);
if (clkIs48K)
SetBitInWord(&controlValue, SET_SENS_DATA_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // set/clear data bit
+ writew(controlValue, korg1212->sensRegPtr); /* set/clear data bit */
udelay(ONE_RTC_TICK);
SetBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // clock goes high
+ writew(controlValue, korg1212->sensRegPtr); /* clock goes high */
udelay(SENSCLKPULSE_WIDTH);
ClearBitInWord(&controlValue, SET_SENS_CLOCK_BITPOS);
- writew(controlValue, korg1212->sensRegPtr); // clock goes low
+ writew(controlValue, korg1212->sensRegPtr); /* clock goes low */
udelay(SENSCLKPULSE_WIDTH);
}
- // ----------------------------------------------------------------------------
- // The update is complete. Set a timeout. This is the inter-update delay.
- // Also, if the card was in monitor mode, restore it.
- // ----------------------------------------------------------------------------
+ /* ---------------------------------------------------------------------------- */
+ /* The update is complete. Set a timeout. This is the inter-update delay. */
+ /* Also, if the card was in monitor mode, restore it. */
+ /* ---------------------------------------------------------------------------- */
for (count = 0; count < 10; count++)
udelay(SENSCLKPULSE_WIDTH);
@@ -1042,9 +1042,9 @@ static void snd_korg1212_OnDSPDownloadComplete(struct snd_korg1212 *korg1212)
K1212_DEBUG_PRINTK("K1212_DEBUG: DSP download is complete. [%s]\n",
stateName[korg1212->cardState]);
- // ----------------------------------------------------
- // tell the card to boot
- // ----------------------------------------------------
+ /* ---------------------------------------------------- */
+ /* tell the card to boot */
+ /* ---------------------------------------------------- */
rc = snd_korg1212_Send1212Command(korg1212, K1212_DB_BootFromDSPPage4, 0, 0, 0, 0);
if (rc)
@@ -1052,17 +1052,17 @@ static void snd_korg1212_OnDSPDownloadComplete(struct snd_korg1212 *korg1212)
rc, stateName[korg1212->cardState]);
msleep(DSP_BOOT_DELAY_IN_MS);
- // --------------------------------------------------------------------------------
- // Let the card know where all the buffers are.
- // --------------------------------------------------------------------------------
+ /* -------------------------------------------------------------------------------- */
+ /* Let the card know where all the buffers are. */
+ /* -------------------------------------------------------------------------------- */
rc = snd_korg1212_Send1212Command(korg1212,
K1212_DB_ConfigureBufferMemory,
LowerWordSwap(korg1212->PlayDataPhy),
LowerWordSwap(korg1212->RecDataPhy),
- ((kNumBuffers * kPlayBufferFrames) / 2), // size given to the card
- // is based on 2 buffers
+ ((kNumBuffers * kPlayBufferFrames) / 2), /* size given to the card */
+ /* is based on 2 buffers */
0
- );
+ );
if (rc)
K1212_DEBUG_PRINTK("K1212_DEBUG: Configure Buffer Memory - RC = %d [%s]\n",
@@ -1076,20 +1076,20 @@ static void snd_korg1212_OnDSPDownloadComplete(struct snd_korg1212 *korg1212)
LowerWordSwap(korg1212->RoutingTablePhy),
LowerWordSwap(korg1212->AdatTimeCodePhy),
0
- );
+ );
if (rc)
K1212_DEBUG_PRINTK("K1212_DEBUG: Configure Misc Memory - RC = %d [%s]\n",
rc, stateName[korg1212->cardState]);
- // --------------------------------------------------------------------------------
- // Initialize the routing and volume tables, then update the card's state.
- // --------------------------------------------------------------------------------
+ /* -------------------------------------------------------------------------------- */
+ /* Initialize the routing and volume tables, then update the card's state. */
+ /* -------------------------------------------------------------------------------- */
udelay(INTERCOMMAND_DELAY);
for (channel = 0; channel < kAudioChannels; channel++) {
korg1212->sharedBufferPtr->volumeData[channel] = k1212MaxVolume;
- //korg1212->sharedBufferPtr->routeData[channel] = channel;
+ /* korg1212->sharedBufferPtr->routeData[channel] = channel; */
korg1212->sharedBufferPtr->routeData[channel] = 8 + (channel & 1);
}
@@ -1142,9 +1142,9 @@ static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id)
}
break;
- // ------------------------------------------------------------------------
- // an error occurred - stop the card
- // ------------------------------------------------------------------------
+ /* ------------------------------------------------------------------------ */
+ /* an error occurred - stop the card */
+ /* ------------------------------------------------------------------------ */
case K1212_DB_DMAERROR:
K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: IRQ DMAE count - %ld, %x, [%s].\n",
korg1212->irqcount, doorbellValue,
@@ -1156,10 +1156,10 @@ static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id)
snd_korg1212_setCardState(korg1212, K1212_STATE_ERRORSTOP);
break;
- // ------------------------------------------------------------------------
- // the card has stopped by our request. Clear the command word and signal
- // the semaphore in case someone is waiting for this.
- // ------------------------------------------------------------------------
+ /* ------------------------------------------------------------------------ */
+ /* the card has stopped by our request. Clear the command word and signal */
+ /* the semaphore in case someone is waiting for this. */
+ /* ------------------------------------------------------------------------ */
case K1212_DB_CARDSTOPPED:
K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: IRQ CSTP count - %ld, %x, [%s].\n",
korg1212->irqcount, doorbellValue,
@@ -1169,7 +1169,7 @@ static irqreturn_t snd_korg1212_interrupt(int irq, void *dev_id)
default:
K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: IRQ DFLT count - %ld, %x, cpos=%d [%s].\n",
- korg1212->irqcount, doorbellValue,
+ korg1212->irqcount, doorbellValue,
korg1212->currentBuffer, stateName[korg1212->cardState]);
if ((korg1212->cardState > K1212_STATE_SETUP) || korg1212->idleMonitorOn) {
korg1212->currentBuffer++;
@@ -1209,9 +1209,9 @@ static int snd_korg1212_downloadDSPCode(struct snd_korg1212 *korg1212)
K1212_DEBUG_PRINTK("K1212_DEBUG: DSP download is starting... [%s]\n",
stateName[korg1212->cardState]);
- // ---------------------------------------------------------------
- // verify the state of the card before proceeding.
- // ---------------------------------------------------------------
+ /* --------------------------------------------------------------- */
+ /* verify the state of the card before proceeding. */
+ /* --------------------------------------------------------------- */
if (korg1212->cardState >= K1212_STATE_DSP_IN_PROCESS)
return 1;
@@ -1226,7 +1226,7 @@ static int snd_korg1212_downloadDSPCode(struct snd_korg1212 *korg1212)
korg1212->dsp_is_loaded = 0;
wait_event_timeout(korg1212->wait, korg1212->dsp_is_loaded, HZ * CARD_BOOT_TIMEOUT);
- if (! korg1212->dsp_is_loaded )
+ if (!korg1212->dsp_is_loaded)
return -EBUSY; /* timeout */
snd_korg1212_OnDSPDownloadComplete(korg1212);
@@ -1284,10 +1284,10 @@ static int snd_korg1212_silence(struct snd_korg1212 *korg1212, int pos, int coun
if (snd_BUG_ON(pos + count > K1212_MAX_SAMPLES))
return -EINVAL;
- for (i=0; i < count; i++) {
+ for (i = 0; i < count; i++) {
#if K1212_DEBUG_LEVEL > 0
- if ( (void *) dst < (void *) korg1212->playDataBufsPtr ||
- (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData ) {
+ if ((void *) dst < (void *) korg1212->playDataBufsPtr ||
+ (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData) {
printk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_silence KERNEL EFAULT dst=%p iter=%d\n",
dst, i);
return -EFAULT;
@@ -1310,10 +1310,10 @@ static int snd_korg1212_copy_to(struct snd_korg1212 *korg1212, void __user *dst,
if (snd_BUG_ON(pos + count > K1212_MAX_SAMPLES))
return -EINVAL;
- for (i=0; i < count; i++) {
+ for (i = 0; i < count; i++) {
#if K1212_DEBUG_LEVEL > 0
- if ( (void *) src < (void *) korg1212->recordDataBufsPtr ||
- (void *) src > (void *) korg1212->recordDataBufsPtr[8].bufferData ) {
+ if ((void *) src < (void *) korg1212->recordDataBufsPtr ||
+ (void *) src > (void *) korg1212->recordDataBufsPtr[8].bufferData) {
printk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_copy_to KERNEL EFAULT, src=%p dst=%p iter=%d\n", src, dst, i);
return -EFAULT;
}
@@ -1341,10 +1341,10 @@ static int snd_korg1212_copy_from(struct snd_korg1212 *korg1212, void __user *sr
if (snd_BUG_ON(pos + count > K1212_MAX_SAMPLES))
return -EINVAL;
- for (i=0; i < count; i++) {
+ for (i = 0; i < count; i++) {
#if K1212_DEBUG_LEVEL > 0
- if ( (void *) dst < (void *) korg1212->playDataBufsPtr ||
- (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData ) {
+ if ((void *) dst < (void *) korg1212->playDataBufsPtr ||
+ (void *) dst > (void *) korg1212->playDataBufsPtr[8].bufferData) {
printk(KERN_DEBUG "K1212_DEBUG: snd_korg1212_copy_from KERNEL EFAULT, src=%p dst=%p iter=%d\n", src, dst, i);
return -EFAULT;
}
@@ -1475,7 +1475,7 @@ static int snd_korg1212_ioctl(struct snd_pcm_substream *substream,
{
K1212_DEBUG_PRINTK("K1212_DEBUG: snd_korg1212_ioctl: cmd=%d\n", cmd);
- if (cmd == SNDRV_PCM_IOCTL1_CHANNEL_INFO ) {
+ if (cmd == SNDRV_PCM_IOCTL1_CHANNEL_INFO) {
struct snd_pcm_channel_info *info = arg;
info->offset = 0;
info->first = info->channel * 16;
@@ -1619,7 +1619,7 @@ static snd_pcm_uframes_t snd_korg1212_playback_pointer(struct snd_pcm_substream
pos = korg1212->currentBuffer * kPlayBufferFrames;
- K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: snd_korg1212_playback_pointer [%s] %ld\n",
+ K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: snd_korg1212_playback_pointer [%s] %ld\n",
stateName[korg1212->cardState], pos);
return pos;
@@ -1648,7 +1648,7 @@ static int snd_korg1212_playback_copy(struct snd_pcm_substream *substream,
K1212_DEBUG_PRINTK_VERBOSE("K1212_DEBUG: snd_korg1212_playback_copy [%s] %ld %ld\n",
stateName[korg1212->cardState], pos, count);
-
+
return snd_korg1212_copy_from(korg1212, src, pos, count, 0, korg1212->channels * 2);
}
@@ -1792,7 +1792,7 @@ static int snd_korg1212_control_volume_get(struct snd_kcontrol *kcontrol,
i = kcontrol->private_value;
u->value.integer.value[0] = abs(korg1212->sharedBufferPtr->volumeData[i]);
- if (i >= 8)
+ if (i >= 8)
u->value.integer.value[1] = abs(korg1212->sharedBufferPtr->volumeData[i+1]);
spin_unlock_irq(&korg1212->lock);
@@ -1812,7 +1812,7 @@ static int snd_korg1212_control_volume_put(struct snd_kcontrol *kcontrol,
i = kcontrol->private_value;
- if (u->value.integer.value[0] >= k1212MinVolume &&
+ if (u->value.integer.value[0] >= k1212MinVolume &&
u->value.integer.value[0] >= k1212MaxVolume &&
u->value.integer.value[0] !=
abs(korg1212->sharedBufferPtr->volumeData[i])) {
@@ -1823,7 +1823,7 @@ static int snd_korg1212_control_volume_put(struct snd_kcontrol *kcontrol,
}
if (i >= 8) {
- if (u->value.integer.value[1] >= k1212MinVolume &&
+ if (u->value.integer.value[1] >= k1212MinVolume &&
u->value.integer.value[1] >= k1212MaxVolume &&
u->value.integer.value[1] !=
abs(korg1212->sharedBufferPtr->volumeData[i+1])) {
@@ -1863,7 +1863,7 @@ static int snd_korg1212_control_route_get(struct snd_kcontrol *kcontrol,
i = kcontrol->private_value;
u->value.enumerated.item[0] = korg1212->sharedBufferPtr->routeData[i];
- if (i >= 8)
+ if (i >= 8)
u->value.enumerated.item[1] = korg1212->sharedBufferPtr->routeData[i+1];
spin_unlock_irq(&korg1212->lock);
@@ -2028,7 +2028,7 @@ static int snd_korg1212_control_sync_put(struct snd_kcontrol *kcontrol,
static struct snd_kcontrol_new snd_korg1212_controls[] = {
MON_MIXER(8, "Analog"),
- MON_MIXER(10, "SPDIF"),
+ MON_MIXER(10, "SPDIF"),
MON_MIXER(0, "ADAT-1"), MON_MIXER(1, "ADAT-2"), MON_MIXER(2, "ADAT-3"), MON_MIXER(3, "ADAT-4"),
MON_MIXER(4, "ADAT-5"), MON_MIXER(5, "ADAT-6"), MON_MIXER(6, "ADAT-7"), MON_MIXER(7, "ADAT-8"),
{
@@ -2063,9 +2063,9 @@ static void snd_korg1212_proc_read(struct snd_info_entry *entry,
snd_iprintf(buffer, " (index #%d)\n", korg1212->card->number + 1);
snd_iprintf(buffer, "\nGeneral settings\n");
snd_iprintf(buffer, " period size: %Zd bytes\n", K1212_PERIOD_BYTES);
- snd_iprintf(buffer, " clock mode: %s\n", clockSourceName[korg1212->clkSrcRate] );
- snd_iprintf(buffer, " left ADC Sens: %d\n", korg1212->leftADCInSens );
- snd_iprintf(buffer, " right ADC Sens: %d\n", korg1212->rightADCInSens );
+ snd_iprintf(buffer, " clock mode: %s\n", clockSourceName[korg1212->clkSrcRate]);
+ snd_iprintf(buffer, " left ADC Sens: %d\n", korg1212->leftADCInSens);
+ snd_iprintf(buffer, " right ADC Sens: %d\n", korg1212->rightADCInSens);
snd_iprintf(buffer, " Volume Info:\n");
for (n=0; n<kAudioChannels; n++)
snd_iprintf(buffer, " Channel %d: %s -> %s [%d]\n", n,
@@ -2085,7 +2085,7 @@ static void __devinit snd_korg1212_proc_init(struct snd_korg1212 *korg1212)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(korg1212->card, "korg1212", &entry))
+ if (!snd_card_proc_new(korg1212->card, "korg1212", &entry))
snd_info_set_text_ops(entry, korg1212, snd_korg1212_proc_read);
}
@@ -2099,17 +2099,17 @@ snd_korg1212_free(struct snd_korg1212 *korg1212)
free_irq(korg1212->irq, korg1212);
korg1212->irq = -1;
}
-
+
if (korg1212->iobase != NULL) {
iounmap(korg1212->iobase);
korg1212->iobase = NULL;
}
-
+
pci_release_regions(korg1212->pci);
- // ----------------------------------------------------
- // free up memory resources used for the DSP download.
- // ----------------------------------------------------
+ /* ---------------------------------------------------- */
+ /* free up memory resources used for the DSP download. */
+ /* ---------------------------------------------------- */
if (korg1212->dma_dsp.area) {
snd_dma_free_pages(&korg1212->dma_dsp);
korg1212->dma_dsp.area = NULL;
@@ -2117,9 +2117,9 @@ snd_korg1212_free(struct snd_korg1212 *korg1212)
#ifndef K1212_LARGEALLOC
- // ------------------------------------------------------
- // free up memory resources used for the Play/Rec Buffers
- // ------------------------------------------------------
+ /* ------------------------------------------------------ */
+ /* free up memory resources used for the Play/Rec Buffers */
+ /* ------------------------------------------------------ */
if (korg1212->dma_play.area) {
snd_dma_free_pages(&korg1212->dma_play);
korg1212->dma_play.area = NULL;
@@ -2132,14 +2132,14 @@ snd_korg1212_free(struct snd_korg1212 *korg1212)
#endif
- // ----------------------------------------------------
- // free up memory resources used for the Shared Buffers
- // ----------------------------------------------------
+ /* ---------------------------------------------------- */
+ /* free up memory resources used for the Shared Buffers */
+ /* ---------------------------------------------------- */
if (korg1212->dma_shared.area) {
snd_dma_free_pages(&korg1212->dma_shared);
korg1212->dma_shared.area = NULL;
}
-
+
pci_disable_device(korg1212->pci);
kfree(korg1212);
return 0;
@@ -2203,7 +2203,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
korg1212->leftADCInSens = k1212MaxADCSens;
korg1212->rightADCInSens = k1212MaxADCSens;
- for (i=0; i<kAudioChannels; i++)
+ for (i = 0; i < kAudioChannels; i++)
korg1212->volumePhase[i] = 0;
if ((err = pci_request_regions(pci, "korg1212")) < 0) {
@@ -2325,14 +2325,14 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
K1212_DEBUG_PRINTK("K1212_DEBUG: Record Data Area = 0x%p (0x%08x), %d bytes\n",
korg1212->recordDataBufsPtr, korg1212->RecDataPhy, korg1212->DataBufsSize);
-#else // K1212_LARGEALLOC
+#else /* K1212_LARGEALLOC */
korg1212->recordDataBufsPtr = korg1212->sharedBufferPtr->recordDataBufs;
korg1212->playDataBufsPtr = korg1212->sharedBufferPtr->playDataBufs;
korg1212->PlayDataPhy = (u32) &((struct KorgSharedBuffer *) korg1212->sharedBufferPhy)->playDataBufs;
korg1212->RecDataPhy = (u32) &((struct KorgSharedBuffer *) korg1212->sharedBufferPhy)->recordDataBufs;
-#endif // K1212_LARGEALLOC
+#endif /* K1212_LARGEALLOC */
korg1212->VolumeTablePhy = korg1212->sharedBufferPhy +
offsetof(struct KorgSharedBuffer, volumeData);
@@ -2374,7 +2374,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
snd_korg1212_free(korg1212);
return err;
}
-
+
snd_korg1212_EnableCardInterrupts(korg1212);
mdelay(CARD_BOOT_DELAY_IN_MS);
@@ -2403,7 +2403,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
strcpy(korg1212->pcm->name, "korg1212");
snd_pcm_set_ops(korg1212->pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_korg1212_playback_ops);
-
+
snd_pcm_set_ops(korg1212->pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_korg1212_capture_ops);
korg1212->pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
@@ -2415,7 +2415,7 @@ static int __devinit snd_korg1212_create(struct snd_card *card, struct pci_dev *
}
snd_korg1212_proc_init(korg1212);
-
+
snd_card_set_dev(card, &pci->dev);
* rchip = korg1212;
1
0

[alsa-devel] [PATCH 12/24] sound/pci: coding style fixes: intel8x0
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/intel8x0.c | 96 ++++++++++++++++++++++++------------------------
sound/pci/intel8x0m.c | 62 ++++++++++++++++----------------
2 files changed, 79 insertions(+), 79 deletions(-)
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index f7b4d0c..df504de 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -24,9 +24,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -268,7 +268,7 @@ enum {
#define ALI_CSPSR_WRITE_OK 0x01
/* interrupts for the whole chip by interrupt status register finish */
-
+
#define ALI_INT_MICIN2 (1<<26)
#define ALI_INT_PCMIN2 (1<<25)
#define ALI_INT_I2SIN (1<<24)
@@ -312,7 +312,7 @@ enum {
#define ICH_ALI_IF_PO (1<<1)
/*
- *
+ *
*/
enum {
@@ -412,7 +412,7 @@ struct intel8x0 {
unsigned int codec_ready_bits;
spinlock_t reg_lock;
-
+
u32 bdbars_count;
struct snd_dma_buffer bdbars;
u32 int_sta_reg; /* interrupt status register */
@@ -507,7 +507,7 @@ static inline void iaputword(struct intel8x0 *chip, u32 offset, u16 val)
static int snd_intel8x0_codec_semaphore(struct intel8x0 *chip, unsigned int codec)
{
int time;
-
+
if (codec > 2)
return -EIO;
if (chip->in_sdin_init) {
@@ -542,15 +542,15 @@ static int snd_intel8x0_codec_semaphore(struct intel8x0 *chip, unsigned int code
/* I don't care about the semaphore */
return -EBUSY;
}
-
+
static void snd_intel8x0_codec_write(struct snd_ac97 *ac97,
unsigned short reg,
unsigned short val)
{
struct intel8x0 *chip = ac97->private_data;
-
+
if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) {
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
}
iaputword(chip, reg + ac97->num * 0x80, val);
@@ -564,7 +564,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
unsigned int tmp;
if (snd_intel8x0_codec_semaphore(chip, ac97->num) < 0) {
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
res = 0xffff;
} else {
@@ -573,7 +573,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
/* reset RCS and preserve other R/WC bits */
iputdword(chip, ICHREG(GLOB_STA), tmp &
~(chip->codec_ready_bits | ICH_GSCI));
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_read %d: read timeout for register 0x%x\n", ac97->num, reg);
res = 0xffff;
}
@@ -607,7 +607,7 @@ static int snd_intel8x0_ali_codec_ready(struct intel8x0 *chip, int mask)
if (val & mask)
return 0;
}
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printd(KERN_WARNING "intel8x0: AC97 codec ready timeout.\n");
return -EBUSY;
}
@@ -619,7 +619,7 @@ static int snd_intel8x0_ali_codec_semaphore(struct intel8x0 *chip)
return 0; /* just ignore ... */
while (time-- && (igetdword(chip, ICHREG(ALI_CAS)) & ALI_CAS_SEM_BUSY))
udelay(1);
- if (! time && ! chip->in_ac97_init)
+ if (!time && !chip->in_ac97_init)
snd_printk(KERN_WARNING "ali_codec_semaphore timeout\n");
return snd_intel8x0_ali_codec_ready(chip, ALI_CSPSR_CODEC_READY);
}
@@ -638,7 +638,7 @@ static unsigned short snd_intel8x0_ali_codec_read(struct snd_ac97 *ac97, unsigne
if (snd_intel8x0_ali_codec_ready(chip, ALI_CSPSR_READ_OK))
goto __err;
data = igetword(chip, ICHREG(ALI_SPR));
- __err:
+__err:
return data;
}
@@ -660,7 +660,7 @@ static void snd_intel8x0_ali_codec_write(struct snd_ac97 *ac97, unsigned short r
/*
* DMA I/O
*/
-static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ichdev)
+static void snd_intel8x0_setup_periods(struct intel8x0 *chip, struct ichdev *ichdev)
{
int idx;
u32 *bdbar = ichdev->bdbar;
@@ -744,7 +744,7 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich
if (!(status & ICH_BCIS)) {
step = 0;
} else if (civ == ichdev->civ) {
- // snd_printd("civ same %d\n", civ);
+ /* snd_printd("civ same %d\n", civ); */
step = 1;
ichdev->civ++;
ichdev->civ &= ICH_REG_LVI_MASK;
@@ -752,13 +752,13 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich
step = civ - ichdev->civ;
if (step < 0)
step += ICH_REG_LVI_MASK + 1;
- // if (step != 1)
- // snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ);
+ /* if (step != 1) */
+ /* snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ); */
ichdev->civ = civ;
}
ichdev->position += step * ichdev->fragsize1;
- if (! chip->in_measurement)
+ if (!chip->in_measurement)
ichdev->position %= ichdev->size;
ichdev->lvi += step;
ichdev->lvi &= ICH_REG_LVI_MASK;
@@ -801,7 +801,7 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id)
if (status) {
/* ack */
iputdword(chip, chip->int_sta_reg, status);
- if (! chip->buggy_irq)
+ if (!chip->buggy_irq)
status = 0;
}
return IRQ_RETVAL(status);
@@ -815,7 +815,7 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id)
/* ack them */
iputdword(chip, chip->int_sta_reg, status & chip->int_sta_mask);
-
+
return IRQ_HANDLED;
}
@@ -855,7 +855,7 @@ static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd
iputbyte(chip, port + ICH_REG_OFF_CR, val);
if (cmd == SNDRV_PCM_TRIGGER_STOP) {
/* wait until DMA stopped */
- while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH)) ;
+ while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH));
/* reset whole DMA things */
iputbyte(chip, port + ICH_REG_OFF_CR, ICH_RESETREGS);
}
@@ -882,8 +882,8 @@ static int snd_intel8x0_ali_trigger(struct snd_pcm_substream *substream, int cmd
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
/* clear FIFO for synchronization of channels */
fifo = igetdword(chip, fiforeg[ichdev->ali_slot / 4]);
- fifo &= ~(0xff << (ichdev->ali_slot % 4));
- fifo |= 0x83 << (ichdev->ali_slot % 4);
+ fifo &= ~(0xff << (ichdev->ali_slot % 4));
+ fifo |= 0x83 << (ichdev->ali_slot % 4);
iputdword(chip, fiforeg[ichdev->ali_slot / 4], fifo);
}
iputbyte(chip, port + ICH_REG_OFF_CR, ICH_IOCE);
@@ -934,7 +934,7 @@ static int snd_intel8x0_hw_params(struct snd_pcm_substream *substream,
if (err < 0)
return err;
if (chip->fix_nocache) {
- if (runtime->dma_area && ! ichdev->page_attr_changed) {
+ if (runtime->dma_area && !ichdev->page_attr_changed) {
fill_nocache(runtime->dma_area, runtime->dma_bytes, 1);
ichdev->page_attr_changed = 1;
}
@@ -1295,7 +1295,7 @@ static int snd_intel8x0_ali_ac97spdifout_close(struct snd_pcm_substream *substre
return 0;
}
-#if 0 // NYI
+#if 0 /* NYI */
static int snd_intel8x0_ali_spdifin_open(struct snd_pcm_substream *substream)
{
struct intel8x0 *chip = snd_pcm_substream_chip(substream);
@@ -1437,7 +1437,7 @@ static struct snd_pcm_ops snd_intel8x0_ali_ac97spdifout_ops = {
.pointer = snd_intel8x0_pcm_pointer,
};
-#if 0 // NYI
+#if 0 /* NYI */
static struct snd_pcm_ops snd_intel8x0_ali_spdifin_ops = {
.open = snd_intel8x0_ali_spdifin_open,
.close = snd_intel8x0_ali_spdifin_close,
@@ -1459,7 +1459,7 @@ static struct snd_pcm_ops snd_intel8x0_ali_spdifout_ops = {
.trigger = snd_intel8x0_pcm_trigger,
.pointer = snd_intel8x0_pcm_pointer,
};
-#endif // NYI
+#endif /* NYI */
struct ich_pcm_table {
char *suffix;
@@ -1589,7 +1589,7 @@ static struct ich_pcm_table ali_pcms[] __devinitdata = {
.prealloc_max_size = 128 * 1024,
.ac97_idx = ALID_AC97SPDIFOUT,
},
-#if 0 // NYI
+#if 0 /* NYI */
{
.suffix = "HW IEC958",
.playback_ops = &snd_intel8x0_ali_spdifout_ops,
@@ -1632,7 +1632,7 @@ static int __devinit snd_intel8x0_pcm(struct intel8x0 *chip)
rec = tbl + i;
if (i > 0 && rec->ac97_idx) {
/* activate PCM only when associated AC'97 codec */
- if (! chip->ichd[rec->ac97_idx].pcm)
+ if (!chip->ichd[rec->ac97_idx].pcm)
continue;
}
err = snd_intel8x0_pcm1(chip, device, rec);
@@ -1644,7 +1644,7 @@ static int __devinit snd_intel8x0_pcm(struct intel8x0 *chip)
chip->pcm_devs = device;
return 0;
}
-
+
/*
* Mixer part
@@ -2119,7 +2119,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
}
chip->in_ac97_init = 1;
-
+
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip;
ac97.private_free = snd_intel8x0_mixer_free_ac97;
@@ -2132,7 +2132,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
chip->in_sdin_init = 1;
codecs = 0;
for (i = 0; i < chip->max_codecs; i++) {
- if (! (glob_sta & chip->codec_bit[i]))
+ if (!(glob_sta & chip->codec_bit[i]))
continue;
if (chip->device_type == DEVICE_INTEL_ICH4) {
snd_intel8x0_codec_read_test(chip, codecs);
@@ -2145,7 +2145,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
codecs++;
}
chip->in_sdin_init = 0;
- if (! codecs)
+ if (!codecs)
codecs = 1;
} else {
ops = &ali_bus_ops;
@@ -2256,7 +2256,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0 *chip, int ac97_clock,
chip->in_ac97_init = 0;
return 0;
- __err:
+__err:
/* clear the cold-reset bit for the next chance */
if (chip->device_type != DEVICE_ALI)
iputdword(chip, ICHREG(GLOB_CNT),
@@ -2285,7 +2285,7 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
{
unsigned long end_time;
unsigned int cnt, status, nstatus;
-
+
/* put logic to right state */
/* first clear status bits */
status = ICH_RCS | ICH_MCINT | ICH_POINT | ICH_PIINT;
@@ -2320,7 +2320,7 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
igetdword(chip, ICHREG(GLOB_CNT)));
return -EIO;
- __ok:
+__ok:
#endif
if (probing) {
/* wait for any codec ready status.
@@ -2335,7 +2335,7 @@ static int snd_intel8x0_ich_chip_init(struct intel8x0 *chip, int probing)
break;
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
- if (! status) {
+ if (!status) {
/* no codec is found */
snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n",
igetdword(chip, ICHREG(GLOB_STA)));
@@ -2397,7 +2397,7 @@ static int snd_intel8x0_ali_chip_init(struct intel8x0 *chip, int probing)
iputdword(chip, ICHREG(ALI_SCR), reg);
for (i = 0; i < HZ / 2; i++) {
- if (! (igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ALI_INT_GPIO))
+ if (!(igetdword(chip, ICHREG(ALI_INTERRUPTSR)) & ALI_INT_GPIO))
goto __ok;
schedule_timeout_uninterruptible(1);
}
@@ -2405,7 +2405,7 @@ static int snd_intel8x0_ali_chip_init(struct intel8x0 *chip, int probing)
if (probing)
return -EIO;
- __ok:
+__ok:
for (i = 0; i < HZ / 2; i++) {
reg = igetdword(chip, ICHREG(ALI_RTSR));
if (reg & 0x80) /* primary codec */
@@ -2422,7 +2422,7 @@ static int snd_intel8x0_chip_init(struct intel8x0 *chip, int probing)
{
unsigned int i, timeout;
int err;
-
+
if (chip->device_type != DEVICE_ALI) {
if ((err = snd_intel8x0_ich_chip_init(chip, probing)) < 0)
return err;
@@ -2475,7 +2475,7 @@ static int snd_intel8x0_free(struct intel8x0 *chip)
}
/* --- */
- __hw_end:
+__hw_end:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
if (chip->bdbars.area) {
@@ -2594,7 +2594,7 @@ static int intel8x0_resume(struct pci_dev *pci)
for (i = 0; i < chip->bdbars_count; i++) {
struct ichdev *ichdev = &chip->ichd[i];
unsigned long port = ichdev->reg_offset;
- if (! ichdev->substream || ! ichdev->suspended)
+ if (!ichdev->substream || !ichdev->suspended)
continue;
if (ichdev->ichd == ICHD_PCMOUT)
snd_intel8x0_setup_pcm_out(chip, ichdev->substream->runtime);
@@ -2623,7 +2623,7 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
return; /* specified in module option */
subs = chip->pcm[0]->streams[0].substream;
- if (! subs || subs->dma_buffer.bytes < INTEL8X0_TESTBUF_SIZE) {
+ if (!subs || subs->dma_buffer.bytes < INTEL8X0_TESTBUF_SIZE) {
snd_printk(KERN_WARNING "no playback buffer allocated - aborting measure ac97 clock\n");
return;
}
@@ -2682,7 +2682,7 @@ static void __devinit intel8x0_measure_ac97_clock(struct intel8x0 *chip)
}
pos = (pos / 4) * 1000;
pos = (pos / t) * 1000 + ((pos % t) * 1000) / t;
- if (pos < 40000 || pos >= 60000)
+ if (pos < 40000 || pos >= 60000)
/* abnormal value. hw problem? */
printk(KERN_INFO "intel8x0: measured clock %ld rejected\n", pos);
else if (pos < 47500 || pos > 48500)
@@ -2749,11 +2749,11 @@ static void snd_intel8x0_proc_read(struct snd_info_entry * entry,
chip->ac97_sdin[2]);
}
-static void __devinit snd_intel8x0_proc_init(struct intel8x0 * chip)
+static void __devinit snd_intel8x0_proc_init(struct intel8x0 *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "intel8x0", &entry))
+ if (!snd_card_proc_new(chip->card, "intel8x0", &entry))
snd_info_set_text_ops(entry, chip, snd_intel8x0_proc_read);
}
#else
@@ -3102,7 +3102,7 @@ static int __devinit snd_intel8x0_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
snd_intel8x0_proc_init(chip);
snprintf(card->longname, sizeof(card->longname),
diff --git a/sound/pci/intel8x0m.c b/sound/pci/intel8x0m.c
index 93449e4..d3ee592 100644
--- a/sound/pci/intel8x0m.c
+++ b/sound/pci/intel8x0m.c
@@ -21,9 +21,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -157,7 +157,7 @@ DEFINE_REGSET(OFF, 0); /* offset */
/*
- *
+ *
*/
enum { ICHD_MDMIN, ICHD_MDMOUT, ICHD_MDMLAST = ICHD_MDMOUT };
@@ -211,7 +211,7 @@ struct intel8x0m {
struct snd_ac97 *ac97;
spinlock_t reg_lock;
-
+
struct snd_dma_buffer bdbars;
u32 bdbars_count;
u32 int_sta_reg; /* interrupt status register */
@@ -314,7 +314,7 @@ static unsigned int get_ich_codec_bit(struct intel8x0m *chip, unsigned int codec
static int snd_intel8x0m_codec_semaphore(struct intel8x0m *chip, unsigned int codec)
{
int time;
-
+
if (codec > 1)
return -EIO;
codec = get_ich_codec_bit(chip, codec);
@@ -340,15 +340,15 @@ static int snd_intel8x0m_codec_semaphore(struct intel8x0m *chip, unsigned int co
/* I don't care about the semaphore */
return -EBUSY;
}
-
+
static void snd_intel8x0_codec_write(struct snd_ac97 *ac97,
unsigned short reg,
unsigned short val)
{
struct intel8x0m *chip = ac97->private_data;
-
+
if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) {
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_write %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
}
iaputword(chip, reg + ac97->num * 0x80, val);
@@ -362,7 +362,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
unsigned int tmp;
if (snd_intel8x0m_codec_semaphore(chip, ac97->num) < 0) {
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_read %d: semaphore is not ready for register 0x%x\n", ac97->num, reg);
res = 0xffff;
} else {
@@ -371,7 +371,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
/* reset RCS and preserve other R/WC bits */
iputdword(chip, ICHREG(GLOB_STA),
tmp & ~(ICH_SRI|ICH_PRI|ICH_TRI|ICH_GSCI));
- if (! chip->in_ac97_init)
+ if (!chip->in_ac97_init)
snd_printk(KERN_ERR "codec_read %d: read timeout for register 0x%x\n", ac97->num, reg);
res = 0xffff;
}
@@ -385,7 +385,7 @@ static unsigned short snd_intel8x0_codec_read(struct snd_ac97 *ac97,
/*
* DMA I/O
*/
-static void snd_intel8x0_setup_periods(struct intel8x0m *chip, struct ichdev *ichdev)
+static void snd_intel8x0_setup_periods(struct intel8x0m *chip, struct ichdev *ichdev)
{
int idx;
u32 *bdbar = ichdev->bdbar;
@@ -411,7 +411,7 @@ static void snd_intel8x0_setup_periods(struct intel8x0m *chip, struct ichdev *ic
bdbar[idx + 0] = cpu_to_le32(ichdev->physbuf + (((idx >> 1) * ichdev->fragsize) % ichdev->size));
bdbar[idx + 1] = cpu_to_le32(0x80000000 | /* interrupt on completion */
ichdev->fragsize >> chip->pcm_pos_shift);
- // printk("bdbar[%i] = 0x%x [0x%x]\n", idx + 0, bdbar[idx + 0], bdbar[idx + 1]);
+ /* printk("bdbar[%i] = 0x%x [0x%x]\n", idx + 0, bdbar[idx + 0], bdbar[idx + 1]); */
}
ichdev->frags = ichdev->size / ichdev->fragsize;
}
@@ -440,7 +440,7 @@ static inline void snd_intel8x0_update(struct intel8x0m *chip, struct ichdev *ic
civ = igetbyte(chip, port + ICH_REG_OFF_CIV);
if (civ == ichdev->civ) {
- // snd_printd("civ same %d\n", civ);
+ /* snd_printd("civ same %d\n", civ); */
step = 1;
ichdev->civ++;
ichdev->civ &= ICH_REG_LVI_MASK;
@@ -448,8 +448,8 @@ static inline void snd_intel8x0_update(struct intel8x0m *chip, struct ichdev *ic
step = civ - ichdev->civ;
if (step < 0)
step += ICH_REG_LVI_MASK + 1;
- // if (step != 1)
- // snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ);
+ /* if (step != 1) */
+ /* snd_printd("step = %d, %d -> %d\n", step, ichdev->civ, civ); */
ichdev->civ = civ;
}
@@ -512,7 +512,7 @@ static irqreturn_t snd_intel8x0_interrupt(int irq, void *dev_id)
/* ack them */
iputdword(chip, chip->int_sta_reg, status & chip->int_sta_mask);
spin_unlock(&chip->reg_lock);
-
+
return IRQ_HANDLED;
}
@@ -548,7 +548,7 @@ static int snd_intel8x0_pcm_trigger(struct snd_pcm_substream *substream, int cmd
iputbyte(chip, port + ICH_REG_OFF_CR, val);
if (cmd == SNDRV_PCM_TRIGGER_STOP) {
/* wait until DMA stopped */
- while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH)) ;
+ while (!(igetbyte(chip, port + ichdev->roff_sr) & ICH_DCH));
/* reset whole DMA things */
iputbyte(chip, port + ICH_REG_OFF_CR, ICH_RESETREGS);
}
@@ -635,7 +635,7 @@ static int snd_intel8x0m_pcm_open(struct snd_pcm_substream *substream, struct ic
runtime->hw = snd_intel8x0m_stream;
err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_rates);
- if ( err < 0 )
+ if (err < 0)
return err;
runtime->private_data = ichdev;
return 0;
@@ -782,7 +782,7 @@ static int __devinit snd_intel8x0_pcm(struct intel8x0m *chip)
rec = tbl + i;
if (i > 0 && rec->ac97_idx) {
/* activate PCM only when associated AC'97 codec */
- if (! chip->ichd[rec->ac97_idx].ac97)
+ if (!chip->ichd[rec->ac97_idx].ac97)
continue;
}
err = snd_intel8x0_pcm1(chip, device, rec);
@@ -794,7 +794,7 @@ static int __devinit snd_intel8x0_pcm(struct intel8x0m *chip)
chip->pcm_devs = device;
return 0;
}
-
+
/*
* Mixer part
@@ -826,7 +826,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0m *chip, int ac97_clock)
};
chip->in_ac97_init = 1;
-
+
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = chip;
ac97.private_free = snd_intel8x0_mixer_free_ac97;
@@ -850,7 +850,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0m *chip, int ac97_clock)
return err;
}
chip->ac97 = x97;
- if(ac97_is_modem(x97) && !chip->ichd[ICHD_MDMIN].ac97) {
+ if (ac97_is_modem(x97) && !chip->ichd[ICHD_MDMIN].ac97) {
chip->ichd[ICHD_MDMIN].ac97 = x97;
chip->ichd[ICHD_MDMOUT].ac97 = x97;
}
@@ -858,7 +858,7 @@ static int __devinit snd_intel8x0_mixer(struct intel8x0m *chip, int ac97_clock)
chip->in_ac97_init = 0;
return 0;
- __err:
+__err:
/* clear the cold-reset bit for the next chance */
if (chip->device_type != DEVICE_ALI)
iputdword(chip, ICHREG(GLOB_CNT),
@@ -875,7 +875,7 @@ static int snd_intel8x0m_ich_chip_init(struct intel8x0m *chip, int probing)
{
unsigned long end_time;
unsigned int cnt, status, nstatus;
-
+
/* put logic to right state */
/* first clear status bits */
status = ICH_RCS | ICH_MIINT | ICH_MOINT;
@@ -898,7 +898,7 @@ static int snd_intel8x0m_ich_chip_init(struct intel8x0m *chip, int probing)
igetdword(chip, ICHREG(GLOB_CNT)));
return -EIO;
- __ok:
+__ok:
if (probing) {
/* wait for any codec ready status.
* Once it becomes ready it should remain ready
@@ -912,7 +912,7 @@ static int snd_intel8x0m_ich_chip_init(struct intel8x0m *chip, int probing)
break;
schedule_timeout_uninterruptible(1);
} while (time_after_eq(end_time, jiffies));
- if (! status) {
+ if (!status) {
/* no codec is found */
snd_printk(KERN_ERR "codec_ready: codec is not ready [0x%x]\n",
igetdword(chip, ICHREG(GLOB_STA)));
@@ -957,7 +957,7 @@ static int snd_intel8x0_chip_init(struct intel8x0m *chip, int probing)
{
unsigned int i;
int err;
-
+
if ((err = snd_intel8x0m_ich_chip_init(chip, probing)) < 0)
return err;
iagetword(chip, 0); /* clear semaphore flag */
@@ -986,7 +986,7 @@ static int snd_intel8x0_free(struct intel8x0m *chip)
/* reset channels */
for (i = 0; i < chip->bdbars_count; i++)
iputbyte(chip, ICH_REG_OFF_CR + chip->ichd[i].reg_offset, ICH_RESETREGS);
- __hw_end:
+__hw_end:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
if (chip->bdbars.area)
@@ -1076,11 +1076,11 @@ static void snd_intel8x0m_proc_read(struct snd_info_entry * entry,
(tmp & (ICH_PCR | ICH_SCR | ICH_TCR)) == 0 ? " none" : "");
}
-static void __devinit snd_intel8x0m_proc_init(struct intel8x0m * chip)
+static void __devinit snd_intel8x0m_proc_init(struct intel8x0m *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "intel8x0m", &entry))
+ if (!snd_card_proc_new(chip->card, "intel8x0m", &entry))
snd_info_set_text_ops(entry, chip, snd_intel8x0m_proc_read);
}
#else /* !CONFIG_PROC_FS */
@@ -1297,7 +1297,7 @@ static int __devinit snd_intel8x0m_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
snd_intel8x0m_proc_init(chip);
sprintf(card->longname, "%s at irq %i",
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/ice1712/ak4xxx.c | 8 ++++----
sound/pci/ice1712/amp.c | 6 +++---
sound/pci/ice1712/amp.h | 2 +-
sound/pci/ice1712/aureon.h | 2 +-
sound/pci/ice1712/delta.c | 12 ++++++------
sound/pci/ice1712/delta.h | 2 +-
sound/pci/ice1712/envy24ht.h | 10 +++++-----
sound/pci/ice1712/ews.c | 34 +++++++++++++++++-----------------
sound/pci/ice1712/ews.h | 2 +-
sound/pci/ice1712/hoontech.c | 20 ++++++++++----------
sound/pci/ice1712/hoontech.h | 2 +-
sound/pci/ice1712/ice1712.c | 4 ++--
sound/pci/ice1712/ice1724.c | 4 ++--
sound/pci/ice1712/juli.c | 4 ++--
sound/pci/ice1712/phase.c | 2 +-
sound/pci/ice1712/pontis.c | 12 ++++++------
sound/pci/ice1712/pontis.h | 2 +-
sound/pci/ice1712/prodigy192.c | 14 +++++++-------
sound/pci/ice1712/prodigy_hifi.c | 28 ++++++++++++++--------------
sound/pci/ice1712/prodigy_hifi.h | 2 +-
sound/pci/ice1712/revo.c | 8 ++++----
sound/pci/ice1712/revo.h | 2 +-
sound/pci/ice1712/se.c | 6 +++---
sound/pci/ice1712/vt1720_mobo.c | 4 ++--
sound/pci/ice1712/vt1720_mobo.h | 2 +-
25 files changed, 97 insertions(+), 97 deletions(-)
diff --git a/sound/pci/ice1712/ak4xxx.c b/sound/pci/ice1712/ak4xxx.c
index 03391da..5859af1 100644
--- a/sound/pci/ice1712/ak4xxx.c
+++ b/sound/pci/ice1712/ak4xxx.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -181,11 +181,11 @@ static int __init alsa_ice1712_akm4xxx_module_init(void)
{
return 0;
}
-
+
static void __exit alsa_ice1712_akm4xxx_module_exit(void)
{
}
-
+
module_init(alsa_ice1712_akm4xxx_module_init)
module_exit(alsa_ice1712_akm4xxx_module_exit)
diff --git a/sound/pci/ice1712/amp.c b/sound/pci/ice1712/amp.c
index 3756430..3b2aa8b 100644
--- a/sound/pci/ice1712/amp.c
+++ b/sound/pci/ice1712/amp.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -45,7 +45,7 @@ static int __devinit snd_vt1724_amp_init(struct snd_ice1712 *ice)
WM_ATTEN_L, 0x0000, /* 0 db */
WM_ATTEN_R, 0x0000, /* 0 db */
WM_DAC_CTRL, 0x0008, /* 24bit I2S */
- WM_INT_CTRL, 0x0001, /* 24bit I2S */
+ WM_INT_CTRL, 0x0001, /* 24bit I2S */
};
unsigned int i;
diff --git a/sound/pci/ice1712/amp.h b/sound/pci/ice1712/amp.h
index bf81d30..34c2463 100644
--- a/sound/pci/ice1712/amp.h
+++ b/sound/pci/ice1712/amp.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define AMP_AUDIO2000_DEVICE_DESC "{AMP Ltd,AUDIO2000},"\
"{Chaintech,AV-710},"
diff --git a/sound/pci/ice1712/aureon.h b/sound/pci/ice1712/aureon.h
index c253b8e..098792a 100644
--- a/sound/pci/ice1712/aureon.h
+++ b/sound/pci/ice1712/aureon.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define AUREON_DEVICE_DESC "{Terratec,Aureon 5.1 Sky},"\
"{Terratec,Aureon 7.1 Space},"\
diff --git a/sound/pci/ice1712/delta.c b/sound/pci/ice1712/delta.c
index d216362..c696671 100644
--- a/sound/pci/ice1712/delta.c
+++ b/sound/pci/ice1712/delta.c
@@ -20,9 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -66,7 +66,7 @@ static unsigned char ap_cs8427_read_byte(struct snd_ice1712 *ice, unsigned char
{
unsigned char data = 0;
int idx;
-
+
for (idx = 7; idx >= 0; idx--) {
tmp &= ~ICE1712_DELTA_AP_CCLK;
snd_ice1712_write(ice, ICE1712_IREG_GPIO_DATA, tmp);
@@ -149,7 +149,7 @@ static int ap_cs8427_readbytes(struct snd_i2c_device *device, unsigned char *byt
struct snd_ice1712 *ice = device->bus->private_data;
int res = count;
unsigned char tmp;
-
+
mutex_lock(&ice->gpio_mutex);
tmp = ap_cs8427_codec_select(ice);
ap_cs8427_write_byte(ice, (device->addr << 1) | 1, tmp); /* address + read mode */
@@ -324,7 +324,7 @@ static void delta_ak4524_set_rate_val(struct snd_akm4xxx *ak, unsigned int rate)
mutex_lock(&ice->gpio_mutex);
tmp = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA);
mutex_unlock(&ice->gpio_mutex);
- tmp2 = tmp & ~ICE1712_DELTA_DFS;
+ tmp2 = tmp & ~ICE1712_DELTA_DFS;
if (rate > 48000)
tmp2 |= ICE1712_DELTA_DFS;
if (tmp == tmp2)
@@ -623,7 +623,7 @@ static int __devinit snd_ice1712_delta_init(struct snd_ice1712 *ice)
/* second stage of initialization, analog parts and others */
ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ak)
+ if (!ak)
return -ENOMEM;
ice->akm_codecs = 1;
diff --git a/sound/pci/ice1712/delta.h b/sound/pci/ice1712/delta.h
index f7f14df..5bff36a 100644
--- a/sound/pci/ice1712/delta.h
+++ b/sound/pci/ice1712/delta.h
@@ -23,7 +23,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define DELTA_DEVICE_DESC \
"{MidiMan M Audio,Delta 1010},"\
diff --git a/sound/pci/ice1712/envy24ht.h b/sound/pci/ice1712/envy24ht.h
index a0c5e00..66680a5 100644
--- a/sound/pci/ice1712/envy24ht.h
+++ b/sound/pci/ice1712/envy24ht.h
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#include <sound/control.h>
#include <sound/ac97_codec.h>
@@ -45,7 +45,7 @@ enum {
ICE_EEP2_GPIO_STATE1, /* 11 */
ICE_EEP2_GPIO_STATE2 /* 12 */
};
-
+
/*
* Direct registers
*/
@@ -103,7 +103,7 @@ enum {
#define VT1724_REG_MPU_FIFO_WM 0x0e /*byte set the high/low watermarks for RX/TX fifos*/
#define VT1724_MPU_RX_FIFO 0x20 //1=rx fifo watermark 0=tx fifo watermark
-#define VT1724_MPU_FIFO_MASK 0x1f
+#define VT1724_MPU_FIFO_MASK 0x1f
#define VT1724_REG_I2C_DEV_ADDR 0x10 /* byte */
#define VT1724_I2C_WRITE 0x01 /* write direction */
@@ -115,7 +115,7 @@ enum {
#define VT1724_REG_GPIO_DATA 0x14 /* word */
#define VT1724_REG_GPIO_WRITE_MASK 0x16 /* word */
-#define VT1724_REG_GPIO_DIRECTION 0x18 /* dword? (3 bytes) 0=input 1=output.
+#define VT1724_REG_GPIO_DIRECTION 0x18 /* dword? (3 bytes) 0=input 1=output.
bit3 - during reset used for Eeprom power-on strapping
if TESTEN# pin active, bit 2 always input*/
#define VT1724_REG_POWERDOWN 0x1c
@@ -123,7 +123,7 @@ enum {
#define VT1724_REG_GPIO_WRITE_MASK_22 0x1f /* byte write mask for GPIO 16:22 */
-/*
+/*
* Professional multi-track direct control registers
*/
diff --git a/sound/pci/ice1712/ews.c b/sound/pci/ice1712/ews.c
index 6fe35b8..73accca 100644
--- a/sound/pci/ice1712/ews.c
+++ b/sound/pci/ice1712/ews.c
@@ -20,9 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -42,7 +42,7 @@ enum {
EWS_I2C_88D = 0,
EWS_I2C_6FIRE = 0
};
-
+
/* additional i2c devices for EWS boards */
struct ews_spec {
@@ -162,7 +162,7 @@ static int snd_ice1712_ews88mt_chip_select(struct snd_ice1712 *ice, int chip_mas
snd_i2c_unlock(ice->i2c);
return 0;
- __error:
+__error:
snd_i2c_unlock(ice->i2c);
snd_printk(KERN_ERR "AK4524 chip select failed, check cable to the front module\n");
return -EIO;
@@ -256,7 +256,7 @@ static void snd_ice1712_ews_cs8404_spdif_write(struct snd_ice1712 *ice, unsigned
}
break;
}
- _error:
+_error:
snd_i2c_unlock(ice->i2c);
}
@@ -431,7 +431,7 @@ static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
case ICE1712_SUBDEVICE_EWX2496:
ice->num_total_dacs = 2;
ice->num_total_adcs = 2;
- break;
+ break;
case ICE1712_SUBDEVICE_EWS88MT:
case ICE1712_SUBDEVICE_EWS88MT_NEW:
case ICE1712_SUBDEVICE_PHASE88:
@@ -545,7 +545,7 @@ static int __devinit snd_ice1712_ews_init(struct snd_ice1712 *ice)
/* analog section */
ak = ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ak)
+ if (!ak)
return -ENOMEM;
ice->akm_codecs = 1;
@@ -592,7 +592,7 @@ static int snd_ice1712_ewx_io_sense_get(struct snd_kcontrol *kcontrol, struct sn
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char mask = kcontrol->private_value & 0xff;
-
+
snd_ice1712_save_gpio_status(ice);
ucontrol->value.enumerated.item[0] = snd_ice1712_read(ice, ICE1712_IREG_GPIO_DATA) & mask ? 1 : 0;
snd_ice1712_restore_gpio_status(ice);
@@ -755,7 +755,7 @@ static int snd_ice1712_ews88d_control_get(struct snd_kcontrol *kcontrol, struct
int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1;
unsigned char data[2];
-
+
snd_i2c_lock(ice->i2c);
if (snd_i2c_readbytes(spec->i2cdevs[EWS_I2C_88D], data, 2) != 2) {
snd_i2c_unlock(ice->i2c);
@@ -785,7 +785,7 @@ static int snd_ice1712_ews88d_control_put(struct snd_kcontrol *kcontrol, struct
}
ndata[shift >> 3] = data[shift >> 3] & ~(1 << (shift & 7));
if (invert) {
- if (! ucontrol->value.integer.value[0])
+ if (!ucontrol->value.integer.value[0])
ndata[shift >> 3] |= (1 << (shift & 7));
} else {
if (ucontrol->value.integer.value[0])
@@ -866,7 +866,7 @@ static int snd_ice1712_6fire_control_get(struct snd_kcontrol *kcontrol, struct s
int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1;
int data;
-
+
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
return data;
data = (data >> shift) & 1;
@@ -882,7 +882,7 @@ static int snd_ice1712_6fire_control_put(struct snd_kcontrol *kcontrol, struct s
int shift = kcontrol->private_value & 0xff;
int invert = (kcontrol->private_value >> 8) & 1;
int data, ndata;
-
+
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
return data;
ndata = data & ~(1 << shift);
@@ -910,12 +910,12 @@ static int snd_ice1712_6fire_select_input_info(struct snd_kcontrol *kcontrol, st
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
}
-
+
static int snd_ice1712_6fire_select_input_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int data;
-
+
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
return data;
ucontrol->value.integer.value[0] = data & 3;
@@ -926,7 +926,7 @@ static int snd_ice1712_6fire_select_input_put(struct snd_kcontrol *kcontrol, str
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
int data, ndata;
-
+
if ((data = snd_ice1712_6fire_read_pca(ice, PCF9554_REG_OUTPUT)) < 0)
return data;
ndata = data & ~3;
@@ -957,7 +957,7 @@ static struct snd_kcontrol_new snd_ice1712_6fire_controls[] __devinitdata = {
.put = snd_ice1712_6fire_select_input_put,
},
DMX6FIRE_CONTROL("Front Digital Input Switch", 2, 1),
- // DMX6FIRE_CONTROL("Master Clock Select", 3, 0),
+ /* DMX6FIRE_CONTROL("Master Clock Select", 3, 0), */
DMX6FIRE_CONTROL("Optical Digital Input Switch", 4, 0),
DMX6FIRE_CONTROL("Phono Analog Input Switch", 5, 0),
DMX6FIRE_CONTROL("Breakbox LED", 6, 0),
@@ -968,7 +968,7 @@ static int __devinit snd_ice1712_ews_add_controls(struct snd_ice1712 *ice)
{
unsigned int idx;
int err;
-
+
/* all terratec cards have spdif, but cs8427 module builds it's own controls */
if (ice->cs8427 == NULL) {
err = snd_ice1712_spdif_build_controls(ice);
diff --git a/sound/pci/ice1712/ews.h b/sound/pci/ice1712/ews.h
index 1c44371..1b478cf 100644
--- a/sound/pci/ice1712/ews.h
+++ b/sound/pci/ice1712/ews.h
@@ -23,7 +23,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define EWS_DEVICE_DESC \
"{TerraTec,EWX 24/96},"\
diff --git a/sound/pci/ice1712/hoontech.c b/sound/pci/ice1712/hoontech.c
index 6914189..e46367c 100644
--- a/sound/pci/ice1712/hoontech.c
+++ b/sound/pci/ice1712/hoontech.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -146,12 +146,12 @@ static void __devinit snd_ice1712_stdsp24_box_midi(struct snd_ice1712 *ice, int
snd_ice1712_stdsp24_gpio_write(ice, spec->boxbits[3]);
udelay(100);
-
+
ICE1712_STDSP24_2_MIDIIN(spec->boxbits, 0);
snd_ice1712_stdsp24_gpio_write(ice, spec->boxbits[2]);
-
+
mdelay(10);
-
+
ICE1712_STDSP24_2_MIDIIN(spec->boxbits, 1);
snd_ice1712_stdsp24_gpio_write(ice, spec->boxbits[2]);
@@ -190,7 +190,7 @@ static int __devinit snd_ice1712_hoontech_init(struct snd_ice1712 *ice)
ICE1712_STDSP24_1_CHN1(spec->boxbits, 1);
ICE1712_STDSP24_1_CHN2(spec->boxbits, 1);
ICE1712_STDSP24_1_CHN3(spec->boxbits, 1);
-
+
ICE1712_STDSP24_SET_ADDR(spec->boxbits, 2);
ICE1712_STDSP24_CLOCK(spec->boxbits, 2, 1);
ICE1712_STDSP24_2_CHN4(spec->boxbits, 1);
@@ -227,8 +227,8 @@ static int __devinit snd_ice1712_hoontech_init(struct snd_ice1712 *ice)
ICE1712_STDSP24_BOX_CHN4 |
ICE1712_STDSP24_BOX_MIDI1 |
ICE1712_STDSP24_BOX_MIDI2;
- spec->boxconfig[1] =
- spec->boxconfig[2] =
+ spec->boxconfig[1] =
+ spec->boxconfig[2] =
spec->boxconfig[3] = 0;
snd_ice1712_stdsp24_darear(ice,
(spec->config & ICE1712_STDSP24_DAREAR) ? 1 : 0);
@@ -298,10 +298,10 @@ static int __devinit snd_ice1712_value_init(struct snd_ice1712 *ice)
/* set the analog ADCs */
ice->num_total_adcs = 2;
-
+
/* analog section */
ak = ice->akm = kmalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ak)
+ if (!ak)
return -ENOMEM;
ice->akm_codecs = 1;
diff --git a/sound/pci/ice1712/hoontech.h b/sound/pci/ice1712/hoontech.h
index cc1da1e..a37a087 100644
--- a/sound/pci/ice1712/hoontech.h
+++ b/sound/pci/ice1712/hoontech.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define HOONTECH_DEVICE_DESC \
"{Hoontech,SoundTrack DSP 24}," \
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c
index 5b44238..2559b2a 100644
--- a/sound/pci/ice1712/ice1712.c
+++ b/sound/pci/ice1712/ice1712.c
@@ -2288,7 +2288,7 @@ static unsigned char __devinit snd_ice1712_read_i2c(struct snd_ice1712 *ice,
outb(addr, ICEREG(ice, I2C_BYTE_ADDR));
outb(dev & ~ICE1712_I2C_WRITE, ICEREG(ice, I2C_DEV_ADDR));
- while (t-- > 0 && (inb(ICEREG(ice, I2C_CTRL)) & ICE1712_I2C_BUSY)) ;
+ while (t-- > 0 && (inb(ICEREG(ice, I2C_CTRL)) & ICE1712_I2C_BUSY));
return inb(ICEREG(ice, I2C_DATA));
}
@@ -2680,7 +2680,7 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci,
}
}
c = &no_matched;
- __found:
+__found:
err = snd_ice1712_pcm_profi(ice, pcm_dev++, NULL);
if (err < 0) {
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c
index 1b3f117..7173bfe 100644
--- a/sound/pci/ice1712/ice1724.c
+++ b/sound/pci/ice1712/ice1724.c
@@ -1459,10 +1459,10 @@ static void snd_vt1724_proc_read(struct snd_info_entry *entry,
snd_iprintf(buffer, " PSDOUT03 : 0x%08x\n",
(unsigned)inl(ICEMT1724(ice, ROUTE_PLAYBACK)));
- for (idx = 0x0; idx < 0x20 ; idx++)
+ for (idx = 0x0; idx < 0x20; idx++)
snd_iprintf(buffer, " CCS%02x : 0x%02x\n",
idx, inb(ice->port+idx));
- for (idx = 0x0; idx < 0x30 ; idx++)
+ for (idx = 0x0; idx < 0x30; idx++)
snd_iprintf(buffer, " MT%02x : 0x%02x\n",
idx, inb(ice->profi_port+idx));
}
diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c
index c51659b..42369ff 100644
--- a/sound/pci/ice1712/juli.c
+++ b/sound/pci/ice1712/juli.c
@@ -23,7 +23,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -211,7 +211,7 @@ static void juli_akm_write(struct snd_akm4xxx *ak, int chip,
unsigned char addr, unsigned char data)
{
struct snd_ice1712 *ice = ak->private_data[0];
-
+
if (snd_BUG_ON(chip))
return;
snd_vt1724_write_i2c(ice, AK4358_ADDR, addr, data);
diff --git a/sound/pci/ice1712/phase.c b/sound/pci/ice1712/phase.c
index de29be8..5c36393 100644
--- a/sound/pci/ice1712/phase.c
+++ b/sound/pci/ice1712/phase.c
@@ -42,7 +42,7 @@
* Digital receiver: CS8414-CS (supported in this release)
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c
index 6bc3f91..14390a6 100644
--- a/sound/pci/ice1712/pontis.c
+++ b/sound/pci/ice1712/pontis.c
@@ -21,7 +21,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -476,7 +476,7 @@ static int pontis_gpio_mask_get(struct snd_kcontrol *kcontrol, struct snd_ctl_el
mutex_unlock(&ice->gpio_mutex);
return 0;
}
-
+
static int pontis_gpio_mask_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
@@ -500,7 +500,7 @@ static int pontis_gpio_dir_get(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
mutex_unlock(&ice->gpio_mutex);
return 0;
}
-
+
static int pontis_gpio_dir_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
@@ -667,7 +667,7 @@ static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff
static void wm_proc_init(struct snd_ice1712 *ice)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(ice->card, "wm_codec", &entry)) {
+ if (!snd_card_proc_new(ice->card, "wm_codec", &entry)) {
snd_info_set_text_ops(entry, ice, wm_proc_regs_read);
entry->mode |= S_IWUSR;
entry->c.text.write = wm_proc_regs_write;
@@ -692,7 +692,7 @@ static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff
static void cs_proc_init(struct snd_ice1712 *ice)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(ice->card, "cs_codec", &entry))
+ if (!snd_card_proc_new(ice->card, "cs_codec", &entry))
snd_info_set_text_ops(entry, ice, cs_proc_regs_read);
}
@@ -770,7 +770,7 @@ static int __devinit pontis_init(struct snd_ice1712 *ice)
/* to remeber the register values */
ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ice->akm)
+ if (!ice->akm)
return -ENOMEM;
ice->akm_codecs = 1;
diff --git a/sound/pci/ice1712/pontis.h b/sound/pci/ice1712/pontis.h
index d0d1378..84bc863 100644
--- a/sound/pci/ice1712/pontis.h
+++ b/sound/pci/ice1712/pontis.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define PONTIS_DEVICE_DESC "{Pontis,MS300},"
diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c
index 48d3679..ddfaa28 100644
--- a/sound/pci/ice1712/prodigy192.c
+++ b/sound/pci/ice1712/prodigy192.c
@@ -52,9 +52,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -297,7 +297,7 @@ static int stac9460_mic_sw_get(struct snd_kcontrol *kcontrol,
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char val;
-
+
val = stac9460_get(ice, STAC946X_GENERAL_PURPOSE);
ucontrol->value.enumerated.item[0] = (val >> 7) & 0x1;
return 0;
@@ -341,7 +341,7 @@ static void stac9460_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
/* due to possible conflicts with mute controls - mutexing */
mutex_lock(&spec->mute_mutex);
/* we have to remember current mute status for each DAC */
- for (idx = 0; idx < 7 ; ++idx)
+ for (idx = 0; idx < 7; ++idx)
changed[idx] = stac9460_dac_mute(ice,
STAC946X_MASTER_VOLUME + idx, 0);
/*printk("Rate change: %d, new MC: 0x%02x\n", rate, new);*/
@@ -349,7 +349,7 @@ static void stac9460_set_rate_val(struct snd_ice1712 *ice, unsigned int rate)
udelay(10);
/* unmuting - only originally unmuted dacs -
* i.e. those changed when muting */
- for (idx = 0; idx < 7 ; ++idx) {
+ for (idx = 0; idx < 7; ++idx) {
if (changed[idx])
stac9460_dac_mute(ice, STAC946X_MASTER_VOLUME + idx, 1);
}
@@ -574,7 +574,7 @@ static int ak4114_input_sw_get(struct snd_kcontrol *kcontrol,
{
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
unsigned char val;
-
+
val = prodigy192_ak4114_read(ice, AK4114_REG_IO1);
/* AK4114_IPS0 bit = 0 -> RX0 = Toslink
* AK4114_IPS0 bit = 1 -> RX1 = Coax
@@ -745,7 +745,7 @@ static int __devinit prodigy192_init(struct snd_ice1712 *ice)
ice->num_total_dacs = 6;
ice->num_total_adcs = 2;
ice->vt1720 = 0; /* ice1724, e.g. 23 GPIOs */
-
+
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (!spec)
return -ENOMEM;
diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c
index 043a938..f30aa55 100644
--- a/sound/pci/ice1712/prodigy_hifi.c
+++ b/sound/pci/ice1712/prodigy_hifi.c
@@ -25,7 +25,7 @@
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -230,7 +230,7 @@ static void ak4396_write(struct snd_ice1712 *ice, unsigned int reg,
snd_ice1712_gpio_set_dir(ice, AK4396_CSN|AK4396_CCLK|AK4396_CDTI);
snd_ice1712_gpio_set_mask(ice, ~(AK4396_CSN|AK4396_CCLK|AK4396_CDTI));
/* latch must be low when writing */
- set_gpio_bit(ice, AK4396_CSN, 0);
+ set_gpio_bit(ice, AK4396_CSN, 0);
block = ((AK4396_ADDR & 0x03) << 14) | (1 << 13) |
((reg & 0x1f) << 8) | (data & 0xff);
ak4396_send_word(ice, block); /* REGISTER ADDRESS */
@@ -269,7 +269,7 @@ static int ak4396_dac_vol_get(struct snd_kcontrol *kcontrol,
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
struct prodigy_hifi_spec *spec = ice->spec;
int i;
-
+
for (i = 0; i < 2; i++)
ucontrol->value.integer.value[i] = spec->vol[i];
@@ -282,7 +282,7 @@ static int ak4396_dac_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
struct prodigy_hifi_spec *spec = ice->spec;
int i;
int change = 0;
-
+
mutex_lock(&ice->gpio_mutex);
for (i = 0; i < 2; i++) {
if (ucontrol->value.integer.value[i] != spec->vol[i]) {
@@ -346,7 +346,7 @@ static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index,
unsigned short vol, unsigned short master)
{
unsigned char nvol;
-
+
if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE))
nvol = 0;
else {
@@ -354,7 +354,7 @@ static void wm_set_vol(struct snd_ice1712 *ice, unsigned int index,
& WM_VOL_MAX;
nvol = (nvol ? (nvol + DAC_MIN) : 0) & 0xff;
}
-
+
wm_put(ice, index, nvol);
wm_put_nocache(ice, index, 0x100 | nvol);
}
@@ -363,7 +363,7 @@ static void wm8766_set_vol(struct snd_ice1712 *ice, unsigned int index,
unsigned short vol, unsigned short master)
{
unsigned char nvol;
-
+
if ((master & WM_VOL_MUTE) || (vol & WM_VOL_MUTE))
nvol = 0;
else {
@@ -527,7 +527,7 @@ static int wm_master_vol_put(struct snd_kcontrol *kcontrol,
change = 1;
}
}
- mutex_unlock(&ice->gpio_mutex);
+ mutex_unlock(&ice->gpio_mutex);
return change;
}
@@ -982,7 +982,7 @@ static int __devinit prodigy_hifi_init(struct snd_ice1712 *ice)
/* These come first to reduce init pop noise */
WM_ADC_MUX, 0x0003, /* ADC mute */
/* 0x00c0 replaced by 0x0003 */
-
+
WM_DAC_MUTE, 0x0001, /* DAC softmute */
WM_DAC_CTRL1, 0x0000, /* DAC mute */
@@ -1049,7 +1049,7 @@ static int __devinit prodigy_hifi_init(struct snd_ice1712 *ice)
/* to remeber the register values */
ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ice->akm)
+ if (!ice->akm)
return -ENOMEM;
ice->akm_codecs = 1;
@@ -1082,7 +1082,7 @@ static int __devinit prodigy_hd2_init(struct snd_ice1712 *ice)
static unsigned short ak4396_inits[] = {
AK4396_CTRL1, 0x87, /* I2S Normal Mode, 24 bit */
AK4396_CTRL2, 0x02,
- AK4396_CTRL3, 0x00,
+ AK4396_CTRL3, 0x00,
AK4396_LCH_ATT, 0x00,
AK4396_RCH_ATT, 0x00,
};
@@ -1103,7 +1103,7 @@ static int __devinit prodigy_hd2_init(struct snd_ice1712 *ice)
/* to remeber the register values */
ice->akm = kzalloc(sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ice->akm)
+ if (!ice->akm)
return -ENOMEM;
ice->akm_codecs = 1;
@@ -1117,7 +1117,7 @@ static int __devinit prodigy_hd2_init(struct snd_ice1712 *ice)
ak4396_write(ice, AK4396_CTRL1, 0x86);
msleep(100);
ak4396_write(ice, AK4396_CTRL1, 0x87);
-
+
for (i = 0; i < ARRAY_SIZE(ak4396_inits); i += 2)
ak4396_write(ice, ak4396_inits[i], ak4396_inits[i+1]);
@@ -1158,7 +1158,7 @@ static unsigned char prodigyhd2_eeprom[] __devinitdata = {
};
static unsigned char fortissimo4_eeprom[] __devinitdata = {
- 0x43, /* SYSCONF: clock 512, ADC, 4DACs */
+ 0x43, /* SYSCONF: clock 512, ADC, 4DACs */
0x80, /* ACLINK: I2S */
0xfc, /* I2S: vol, 96k, 24bit, 192k */
0xc1, /* SPDIF: out-en, out-int */
diff --git a/sound/pci/ice1712/prodigy_hifi.h b/sound/pci/ice1712/prodigy_hifi.h
index a4415d4..5667d51 100644
--- a/sound/pci/ice1712/prodigy_hifi.h
+++ b/sound/pci/ice1712/prodigy_hifi.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define PRODIGY_HIFI_DEVICE_DESC "{Audiotrak,Prodigy 7.1 HIFI},"\
"{Audiotrak Prodigy HD2},"\
diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c
index b508bb3..0cdeb85 100644
--- a/sound/pci/ice1712/revo.c
+++ b/sound/pci/ice1712/revo.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -523,7 +523,7 @@ static int __devinit revo_init(struct snd_ice1712 *ice)
/* second stage of initialization, analog parts and others */
ak = ice->akm = kcalloc(2, sizeof(struct snd_akm4xxx), GFP_KERNEL);
- if (! ak)
+ if (!ak)
return -ENOMEM;
switch (ice->eeprom.subvendor) {
case VT1724_SUBDEVICE_REVOLUTION71:
@@ -563,7 +563,7 @@ static int __devinit revo_init(struct snd_ice1712 *ice)
ice);
if (err < 0)
return err;
-
+
/* unmute all codecs */
snd_ice1712_gpio_write_bits(ice, VT1724_REVO_MUTE,
VT1724_REVO_MUTE);
diff --git a/sound/pci/ice1712/revo.h b/sound/pci/ice1712/revo.h
index a3ba425..8685ac5 100644
--- a/sound/pci/ice1712/revo.h
+++ b/sound/pci/ice1712/revo.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define REVO_DEVICE_DESC \
"{MidiMan M Audio,Revolution 7.1},"\
diff --git a/sound/pci/ice1712/se.c b/sound/pci/ice1712/se.c
index 69673b9..0af3289 100644
--- a/sound/pci/ice1712/se.c
+++ b/sound/pci/ice1712/se.c
@@ -20,9 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -70,7 +70,7 @@ struct se_spec {
* WM8740
* A 2ch-DAC of main outputs.
* It setuped as I2S mode by wire, so no way to setup from software.
- * The sample-rate are automatically changed.
+ * The sample-rate are automatically changed.
* ML/I2S (28pin) --------+
* MC/DM1 (27pin) -- 5V |
* MD/DM0 (26pin) -- GND |
diff --git a/sound/pci/ice1712/vt1720_mobo.c b/sound/pci/ice1712/vt1720_mobo.c
index 7f9674b..0f7ba24 100644
--- a/sound/pci/ice1712/vt1720_mobo.c
+++ b/sound/pci/ice1712/vt1720_mobo.c
@@ -19,9 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
diff --git a/sound/pci/ice1712/vt1720_mobo.h b/sound/pci/ice1712/vt1720_mobo.h
index 0b1b0ee..60c90d5 100644
--- a/sound/pci/ice1712/vt1720_mobo.h
+++ b/sound/pci/ice1712/vt1720_mobo.h
@@ -22,7 +22,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- */
+ */
#define VT1720_MOBO_DEVICE_DESC "{Albatron,K8X800 Pro II},"\
"{Chaintech,ZNF3-150},"\
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/hda/hda_codec.c | 12 ++--
sound/pci/hda/hda_codec.h | 10 ++--
sound/pci/hda/hda_generic.c | 58 +++++++++---------
sound/pci/hda/hda_hwdep.c | 2 +-
sound/pci/hda/hda_intel.c | 18 +++---
sound/pci/hda/hda_proc.c | 8 +-
sound/pci/hda/patch_analog.c | 22 ++++----
sound/pci/hda/patch_cmedia.c | 2 +-
sound/pci/hda/patch_conexant.c | 22 ++++----
sound/pci/hda/patch_realtek.c | 6 +-
sound/pci/hda/patch_si3054.c | 8 +-
sound/pci/hda/patch_sigmatel.c | 130 ++++++++++++++++++++--------------------
sound/pci/hda/patch_via.c | 34 +++++-----
13 files changed, 166 insertions(+), 166 deletions(-)
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 696d77e..f58c351 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -1123,7 +1123,7 @@ int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
err = snd_ctl_add(codec->bus->card, kctl);
if (err < 0)
return err;
-
+
for (s = slaves; *s; s++) {
struct snd_kcontrol *sctl;
@@ -2832,7 +2832,7 @@ static void sort_pins_by_sequence(hda_nid_t * pins, short * sequences,
int i, j;
short seq;
hda_nid_t nid;
-
+
for (i = 0; i < num_pins; i++) {
for (j = i + 1; j < num_pins; j++) {
if (sequences[i] > sequences[j]) {
@@ -2860,7 +2860,7 @@ static void sort_pins_by_sequence(hda_nid_t * pins, short * sequences,
* is detected, one of speaker of HP pins is assigned as the primary
* output, i.e. to line_out_pins[0]. So, line_outs is always positive
* if any analog output exists.
- *
+ *
* The analog input pins are assigned to input_pins array.
* The digital input/output pins are assigned to dig_in_pin and dig_out_pin,
* respectively.
@@ -2925,9 +2925,9 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
case AC_JACK_SPEAKER:
seq = get_defcfg_sequence(def_conf);
assoc = get_defcfg_association(def_conf);
- if (! assoc)
+ if (!assoc)
continue;
- if (! assoc_speaker)
+ if (!assoc_speaker)
assoc_speaker = assoc;
else if (assoc_speaker != assoc)
continue;
@@ -3013,7 +3013,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
cfg->speaker_outs);
sort_pins_by_sequence(cfg->hp_pins, sequences_hp,
cfg->hp_outs);
-
+
/* if we have only one mic, make it AUTO_PIN_MIC */
if (!cfg->input_pins[AUTO_PIN_MIC] &&
cfg->input_pins[AUTO_PIN_FRONT_MIC]) {
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h
index 60468f5..5dda6af 100644
--- a/sound/pci/hda/hda_codec.h
+++ b/sound/pci/hda/hda_codec.h
@@ -42,7 +42,7 @@ enum {
AC_GRP_AUDIO_FUNCTION = 0x01,
AC_GRP_MODEM_FUNCTION = 0x02,
};
-
+
/*
* widget types
*/
@@ -306,15 +306,15 @@ enum {
#define AC_KNBCAP_DELTA (1<<7)
/* HDMI LPCM capabilities */
-#define AC_LPCMCAP_48K_CP_CHNS (0x0f<<0) /* max channels w/ CP-on */
+#define AC_LPCMCAP_48K_CP_CHNS (0x0f<<0) /* max channels w/ CP-on */
#define AC_LPCMCAP_48K_NO_CHNS (0x0f<<4) /* max channels w/o CP-on */
#define AC_LPCMCAP_48K_20BIT (1<<8) /* 20b bitrate supported */
#define AC_LPCMCAP_48K_24BIT (1<<9) /* 24b bitrate supported */
-#define AC_LPCMCAP_96K_CP_CHNS (0x0f<<10) /* max channels w/ CP-on */
+#define AC_LPCMCAP_96K_CP_CHNS (0x0f<<10) /* max channels w/ CP-on */
#define AC_LPCMCAP_96K_NO_CHNS (0x0f<<14) /* max channels w/o CP-on */
#define AC_LPCMCAP_96K_20BIT (1<<18) /* 20b bitrate supported */
#define AC_LPCMCAP_96K_24BIT (1<<19) /* 24b bitrate supported */
-#define AC_LPCMCAP_192K_CP_CHNS (0x0f<<20) /* max channels w/ CP-on */
+#define AC_LPCMCAP_192K_CP_CHNS (0x0f<<20) /* max channels w/ CP-on */
#define AC_LPCMCAP_192K_NO_CHNS (0x0f<<24) /* max channels w/o CP-on */
#define AC_LPCMCAP_192K_20BIT (1<<28) /* 20b bitrate supported */
#define AC_LPCMCAP_192K_24BIT (1<<29) /* 24b bitrate supported */
@@ -603,7 +603,7 @@ struct hda_codec_preset {
const char *name;
int (*patch)(struct hda_codec *codec);
};
-
+
/* ops set by the preset patch */
struct hda_codec_ops {
int (*build_controls)(struct hda_codec *codec);
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index 0ca3089..1a57399 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -96,7 +96,7 @@ static void snd_hda_generic_free(struct hda_codec *codec)
struct hda_gspec *spec = codec->spec;
struct hda_gnode *node, *n;
- if (! spec)
+ if (!spec)
return;
/* free all widgets */
list_for_each_entry_safe(node, n, &spec->nid_list, list) {
@@ -132,7 +132,7 @@ static int add_new_node(struct hda_codec *codec, struct hda_gspec *spec, hda_nid
else {
node->conn_list = kmalloc(sizeof(hda_nid_t) * nconns,
GFP_KERNEL);
- if (! node->conn_list) {
+ if (!node->conn_list) {
snd_printk(KERN_ERR "hda-generic: cannot malloc\n");
kfree(node);
return -ENOMEM;
@@ -152,13 +152,13 @@ static int add_new_node(struct hda_codec *codec, struct hda_gspec *spec, hda_nid
if (node->wid_caps & AC_WCAP_OUT_AMP) {
if (node->wid_caps & AC_WCAP_AMP_OVRD)
node->amp_out_caps = snd_hda_param_read(codec, node->nid, AC_PAR_AMP_OUT_CAP);
- if (! node->amp_out_caps)
+ if (!node->amp_out_caps)
node->amp_out_caps = spec->def_amp_out_caps;
}
if (node->wid_caps & AC_WCAP_IN_AMP) {
if (node->wid_caps & AC_WCAP_AMP_OVRD)
node->amp_in_caps = snd_hda_param_read(codec, node->nid, AC_PAR_AMP_IN_CAP);
- if (! node->amp_in_caps)
+ if (!node->amp_in_caps)
node->amp_in_caps = spec->def_amp_in_caps;
}
list_add_tail(&node->list, &spec->nid_list);
@@ -181,7 +181,7 @@ static int build_afg_tree(struct hda_codec *codec)
spec->def_amp_in_caps = snd_hda_param_read(codec, codec->afg, AC_PAR_AMP_IN_CAP);
nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);
- if (! nid || nodes < 0) {
+ if (!nid || nodes < 0) {
printk(KERN_ERR "Invalid AFG subtree\n");
return -EINVAL;
}
@@ -301,7 +301,7 @@ static int parse_output_path(struct hda_codec *codec, struct hda_gspec *spec,
for (i = 0; i < node->nconns; i++) {
child = hda_get_node(spec, node->conn_list[i]);
- if (! child)
+ if (!child)
continue;
err = parse_output_path(codec, spec, child, dac_idx);
if (err < 0)
@@ -349,7 +349,7 @@ static struct hda_gnode *parse_output_jack(struct hda_codec *codec,
if (node->type != AC_WID_PIN)
continue;
/* output capable? */
- if (! (node->pin_caps & AC_PINCAP_OUT))
+ if (!(node->pin_caps & AC_PINCAP_OUT))
continue;
if (defcfg_port_conn(node) == AC_JACK_PORT_NONE)
continue; /* unconnected */
@@ -360,14 +360,14 @@ static struct hda_gnode *parse_output_jack(struct hda_codec *codec,
continue; /* skip SPDIF */
} else {
/* output as default? */
- if (! (node->pin_ctl & AC_PINCTL_OUT_EN))
+ if (!(node->pin_ctl & AC_PINCTL_OUT_EN))
continue;
}
clear_check_flags(spec);
err = parse_output_path(codec, spec, node, 0);
if (err < 0)
return NULL;
- if (! err && spec->out_pin_node[0]) {
+ if (!err && spec->out_pin_node[0]) {
err = parse_output_path(codec, spec, node, 1);
if (err < 0)
return NULL;
@@ -412,18 +412,18 @@ static int parse_output(struct hda_codec *codec)
/* look for the HP-out pin */
node = parse_output_jack(codec, spec, AC_JACK_HP_OUT);
if (node) {
- if (! spec->out_pin_node[0])
+ if (!spec->out_pin_node[0])
spec->out_pin_node[0] = node;
else
spec->out_pin_node[1] = node;
}
- if (! spec->out_pin_node[0]) {
+ if (!spec->out_pin_node[0]) {
/* no line-out or HP pins found,
* then choose for the first output pin
*/
spec->out_pin_node[0] = parse_output_jack(codec, spec, -1);
- if (! spec->out_pin_node[0])
+ if (!spec->out_pin_node[0])
snd_printd("hda_generic: no proper output path found\n");
}
@@ -517,7 +517,7 @@ static int parse_adc_sub_nodes(struct hda_codec *codec, struct hda_gspec *spec,
for (i = 0; i < node->nconns; i++) {
struct hda_gnode *child;
child = hda_get_node(spec, node->conn_list[i]);
- if (! child)
+ if (!child)
continue;
err = parse_adc_sub_nodes(codec, spec, child);
if (err < 0)
@@ -537,7 +537,7 @@ static int parse_adc_sub_nodes(struct hda_codec *codec, struct hda_gspec *spec,
}
/* input capable? */
- if (! (node->pin_caps & AC_PINCAP_IN))
+ if (!(node->pin_caps & AC_PINCAP_IN))
return 0;
if (defcfg_port_conn(node) == AC_JACK_PORT_NONE)
@@ -554,9 +554,9 @@ static int parse_adc_sub_nodes(struct hda_codec *codec, struct hda_gspec *spec,
pinctl = AC_PINCTL_IN_EN;
/* create a proper capture source label */
type = get_input_type(node, &pinctl);
- if (! type) {
+ if (!type) {
/* input as default? */
- if (! (node->pin_ctl & AC_PINCTL_IN_EN))
+ if (!(node->pin_ctl & AC_PINCTL_IN_EN))
return 0;
type = "Input";
}
@@ -584,7 +584,7 @@ static void add_cap_src(struct hda_gspec *spec, int idx)
csrc = &spec->input_mux.items[num];
buf = spec->cap_labels[num];
for (ocap = 0; ocap < num; ocap++) {
- if (! strcmp(buf, spec->cap_labels[ocap])) {
+ if (!strcmp(buf, spec->cap_labels[ocap])) {
/* same label already exists,
* put the index number to be unique
*/
@@ -608,9 +608,9 @@ static int parse_input_path(struct hda_codec *codec, struct hda_gnode *adc_node)
snd_printdd("AUD_IN = %x\n", adc_node->nid);
clear_check_flags(spec);
- // awk added - fixed no recording due to muted widget
+ /* awk added - fixed no recording due to muted widget */
unmute_input(codec, adc_node, 0);
-
+
/*
* check each connection of the ADC
* if it reaches to a proper input PIN, add the path as the
@@ -639,7 +639,7 @@ static int parse_input_path(struct hda_codec *codec, struct hda_gnode *adc_node)
}
}
- if (! spec->input_mux.num_items)
+ if (!spec->input_mux.num_items)
return 0; /* no input path found... */
snd_printdd("[Capture Source] NID=0x%x, #SRC=%d\n", adc_node->nid, spec->input_mux.num_items);
@@ -830,7 +830,7 @@ static int build_input_controls(struct hda_codec *codec)
.put = capture_source_put,
};
- if (! adc_node || ! spec->input_mux.num_items)
+ if (!adc_node || !spec->input_mux.num_items)
return 0; /* not found */
spec->cur_cap_src = 0;
@@ -854,8 +854,8 @@ static int build_input_controls(struct hda_codec *codec)
return err;
/* no volume control? */
- if (! (adc_node->wid_caps & AC_WCAP_IN_AMP) ||
- ! (adc_node->amp_in_caps & AC_AMPCAP_NUM_STEPS))
+ if (!(adc_node->wid_caps & AC_WCAP_IN_AMP) ||
+ !(adc_node->amp_in_caps & AC_AMPCAP_NUM_STEPS))
return 0;
for (i = 0; i < spec->input_mux.num_items; i++) {
@@ -901,7 +901,7 @@ static int parse_loopback_path(struct hda_codec *codec, struct hda_gspec *spec,
for (i = 0; i < node->nconns; i++) {
struct hda_gnode *child = hda_get_node(spec, node->conn_list[i]);
- if (! child)
+ if (!child)
continue;
err = parse_loopback_path(codec, spec, child, dest_node, type);
if (err < 0)
@@ -938,14 +938,14 @@ static int build_loopback_controls(struct hda_codec *codec)
int err;
const char *type;
- if (! spec->out_pin_node[0])
+ if (!spec->out_pin_node[0])
return 0;
list_for_each_entry(node, &spec->nid_list, list) {
if (node->type != AC_WID_PIN)
continue;
/* input capable? */
- if (! (node->pin_caps & AC_PINCAP_IN))
+ if (!(node->pin_caps & AC_PINCAP_IN))
return 0;
type = get_input_type(node, NULL);
if (type) {
@@ -957,7 +957,7 @@ static int build_loopback_controls(struct hda_codec *codec)
node, type);
if (err < 0)
return err;
- if (! err)
+ if (!err)
continue;
}
}
@@ -1018,7 +1018,7 @@ static int build_generic_pcms(struct hda_codec *codec)
struct hda_gspec *spec = codec->spec;
struct hda_pcm *info = &spec->pcm_rec;
- if (! spec->dac_node[0] && ! spec->adc_node) {
+ if (!spec->dac_node[0] && !spec->adc_node) {
snd_printd("hda_generic: no PCM found\n");
return 0;
}
@@ -1071,7 +1071,7 @@ int snd_hda_parse_generic_codec(struct hda_codec *codec)
struct hda_gspec *spec;
int err;
- if(!codec->afg)
+ if (!codec->afg)
return 0;
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
diff --git a/sound/pci/hda/hda_hwdep.c b/sound/pci/hda/hda_hwdep.c
index 6e18a42..22c44fc 100644
--- a/sound/pci/hda/hda_hwdep.c
+++ b/sound/pci/hda/hda_hwdep.c
@@ -49,7 +49,7 @@ static int get_wcap_ioctl(struct hda_codec *codec,
struct hda_verb_ioctl __user *arg)
{
u32 verb, res;
-
+
if (get_user(verb, &arg->verb))
return -EFAULT;
res = get_wcaps(codec, verb >> 24);
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 60cc44a..3448c42 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -31,10 +31,10 @@
* CHANGES:
*
* 2004.12.01 Major rewrite by tiwai, merged the work of pshou
- *
+ *
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
@@ -139,7 +139,7 @@ MODULE_DESCRIPTION("Intel HDA driver");
#define ICH6_REG_INTCTL 0x20
#define ICH6_REG_INTSTS 0x24
#define ICH6_REG_WALCLK 0x30
-#define ICH6_REG_SYNC 0x34
+#define ICH6_REG_SYNC 0x34
#define ICH6_REG_CORBLBASE 0x40
#define ICH6_REG_CORBUBASE 0x44
#define ICH6_REG_CORBWP 0x48
@@ -422,7 +422,7 @@ static char *driver_short_names[] __devinitdata = {
[AZX_DRIVER_SIS] = "HDA SIS966",
[AZX_DRIVER_ULI] = "HDA ULI M5461",
[AZX_DRIVER_NVIDIA] = "HDA NVidia",
- [AZX_DRIVER_TERA] = "HDA Teradici",
+ [AZX_DRIVER_TERA] = "HDA Teradici",
};
/*
@@ -554,7 +554,7 @@ static void azx_update_rirb(struct azx *chip)
if (wp == chip->rirb.wp)
return;
chip->rirb.wp = wp;
-
+
while (chip->rirb.rp != wp) {
chip->rirb.rp++;
chip->rirb.rp %= ICH6_MAX_RIRB_ENTRIES;
@@ -777,7 +777,7 @@ static int azx_reset(struct azx *chip)
/*
* Lowlevel interface
- */
+ */
/* enable interrupts */
static void azx_int_enable(struct azx *chip)
@@ -913,7 +913,7 @@ static void azx_init_pci(struct azx *chip)
case AZX_DRIVER_ATI:
/* For ATI SB450 azalia HD audio, we need to enable snoop */
update_pci_byte(chip->pci,
- ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR,
+ ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR,
0x07, ATI_SB450_HDAUDIO_ENABLE_SNOOP);
break;
case AZX_DRIVER_NVIDIA:
@@ -964,7 +964,7 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
spin_unlock(&chip->reg_lock);
return IRQ_NONE;
}
-
+
for (i = 0; i < chip->num_streams; i++) {
azx_dev = &chip->azx_dev[i];
if (status & azx_dev->sd_int_sta_mask) {
@@ -1004,7 +1004,7 @@ static irqreturn_t azx_interrupt(int irq, void *dev_id)
azx_writeb(chip, STATESTS, 0x04);
#endif
spin_unlock(&chip->reg_lock);
-
+
return IRQ_HANDLED;
}
diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c
index 4927c4b..5833f7e 100644
--- a/sound/pci/hda/hda_proc.c
+++ b/sound/pci/hda/hda_proc.c
@@ -1,6 +1,6 @@
/*
* Universal Interface for Intel High Definition Audio Codec
- *
+ *
* Generic proc interface
*
* Copyright (c) 2004 Takashi Iwai <tiwai(a)suse.de>
@@ -99,7 +99,7 @@ static void print_pcm_rates(struct snd_info_buffer *buffer, unsigned int pcm)
pcm &= AC_SUPPCM_RATES;
snd_iprintf(buffer, " rates [0x%x]:", pcm);
- for (i = 0; i < ARRAY_SIZE(rates); i++)
+ for (i = 0; i < ARRAY_SIZE(rates); i++)
if (pcm & (1 << i))
snd_iprintf(buffer, " %d", rates[i]);
snd_iprintf(buffer, "\n");
@@ -527,7 +527,7 @@ static void print_codec_info(struct snd_info_entry *entry,
else
snd_iprintf(buffer, "No Modem Function Group found\n");
- if (! codec->afg)
+ if (!codec->afg)
return;
snd_hda_power_up(codec);
snd_iprintf(buffer, "Default PCM:\n");
@@ -538,7 +538,7 @@ static void print_codec_info(struct snd_info_entry *entry,
print_amp_caps(buffer, codec, codec->afg, HDA_OUTPUT);
nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid);
- if (! nid || nodes < 0) {
+ if (!nid || nodes < 0) {
snd_iprintf(buffer, "Invalid AFG subtree\n");
snd_hda_power_down(codec);
return;
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
index 0899b6b..f5b125a 100644
--- a/sound/pci/hda/patch_analog.c
+++ b/sound/pci/hda/patch_analog.c
@@ -174,7 +174,7 @@ static int ad198x_build_controls(struct hda_codec *codec)
if (err < 0)
return err;
spec->multiout.share_spdif = 1;
- }
+ }
if (spec->dig_in_nid) {
err = snd_hda_create_spdif_in_ctls(codec, spec->dig_in_nid);
if (err < 0)
@@ -412,7 +412,7 @@ static int ad198x_eapd_get(struct snd_kcontrol *kcontrol,
struct ad198x_spec *spec = codec->spec;
int invert = (kcontrol->private_value >> 8) & 1;
if (invert)
- ucontrol->value.integer.value[0] = ! spec->cur_eapd;
+ ucontrol->value.integer.value[0] = !spec->cur_eapd;
else
ucontrol->value.integer.value[0] = spec->cur_eapd;
return 0;
@@ -1413,7 +1413,7 @@ static int ad1981_hp_master_sw_put(struct snd_kcontrol *kcontrol,
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
struct ad198x_spec *spec = codec->spec;
- if (! ad198x_eapd_put(kcontrol, ucontrol))
+ if (!ad198x_eapd_put(kcontrol, ucontrol))
return 0;
/* change speaker pin appropriately */
snd_hda_codec_write(codec, 0x05, 0,
@@ -2426,7 +2426,7 @@ static void ad1988_laptop_unsol_event(struct hda_codec *codec, unsigned int res)
snd_hda_sequence_write(codec, ad1988_laptop_hp_on);
else
snd_hda_sequence_write(codec, ad1988_laptop_hp_off);
-}
+}
#ifdef CONFIG_SND_HDA_POWER_SAVE
static struct hda_amp_list ad1988_loopbacks[] = {
@@ -2466,7 +2466,7 @@ static int add_control(struct ad198x_spec *spec, int type, const char *name,
int num = spec->num_kctl_alloc + NUM_CONTROL_ALLOC;
knew = kcalloc(num + 1, sizeof(*knew), GFP_KERNEL); /* array + terminator */
- if (! knew)
+ if (!knew)
return -ENOMEM;
if (spec->kctl_alloc) {
memcpy(knew, spec->kctl_alloc, sizeof(*knew) * spec->num_kctl_alloc);
@@ -2479,7 +2479,7 @@ static int add_control(struct ad198x_spec *spec, int type, const char *name,
knew = &spec->kctl_alloc[spec->num_kctl_used];
*knew = ad1988_control_templates[type];
knew->name = kstrdup(name, GFP_KERNEL);
- if (! knew->name)
+ if (!knew->name)
return -ENOMEM;
knew->private_value = val;
spec->num_kctl_used++;
@@ -2581,7 +2581,7 @@ static int ad1988_auto_create_multi_out_ctls(struct ad198x_spec *spec,
for (i = 0; i < cfg->line_outs; i++) {
hda_nid_t dac = spec->multiout.dac_nids[i];
- if (! dac)
+ if (!dac)
continue;
nid = ad1988_mixer_nids[ad1988_pin_idx(cfg->line_out_pins[i])];
if (i == 2) {
@@ -2631,7 +2631,7 @@ static int ad1988_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
int i, idx, err;
char name[32];
- if (! pin)
+ if (!pin)
return 0;
idx = ad1988_pin_idx(pin);
@@ -2784,7 +2784,7 @@ static void ad1988_auto_init_analog_input(struct hda_codec *codec)
for (i = 0; i < AUTO_PIN_LAST; i++) {
hda_nid_t nid = spec->autocfg.input_pins[i];
- if (! nid)
+ if (!nid)
continue;
switch (nid) {
case 0x15: /* port-C */
@@ -2818,7 +2818,7 @@ static int ad1988_parse_auto_config(struct hda_codec *codec)
return err;
if ((err = ad1988_auto_fill_dac_nids(codec, &spec->autocfg)) < 0)
return err;
- if (! spec->autocfg.line_outs)
+ if (!spec->autocfg.line_outs)
return 0; /* can't find valid BIOS pin config */
if ((err = ad1988_auto_create_multi_out_ctls(spec, &spec->autocfg)) < 0 ||
(err = ad1988_auto_create_extra_out(codec,
@@ -2904,7 +2904,7 @@ static int patch_ad1988(struct hda_codec *codec)
if (err < 0) {
ad198x_free(codec);
return err;
- } else if (! err) {
+ } else if (!err) {
printk(KERN_INFO "hda_codec: Cannot set up configuration from BIOS. Using 6-stack mode...\n");
board_config = AD1988_6STACK;
}
diff --git a/sound/pci/hda/patch_cmedia.c b/sound/pci/hda/patch_cmedia.c
index 6ef57fb..473157b 100644
--- a/sound/pci/hda/patch_cmedia.c
+++ b/sound/pci/hda/patch_cmedia.c
@@ -372,7 +372,7 @@ static int cmi9880_fill_multi_dac_nids(struct hda_codec *codec, const struct aut
continue;
/* search for an empty channel */
for (j = 0; j < cfg->line_outs; j++) {
- if (! assigned[j]) {
+ if (!assigned[j]) {
spec->dac_nids[i] = j + 0x03;
assigned[j] = 1;
break;
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
index 7c1eb23..f2b16f8 100644
--- a/sound/pci/hda/patch_conexant.c
+++ b/sound/pci/hda/patch_conexant.c
@@ -377,7 +377,7 @@ static int conexant_build_controls(struct hda_codec *codec)
if (err < 0)
return err;
spec->multiout.share_spdif = 1;
- }
+ }
if (spec->dig_in_nid) {
err = snd_hda_create_spdif_in_ctls(codec,spec->dig_in_nid);
if (err < 0)
@@ -428,7 +428,7 @@ static int cxt_eapd_put(struct snd_kcontrol *kcontrol,
eapd = !eapd;
if (eapd == spec->cur_eapd)
return 0;
-
+
spec->cur_eapd = eapd;
snd_hda_codec_write_cache(codec, nid,
0, AC_VERB_SET_EAPD_BTLENABLE,
@@ -592,7 +592,7 @@ static void cxt5045_hp_automute(struct hda_codec *codec)
spec->hp_present = snd_hda_codec_read(codec, 0x11, 0,
AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
- bits = (spec->hp_present || !spec->cur_eapd) ? HDA_AMP_MUTE : 0;
+ bits = (spec->hp_present || !spec->cur_eapd) ? HDA_AMP_MUTE : 0;
snd_hda_codec_amp_stereo(codec, 0x10, HDA_OUTPUT, 0,
HDA_AMP_MUTE, bits);
}
@@ -706,7 +706,7 @@ static struct hda_verb cxt5045_init_verbs[] = {
{0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_OUT},
{ 0x13, AC_VERB_SET_CONNECT_SEL, 0x0 },
/* EAPD */
- {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x2 }, /* default on */
+ {0x10, AC_VERB_SET_EAPD_BTLENABLE, 0x2 }, /* default on */
{ } /* end */
};
@@ -772,7 +772,7 @@ static struct snd_kcontrol_new cxt5045_test_mixer[] = {
HDA_CODEC_MUTE("Node 11 Playback Switch", 0x11, 0x0, HDA_OUTPUT),
HDA_CODEC_VOLUME("Node 12 Playback Volume", 0x12, 0x0, HDA_OUTPUT),
HDA_CODEC_MUTE("Node 12 Playback Switch", 0x12, 0x0, HDA_OUTPUT),
-
+
/* Modes for retasking pin widgets */
CXT_PIN_MODE("HP-OUT pin mode", 0x11, CXT_PIN_DIR_INOUT),
CXT_PIN_MODE("LINE1 pin mode", 0x12, CXT_PIN_DIR_INOUT),
@@ -1004,8 +1004,8 @@ static int patch_cxt5045(struct hda_codec *codec)
spec->mixers[0] = cxt5045_test_mixer;
spec->init_verbs[0] = cxt5045_test_init_verbs;
break;
-
-#endif
+
+#endif
}
switch (codec->subsystem_id >> 16) {
@@ -1395,7 +1395,7 @@ static struct hda_verb cxt5047_test_init_verbs[] = {
*/
{0x18, AC_VERB_SET_DIGI_CONVERT_1, 0},
- /* Ensure mic1, mic2, line1 pin widgets take input from the
+ /* Ensure mic1, mic2, line1 pin widgets take input from the
* OUT1 sum bus when acting as an output.
*/
{0x1a, AC_VERB_SET_CONNECT_SEL, 0},
@@ -1530,7 +1530,7 @@ static int patch_cxt5047(struct hda_codec *codec)
spec->mixers[0] = cxt5047_test_mixer;
spec->init_verbs[0] = cxt5047_test_init_verbs;
codec->patch_ops.unsol_event = cxt5047_hp_unsol_event;
-#endif
+#endif
}
return 0;
}
@@ -1685,7 +1685,7 @@ static struct hda_verb cxt5051_init_verbs[] = {
/* HP, Amp */
{0x16, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
{0x16, AC_VERB_SET_CONNECT_SEL, 0x00},
- /* DAC1 */
+ /* DAC1 */
{0x10, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_UNMUTE},
/* Record selector: Int mic */
{0x14, AC_VERB_SET_AMP_GAIN_MUTE, AMP_IN_UNMUTE(0) | 0x44},
@@ -1694,7 +1694,7 @@ static struct hda_verb cxt5051_init_verbs[] = {
/* SPDIF route: PCM */
{0x1c, AC_VERB_SET_CONNECT_SEL, 0x0},
/* EAPD */
- {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */
+ {0x1a, AC_VERB_SET_EAPD_BTLENABLE, 0x2}, /* default on */
{0x16, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CONEXANT_HP_EVENT},
{0x17, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTB_EVENT},
{0x18, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN|CXT5051_PORTC_EVENT},
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 5c80a27..80e66d2 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -9291,7 +9291,7 @@ static struct hda_verb alc262_hippo1_unsol_verbs[] = {
static struct hda_verb alc262_sony_unsol_verbs[] = {
{0x14, AC_VERB_SET_PIN_WIDGET_CONTROL, 0xc0},
{0x15, AC_VERB_SET_CONNECT_SEL, 0x00},
- {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, // Front Mic
+ {0x19, AC_VERB_SET_PIN_WIDGET_CONTROL, 0x24}, /* Front Mic */
{0x15, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | ALC880_HP_EVENT},
{0x15, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP},
@@ -15209,7 +15209,7 @@ static void alc662_eeepc_unsol_event(struct hda_codec *codec,
unsigned int res)
{
if ((res >> 26) == ALC880_HP_EVENT)
- alc262_hippo1_automute( codec );
+ alc262_hippo1_automute(codec);
if ((res >> 26) == ALC880_MIC_EVENT)
alc662_eeepc_mic_automute(codec);
@@ -15217,7 +15217,7 @@ static void alc662_eeepc_unsol_event(struct hda_codec *codec,
static void alc662_eeepc_inithook(struct hda_codec *codec)
{
- alc262_hippo1_automute( codec );
+ alc262_hippo1_automute(codec);
alc662_eeepc_mic_automute(codec);
}
diff --git a/sound/pci/hda/patch_si3054.c b/sound/pci/hda/patch_si3054.c
index 9332b63..1148d8d 100644
--- a/sound/pci/hda/patch_si3054.c
+++ b/sound/pci/hda/patch_si3054.c
@@ -103,7 +103,7 @@ static int si3054_switch_get(struct snd_kcontrol *kcontrol,
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
u16 reg = PRIVATE_REG(kcontrol->private_value);
u16 mask = PRIVATE_MASK(kcontrol->private_value);
- uvalue->value.integer.value[0] = (GET_REG(codec, reg)) & mask ? 1 : 0 ;
+ uvalue->value.integer.value[0] = (GET_REG(codec, reg)) & mask ? 1 : 0;
return 0;
}
@@ -128,7 +128,7 @@ static int si3054_switch_put(struct snd_kcontrol *kcontrol,
.put = si3054_switch_put, \
.private_value = PRIVATE_VALUE(reg,mask), \
}
-
+
static struct snd_kcontrol_new si3054_modem_mixer[] = {
SI3054_KCONTROL("Off-hook Switch", SI3054_GPIO_CONTROL, SI3054_GPIO_OH),
@@ -233,7 +233,7 @@ static int si3054_init(struct hda_codec *codec)
val = GET_REG(codec, SI3054_EXTENDED_MID);
} while ((val & SI3054_MEI_READY) != SI3054_MEI_READY && wait_count--);
- if((val&SI3054_MEI_READY) != SI3054_MEI_READY) {
+ if ((val&SI3054_MEI_READY) != SI3054_MEI_READY) {
snd_printk(KERN_ERR "si3054: cannot initialize. EXT MID = %04x\n", val);
/* let's pray that this is no fatal error */
/* return -EACCES; */
@@ -244,7 +244,7 @@ static int si3054_init(struct hda_codec *codec)
SET_REG(codec, SI3054_MISC_AFE, 0);
SET_REG(codec, SI3054_LINE_CFG1,0x200);
- if((GET_REG(codec,SI3054_LINE_STATUS) & (1<<6)) == 0) {
+ if ((GET_REG(codec,SI3054_LINE_STATUS) & (1<<6)) == 0) {
snd_printd("Link Frame Detect(FDT) is not ready (line status: %04x)\n",
GET_REG(codec,SI3054_LINE_STATUS));
}
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index 238aebf..6c4cfe8 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -405,12 +405,12 @@ static hda_nid_t stac9205_dmic_nids[STAC9205_NUM_DMICS + 1] = {
};
static hda_nid_t stac9200_pin_nids[8] = {
- 0x08, 0x09, 0x0d, 0x0e,
+ 0x08, 0x09, 0x0d, 0x0e,
0x0f, 0x10, 0x11, 0x12,
};
static hda_nid_t stac925x_pin_nids[8] = {
- 0x07, 0x08, 0x0a, 0x0b,
+ 0x07, 0x08, 0x0a, 0x0b,
0x0c, 0x0d, 0x10, 0x11,
};
@@ -796,23 +796,23 @@ static struct hda_verb stac925x_core_init[] = {
};
static struct hda_verb stac922x_core_init[] = {
- /* set master volume and direct control */
+ /* set master volume and direct control */
{ 0x16, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
{}
};
static struct hda_verb d965_core_init[] = {
- /* set master volume and direct control */
+ /* set master volume and direct control */
{ 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
/* unmute node 0x1b */
{ 0x1b, AC_VERB_SET_AMP_GAIN_MUTE, 0xb000},
- /* select node 0x03 as DAC */
+ /* select node 0x03 as DAC */
{ 0x0b, AC_VERB_SET_CONNECT_SEL, 0x01},
{}
};
static struct hda_verb stac927x_core_init[] = {
- /* set master volume and direct control */
+ /* set master volume and direct control */
{ 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
/* enable analog pc beep path */
{ 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
@@ -820,7 +820,7 @@ static struct hda_verb stac927x_core_init[] = {
};
static struct hda_verb stac9205_core_init[] = {
- /* set master volume and direct control */
+ /* set master volume and direct control */
{ 0x24, AC_VERB_SET_VOLUME_KNOB_CONTROL, 0xff},
/* enable analog pc beep path */
{ 0x01, AC_VERB_SET_DIGI_CONVERT_2, 1 << 5},
@@ -1159,7 +1159,7 @@ static int stac92xx_build_controls(struct hda_codec *codec)
return err;
}
- return 0;
+ return 0;
}
static unsigned int ref9200_pin_configs[8] = {
@@ -1167,28 +1167,28 @@ static unsigned int ref9200_pin_configs[8] = {
0x02a19020, 0x01a19021, 0x90100140, 0x01813122,
};
-/*
+/*
STAC 9200 pin configs for
102801A8
102801DE
102801E8
*/
static unsigned int dell9200_d21_pin_configs[8] = {
- 0x400001f0, 0x400001f1, 0x02214030, 0x01014010,
+ 0x400001f0, 0x400001f1, 0x02214030, 0x01014010,
0x02a19020, 0x01a19021, 0x90100140, 0x01813122,
};
-/*
+/*
STAC 9200 pin configs for
102801C0
102801C1
*/
static unsigned int dell9200_d22_pin_configs[8] = {
- 0x400001f0, 0x400001f1, 0x0221401f, 0x01014010,
+ 0x400001f0, 0x400001f1, 0x0221401f, 0x01014010,
0x01813020, 0x02a19021, 0x90100140, 0x400001f2,
};
-/*
+/*
STAC 9200 pin configs for
102801C4 (Dell Dimension E310)
102801C5
@@ -1198,12 +1198,12 @@ static unsigned int dell9200_d22_pin_configs[8] = {
102801E3
*/
static unsigned int dell9200_d23_pin_configs[8] = {
- 0x400001f0, 0x400001f1, 0x0221401f, 0x01014010,
- 0x01813020, 0x01a19021, 0x90100140, 0x400001f2,
+ 0x400001f0, 0x400001f1, 0x0221401f, 0x01014010,
+ 0x01813020, 0x01a19021, 0x90100140, 0x400001f2,
};
-/*
+/*
STAC 9200-32 pin configs for
102801B5 (Dell Inspiron 630m)
102801D8 (Dell Inspiron 640m)
@@ -1213,20 +1213,20 @@ static unsigned int dell9200_m21_pin_configs[8] = {
0x408003fb, 0x03a11020, 0x401003fc, 0x403003fd,
};
-/*
+/*
STAC 9200-32 pin configs for
102801C2 (Dell Latitude D620)
- 102801C8
+ 102801C8
102801CC (Dell Latitude D820)
- 102801D4
- 102801D6
+ 102801D4
+ 102801D6
*/
static unsigned int dell9200_m22_pin_configs[8] = {
- 0x40c003fa, 0x0144131f, 0x0321121f, 0x90170310,
+ 0x40c003fa, 0x0144131f, 0x0321121f, 0x90170310,
0x90a70321, 0x03a11020, 0x401003fb, 0x40f000fc,
};
-/*
+/*
STAC 9200-32 pin configs for
102801CE (Dell XPS M1710)
102801CF (Dell Precision M90)
@@ -1237,15 +1237,15 @@ static unsigned int dell9200_m23_pin_configs[8] = {
};
/*
- STAC 9200-32 pin configs for
+ STAC 9200-32 pin configs for
102801C9
102801CA
102801CB (Dell Latitude 120L)
102801D3
*/
static unsigned int dell9200_m24_pin_configs[8] = {
- 0x40c003fa, 0x404003fb, 0x0321121f, 0x90170310,
- 0x408003fc, 0x03a11020, 0x401003fd, 0x403003fe,
+ 0x40c003fa, 0x404003fb, 0x0321121f, 0x90170310,
+ 0x408003fc, 0x03a11020, 0x401003fd, 0x403003fe,
};
/*
@@ -1255,7 +1255,7 @@ static unsigned int dell9200_m24_pin_configs[8] = {
102801EF
*/
static unsigned int dell9200_m25_pin_configs[8] = {
- 0x40c003fa, 0x01441340, 0x0421121f, 0x90170310,
+ 0x40c003fa, 0x01441340, 0x0421121f, 0x90170310,
0x408003fb, 0x04a11020, 0x401003fc, 0x403003fd,
};
@@ -1265,7 +1265,7 @@ static unsigned int dell9200_m25_pin_configs[8] = {
102801F6
*/
static unsigned int dell9200_m26_pin_configs[8] = {
- 0x40c003fa, 0x404003fb, 0x0421121f, 0x90170310,
+ 0x40c003fa, 0x404003fb, 0x0421121f, 0x90170310,
0x408003fc, 0x04a11020, 0x401003fd, 0x403003fe,
};
@@ -1601,7 +1601,7 @@ static unsigned int dell_922x_d82_pin_configs[10] = {
*/
static unsigned int dell_922x_m81_pin_configs[10] = {
0x0321101f, 0x01112024, 0x01111222, 0x91174220,
- 0x03a11050, 0x01116221, 0x90a70330, 0x01452340,
+ 0x03a11050, 0x01116221, 0x90a70330, 0x01452340,
0x40C003f1, 0x405003f0,
};
@@ -1610,9 +1610,9 @@ static unsigned int dell_922x_m81_pin_configs[10] = {
102801D7 (Dell XPS M1210)
*/
static unsigned int dell_922x_m82_pin_configs[10] = {
- 0x02211211, 0x408103ff, 0x02a1123e, 0x90100310,
- 0x408003f1, 0x0221121f, 0x03451340, 0x40c003f2,
- 0x508003f3, 0x405003f4,
+ 0x02211211, 0x408103ff, 0x02a1123e, 0x90100310,
+ 0x408003f1, 0x0221121f, 0x03451340, 0x40c003f2,
+ 0x508003f3, 0x405003f4,
};
static unsigned int d945gtp3_pin_configs[10] = {
@@ -1682,9 +1682,9 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = {
[STAC_IMAC_INTEL_20] = intel_mac_v3_pin_configs,
[STAC_ECS_202] = ecs202_pin_configs,
[STAC_922X_DELL_D81] = dell_922x_d81_pin_configs,
- [STAC_922X_DELL_D82] = dell_922x_d82_pin_configs,
+ [STAC_922X_DELL_D82] = dell_922x_d82_pin_configs,
[STAC_922X_DELL_M81] = dell_922x_m81_pin_configs,
- [STAC_922X_DELL_M82] = dell_922x_m82_pin_configs,
+ [STAC_922X_DELL_M82] = dell_922x_m82_pin_configs,
};
static const char *stac922x_models[STAC_922X_MODELS] = {
@@ -1823,7 +1823,7 @@ static struct snd_pci_quirk stac922x_cfg_tbl[] = {
static unsigned int ref927x_pin_configs[14] = {
0x02214020, 0x02a19080, 0x0181304e, 0x01014010,
- 0x01a19040, 0x01011012, 0x01016011, 0x0101201f,
+ 0x01a19040, 0x01011012, 0x01016011, 0x0101201f,
0x183301f0, 0x18a001f0, 0x18a001f0, 0x01442070,
0x01c42190, 0x40000100,
};
@@ -2015,25 +2015,25 @@ static int stac92xx_save_bios_config_regs(struct hda_codec *codec)
{
int i;
struct sigmatel_spec *spec = codec->spec;
-
- if (! spec->bios_pin_configs) {
+
+ if (!spec->bios_pin_configs) {
spec->bios_pin_configs = kcalloc(spec->num_pins,
sizeof(*spec->bios_pin_configs), GFP_KERNEL);
- if (! spec->bios_pin_configs)
+ if (!spec->bios_pin_configs)
return -ENOMEM;
}
-
+
for (i = 0; i < spec->num_pins; i++) {
hda_nid_t nid = spec->pin_nids[i];
unsigned int pin_cfg;
-
- pin_cfg = snd_hda_codec_read(codec, nid, 0,
- AC_VERB_GET_CONFIG_DEFAULT, 0x00);
+
+ pin_cfg = snd_hda_codec_read(codec, nid, 0,
+ AC_VERB_GET_CONFIG_DEFAULT, 0x00);
snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x bios pin config %8.8x\n",
nid, pin_cfg);
spec->bios_pin_configs[i] = pin_cfg;
}
-
+
return 0;
}
@@ -2055,7 +2055,7 @@ static void stac92xx_set_config_reg(struct hda_codec *codec,
pin_config >> 24);
i = snd_hda_codec_read(codec, pin_nid, 0,
AC_VERB_GET_CONFIG_DEFAULT,
- 0x00);
+ 0x00);
snd_printdd(KERN_INFO "hda_codec: pin nid %2.2x pin config %8.8x\n",
pin_nid, i);
}
@@ -2442,7 +2442,7 @@ static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type,
int num = spec->num_kctl_alloc + NUM_CONTROL_ALLOC;
knew = kcalloc(num + 1, sizeof(*knew), GFP_KERNEL); /* array + terminator */
- if (! knew)
+ if (!knew)
return -ENOMEM;
if (spec->kctl_alloc) {
memcpy(knew, spec->kctl_alloc, sizeof(*knew) * spec->num_kctl_alloc);
@@ -2456,7 +2456,7 @@ static int stac92xx_add_control_idx(struct sigmatel_spec *spec, int type,
*knew = stac92xx_control_templates[type];
knew->index = idx;
knew->name = kstrdup(name, GFP_KERNEL);
- if (! knew->name)
+ if (!knew->name)
return -ENOMEM;
knew->private_value = val;
spec->num_kctl_used++;
@@ -2477,7 +2477,7 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
struct sigmatel_spec *spec = codec->spec;
unsigned int wcaps, wtype;
int i, num_dacs = 0;
-
+
/* use the wcaps cache to count all DACs available for line-outs */
for (i = 0; i < codec->num_nodes; i++) {
wcaps = codec->wcaps[i];
@@ -2488,7 +2488,7 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
}
snd_printdd("%s: total dac count=%d\n", __func__, num_dacs);
-
+
switch (cfg->line_outs) {
case 3:
/* add line-in as side */
@@ -2538,7 +2538,7 @@ static int stac92xx_add_dyn_out_pins(struct hda_codec *codec, struct auto_pin_cf
static int is_in_dac_nids(struct sigmatel_spec *spec, hda_nid_t nid)
{
int i;
-
+
for (i = 0; i < spec->multiout.num_dacs; i++) {
if (spec->multiout.dac_nids[i] == nid)
return 1;
@@ -2558,10 +2558,10 @@ static int stac92xx_auto_fill_dac_nids(struct hda_codec *codec,
struct auto_pin_cfg *cfg)
{
struct sigmatel_spec *spec = codec->spec;
- int i, j, conn_len = 0;
+ int i, j, conn_len = 0;
hda_nid_t nid, conn[HDA_MAX_CONNECTIONS];
unsigned int wcaps, wtype;
-
+
for (i = 0; i < cfg->line_outs; i++) {
nid = cfg->line_out_pins[i];
conn_len = snd_hda_get_connections(codec, nid, conn,
@@ -2772,7 +2772,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
if (check_in_dac_nids(spec, nid))
nid = 0;
- if (! nid)
+ if (!nid)
continue;
add_spec_dacs(spec, nid);
}
@@ -2781,7 +2781,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
if (check_in_dac_nids(spec, nid))
nid = 0;
- if (! nid)
+ if (!nid)
continue;
add_spec_dacs(spec, nid);
}
@@ -2790,7 +2790,7 @@ static int stac92xx_auto_create_hp_ctls(struct hda_codec *codec,
AC_VERB_GET_CONNECT_LIST, 0) & 0xff;
if (check_in_dac_nids(spec, nid))
nid = 0;
- if (! nid)
+ if (!nid)
continue;
add_spec_dacs(spec, nid);
}
@@ -3082,7 +3082,7 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
&spec->autocfg,
spec->dmic_nids)) < 0)
return err;
- if (! spec->autocfg.line_outs)
+ if (!spec->autocfg.line_outs)
return 0; /* can't find valid pin config */
/* If we have no real line-out pin and multiple hp-outs, HPs should
@@ -3258,7 +3258,7 @@ static int stac9200_auto_create_hp_ctls(struct hda_codec *codec,
hda_nid_t pin = cfg->hp_pins[0];
unsigned int wid_caps;
- if (! pin)
+ if (!pin)
return 0;
wid_caps = get_wcaps(codec, pin);
@@ -3503,7 +3503,7 @@ static void stac92xx_free(struct hda_codec *codec)
struct sigmatel_spec *spec = codec->spec;
int i;
- if (! spec)
+ if (!spec)
return;
if (spec->kctl_alloc) {
@@ -3544,7 +3544,7 @@ static void stac92xx_set_pinctl(struct hda_codec *codec, hda_nid_t nid,
direction bits first */
if (flag & (AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN))
pin_ctl &= ~(AC_PINCTL_IN_EN | AC_PINCTL_OUT_EN);
-
+
snd_hda_codec_write_cache(codec, nid, 0,
AC_VERB_SET_PIN_WIDGET_CONTROL,
pin_ctl | flag);
@@ -3628,7 +3628,7 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
}
if (!spec->hp_switch && cfg->hp_outs > 1 && presence)
stac92xx_set_pinctl(codec, nid, AC_PINCTL_OUT_EN);
-}
+}
static void stac92xx_pin_sense(struct hda_codec *codec, int idx)
{
@@ -3779,7 +3779,7 @@ static int patch_stac925x(struct hda_codec *codec)
stac925x_cfg_tbl);
again:
if (spec->board_config < 0) {
- snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x,"
+ snd_printdd(KERN_INFO "hda_codec: Unknown model for STAC925x,"
"using BIOS defaults\n");
err = stac92xx_save_bios_config_regs(codec);
if (err < 0) {
@@ -4309,7 +4309,7 @@ static int patch_stac922x(struct hda_codec *codec)
spec->mixer = stac922x_mixer;
spec->multiout.dac_nids = spec->dac_nids;
-
+
err = stac92xx_parse_auto_config(codec, 0x08, 0x09);
if (!err) {
if (spec->board_config < 0) {
@@ -4510,7 +4510,7 @@ static int patch_stac9205(struct hda_codec *codec)
spec->aloopback_mask = 0x40;
spec->aloopback_shift = 0;
spec->multiout.dac_nids = spec->dac_nids;
-
+
switch (spec->board_config){
case STAC_9205_DELL_M43:
/* Enable SPDIF in/out */
@@ -4700,7 +4700,7 @@ static void stac9872_vaio_hp_detect(struct hda_codec *codec, unsigned int res)
stac92xx_reset_pinctl(codec, 0x0a, AC_PINCTL_OUT_EN);
stac92xx_set_pinctl(codec, 0x0f, AC_PINCTL_OUT_EN);
}
-}
+}
static void stac9872_vaio_unsol_event(struct hda_codec *codec, unsigned int res)
{
@@ -4725,7 +4725,7 @@ static struct hda_codec_ops stac9872_vaio_patch_ops = {
enum { /* FE and SZ series. id=0x83847661 and subsys=0x104D0700 or 104D1000. */
CXD9872RD_VAIO,
/* Unknown. id=0x83847662 and subsys=0x104D1200 or 104D1000. */
- STAC9872AK_VAIO,
+ STAC9872AK_VAIO,
/* Unknown. id=0x83847661 and subsys=0x104D1200. */
STAC9872K_VAIO,
/* AR Series. id=0x83847664 and subsys=104D1300 */
@@ -4757,7 +4757,7 @@ static int patch_stac9872(struct hda_codec *codec)
if (board_config < 0)
/* unknown config, let generic-parser do its job... */
return snd_hda_parse_generic_codec(codec);
-
+
spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL)
return -ENOMEM;
@@ -4780,7 +4780,7 @@ static int patch_stac9872(struct hda_codec *codec)
spec->mux_nids = vaio_mux_nids;
codec->patch_ops = stac9872_vaio_patch_ops;
break;
-
+
case CXD9872AKD_VAIO:
spec->mixer = vaio_ar_mixer;
spec->init = vaio_ar_init;
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index e7e4352..4597ec9 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -344,7 +344,7 @@ static struct hda_verb vt1708_volume_init_verbs[] = {
{0x19, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
{0x1a, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
{0x1b, AC_VERB_SET_AMP_GAIN_MUTE, AMP_OUT_ZERO},
-
+
/* Setup default input to PW4 */
{0x20, AC_VERB_SET_CONNECT_SEL, 0x1},
/* PW9 Output enable */
@@ -644,8 +644,8 @@ static int vt1708_auto_fill_dac_nids(struct via_spec *spec,
spec->multiout.num_dacs = cfg->line_outs;
spec->multiout.dac_nids = spec->private_dac_nids;
-
- for(i = 0; i < 4; i++) {
+
+ for (i = 0; i < 4; i++) {
nid = cfg->line_out_pins[i];
if (nid) {
/* config dac list */
@@ -683,7 +683,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec,
if (!nid)
continue;
-
+
if (i != AUTO_SEQ_FRONT)
nid_vol = 0x1b - i + 1;
@@ -727,7 +727,7 @@ static int vt1708_auto_create_multi_out_ctls(struct via_spec *spec,
HDA_INPUT));
if (err < 0)
return err;
-
+
/* add control to PW3 */
sprintf(name, "%s Playback Volume", chname[i]);
err = via_add_control(spec, VIA_CTL_WIDGET_VOL, name,
@@ -806,7 +806,7 @@ static int vt1708_auto_create_analog_input_ctls(struct via_spec *spec,
case 0x1d: /* Mic */
idx = 2;
break;
-
+
case 0x1e: /* Line In */
idx = 3;
break;
@@ -874,7 +874,7 @@ static int vt1708_parse_auto_config(struct hda_codec *codec)
if (spec->kctl_alloc)
spec->mixers[spec->num_mixers++] = spec->kctl_alloc;
- spec->init_verbs = vt1708_volume_init_verbs;
+ spec->init_verbs = vt1708_volume_init_verbs;
spec->input_mux = &spec->private_imux;
@@ -913,7 +913,7 @@ static int patch_vt1708(struct hda_codec *codec)
"from BIOS. Using genenic mode...\n");
}
-
+
spec->stream_name_analog = "VT1708 Analog";
spec->stream_analog_playback = &vt1708_pcm_analog_playback;
/* disable 32bit format on VT1708 */
@@ -925,7 +925,7 @@ static int patch_vt1708(struct hda_codec *codec)
spec->stream_digital_playback = &vt1708_pcm_digital_playback;
spec->stream_digital_capture = &vt1708_pcm_digital_capture;
-
+
if (!spec->adc_nids && spec->input_mux) {
spec->adc_nids = vt1708_adc_nids;
spec->num_adc_nids = ARRAY_SIZE(vt1708_adc_nids);
@@ -1104,7 +1104,7 @@ static int vt1709_auto_fill_dac_nids(struct via_spec *spec,
spec->multiout.dac_nids[cfg->line_outs] = 0x28; /* AOW4 */
} else if (cfg->line_outs == 3) { /* 6 channels */
- for(i = 0; i < cfg->line_outs; i++) {
+ for (i = 0; i < cfg->line_outs; i++) {
nid = cfg->line_out_pins[i];
if (nid) {
/* config dac list */
@@ -1143,7 +1143,7 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec,
for (i = 0; i <= AUTO_SEQ_SIDE; i++) {
nid = cfg->line_out_pins[i];
- if (!nid)
+ if (!nid)
continue;
if (i == AUTO_SEQ_CENLFE) {
@@ -1186,7 +1186,7 @@ static int vt1709_auto_create_multi_out_ctls(struct via_spec *spec,
HDA_INPUT));
if (err < 0)
return err;
-
+
/* add control to PW3 */
sprintf(name, "%s Playback Volume", chname[i]);
err = via_add_control(spec, VIA_CTL_WIDGET_VOL, name,
@@ -1281,7 +1281,7 @@ static int vt1709_auto_create_analog_input_ctls(struct via_spec *spec,
case 0x1d: /* Mic */
idx = 2;
break;
-
+
case 0x1e: /* Line In */
idx = 3;
break;
@@ -1375,7 +1375,7 @@ static int patch_vt1709_10ch(struct hda_codec *codec)
"Using genenic mode...\n");
}
- spec->init_verbs = vt1709_10ch_volume_init_verbs;
+ spec->init_verbs = vt1709_10ch_volume_init_verbs;
spec->stream_name_analog = "VT1709 Analog";
spec->stream_analog_playback = &vt1709_10ch_pcm_analog_playback;
@@ -1385,7 +1385,7 @@ static int patch_vt1709_10ch(struct hda_codec *codec)
spec->stream_digital_playback = &vt1709_pcm_digital_playback;
spec->stream_digital_capture = &vt1709_pcm_digital_capture;
-
+
if (!spec->adc_nids && spec->input_mux) {
spec->adc_nids = vt1709_adc_nids;
spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids);
@@ -1466,7 +1466,7 @@ static int patch_vt1709_6ch(struct hda_codec *codec)
"Using genenic mode...\n");
}
- spec->init_verbs = vt1709_6ch_volume_init_verbs;
+ spec->init_verbs = vt1709_6ch_volume_init_verbs;
spec->stream_name_analog = "VT1709 Analog";
spec->stream_analog_playback = &vt1709_6ch_pcm_analog_playback;
@@ -1476,7 +1476,7 @@ static int patch_vt1709_6ch(struct hda_codec *codec)
spec->stream_digital_playback = &vt1709_pcm_digital_playback;
spec->stream_digital_capture = &vt1709_pcm_digital_capture;
-
+
if (!spec->adc_nids && spec->input_mux) {
spec->adc_nids = vt1709_adc_nids;
spec->num_adc_nids = ARRAY_SIZE(vt1709_adc_nids);
1
0

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/emu10k1/emu10k1.c | 8 +-
sound/pci/emu10k1/emu10k1_callback.c | 28 ++--
sound/pci/emu10k1/emu10k1_main.c | 266 +++++++++++++++++-----------------
sound/pci/emu10k1/emu10k1_patch.c | 14 +-
sound/pci/emu10k1/emu10k1_synth.c | 2 +-
sound/pci/emu10k1/emu10k1x.c | 156 ++++++++++----------
sound/pci/emu10k1/emufx.c | 148 ++++++++++----------
sound/pci/emu10k1/emumixer.c | 130 ++++++++--------
sound/pci/emu10k1/emumpu401.c | 2 +-
sound/pci/emu10k1/emupcm.c | 56 ++++----
sound/pci/emu10k1/emuproc.c | 80 +++++-----
sound/pci/emu10k1/io.c | 32 ++--
sound/pci/emu10k1/irq.c | 18 +-
sound/pci/emu10k1/memory.c | 8 +-
sound/pci/emu10k1/p16v.c | 132 +++++++++---------
sound/pci/emu10k1/p16v.h | 14 +-
sound/pci/emu10k1/p17v.h | 6 +-
sound/pci/emu10k1/voice.c | 32 ++--
18 files changed, 566 insertions(+), 566 deletions(-)
diff --git a/sound/pci/emu10k1/emu10k1.c b/sound/pci/emu10k1/emu10k1.c
index 8354c1a..094a874 100644
--- a/sound/pci/emu10k1/emu10k1.c
+++ b/sound/pci/emu10k1/emu10k1.c
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- *
+ *
*/
#include <linux/init.h>
@@ -134,7 +134,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
if ((err = snd_emu10k1_pcm_efx(emu, 2, NULL)) < 0)
goto error;
/* This stores the periods table. */
- if (emu->card_capabilities->ca0151_chip) { /* P16V */
+ if (emu->card_capabilities->ca0151_chip) { /* P16V */
if ((err = snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
1024, &emu->p16v_buffer)) < 0)
goto error;
@@ -142,7 +142,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
if ((err = snd_emu10k1_mixer(emu, 0, 3)) < 0)
goto error;
-
+
if ((err = snd_emu10k1_timer(emu, 0)) < 0)
goto error;
@@ -176,7 +176,7 @@ static int __devinit snd_card_emu10k1_probe(struct pci_dev *pci,
arg->max_voices = max_synth_voices[dev];
}
#endif
-
+
strcpy(card->driver, emu->card_capabilities->driver);
strcpy(card->shortname, emu->card_capabilities->name);
snprintf(card->longname, sizeof(card->longname),
diff --git a/sound/pci/emu10k1/emu10k1_callback.c b/sound/pci/emu10k1/emu10k1_callback.c
index 0e649dc..7bc7fce 100644
--- a/sound/pci/emu10k1/emu10k1_callback.c
+++ b/sound/pci/emu10k1/emu10k1_callback.c
@@ -103,7 +103,7 @@ snd_emu10k1_synth_get_voice(struct snd_emu10k1 *hw)
int ch;
vp = &emu->voices[best[i].voice];
if ((ch = vp->ch) < 0) {
- //printk("synth_get_voice: ch < 0 (%d) ??", i);
+ /* printk("synth_get_voice: ch < 0 (%d) ??", i); */
continue;
}
vp->emu->num_voices--;
@@ -128,7 +128,7 @@ release_voice(struct snd_emux_voice *vp)
{
int dcysusv;
struct snd_emu10k1 *hw;
-
+
hw = vp->hw;
dcysusv = 0x8000 | (unsigned char)vp->reg.parm.modrelease;
snd_emu10k1_ptr_write(hw, DCYSUSM, vp->ch, dcysusv);
@@ -144,7 +144,7 @@ static void
terminate_voice(struct snd_emux_voice *vp)
{
struct snd_emu10k1 *hw;
-
+
if (snd_BUG_ON(!vp))
return;
hw = vp->hw;
@@ -164,7 +164,7 @@ static void
free_voice(struct snd_emux_voice *vp)
{
struct snd_emu10k1 *hw;
-
+
hw = vp->hw;
/* FIXME: emu10k1_synth is broken. */
/* This can get called with hw == 0 */
@@ -173,7 +173,7 @@ free_voice(struct snd_emux_voice *vp)
if (hw && (vp->ch >= 0)) {
snd_emu10k1_ptr_write(hw, IFATN, vp->ch, 0xff00);
snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0x807f | DCYSUSV_CHANNELENABLE_MASK);
- // snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0);
+ /* snd_emu10k1_ptr_write(hw, DCYSUSV, vp->ch, 0); */
snd_emu10k1_ptr_write(hw, VTFT, vp->ch, 0xffff);
snd_emu10k1_ptr_write(hw, CVCF, vp->ch, 0xffff);
snd_emu10k1_voice_free(hw, &hw->voices[vp->ch]);
@@ -190,7 +190,7 @@ static void
update_voice(struct snd_emux_voice *vp, int update)
{
struct snd_emu10k1 *hw;
-
+
hw = vp->hw;
if (update & SNDRV_EMUX_UPDATE_VOLUME)
snd_emu10k1_ptr_write(hw, IFATN_ATTENUATION, vp->ch, vp->avol);
@@ -250,7 +250,7 @@ lookup_voices(struct snd_emux *emu, struct snd_emu10k1 *hw,
bp = best + V_RELEASED;
#if 1
val = snd_emu10k1_ptr_read(hw, CVCF_CURRENTVOL, vp->ch);
- if (! val)
+ if (!val)
bp = best + V_OFF;
#endif
}
@@ -323,7 +323,7 @@ start_voice(struct snd_emux_voice *vp)
struct snd_midi_channel *chan;
struct snd_emu10k1 *hw;
struct snd_emu10k1_memblk *emem;
-
+
hw = vp->hw;
ch = vp->ch;
if (snd_BUG_ON(ch < 0))
@@ -335,7 +335,7 @@ start_voice(struct snd_emux_voice *vp)
return -EINVAL;
emem->map_locked++;
if (snd_emu10k1_memblk_map(hw, emem) < 0) {
- // printk("emu: cannot map!\n");
+ /* printk("emu: cannot map!\n"); */
return -ENOMEM;
}
mapped_offset = snd_emu10k1_memblk_offset(emem) >> 1;
@@ -347,11 +347,11 @@ start_voice(struct snd_emux_voice *vp)
/* set channel routing */
/* A = left(0), B = right(1), C = reverb(c), D = chorus(d) */
if (hw->audigy) {
- temp = FXBUS_MIDI_LEFT | (FXBUS_MIDI_RIGHT << 8) |
+ temp = FXBUS_MIDI_LEFT | (FXBUS_MIDI_RIGHT << 8) |
(FXBUS_MIDI_REVERB << 16) | (FXBUS_MIDI_CHORUS << 24);
snd_emu10k1_ptr_write(hw, A_FXRT1, ch, temp);
} else {
- temp = (FXBUS_MIDI_LEFT << 16) | (FXBUS_MIDI_RIGHT << 20) |
+ temp = (FXBUS_MIDI_LEFT << 16) | (FXBUS_MIDI_RIGHT << 20) |
(FXBUS_MIDI_REVERB << 24) | (FXBUS_MIDI_CHORUS << 28);
snd_emu10k1_ptr_write(hw, FXRT, ch, temp);
}
@@ -437,7 +437,7 @@ start_voice(struct snd_emux_voice *vp)
temp = ((unsigned int)hw->silent_page.addr << 1) | MAP_PTI_MASK;
snd_emu10k1_ptr_write(hw, MAPA, ch, temp);
snd_emu10k1_ptr_write(hw, MAPB, ch, temp);
-
+
/* fill cache */
val -= 4;
val <<= 25;
@@ -476,11 +476,11 @@ trigger_voice(struct snd_emux_voice *vp)
unsigned int temp, ptarget;
struct snd_emu10k1 *hw;
struct snd_emu10k1_memblk *emem;
-
+
hw = vp->hw;
emem = (struct snd_emu10k1_memblk *)vp->block;
- if (! emem || emem->mapped_page < 0)
+ if (!emem || emem->mapped_page < 0)
return; /* not mapped */
#if 0
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c
index 2f283ea..ab57586 100644
--- a/sound/pci/emu10k1/emu10k1_main.c
+++ b/sound/pci/emu10k1/emu10k1_main.c
@@ -153,7 +153,7 @@ static unsigned int i2c_adc_init[][2] = {
{ 0x14, 0xa6 }, /* Limiter control */
{ 0x15, ADC_MUX_2 }, /* ADC Mixer control. Mic for Audigy 2 ZS Notebook */
};
-
+
static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
{
unsigned int silent_page;
@@ -197,12 +197,12 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
if (emu->card_capabilities->ca0151_chip) { /* audigy2 */
/* Hacks for Alice3 to work independent of haP16V driver */
- //Setup SRCMulti_I2S SamplingRate
+ /* Setup SRCMulti_I2S SamplingRate */
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
tmp &= 0xfffff1ff;
tmp |= (0x2<<9);
snd_emu10k1_ptr_write(emu, A_SPDIF_SAMPLERATE, 0, tmp);
-
+
/* Setup SRCSel (Enable Spdif,I2S SRCMulti) */
snd_emu10k1_ptr20_write(emu, SRCSel, 0, 0x14);
/* Setup SRCMulti Input Audio Enable */
@@ -217,7 +217,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
if (emu->card_capabilities->ca0108_chip) { /* audigy2 Value */
/* Hacks for Alice3 to work independent of haP16V driver */
snd_printk(KERN_INFO "Audigy2 value: Special config.\n");
- //Setup SRCMulti_I2S SamplingRate
+ /* Setup SRCMulti_I2S SamplingRate */
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
tmp &= 0xfffff1ff;
tmp |= (0x2<<9);
@@ -276,7 +276,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
}
}
-
+
snd_emu10k1_ptr_write(emu, PTB, 0, emu->ptb_pages.addr);
snd_emu10k1_ptr_write(emu, TCB, 0, 0); /* taken from original driver */
snd_emu10k1_ptr_write(emu, TCBS, 0, 4); /* taken from original driver */
@@ -313,7 +313,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
(emu->model == 0x21 && emu->revision < 6))
outl(HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE, emu->port + HCFG);
else
- // With on-chip joystick
+ /* With on-chip joystick */
outl(HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE | HCFG_JOYENABLE, emu->port + HCFG);
if (enable_ir) { /* enable IR for SB Live */
@@ -337,7 +337,7 @@ static int snd_emu10k1_init(struct snd_emu10k1 *emu, int enable_ir, int resume)
outl(reg, emu->port + HCFG);
}
}
-
+
if (emu->card_capabilities->emu_model) {
; /* Disable all access to A_IOCFG for the emu1010 */
} else if (emu->card_capabilities->i2c_adc) {
@@ -364,7 +364,7 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu)
; /* Disable A_IOCFG for Audigy 2 ZS Notebook */
} else if (emu->audigy) {
outl(inl(emu->port + A_IOCFG) & ~0x44, emu->port + A_IOCFG);
-
+
if (emu->card_capabilities->ca0151_chip) { /* audigy2 */
/* Unmute Analog now. Set GPO6 to 1 for Apollo.
* This has to be done after init ALice3 I2SOut beyond 48KHz.
@@ -378,12 +378,12 @@ static void snd_emu10k1_audio_enable(struct snd_emu10k1 *emu)
outl(inl(emu->port + A_IOCFG) | 0x0080, emu->port + A_IOCFG);
}
}
-
+
#if 0
{
unsigned int tmp;
/* FIXME: the following routine disables LiveDrive-II !! */
- // TOSLink detection
+ /* TOSLink detection */
emu->tos_link = 0;
tmp = inl(emu->port + HCFG);
if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) {
@@ -495,7 +495,7 @@ int snd_emu10k1_done(struct snd_emu10k1 * emu)
#define EC_LAST_PROMFILE_ADDR 0x2f
-#define EC_SERIALNUM_ADDR 0x30 /* First word of serial number. The
+#define EC_SERIALNUM_ADDR 0x30 /* First word of serial number. The
* can be up to 30 characters in length
* and is stored as a NULL-terminated
* ASCII string. Any unused bytes must be
@@ -503,8 +503,8 @@ int snd_emu10k1_done(struct snd_emu10k1 * emu)
#define EC_CHECKSUM_ADDR 0x3f /* Location at which checksum is stored */
-/* Most of this stuff is pretty self-evident. According to the hardware
- * dudes, we need to leave the ADCCAL bit low in order to avoid a DC
+/* Most of this stuff is pretty self-evident. According to the hardware
+ * dudes, we need to leave the ADCCAL bit low in order to avoid a DC
* offset problem. Weird.
*/
#define EC_RAW_RUN_MODE (EC_DACMUTEN | EC_ADCRSTN | EC_TRIM_MUTEN | \
@@ -574,7 +574,7 @@ static void snd_emu10k1_ecard_setadcgain(struct snd_emu10k1 * emu,
for (bit = (1 << 15); bit; bit >>= 1) {
unsigned int value;
-
+
value = emu->ecard_ctrl & ~(EC_TRIM_CSN | EC_TRIM_SDATA);
if (gain & bit)
@@ -598,7 +598,7 @@ static int snd_emu10k1_ecard_init(struct snd_emu10k1 * emu)
EC_SPDIF0_SELECT(EC_DEFAULT_SPDIF0_SEL) |
EC_SPDIF1_SELECT(EC_DEFAULT_SPDIF1_SEL);
- /* Step 0: Set the codec type in the hardware control register
+ /* Step 0: Set the codec type in the hardware control register
* and enable audio output */
hc_value = inl(emu->port + HCFG);
outl(hc_value | HCFG_AUDIOENABLE | HCFG_CODECFORMAT_I2S, emu->port + HCFG);
@@ -685,13 +685,13 @@ static int snd_emu1010_load_firmware(struct snd_emu10k1 * emu, const char * file
outl(0x80, emu->port + A_IOCFG); /* Leave bit 7 set during netlist setup. */
write_post = inl(emu->port + A_IOCFG);
udelay(100); /* Allow FPGA memory to clean */
- for(n = 0; n < fw_entry->size; n++) {
- value=fw_entry->data[n];
- for(i = 0; i < 8; i++) {
+ for (n = 0; n < fw_entry->size; n++) {
+ value=fw_entry->data[n];
+ for (i = 0; i < 8; i++) {
reg = 0x80;
if (value & 0x1)
reg = reg | 0x20;
- value = value >> 1;
+ value = value >> 1;
outl(reg, emu->port + A_IOCFG);
write_post = inl(emu->port + A_IOCFG);
outl(reg | 0x40, emu->port + A_IOCFG);
@@ -719,13 +719,13 @@ static int emu1010_firmware_thread(void *data)
msleep_interruptible(1000);
if (kthread_should_stop())
break;
- snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp ); /* IRQ Status */
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ® ); /* OPTIONS: Which cards are attached to the EMU */
+ snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, &tmp); /* IRQ Status */
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ®); /* OPTIONS: Which cards are attached to the EMU */
if (reg & EMU_HANA_OPTION_DOCK_OFFLINE) {
/* Audio Dock attached */
/* Return to Audio Dock programming mode */
snd_printk(KERN_INFO "emu1010: Loading Audio Dock Firmware\n");
- snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK );
+ snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, EMU_HANA_FPGA_CONFIG_AUDIODOCK);
if (emu->card_capabilities->emu_model ==
EMU_MODEL_EMU1010) {
if ((err = snd_emu1010_load_firmware(emu, DOCK_FILENAME)) != 0) {
@@ -743,11 +743,11 @@ static int emu1010_firmware_thread(void *data)
}
}
- snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0 );
- snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, ® );
+ snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0);
+ snd_emu1010_fpga_read(emu, EMU_HANA_IRQ_STATUS, ®);
snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_IRQ_STATUS=0x%x\n",reg);
/* ID, should read & 0x7f = 0x55 when FPGA programmed. */
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ®);
snd_printk(KERN_INFO "emu1010: EMU_HANA+DOCK_ID=0x%x\n",reg);
if ((reg & 0x1f) != 0x15) {
/* FPGA failed to be programmed */
@@ -755,14 +755,14 @@ static int emu1010_firmware_thread(void *data)
continue;
}
snd_printk(KERN_INFO "emu1010: Audio Dock Firmware loaded\n");
- snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp );
- snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2 );
+ snd_emu1010_fpga_read(emu, EMU_DOCK_MAJOR_REV, &tmp);
+ snd_emu1010_fpga_read(emu, EMU_DOCK_MINOR_REV, &tmp2);
snd_printk("Audio Dock ver:%d.%d\n",tmp ,tmp2);
/* Sync clocking between 1010 and Dock */
/* Allow DLL to settle */
msleep(10);
/* Unmute all. Default is muted after a firmware load */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
}
}
snd_printk(KERN_INFO "emu1010: firmware thread stopping\n");
@@ -818,7 +818,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
* Lock Tank Memory Cache,
* Mute all codecs.
*/
- outl(0x0005a004, emu->port + HCFG);
+ outl(0x0005a004, emu->port + HCFG);
/* AC97 2.1, Any 16Meg of 4Gig address, Auto-Mute, EMU32 Slave,
* Mute all codecs.
*/
@@ -829,18 +829,18 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
outl(0x0005a000, emu->port + HCFG);
/* Disable 48Volt power to Audio Dock */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
/* ID, should read & 0x7f = 0x55. (Bit 7 is the IRQ bit) */
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ®);
snd_printdd("reg1=0x%x\n",reg);
if ((reg & 0x3f) == 0x15) {
/* FPGA netlist already present so clear it */
/* Return to programming mode */
- snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0x02 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_FPGA_CONFIG, 0x02);
}
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ®);
snd_printdd("reg2=0x%x\n",reg);
if ((reg & 0x3f) == 0x15) {
/* FPGA failed to return to programming mode */
@@ -876,7 +876,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
}
/* ID, should read & 0x7f = 0x55 when FPGA programmed. */
- snd_emu1010_fpga_read(emu, EMU_HANA_ID, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, ®);
if ((reg & 0x3f) != 0x15) {
/* FPGA failed to be programmed */
snd_printk(KERN_INFO "emu1010: Loading Hana Firmware file failed, reg=0x%x\n", reg);
@@ -884,17 +884,17 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
}
snd_printk(KERN_INFO "emu1010: Hana Firmware loaded\n");
- snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp );
- snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2 );
+ snd_emu1010_fpga_read(emu, EMU_HANA_MAJOR_REV, &tmp);
+ snd_emu1010_fpga_read(emu, EMU_HANA_MINOR_REV, &tmp2);
snd_printk("Hana ver:%d.%d\n",tmp ,tmp2);
/* Enable 48Volt power to Audio Dock */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, EMU_HANA_DOCK_PWR_ON);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ®);
snd_printk(KERN_INFO "emu1010: Card options=0x%x\n",reg);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ®);
snd_printk(KERN_INFO "emu1010: Card options=0x%x\n",reg);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp );
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTICAL_TYPE, &tmp);
/* Optical -> ADAT I/O */
/* 0 : SPDIF
* 1 : ADAT
@@ -904,41 +904,41 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
tmp = 0;
tmp = (emu->emu1010.optical_in ? EMU_HANA_OPTICAL_IN_ADAT : 0) |
(emu->emu1010.optical_out ? EMU_HANA_OPTICAL_OUT_ADAT : 0);
- snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, tmp );
- snd_emu1010_fpga_read(emu, EMU_HANA_ADC_PADS, &tmp );
+ snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, tmp);
+ snd_emu1010_fpga_read(emu, EMU_HANA_ADC_PADS, &tmp);
/* Set no attenuation on Audio Dock pads. */
- snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, 0x00 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, 0x00);
emu->emu1010.adc_pads = 0x00;
- snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp );
+ snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp);
/* Unmute Audio dock DACs, Headphone source DAC-4. */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 );
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12 );
- snd_emu1010_fpga_read(emu, EMU_HANA_DAC_PADS, &tmp );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30);
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);
+ snd_emu1010_fpga_read(emu, EMU_HANA_DAC_PADS, &tmp);
/* DAC PADs. */
- snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, 0x0f );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, 0x0f);
emu->emu1010.dac_pads = 0x0f;
- snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp );
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30 );
- snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp );
+ snd_emu1010_fpga_read(emu, EMU_HANA_DOCK_MISC, &tmp);
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_MISC, 0x30);
+ snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp);
/* SPDIF Format. Set Consumer mode, 24bit, copy enable */
- snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10);
/* MIDI routing */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19);
/* Unknown. */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c );
- /* snd_emu1010_fpga_write(emu, 0x09, 0x0f ); // IRQ Enable: All on */
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c);
+ /* snd_emu1010_fpga_write(emu, 0x09, 0x0f); IRQ Enable: All on */
/* IRQ Enable: All off */
- snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_IRQ_ENABLE, 0x00);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ® );
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, ®);
snd_printk(KERN_INFO "emu1010: Card options3=0x%x\n",reg);
/* Default WCLK set to 48kHz. */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x00 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x00);
/* Word Clock source, Internal 48kHz x1 */
- snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K );
- //snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X );
+ snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K);
+ /* snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X); */
/* Audio Dock LEDs. */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);
#if 0
/* For 96kHz */
@@ -992,7 +992,7 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
* Defaults only, users will set their own values anyways, let's
* just copy/paste.
*/
-
+
snd_emu1010_fpga_link_dst_src_write(emu,
EMU_DST_ALICE2_EMU32_8, EMU_SRC_DOCK_MIC_A1);
snd_emu1010_fpga_link_dst_src_write(emu,
@@ -1037,19 +1037,19 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
snd_emu1010_fpga_link_dst_src_write(emu,
EMU_DST_ALICE2_EMU32_F, EMU_SRC_HAMOA_ADC_LEFT2);
#endif
- for (i = 0;i < 0x20; i++ ) {
+ for (i = 0; i < 0x20; i++) {
/* AudioDock Elink <- Silence */
snd_emu1010_fpga_link_dst_src_write(emu, 0x0100+i, EMU_SRC_SILENCE);
}
- for (i = 0;i < 4; i++) {
+ for (i = 0; i < 4; i++) {
/* Hana SPDIF Out <- Silence */
snd_emu1010_fpga_link_dst_src_write(emu, 0x0200+i, EMU_SRC_SILENCE);
}
- for (i = 0;i < 7; i++) {
+ for (i = 0; i < 7; i++) {
/* Hamoa DAC <- Silence */
snd_emu1010_fpga_link_dst_src_write(emu, 0x0300+i, EMU_SRC_SILENCE);
}
- for (i = 0;i < 7; i++) {
+ for (i = 0; i < 7; i++) {
/* Hana ADAT Out <- Silence */
snd_emu1010_fpga_link_dst_src_write(emu, EMU_DST_HANA_ADAT + i, EMU_SRC_SILENCE);
}
@@ -1065,30 +1065,30 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
EMU_DST_ALICE_I2S2_LEFT, EMU_SRC_DOCK_ADC3_LEFT1);
snd_emu1010_fpga_link_dst_src_write(emu,
EMU_DST_ALICE_I2S2_RIGHT, EMU_SRC_DOCK_ADC3_RIGHT1);
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x01 ); // Unmute all
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x01); /* Unmute all */
+
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp);
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp );
-
/* AC97 1.03, Any 32Meg of 2Gig address, Auto-Mute, EMU32 Slave,
* Lock Sound Memory Cache, Lock Tank Memory Cache,
* Mute all codecs.
*/
- outl(0x0000a000, emu->port + HCFG);
+ outl(0x0000a000, emu->port + HCFG);
/* AC97 1.03, Any 32Meg of 2Gig address, Auto-Mute, EMU32 Slave,
* Lock Sound Memory Cache, Lock Tank Memory Cache,
* Un-Mute all codecs.
*/
outl(0x0000a001, emu->port + HCFG);
-
+
/* Initial boot complete. Now patches */
- snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp );
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 ); /* MIDI Route */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c ); /* Unknown */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19 ); /* MIDI Route */
- snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c ); /* Unknown */
- snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp );
- snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10 ); /* SPDIF Format spdif (or 0x11 for aes/ebu) */
+ snd_emu1010_fpga_read(emu, EMU_HANA_OPTION_CARDS, &tmp);
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19); /* MIDI Route */
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c); /* Unknown */
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_IN, 0x19); /* MIDI Route */
+ snd_emu1010_fpga_write(emu, EMU_HANA_MIDI_OUT, 0x0c); /* Unknown */
+ snd_emu1010_fpga_read(emu, EMU_HANA_SPDIF_MODE, &tmp);
+ snd_emu1010_fpga_write(emu, EMU_HANA_SPDIF_MODE, 0x10); /* SPDIF Format spdif (or 0x11 for aes/ebu) */
/* Start Micro/Audio Dock firmware loader thread */
if (!emu->emu1010.firmware_thread) {
@@ -1218,20 +1218,20 @@ static int snd_emu10k1_emu1010_init(struct snd_emu10k1 * emu)
emu->emu1010.output_source[23] = 28;
}
/* TEMP: Select SPDIF in/out */
- //snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0); /* Output spdif */
+ /* snd_emu1010_fpga_write(emu, EMU_HANA_OPTICAL_TYPE, 0x0); Output spdif */
/* TEMP: Select 48kHz SPDIF out */
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x0); /* Mute all */
snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, 0x0); /* Default fallback clock 48kHz */
/* Word Clock source, Internal 48kHz x1 */
- snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K );
- //snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X );
+ snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K);
+ /* snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK, EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_4X); */
emu->emu1010.internal_clock = 1; /* 48000 */
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, 0x12);/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, 0x1); /* Unmute all */
- //snd_emu1010_fpga_write(emu, 0x7, 0x0); /* Mute all */
- //snd_emu1010_fpga_write(emu, 0x7, 0x1); /* Unmute all */
- //snd_emu1010_fpga_write(emu, 0xe, 0x12); /* Set LEDs on Audio Dock */
+ /* snd_emu1010_fpga_write(emu, 0x7, 0x0); Mute all */
+ /* snd_emu1010_fpga_write(emu, 0x7, 0x1); Unmute all */
+ /* snd_emu1010_fpga_write(emu, 0xe, 0x12); Set LEDs on Audio Dock */
return 0;
}
@@ -1253,7 +1253,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
}
if (emu->card_capabilities->emu_model == EMU_MODEL_EMU1010) {
/* Disable 48Volt power to Audio Dock */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0 );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_PWR, 0);
}
if (emu->emu1010.firmware_thread)
kthread_stop(emu->emu1010.firmware_thread);
@@ -1278,7 +1278,7 @@ static int snd_emu10k1_free(struct snd_emu10k1 *emu)
#endif
if (emu->port)
pci_release_regions(emu->pci);
- if (emu->card_capabilities->ca0151_chip) /* P16V */
+ if (emu->card_capabilities->ca0151_chip) /* P16V */
snd_p16v_free(emu);
pci_disable_device(emu->pci);
kfree(emu);
@@ -1301,7 +1301,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* CA0151: None
*/
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10011102,
- .driver = "Audigy2", .name = "Audigy 2 Value [SB0400]",
+ .driver = "Audigy2", .name = "Audigy 2 Value [SB0400]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1346,7 +1346,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* CA0151: None
*/
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x10211102,
- .driver = "Audigy2", .name = "Audigy 4 [SB0610]",
+ .driver = "Audigy2", .name = "Audigy 4 [SB0610]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1359,7 +1359,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* Digital output working. (AC3 not checked, only PCM)
* Audio Mic/Line inputs working.
* Digital input not tested.
- */
+ */
/* DSP: Tina2
* DAC: Wolfson WM8768/WM8568
* ADC: Wolfson WM8775
@@ -1386,7 +1386,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
*
*/
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x20011102,
- .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]",
+ .driver = "Audigy2", .name = "Audigy 2 ZS Notebook [SB0530]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1396,7 +1396,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spk71 = 1} ,
/* Tested by James(a)superbug.co.uk 4th Nov 2007. */
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x42011102,
- .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]",
+ .driver = "Audigy2", .name = "E-mu 1010 Notebook [MAEM8950]",
.id = "EMU1010",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1405,7 +1405,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.emu_model = EMU_MODEL_EMU1616},
/* Tested by James(a)superbug.co.uk 4th Nov 2007. */
{.vendor = 0x1102, .device = 0x0008, .subsystem = 0x40041102,
- .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]",
+ .driver = "Audigy2", .name = "E-mu 1010b PCI [MAEM????]",
.id = "EMU1010",
.emu10k2_chip = 1,
.ca0108_chip = 1,
@@ -1436,15 +1436,15 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spk71 = 1,
.emu_model = EMU_MODEL_EMU0404}, /* EMU 0404 */
/* Audigy4 (Not PRO) SB0610 */
- {.vendor = 0x1102, .device = 0x0008,
- .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]",
+ {.vendor = 0x1102, .device = 0x0008,
+ .driver = "Audigy2", .name = "Audigy 2 Value [Unknown]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0108_chip = 1,
.ac97_chip = 1} ,
/* Tested by James(a)superbug.co.uk 3rd July 2005 */
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20071102,
- .driver = "Audigy2", .name = "Audigy 4 PRO [SB0380]",
+ .driver = "Audigy2", .name = "Audigy 4 PRO [SB0380]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1457,7 +1457,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* Just like 0x20021102
*/
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20061102,
- .driver = "Audigy2", .name = "Audigy 2 [SB0350b]",
+ .driver = "Audigy2", .name = "Audigy 2 [SB0350b]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1466,7 +1466,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20021102,
- .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]",
+ .driver = "Audigy2", .name = "Audigy 2 ZS [SB0350]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1475,7 +1475,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x20011102,
- .driver = "Audigy2", .name = "Audigy 2 ZS [2001]",
+ .driver = "Audigy2", .name = "Audigy 2 ZS [2001]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1492,7 +1492,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
* CA0151: Yes
*/
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10071102,
- .driver = "Audigy2", .name = "Audigy 2 [SB0240]",
+ .driver = "Audigy2", .name = "Audigy 2 [SB0240]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1502,7 +1502,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.adc_1361t = 1, /* 24 bit capture instead of 16bit */
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10051102,
- .driver = "Audigy2", .name = "Audigy 2 EX [1005]",
+ .driver = "Audigy2", .name = "Audigy 2 EX [1005]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1521,7 +1521,7 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x10021102,
- .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]",
+ .driver = "Audigy2", .name = "Audigy 2 Platinum [SB0240P]",
.id = "Audigy2",
.emu10k2_chip = 1,
.ca0102_chip = 1,
@@ -1540,44 +1540,44 @@ static struct snd_emu_chip_details emu_chip_details[] = {
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00531102,
- .driver = "Audigy", .name = "Audigy 1 [SB0090]",
+ .driver = "Audigy", .name = "Audigy 1 [SB0090]",
.id = "Audigy",
.emu10k2_chip = 1,
.ca0102_chip = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00521102,
- .driver = "Audigy", .name = "Audigy 1 ES [SB0160]",
+ .driver = "Audigy", .name = "Audigy 1 ES [SB0160]",
.id = "Audigy",
.emu10k2_chip = 1,
.ca0102_chip = 1,
.spdif_bug = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004, .subsystem = 0x00511102,
- .driver = "Audigy", .name = "Audigy 1 [SB0090]",
+ .driver = "Audigy", .name = "Audigy 1 [SB0090]",
.id = "Audigy",
.emu10k2_chip = 1,
.ca0102_chip = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0004,
- .driver = "Audigy", .name = "Audigy 1 [Unknown]",
+ .driver = "Audigy", .name = "Audigy 1 [Unknown]",
.id = "Audigy",
.emu10k2_chip = 1,
.ca0102_chip = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806B1102,
- .driver = "EMU10K1", .name = "SBLive! [SB0105]",
+ .driver = "EMU10K1", .name = "SBLive! [SB0105]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x806A1102,
- .driver = "EMU10K1", .name = "SBLive! Value [SB0103]",
+ .driver = "EMU10K1", .name = "SBLive! Value [SB0103]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80691102,
- .driver = "EMU10K1", .name = "SBLive! Value [SB0101]",
+ .driver = "EMU10K1", .name = "SBLive! Value [SB0101]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
@@ -1585,26 +1585,26 @@ static struct snd_emu_chip_details emu_chip_details[] = {
/* Tested by ALSA bug#1680 26th December 2005 */
/* note: It really has SB0220 written on the card. */
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80661102,
- .driver = "EMU10K1", .name = "SB Live 5.1 Dell OEM [SB0220]",
+ .driver = "EMU10K1", .name = "SB Live 5.1 Dell OEM [SB0220]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
/* Tested by Thomas Zehetbauer 27th Aug 2005 */
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80651102,
- .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]",
+ .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x100a1102,
- .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]",
+ .driver = "EMU10K1", .name = "SB Live 5.1 [SB0220]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80641102,
- .driver = "EMU10K1", .name = "SB Live 5.1",
+ .driver = "EMU10K1", .name = "SB Live 5.1",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
@@ -1619,78 +1619,78 @@ static struct snd_emu_chip_details emu_chip_details[] = {
*/
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80511102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4850]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4850]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80401102,
- .driver = "EMU10K1", .name = "SBLive! Platinum [CT4760P]",
+ .driver = "EMU10K1", .name = "SBLive! Platinum [CT4760P]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80321102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4871]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4871]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80311102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4831]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4831]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80281102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4870]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4870]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
/* Tested by James(a)superbug.co.uk 3rd July 2005 */
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80271102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4832]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4832]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80261102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4830]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4830]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80231102,
- .driver = "EMU10K1", .name = "SB PCI512 [CT4790]",
+ .driver = "EMU10K1", .name = "SB PCI512 [CT4790]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x80221102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4780]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4780]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x40011102,
- .driver = "EMU10K1", .name = "E-mu APS [4001]",
+ .driver = "EMU10K1", .name = "E-mu APS [4001]",
.id = "APS",
.emu10k1_chip = 1,
.ecard = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00211102,
- .driver = "EMU10K1", .name = "SBLive! [CT4620]",
+ .driver = "EMU10K1", .name = "SBLive! [CT4620]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002, .subsystem = 0x00201102,
- .driver = "EMU10K1", .name = "SBLive! Value [CT4670]",
+ .driver = "EMU10K1", .name = "SBLive! Value [CT4670]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
.sblive51 = 1} ,
{.vendor = 0x1102, .device = 0x0002,
- .driver = "EMU10K1", .name = "SB Live [Unknown]",
+ .driver = "EMU10K1", .name = "SB Live [Unknown]",
.id = "Live",
.emu10k1_chip = 1,
.ac97_chip = 1,
@@ -1715,7 +1715,7 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
static struct snd_device_ops ops = {
.dev_free = snd_emu10k1_dev_free,
};
-
+
*remu = NULL;
/* enable PCI device */
@@ -1751,11 +1751,11 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
for (c = emu_chip_details; c->vendor; c++) {
if (c->vendor == pci->vendor && c->device == pci->device) {
if (subsystem) {
- if (c->subsystem && (c->subsystem == subsystem) ) {
+ if (c->subsystem && (c->subsystem == subsystem)) {
break;
} else continue;
} else {
- if (c->subsystem && (c->subsystem != emu->serial) )
+ if (c->subsystem && (c->subsystem != emu->serial))
continue;
if (c->revision && c->revision != emu->revision)
continue;
@@ -1772,13 +1772,13 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
emu->card_capabilities = c;
if (c->subsystem && !subsystem)
snd_printdd("Sound card name=%s\n", c->name);
- else if (subsystem)
+ else if (subsystem)
snd_printdd("Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x. Forced to subsytem=0x%x\n",
c->name, pci->vendor, pci->device, emu->serial, c->subsystem);
- else
+ else
snd_printdd("Sound card name=%s, vendor=0x%x, device=0x%x, subsystem=0x%x.\n",
c->name, pci->vendor, pci->device, emu->serial);
-
+
if (!*card->id && c->id) {
int i, n = 0;
strlcpy(card->id, c->id, sizeof(card->id));
@@ -1913,7 +1913,7 @@ int __devinit snd_emu10k1_create(struct snd_card *card,
snd_emu10k1_synth_alloc(emu, 4096);
if (emu->reserved_page)
emu->reserved_page->map_locked = 1;
-
+
/* Clear silent pages and set up pointers */
memset(emu->silent_page.area, 0, PAGE_SIZE);
silent_page = emu->silent_page.addr << 1;
@@ -1978,7 +1978,7 @@ static int __devinit alloc_pm_buffer(struct snd_emu10k1 *emu)
if (emu->audigy)
size += ARRAY_SIZE(saved_regs_audigy);
emu->saved_ptr = vmalloc(4 * NUM_G * size);
- if (! emu->saved_ptr)
+ if (!emu->saved_ptr)
return -ENOMEM;
if (snd_emu10k1_efx_alloc_pm_buffer(emu) < 0)
return -ENOMEM;
diff --git a/sound/pci/emu10k1/emu10k1_patch.c b/sound/pci/emu10k1/emu10k1_patch.c
index e10f027..8e59bba 100644
--- a/sound/pci/emu10k1/emu10k1_patch.c
+++ b/sound/pci/emu10k1/emu10k1_patch.c
@@ -88,7 +88,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* try to allocate a memory block */
blocksize = truesize;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
blocksize *= 2;
sp->block = snd_emu10k1_synth_alloc(emu, blocksize);
if (sp->block == NULL) {
@@ -102,7 +102,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* write blank samples at head */
offset = 0;
size = BLANK_HEAD_SIZE;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
size *= 2;
if (offset + size > blocksize)
return -EINVAL;
@@ -111,7 +111,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* copy start->loopend */
size = loopend;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
size *= 2;
if (offset + size > blocksize)
return -EINVAL;
@@ -127,7 +127,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* handle reverse (or bidirectional) loop */
if (sp->v.mode_flags & (SNDRV_SFNT_SAMPLE_BIDIR_LOOP|SNDRV_SFNT_SAMPLE_REVERSE_LOOP)) {
/* copy loop in reverse */
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
int woffset;
unsigned short *wblock = (unsigned short*)block;
woffset = offset / 2;
@@ -160,7 +160,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
size = sp->v.size - loopend;
if (size < 0)
return -EINVAL;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
size *= 2;
if (snd_emu10k1_synth_copy_from_user(emu, sp->block, offset, data, size)) {
snd_emu10k1_synth_free(emu, sp->block);
@@ -184,7 +184,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
#if 0 /* not supported yet */
if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_UNSIGNED) {
/* unsigned -> signed */
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS)) {
unsigned short *wblock = (unsigned short*)block;
for (i = 0; i < truesize; i++)
wblock[i] ^= 0x8000;
@@ -197,7 +197,7 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp,
/* recalculate offset */
start_addr = BLANK_HEAD_SIZE * 2;
- if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
+ if (!(sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))
start_addr >>= 1;
sp->v.start += start_addr;
sp->v.end += start_addr;
diff --git a/sound/pci/emu10k1/emu10k1_synth.c b/sound/pci/emu10k1/emu10k1_synth.c
index ad7b714..bedb7dd 100644
--- a/sound/pci/emu10k1/emu10k1_synth.c
+++ b/sound/pci/emu10k1/emu10k1_synth.c
@@ -105,7 +105,7 @@ static int snd_emu10k1_synth_delete_device(struct snd_seq_device *dev)
static int __init alsa_emu10k1_synth_init(void)
{
-
+
static struct snd_seq_dev_ops ops = {
snd_emu10k1_synth_new_device,
snd_emu10k1_synth_delete_device,
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c
index 5ff4dbb..0c02d87 100644
--- a/sound/pci/emu10k1/emu10k1x.c
+++ b/sound/pci/emu10k1/emu10k1x.c
@@ -107,7 +107,7 @@ MODULE_PARM_DESC(enable, "Enable the EMU10K1X soundcard.");
/* Emu10k1x pointer-offset register set, accessed through the PTR and DATA registers */
/********************************************************************************************************/
#define PLAYBACK_LIST_ADDR 0x00 /* Base DMA address of a list of pointers to each period/size */
- /* One list entry: 4 bytes for DMA address,
+ /* One list entry: 4 bytes for DMA address,
* 4 bytes for period_size << 16.
* One list entry is 8 bytes long.
* One list entry for each period in the buffer.
@@ -186,7 +186,7 @@ MODULE_PARM_DESC(enable, "Enable the EMU10K1X soundcard.");
* - channel 1 is the rear channel
* - channel 2 is the center/lfe chanel
* Volume is controlled by the AC97 for the front and rear channels by
- * the PCM Playback Volume, Sigmatel Surround Playback Volume and
+ * the PCM Playback Volume, Sigmatel Surround Playback Volume and
* Surround Playback Volume. The Sigmatel 4-Speaker Stereo switch affects
* the front/rear channel mixing in the REAR OUT jack. When using the
* 4-Speaker Stereo, both front and rear channels will be mixed in the
@@ -199,7 +199,7 @@ struct emu10k1x_voice {
struct emu10k1x *emu;
int number;
int use;
-
+
struct emu10k1x_pcm *epcm;
};
@@ -246,7 +246,7 @@ struct emu10k1x {
struct emu10k1x_voice voices[3];
struct emu10k1x_voice capture_voice;
- u32 spdif_bits[3]; // SPDIF out setup
+ u32 spdif_bits[3]; /* SPDIF out setup */
struct snd_dma_buffer dma_buffer;
@@ -255,7 +255,7 @@ struct emu10k1x {
/* hardware definition */
static struct snd_pcm_hardware snd_emu10k1x_playback_hw = {
- .info = (SNDRV_PCM_INFO_MMAP |
+ .info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID),
@@ -274,7 +274,7 @@ static struct snd_pcm_hardware snd_emu10k1x_playback_hw = {
};
static struct snd_pcm_hardware snd_emu10k1x_capture_hw = {
- .info = (SNDRV_PCM_INFO_MMAP |
+ .info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID),
@@ -292,13 +292,13 @@ static struct snd_pcm_hardware snd_emu10k1x_capture_hw = {
.fifo_size = 0,
};
-static unsigned int snd_emu10k1x_ptr_read(struct emu10k1x * emu,
- unsigned int reg,
+static unsigned int snd_emu10k1x_ptr_read(struct emu10k1x * emu,
+ unsigned int reg,
unsigned int chn)
{
unsigned long flags;
unsigned int regptr, val;
-
+
regptr = (reg << 16) | chn;
spin_lock_irqsave(&emu->emu_lock, flags);
@@ -308,9 +308,9 @@ static unsigned int snd_emu10k1x_ptr_read(struct emu10k1x * emu,
return val;
}
-static void snd_emu10k1x_ptr_write(struct emu10k1x *emu,
- unsigned int reg,
- unsigned int chn,
+static void snd_emu10k1x_ptr_write(struct emu10k1x *emu,
+ unsigned int reg,
+ unsigned int chn,
unsigned int data)
{
unsigned int regptr;
@@ -396,10 +396,10 @@ static int snd_emu10k1x_playback_open(struct snd_pcm_substream *substream)
return -ENOMEM;
epcm->emu = chip;
epcm->substream = substream;
-
+
runtime->private_data = epcm;
runtime->private_free = snd_emu10k1x_pcm_free_substream;
-
+
runtime->hw = snd_emu10k1x_playback_hw;
return 0;
@@ -418,7 +418,7 @@ static int snd_emu10k1x_pcm_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_runtime *runtime = substream->runtime;
struct emu10k1x_pcm *epcm = runtime->private_data;
- if (! epcm->voice) {
+ if (!epcm->voice) {
epcm->voice = &epcm->emu->voices[substream->pcm->device];
epcm->voice->use = 1;
epcm->voice->epcm = epcm;
@@ -436,7 +436,7 @@ static int snd_emu10k1x_pcm_hw_free(struct snd_pcm_substream *substream)
if (runtime->private_data == NULL)
return 0;
-
+
epcm = runtime->private_data;
if (epcm->voice) {
@@ -458,8 +458,8 @@ static int snd_emu10k1x_pcm_prepare(struct snd_pcm_substream *substream)
u32 *table_base = (u32 *)(emu->dma_buffer.area+1024*voice);
u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size);
int i;
-
- for(i = 0; i < runtime->periods; i++) {
+
+ for (i = 0; i < runtime->periods; i++) {
*table_base++=runtime->dma_addr+(i*period_size_bytes);
*table_base++=period_size_bytes<<16;
}
@@ -491,7 +491,7 @@ static int snd_emu10k1x_pcm_trigger(struct snd_pcm_substream *substream,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
- if(runtime->periods == 2)
+ if (runtime->periods == 2)
snd_emu10k1x_intr_enable(emu, (INTE_CH_0_LOOP | INTE_CH_0_HALF_LOOP) << channel);
else
snd_emu10k1x_intr_enable(emu, INTE_CH_0_LOOP << channel);
@@ -527,10 +527,10 @@ snd_emu10k1x_pcm_pointer(struct snd_pcm_substream *substream)
ptr1 = snd_emu10k1x_ptr_read(emu, PLAYBACK_POINTER, channel);
ptr4 = snd_emu10k1x_ptr_read(emu, PLAYBACK_LIST_PTR, channel);
- if(ptr4 == 0 && ptr1 == frames_to_bytes(runtime, runtime->buffer_size))
+ if (ptr4 == 0 && ptr1 == frames_to_bytes(runtime, runtime->buffer_size))
return 0;
-
- if (ptr3 != ptr4)
+
+ if (ptr3 != ptr4)
ptr1 = snd_emu10k1x_ptr_read(emu, PLAYBACK_POINTER, channel);
ptr2 = bytes_to_frames(runtime, ptr1);
ptr2 += (ptr4 >> 3) * runtime->period_size;
@@ -595,7 +595,7 @@ static int snd_emu10k1x_pcm_hw_params_capture(struct snd_pcm_substream *substrea
struct snd_pcm_runtime *runtime = substream->runtime;
struct emu10k1x_pcm *epcm = runtime->private_data;
- if (! epcm->voice) {
+ if (!epcm->voice) {
if (epcm->emu->capture_voice.use)
return -EBUSY;
epcm->voice = &epcm->emu->capture_voice;
@@ -634,7 +634,7 @@ static int snd_emu10k1x_pcm_prepare_capture(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
snd_emu10k1x_ptr_write(emu, CAPTURE_DMA_ADDR, 0, runtime->dma_addr);
- snd_emu10k1x_ptr_write(emu, CAPTURE_BUFFER_SIZE, 0, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes
+ snd_emu10k1x_ptr_write(emu, CAPTURE_BUFFER_SIZE, 0, frames_to_bytes(runtime, runtime->buffer_size)<<16); /* buffer size in bytes */
snd_emu10k1x_ptr_write(emu, CAPTURE_POINTER, 0, 0);
snd_emu10k1x_ptr_write(emu, CAPTURE_UNKNOWN, 0, 0);
@@ -652,14 +652,14 @@ static int snd_emu10k1x_pcm_trigger_capture(struct snd_pcm_substream *substream,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
- snd_emu10k1x_intr_enable(emu, INTE_CAP_0_LOOP |
+ snd_emu10k1x_intr_enable(emu, INTE_CAP_0_LOOP |
INTE_CAP_0_HALF_LOOP);
snd_emu10k1x_ptr_write(emu, TRIGGER_CHANNEL, 0, snd_emu10k1x_ptr_read(emu, TRIGGER_CHANNEL, 0)|TRIGGER_CAPTURE);
epcm->running = 1;
break;
case SNDRV_PCM_TRIGGER_STOP:
epcm->running = 0;
- snd_emu10k1x_intr_disable(emu, INTE_CAP_0_LOOP |
+ snd_emu10k1x_intr_disable(emu, INTE_CAP_0_LOOP |
INTE_CAP_0_HALF_LOOP);
snd_emu10k1x_ptr_write(emu, TRIGGER_CHANNEL, 0, snd_emu10k1x_ptr_read(emu, TRIGGER_CHANNEL, 0) & ~(TRIGGER_CAPTURE));
break;
@@ -706,7 +706,7 @@ static unsigned short snd_emu10k1x_ac97_read(struct snd_ac97 *ac97,
struct emu10k1x *emu = ac97->private_data;
unsigned long flags;
unsigned short val;
-
+
spin_lock_irqsave(&emu->emu_lock, flags);
outb(reg, emu->port + AC97ADDRESS);
val = inw(emu->port + AC97DATA);
@@ -719,7 +719,7 @@ static void snd_emu10k1x_ac97_write(struct snd_ac97 *ac97,
{
struct emu10k1x *emu = ac97->private_data;
unsigned long flags;
-
+
spin_lock_irqsave(&emu->emu_lock, flags);
outb(reg, emu->port + AC97ADDRESS);
outw(val, emu->port + AC97DATA);
@@ -735,7 +735,7 @@ static int snd_emu10k1x_ac97(struct emu10k1x *chip)
.write = snd_emu10k1x_ac97_write,
.read = snd_emu10k1x_ac97_read,
};
-
+
if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0)
return err;
pbus->no_vra = 1; /* we don't need VRA */
@@ -749,26 +749,26 @@ static int snd_emu10k1x_ac97(struct emu10k1x *chip)
static int snd_emu10k1x_free(struct emu10k1x *chip)
{
snd_emu10k1x_ptr_write(chip, TRIGGER_CHANNEL, 0, 0);
- // disable interrupts
+ /* disable interrupts */
outl(0, chip->port + INTE);
- // disable audio
+ /* disable audio */
outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG);
/* release the irq */
if (chip->irq >= 0)
free_irq(chip->irq, chip);
- // release the i/o port
+ /* release the i/o port */
release_and_free_resource(chip->res_port);
- // release the DMA
+ /* release the DMA */
if (chip->dma_buffer.area) {
snd_dma_free_pages(&chip->dma_buffer);
}
pci_disable_device(chip->pci);
- // release the data
+ /* release the data */
kfree(chip);
return 0;
}
@@ -790,43 +790,43 @@ static irqreturn_t snd_emu10k1x_interrupt(int irq, void *dev_id)
status = inl(chip->port + IPR);
- if (! status)
+ if (!status)
return IRQ_NONE;
- // capture interrupt
+ /* capture interrupt */
if (status & (IPR_CAP_0_LOOP | IPR_CAP_0_HALF_LOOP)) {
struct emu10k1x_voice *cap_voice = &chip->capture_voice;
if (cap_voice->use)
snd_emu10k1x_pcm_interrupt(chip, cap_voice);
else
- snd_emu10k1x_intr_disable(chip,
+ snd_emu10k1x_intr_disable(chip,
INTE_CAP_0_LOOP |
INTE_CAP_0_HALF_LOOP);
}
-
+
mask = IPR_CH_0_LOOP|IPR_CH_0_HALF_LOOP;
for (i = 0; i < 3; i++) {
if (status & mask) {
if (pvoice->use)
snd_emu10k1x_pcm_interrupt(chip, pvoice);
- else
+ else
snd_emu10k1x_intr_disable(chip, mask);
}
pvoice++;
mask <<= 1;
}
-
+
if (status & (IPR_MIDITRANSBUFEMPTY|IPR_MIDIRECVBUFEMPTY)) {
if (chip->midi.interrupt)
chip->midi.interrupt(chip, status);
else
snd_emu10k1x_intr_disable(chip, INTE_MIDITXENABLE|INTE_MIDIRXENABLE);
}
-
- // acknowledge the interrupt if necessary
+
+ /* acknowledge the interrupt if necessary */
outl(status, chip->port + IPR);
- // snd_printk(KERN_INFO "interrupt %08x\n", status);
+ /* snd_printk(KERN_INFO "interrupt %08x\n", status); */
return IRQ_HANDLED;
}
@@ -835,17 +835,17 @@ static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct s
struct snd_pcm *pcm;
int err;
int capture = 0;
-
+
if (rpcm)
*rpcm = NULL;
if (device == 0)
capture = 1;
-
+
if ((err = snd_pcm_new(emu->card, "emu10k1x", device, 1, capture, &pcm)) < 0)
return err;
-
+
pcm->private_data = emu;
-
+
switch(device) {
case 0:
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_emu10k1x_playback_ops);
@@ -873,12 +873,12 @@ static int __devinit snd_emu10k1x_pcm(struct emu10k1x *emu, int device, struct s
emu->pcm = pcm;
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
+ snd_dma_pci_data(emu->pci),
32*1024, 32*1024);
-
+
if (rpcm)
*rpcm = pcm;
-
+
return 0;
}
@@ -916,10 +916,10 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
spin_lock_init(&chip->emu_lock);
spin_lock_init(&chip->voice_lock);
-
+
chip->port = pci_resource_start(pci, 0);
if ((chip->res_port = request_region(chip->port, 8,
- "EMU10K1X")) == NULL) {
+ "EMU10K1X")) == NULL) {
snd_printk(KERN_ERR "emu10k1x: cannot allocate the port 0x%lx\n", chip->port);
snd_emu10k1x_free(chip);
return -EBUSY;
@@ -932,8 +932,8 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
return -EBUSY;
}
chip->irq = pci->irq;
-
- if(snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
+
+ if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci),
4 * 1024, &chip->dma_buffer) < 0) {
snd_emu10k1x_free(chip);
return -ENOMEM;
@@ -947,9 +947,9 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
snd_printk(KERN_INFO "Model %04x Rev %08x Serial %08x\n", chip->model,
chip->revision, chip->serial);
- outl(0, chip->port + INTE);
+ outl(0, chip->port + INTE);
- for(ch = 0; ch < 3; ch++) {
+ for (ch = 0; ch < 3; ch++) {
chip->voices[ch].emu = chip;
chip->voices[ch].number = ch;
}
@@ -969,27 +969,27 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
* P = 0 (Consumer)
*/
snd_emu10k1x_ptr_write(chip, SPCS0, 0,
- chip->spdif_bits[0] =
+ chip->spdif_bits[0] =
SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
SPCS_GENERATIONSTATUS | 0x00001200 |
0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
snd_emu10k1x_ptr_write(chip, SPCS1, 0,
- chip->spdif_bits[1] =
+ chip->spdif_bits[1] =
SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
SPCS_GENERATIONSTATUS | 0x00001200 |
0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
snd_emu10k1x_ptr_write(chip, SPCS2, 0,
- chip->spdif_bits[2] =
+ chip->spdif_bits[2] =
SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
SPCS_GENERATIONSTATUS | 0x00001200 |
0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
- snd_emu10k1x_ptr_write(chip, SPDIF_SELECT, 0, 0x700); // disable SPDIF
- snd_emu10k1x_ptr_write(chip, ROUTING, 0, 0x1003F); // routing
- snd_emu10k1x_gpio_write(chip, 0x1080); // analog mode
+ snd_emu10k1x_ptr_write(chip, SPDIF_SELECT, 0, 0x700); /* disable SPDIF */
+ snd_emu10k1x_ptr_write(chip, ROUTING, 0, 0x1003F); /* routing */
+ snd_emu10k1x_gpio_write(chip, 0x1080); /* analog mode */
outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG);
@@ -1002,7 +1002,7 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card,
return 0;
}
-static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry,
+static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct emu10k1x *emu = entry->private_data;
@@ -1011,16 +1011,16 @@ static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry,
int i;
snd_iprintf(buffer, "Registers:\n\n");
- for(i = 0; i < 0x20; i+=4) {
+ for (i = 0; i < 0x20; i += 4) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inl(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
snd_iprintf(buffer, "Register %02X: %08lX\n", i, value);
}
snd_iprintf(buffer, "\nRegisters\n\n");
- for(i = 0; i <= 0x48; i++) {
+ for (i = 0; i <= 0x48; i++) {
value = snd_emu10k1x_ptr_read(emu, i, 0);
- if(i < 0x10 || (i >= 0x20 && i < 0x40)) {
+ if (i < 0x10 || (i >= 0x20 && i < 0x40)) {
value1 = snd_emu10k1x_ptr_read(emu, i, 1);
value2 = snd_emu10k1x_ptr_read(emu, i, 2);
snd_iprintf(buffer, "%02X: %08lX %08lX %08lX\n", i, value, value1, value2);
@@ -1030,7 +1030,7 @@ static void snd_emu10k1x_proc_reg_read(struct snd_info_entry *entry,
}
}
-static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
+static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct emu10k1x *emu = entry->private_data;
@@ -1041,8 +1041,8 @@ static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3)
continue;
- if ((reg < 0x49) && (reg >= 0) && (val <= 0xffffffff)
- && (channel_id >= 0) && (channel_id <= 2) )
+ if ((reg < 0x49) && (reg >= 0) && (val <= 0xffffffff)
+ && (channel_id >= 0) && (channel_id <= 2))
snd_emu10k1x_ptr_write(emu, reg, channel_id, val);
}
}
@@ -1050,14 +1050,14 @@ static void snd_emu10k1x_proc_reg_write(struct snd_info_entry *entry,
static int __devinit snd_emu10k1x_proc_init(struct emu10k1x * emu)
{
struct snd_info_entry *entry;
-
- if(! snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) {
+
+ if (!snd_card_proc_new(emu->card, "emu10k1x_regs", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu10k1x_proc_reg_read);
entry->c.text.write = snd_emu10k1x_proc_reg_write;
entry->mode |= S_IWUSR;
entry->private_data = emu;
}
-
+
return 0;
}
@@ -1080,15 +1080,15 @@ static int snd_emu10k1x_shared_spdif_put(struct snd_kcontrol *kcontrol,
unsigned int val;
int change = 0;
- val = ucontrol->value.integer.value[0] ;
+ val = ucontrol->value.integer.value[0];
if (val) {
- // enable spdif output
+ /* enable spdif output */
snd_emu10k1x_ptr_write(emu, SPDIF_SELECT, 0, 0x000);
snd_emu10k1x_ptr_write(emu, ROUTING, 0, 0x700);
snd_emu10k1x_gpio_write(emu, 0x1000);
} else {
- // disable spdif output
+ /* disable spdif output */
snd_emu10k1x_ptr_write(emu, SPDIF_SELECT, 0, 0x700);
snd_emu10k1x_ptr_write(emu, ROUTING, 0, 0x1003F);
snd_emu10k1x_gpio_write(emu, 0x1080);
@@ -1317,7 +1317,7 @@ static int snd_emu10k1x_midi_input_open(struct snd_rawmidi_substream *substream)
struct emu10k1x *emu;
struct emu10k1x_midi *midi = substream->rmidi->private_data;
unsigned long flags;
-
+
emu = midi->emu;
if (snd_BUG_ON(!emu))
return -ENXIO;
@@ -1439,7 +1439,7 @@ static void snd_emu10k1x_midi_output_trigger(struct snd_rawmidi_substream *subst
if (up) {
int max = 4;
unsigned char byte;
-
+
/* try to send some amount of bytes here before interrupts */
spin_lock_irqsave(&midi->output_lock, flags);
while (max > 0) {
@@ -1575,7 +1575,7 @@ static int __devinit snd_emu10k1x_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
if ((err = snd_emu10k1x_midi(chip)) < 0) {
snd_card_free(card);
return err;
diff --git a/sound/pci/emu10k1/emufx.c b/sound/pci/emu10k1/emufx.c
index 7dba08f..f8ce97b 100644
--- a/sound/pci/emu10k1/emufx.c
+++ b/sound/pci/emu10k1/emufx.c
@@ -52,7 +52,7 @@
/*
* Tables
- */
+ */
static char *fxbuses[16] = {
/* 0x00 */ "PCM Left",
@@ -303,7 +303,7 @@ static const u32 onoff_table[2] = {
/*
*/
-
+
static inline mm_segment_t snd_enter_user(void)
{
mm_segment_t fs = get_fs();
@@ -342,7 +342,7 @@ static int snd_emu10k1_gpr_ctl_get(struct snd_kcontrol *kcontrol, struct snd_ctl
(struct snd_emu10k1_fx8010_ctl *) kcontrol->private_value;
unsigned long flags;
unsigned int i;
-
+
spin_lock_irqsave(&emu->reg_lock, flags);
for (i = 0; i < ctl->vcount; i++)
ucontrol->value.integer.value[i] = ctl->value[i];
@@ -359,7 +359,7 @@ static int snd_emu10k1_gpr_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl
unsigned int nval, val;
unsigned int i, j;
int change = 0;
-
+
spin_lock_irqsave(&emu->reg_lock, flags);
for (i = 0; i < ctl->vcount; i++) {
nval = ucontrol->value.integer.value[i];
@@ -398,7 +398,7 @@ static int snd_emu10k1_gpr_ctl_put(struct snd_kcontrol *kcontrol, struct snd_ctl
break;
}
}
- __error:
+__error:
spin_unlock_irqrestore(&emu->reg_lock, flags);
return change;
}
@@ -431,7 +431,7 @@ int snd_emu10k1_fx8010_register_irq_handler(struct snd_emu10k1 *emu,
{
struct snd_emu10k1_fx8010_irq *irq;
unsigned long flags;
-
+
irq = kmalloc(sizeof(*irq), GFP_ATOMIC);
if (irq == NULL)
return -ENOMEM;
@@ -459,7 +459,7 @@ int snd_emu10k1_fx8010_unregister_irq_handler(struct snd_emu10k1 *emu,
{
struct snd_emu10k1_fx8010_irq *tmp;
unsigned long flags;
-
+
spin_lock_irqsave(&emu->fx8010.irq_lock, flags);
if ((tmp = emu->fx8010.irq_handlers) == irq) {
emu->fx8010.irq_handlers = tmp->next;
@@ -703,7 +703,7 @@ static int copy_gctl_to_user(struct snd_emu10k1 *emu,
if (emu->support_tlv)
return copy_to_user(&_gctl[idx], gctl, sizeof(*gctl));
-
+
octl = (struct snd_emu10k1_fx8010_control_old_gpr __user *)_gctl;
return copy_to_user(&octl[idx], gctl, sizeof(*octl));
}
@@ -716,7 +716,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,
struct snd_ctl_elem_id id;
struct snd_emu10k1_fx8010_control_gpr *gctl;
int err;
-
+
for (i = 0, _id = icode->gpr_del_controls;
i < icode->gpr_del_control_count; i++, _id++) {
if (copy_from_user(&id, _id, sizeof(id)))
@@ -725,7 +725,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,
return -ENOENT;
}
gctl = kmalloc(sizeof(*gctl), GFP_KERNEL);
- if (! gctl)
+ if (!gctl)
return -ENOMEM;
err = 0;
for (i = 0; i < icode->gpr_add_control_count; i++) {
@@ -755,7 +755,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,
goto __error;
}
}
- __error:
+__error:
kfree(gctl);
return err;
}
@@ -763,7 +763,7 @@ static int snd_emu10k1_verify_controls(struct snd_emu10k1 *emu,
static void snd_emu10k1_ctl_private_free(struct snd_kcontrol *kctl)
{
struct snd_emu10k1_fx8010_ctl *ctl;
-
+
ctl = (struct snd_emu10k1_fx8010_ctl *) kctl->private_value;
kctl->private_value = 0;
list_del(&ctl->list);
@@ -801,7 +801,7 @@ static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu,
err = -EINVAL;
goto __error;
}
- if (! gctl->id.name[0]) {
+ if (!gctl->id.name[0]) {
err = -EINVAL;
goto __error;
}
@@ -857,7 +857,7 @@ static int snd_emu10k1_add_controls(struct snd_emu10k1 *emu,
}
snd_emu10k1_gpr_ctl_put(ctl->kcontrol, val);
}
- __error:
+__error:
kfree(nctl);
kfree(gctl);
kfree(val);
@@ -872,7 +872,7 @@ static int snd_emu10k1_del_controls(struct snd_emu10k1 *emu,
struct snd_ctl_elem_id __user *_id;
struct snd_emu10k1_fx8010_ctl *ctl;
struct snd_card *card = emu->card;
-
+
for (i = 0, _id = icode->gpr_del_controls;
i < icode->gpr_del_control_count; i++, _id++) {
if (copy_from_user(&id, _id, sizeof(id)))
@@ -896,7 +896,7 @@ static int snd_emu10k1_list_controls(struct snd_emu10k1 *emu,
struct snd_ctl_elem_id *id;
gctl = kmalloc(sizeof(*gctl), GFP_KERNEL);
- if (! gctl)
+ if (!gctl)
return -ENOMEM;
list_for_each_entry(ctl, &emu->fx8010.gpr_ctl, list) {
@@ -959,7 +959,7 @@ static int snd_emu10k1_icode_poke(struct snd_emu10k1 *emu,
snd_emu10k1_ptr_write(emu, A_DBG, 0, emu->fx8010.dbg);
else
snd_emu10k1_ptr_write(emu, DBG, 0, emu->fx8010.dbg);
- __error:
+__error:
mutex_unlock(&emu->fx8010.lock);
return err;
}
@@ -1023,7 +1023,7 @@ static int snd_emu10k1_ipcm_poke(struct snd_emu10k1 *emu,
for (i = 0; i < pcm->channels; i++)
pcm->etram[i] = ipcm->etram[i];
}
- __error:
+__error:
spin_unlock_irq(&emu->reg_lock);
mutex_unlock(&emu->fx8010.lock);
return err;
@@ -1075,7 +1075,7 @@ snd_emu10k1_init_mono_control(struct snd_emu10k1_fx8010_control_gpr *ctl,
ctl->min = 0;
ctl->max = 100;
ctl->tlv = snd_emu10k1_db_scale1;
- ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100;
+ ctl->translation = EMU10K1_GPR_TRANSLATION_TABLE100;
}
static void __devinit
@@ -1177,7 +1177,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
/* clear free GPRs */
for (i = 0; i < 512; i++)
set_bit(i, icode->gpr_valid);
-
+
/* clear TRAM data & address lines */
for (i = 0; i < 256; i++)
set_bit(i, icode->tram_valid);
@@ -1210,7 +1210,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_C_00000000, A_GPR(gpr+1), A_FXBUS(FXBUS_PCM_RIGHT_REAR));
snd_emu10k1_init_stereo_control(&controls[nctl++], "PCM Surround Playback Volume", gpr, 100);
gpr += 2;
-
+
/* PCM Side Playback (independent from stereo mix) */
if (emu->card_capabilities->spk71) {
A_OP(icode, &ptr, iMAC0, A_GPR(playback+6), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LEFT_SIDE));
@@ -1228,7 +1228,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_C_00000000, A_GPR(gpr), A_FXBUS(FXBUS_PCM_LFE));
snd_emu10k1_init_mono_control(&controls[nctl++], "PCM LFE Playback Volume", gpr, 100);
gpr++;
-
+
/*
* Stereo Mix
*/
@@ -1255,7 +1255,7 @@ static int __devinit _snd_emu10k1_audigy_init_efx(struct snd_emu10k1 *emu)
A_OP(icode, &ptr, iMAC0, A_GPR(capture+1), A_GPR(capture+1), A_GPR(gpr+1), A_FXBUS(FXBUS_MIDI_RIGHT));
snd_emu10k1_init_stereo_control(&controls[nctl++], "Synth Capture Volume", gpr, 0);
gpr += 2;
-
+
/*
* inputs
*/
@@ -1288,7 +1288,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
snd_emu10k1_init_stereo_control(&controls[nctl++], "Mic Capture Volume", gpr, 0);
gpr += 2;
- /* mic capture buffer */
+ /* mic capture buffer */
A_OP(icode, &ptr, iINTERP, A_EXTOUT(A_EXTOUT_MIC_CAP), A_EXTIN(A_EXTIN_AC97_L), 0xcd, A_EXTIN(A_EXTIN_AC97_R));
/* Audigy CD Playback Volume */
@@ -1331,7 +1331,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
emu->card_capabilities->ac97_chip ? "Line2 Capture Volume" : "Line Capture Volume",
gpr, 0);
gpr += 2;
-
+
/* Philips ADC Playback Volume */
A_ADD_VOLUME_IN(stereo_mix, gpr, A_EXTIN_ADC_L);
A_ADD_VOLUME_IN(stereo_mix+1, gpr+1, A_EXTIN_ADC_R);
@@ -1357,13 +1357,13 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
emu->card_capabilities->ac97_chip ? "Aux2 Capture Volume" : "Aux Capture Volume",
gpr, 0);
gpr += 2;
-
+
/* Stereo Mix Front Playback Volume */
A_OP(icode, &ptr, iMAC0, A_GPR(playback), A_GPR(playback), A_GPR(gpr), A_GPR(stereo_mix));
A_OP(icode, &ptr, iMAC0, A_GPR(playback+1), A_GPR(playback+1), A_GPR(gpr+1), A_GPR(stereo_mix+1));
snd_emu10k1_init_stereo_control(&controls[nctl++], "Front Playback Volume", gpr, 100);
gpr += 2;
-
+
/* Stereo Mix Surround Playback */
A_OP(icode, &ptr, iMAC0, A_GPR(playback+2), A_GPR(playback+2), A_GPR(gpr), A_GPR(stereo_mix));
A_OP(icode, &ptr, iMAC0, A_GPR(playback+3), A_GPR(playback+3), A_GPR(gpr+1), A_GPR(stereo_mix+1));
@@ -1381,7 +1381,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
A_OP(icode, &ptr, iMAC0, A_GPR(playback+5), A_GPR(playback+5), A_GPR(gpr), A_GPR(tmp));
snd_emu10k1_init_mono_control(&controls[nctl++], "LFE Playback Volume", gpr, 0);
gpr++;
-
+
if (emu->card_capabilities->spk71) {
/* Stereo Mix Side Playback */
A_OP(icode, &ptr, iMAC0, A_GPR(playback+6), A_GPR(playback+6), A_GPR(gpr), A_GPR(stereo_mix));
@@ -1420,7 +1420,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 6), A_GPR(playback + 6), A_C_00000000, A_C_00000000); /* side left */
A_OP(icode, &ptr, iACC3, A_GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 7), A_GPR(playback + 7), A_C_00000000, A_C_00000000); /* side right */
}
-
+
ctl = &controls[nctl + 0];
ctl->id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
@@ -1529,7 +1529,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
}
}
- /* IEC958 Optical Raw Playback Switch */
+ /* IEC958 Optical Raw Playback Switch */
gpr_map[gpr++] = 0;
gpr_map[gpr++] = 0x1008;
gpr_map[gpr++] = 0xffff0000;
@@ -1552,7 +1552,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
}
snd_emu10k1_init_stereo_onoff_control(controls + nctl++, SNDRV_CTL_NAME_IEC958("Optical Raw ",PLAYBACK,SWITCH), gpr, 0);
gpr += 2;
-
+
A_PUT_STEREO_OUTPUT(A_EXTOUT_REAR_L, A_EXTOUT_REAR_R, playback+2 + SND_EMU10K1_PLAYBACK_CHANNELS);
A_PUT_OUTPUT(A_EXTOUT_CENTER, playback+4 + SND_EMU10K1_PLAYBACK_CHANNELS);
A_PUT_OUTPUT(A_EXTOUT_LFE, playback+5 + SND_EMU10K1_PLAYBACK_CHANNELS);
@@ -1569,10 +1569,10 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
if (emu->card_capabilities->ca0108_chip) {
snd_printk("EMU2 inputs on\n");
for (z = 0; z < 0x10; z++) {
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp,
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp,
bit_shifter16,
A3_EMU32IN(z),
- A_FXBUS2(z*2) );
+ A_FXBUS2(z*2));
}
} else {
snd_printk("EMU inputs on\n");
@@ -1584,7 +1584,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
* so all other A_P16VIN channels will need to also be delayed
*/
/* Left ADC in. 1 of 2 */
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_P16VIN(0x0), A_FXBUS2(0) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_P16VIN(0x0), A_FXBUS2(0));
/* Right ADC in 1 of 2 */
gpr_map[gpr++] = 0x00000000;
/* Delaying by one sample: instead of copying the input
@@ -1592,28 +1592,28 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
* we use an auxiliary register, delaying the value by one
* sample
*/
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(2) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(2));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x1), A_C_00000000, A_C_00000000);
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(4) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(4));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x2), A_C_00000000, A_C_00000000);
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(6) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(6));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x3), A_C_00000000, A_C_00000000);
/* For 96kHz mode */
/* Left ADC in. 2 of 2 */
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0x8) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0x8));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x4), A_C_00000000, A_C_00000000);
/* Right ADC in 2 of 2 */
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xa) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xa));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x5), A_C_00000000, A_C_00000000);
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xc) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xc));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x6), A_C_00000000, A_C_00000000);
gpr_map[gpr++] = 0x00000000;
- snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xe) );
+ snd_emu10k1_audigy_dsp_convert_32_to_2x16( icode, &ptr, tmp, bit_shifter16, A_GPR(gpr - 1), A_FXBUS2(0xe));
A_OP(icode, &ptr, iACC3, A_GPR(gpr - 1), A_P16VIN(0x7), A_C_00000000, A_C_00000000);
/* Pavel Hofman - we still have voices, A_FXBUS2s, and
* A_P16VINs available -
@@ -1692,7 +1692,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
A_OP(icode, &ptr, iACC3, A_FXBUS2(z), A_C_00000000, A_C_00000000, A_EXTIN(z));
}
}
-
+
#endif /* JCD test */
/*
* ok, set up done..
@@ -1715,7 +1715,7 @@ A_OP(icode, &ptr, iMAC0, A_GPR(var), A_GPR(var), A_GPR(vol), A_EXTIN(input))
emu->support_tlv = 0; /* clear again */
snd_leave_user(seg);
- __err:
+__err:
kfree(controls);
if (icode != NULL) {
kfree((void __force *)icode->gpr_map);
@@ -1804,7 +1804,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
icode->tram_data_map = icode->gpr_map + 256;
icode->tram_addr_map = icode->tram_data_map + 160;
icode->code = icode->tram_addr_map + 160;
-
+
/* clear free GPRs */
for (i = 0; i < 256; i++)
set_bit(i, icode->gpr_valid);
@@ -1904,7 +1904,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
/* 18: */ OP(icode, &ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_MINUS, C_00000001);
/* 19: */ OP(icode, &ptr, iACC3, GPR(tmp + 0), C_00000000, C_00000000, C_00000000);
/* 1a: */ OP(icode, &ptr, iACC3, GPR(ipcm->gpr_ptr), GPR(tmp + 0), C_00000000, C_00000000);
-
+
/* 1b: */ OP(icode, &ptr, iACC3, GPR(ipcm->gpr_tmpcount), GPR(ipcm->gpr_tmpcount), C_ffffffff, C_00000000);
/* 1c: */ OP(icode, &ptr, iSKIP, GPR_COND, GPR_COND, CC_REG_NONZERO, C_00000002);
/* 1d: */ OP(icode, &ptr, iACC3, GPR(ipcm->gpr_tmpcount), GPR(ipcm->gpr_count), C_00000000, C_00000000);
@@ -1931,7 +1931,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
VOLUME(icode, &ptr, playback + 2 + z, z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, "Wave Surround Playback Volume", gpr, 0);
gpr += 2;
-
+
/* Wave Center/LFE Playback Volume */
OP(icode, &ptr, iACC3, GPR(tmp + 0), FXBUS(FXBUS_PCM_LEFT), FXBUS(FXBUS_PCM_RIGHT), C_00000000);
OP(icode, &ptr, iMACINT0, GPR(tmp + 0), C_00000000, GPR(tmp + 0), C_00000002);
@@ -2016,14 +2016,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
VOLUME_ADDIN(icode, &ptr, capture + 1, EXTIN_AC97_R, gpr); gpr++;
snd_emu10k1_init_stereo_control(controls + i++, "AC97 Capture Volume", gpr-2, 100);
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_SPDIF_CD_L)|(1<<EXTIN_SPDIF_CD_R))) {
/* IEC958 TTL Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_SPDIF_CD_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, SNDRV_CTL_NAME_IEC958("TTL ",PLAYBACK,VOLUME), gpr, 0);
gpr += 2;
-
+
/* IEC958 TTL Capture Volume + Switch */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_SPDIF_CD_L + z, gpr + 2 + z);
@@ -2033,14 +2033,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, SNDRV_CTL_NAME_IEC958("TTL ",CAPTURE,SWITCH), gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_ZOOM_L)|(1<<EXTIN_ZOOM_R))) {
/* Zoom Video Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_ZOOM_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, "Zoom Video Playback Volume", gpr, 0);
gpr += 2;
-
+
/* Zoom Video Capture Volume + Switch */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_ZOOM_L + z, gpr + 2 + z);
@@ -2050,14 +2050,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, "Zoom Video Capture Switch", gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_TOSLINK_L)|(1<<EXTIN_TOSLINK_R))) {
/* IEC958 Optical Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_TOSLINK_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, SNDRV_CTL_NAME_IEC958("LiveDrive ",PLAYBACK,VOLUME), gpr, 0);
gpr += 2;
-
+
/* IEC958 Optical Capture Volume */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_TOSLINK_L + z, gpr + 2 + z);
@@ -2067,14 +2067,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, SNDRV_CTL_NAME_IEC958("LiveDrive ",CAPTURE,SWITCH), gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_LINE1_L)|(1<<EXTIN_LINE1_R))) {
/* Line LiveDrive Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_LINE1_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, "Line LiveDrive Playback Volume", gpr, 0);
gpr += 2;
-
+
/* Line LiveDrive Capture Volume + Switch */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_LINE1_L + z, gpr + 2 + z);
@@ -2084,14 +2084,14 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, "Line LiveDrive Capture Switch", gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_COAX_SPDIF_L)|(1<<EXTIN_COAX_SPDIF_R))) {
/* IEC958 Coax Playback Volume */
for (z = 0; z < 2; z++)
VOLUME_ADDIN(icode, &ptr, playback + z, EXTIN_COAX_SPDIF_L + z, gpr + z);
snd_emu10k1_init_stereo_control(controls + i++, SNDRV_CTL_NAME_IEC958("Coaxial ",PLAYBACK,VOLUME), gpr, 0);
gpr += 2;
-
+
/* IEC958 Coax Capture Volume + Switch */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_COAX_SPDIF_L + z, gpr + 2 + z);
@@ -2101,7 +2101,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_onoff_control(controls + i++, SNDRV_CTL_NAME_IEC958("Coaxial ",CAPTURE,SWITCH), gpr + 2, 0);
gpr += 4;
}
-
+
if (emu->fx8010.extin_mask & ((1<<EXTIN_LINE2_L)|(1<<EXTIN_LINE2_R))) {
/* Line LiveDrive Playback Volume */
for (z = 0; z < 2; z++)
@@ -2109,7 +2109,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_emu10k1_init_stereo_control(controls + i++, "Line2 LiveDrive Playback Volume", gpr, 0);
controls[i-1].id.index = 1;
gpr += 2;
-
+
/* Line LiveDrive Capture Volume */
for (z = 0; z < 2; z++) {
SWITCH_IN(icode, &ptr, tmp + 0, EXTIN_LINE2_L + z, gpr + 2 + z);
@@ -2249,7 +2249,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
gpr += 4;
}
-
+
if (emu->fx8010.extout_mask & ((1<<EXTOUT_REAR_L)|(1<<EXTOUT_REAR_R)))
for (z = 0; z < 2; z++)
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_REAR_L + z), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 2 + z), C_00000000, C_00000000);
@@ -2277,12 +2277,12 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ALFE), GPR(playback + SND_EMU10K1_PLAYBACK_CHANNELS + 1), C_00000000, C_00000000);
#endif
}
-
+
#ifndef EMU10K1_CAPTURE_DIGITAL_OUT
for (z = 0; z < 2; z++)
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_ADC_CAP_L + z), GPR(capture + z), C_00000000, C_00000000);
#endif
-
+
if (emu->fx8010.extout_mask & (1<<EXTOUT_MIC_CAP))
OP(icode, &ptr, iACC3, EXTOUT(EXTOUT_MIC_CAP), GPR(capture + 2), C_00000000, C_00000000);
@@ -2291,10 +2291,10 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
/* On the Live! 5.1, FXBUS2(1) and FXBUS(2) are shared with EXTOUT_ACENTER
* and EXTOUT_ALFE, so we can't connect inputs to them for multitrack recording.
*
- * Since only 14 of the 16 EXTINs are used, this is not a big problem.
- * We route AC97L and R to FX capture 14 and 15, SPDIF CD in to FX capture
- * 0 and 3, then the rest of the EXTINs to the corresponding FX capture
- * channel. Multitrack recorders will still see the center/lfe output signal
+ * Since only 14 of the 16 EXTINs are used, this is not a big problem.
+ * We route AC97L and R to FX capture 14 and 15, SPDIF CD in to FX capture
+ * 0 and 3, then the rest of the EXTINs to the corresponding FX capture
+ * channel. Multitrack recorders will still see the center/lfe output signal
* on the second and third channels.
*/
OP(icode, &ptr, iACC3, FXBUS2(14), C_00000000, C_00000000, EXTIN(0));
@@ -2307,7 +2307,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
for (z = 0; z < 16; z++)
OP(icode, &ptr, iACC3, FXBUS2(z), C_00000000, C_00000000, EXTIN(z));
}
-
+
if (gpr > tmp) {
snd_BUG();
@@ -2319,7 +2319,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
err = -EIO;
goto __err;
}
-
+
/* clear remaining instruction memory */
while (ptr < 0x200)
OP(icode, &ptr, iACC3, C_00000000, C_00000000, C_00000000, C_00000000);
@@ -2335,7 +2335,7 @@ static int __devinit _snd_emu10k1_init_efx(struct snd_emu10k1 *emu)
snd_leave_user(seg);
if (err >= 0)
err = snd_emu10k1_ipcm_poke(emu, ipcm);
- __err:
+__err:
kfree(ipcm);
kfree(controls);
if (icode != NULL) {
@@ -2471,7 +2471,7 @@ static int snd_emu10k1_fx8010_ioctl(struct snd_hwdep * hw, struct file *file, un
unsigned int addr;
void __user *argp = (void __user *)arg;
int res;
-
+
switch (cmd) {
case SNDRV_EMU10K1_IOCTL_PVERSION:
emu->support_tlv = 1;
@@ -2617,7 +2617,7 @@ int __devinit snd_emu10k1_fx8010_new(struct snd_emu10k1 *emu, int device, struct
{
struct snd_hwdep *hw;
int err;
-
+
if (rhwdep)
*rhwdep = NULL;
if ((err = snd_hwdep_new(emu->card, "FX8010", device, &hw)) < 0)
@@ -2640,16 +2640,16 @@ int __devinit snd_emu10k1_efx_alloc_pm_buffer(struct snd_emu10k1 *emu)
len = emu->audigy ? 0x200 : 0x100;
emu->saved_gpr = kmalloc(len * 4, GFP_KERNEL);
- if (! emu->saved_gpr)
+ if (!emu->saved_gpr)
return -ENOMEM;
len = emu->audigy ? 0x100 : 0xa0;
emu->tram_val_saved = kmalloc(len * 4, GFP_KERNEL);
emu->tram_addr_saved = kmalloc(len * 4, GFP_KERNEL);
- if (! emu->tram_val_saved || ! emu->tram_addr_saved)
+ if (!emu->tram_val_saved || ! emu->tram_addr_saved)
return -ENOMEM;
len = emu->audigy ? 2 * 1024 : 2 * 512;
emu->saved_icode = vmalloc(len * 4);
- if (! emu->saved_icode)
+ if (!emu->saved_icode)
return -ENOMEM;
return 0;
}
@@ -2721,7 +2721,7 @@ void snd_emu10k1_efx_resume(struct snd_emu10k1 *emu)
for (i = 0; i < len; i++) {
snd_emu10k1_ptr_write(emu, TANKMEMDATAREGBASE + i, 0,
emu->tram_val_saved[i]);
- if (! emu->audigy)
+ if (!emu->audigy)
snd_emu10k1_ptr_write(emu, TANKMEMADDRREGBASE + i, 0,
emu->tram_addr_saved[i]);
else {
diff --git a/sound/pci/emu10k1/emumixer.c b/sound/pci/emu10k1/emumixer.c
index f34bbfb..a1366e0 100644
--- a/sound/pci/emu10k1/emumixer.c
+++ b/sound/pci/emu10k1/emumixer.c
@@ -83,7 +83,7 @@ static int snd_emu10k1_spdif_get_mask(struct snd_kcontrol *kcontrol,
* Items labels in enum mixer controls assigning source data to
* each destination
*/
-static char *emu1010_src_texts[] = {
+static char *emu1010_src_texts[] = {
"Silence",
"Dock Mic A",
"Dock Mic B",
@@ -615,12 +615,12 @@ static int snd_emu1010_adc_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct
unsigned int val, cache;
val = ucontrol->value.integer.value[0];
cache = emu->emu1010.adc_pads;
- if (val == 1)
+ if (val == 1)
cache = cache | mask;
else
cache = cache & ~mask;
if (cache != emu->emu1010.adc_pads) {
- snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, cache );
+ snd_emu1010_fpga_write(emu, EMU_HANA_ADC_PADS, cache);
emu->emu1010.adc_pads = cache;
}
@@ -663,12 +663,12 @@ static int snd_emu1010_dac_pads_put(struct snd_kcontrol *kcontrol, struct snd_ct
unsigned int val, cache;
val = ucontrol->value.integer.value[0];
cache = emu->emu1010.dac_pads;
- if (val == 1)
+ if (val == 1)
cache = cache | mask;
else
cache = cache & ~mask;
if (cache != emu->emu1010.dac_pads) {
- snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DAC_PADS, cache);
emu->emu1010.dac_pads = cache;
}
@@ -702,7 +702,7 @@ static int snd_emu1010_internal_clock_info(struct snd_kcontrol *kcontrol,
static char *texts[4] = {
"44100", "48000", "SPDIF", "ADAT"
};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 4;
@@ -710,8 +710,8 @@ static int snd_emu1010_internal_clock_info(struct snd_kcontrol *kcontrol,
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
return 0;
-
-
+
+
}
static int snd_emu1010_internal_clock_get(struct snd_kcontrol *kcontrol,
@@ -730,7 +730,7 @@ static int snd_emu1010_internal_clock_put(struct snd_kcontrol *kcontrol,
unsigned int val;
int change = 0;
- val = ucontrol->value.enumerated.item[0] ;
+ val = ucontrol->value.enumerated.item[0];
/* Limit: uinfo->value.enumerated.items = 4; */
if (val >= 4)
return -EINVAL;
@@ -741,75 +741,75 @@ static int snd_emu1010_internal_clock_put(struct snd_kcontrol *kcontrol,
case 0:
/* 44100 */
/* Mute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE);
/* Default fallback clock 48kHz */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_44_1K );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_44_1K);
/* Word Clock source, Internal 44.1kHz x1 */
snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
- EMU_HANA_WCLOCK_INT_44_1K | EMU_HANA_WCLOCK_1X );
+ EMU_HANA_WCLOCK_INT_44_1K | EMU_HANA_WCLOCK_1X);
/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2,
- EMU_HANA_DOCK_LEDS_2_44K | EMU_HANA_DOCK_LEDS_2_LOCK );
+ EMU_HANA_DOCK_LEDS_2_44K | EMU_HANA_DOCK_LEDS_2_LOCK);
/* Allow DLL to settle */
msleep(10);
/* Unmute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
break;
case 1:
/* 48000 */
/* Mute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE);
/* Default fallback clock 48kHz */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K);
/* Word Clock source, Internal 48kHz x1 */
snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
- EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_1X );
+ EMU_HANA_WCLOCK_INT_48K | EMU_HANA_WCLOCK_1X);
/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2,
- EMU_HANA_DOCK_LEDS_2_48K | EMU_HANA_DOCK_LEDS_2_LOCK );
+ EMU_HANA_DOCK_LEDS_2_48K | EMU_HANA_DOCK_LEDS_2_LOCK);
/* Allow DLL to settle */
msleep(10);
/* Unmute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
break;
-
+
case 2: /* Take clock from S/PDIF IN */
/* Mute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE);
/* Default fallback clock 48kHz */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K);
/* Word Clock source, sync to S/PDIF input */
snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
- EMU_HANA_WCLOCK_HANA_SPDIF_IN | EMU_HANA_WCLOCK_1X );
+ EMU_HANA_WCLOCK_HANA_SPDIF_IN | EMU_HANA_WCLOCK_1X);
/* Set LEDs on Audio Dock */
snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2,
- EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK );
- /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
+ EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK);
+ /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
/* Allow DLL to settle */
msleep(10);
/* Unmute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
break;
-
- case 3:
+
+ case 3:
/* Take clock from ADAT IN */
/* Mute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE );
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_MUTE);
/* Default fallback clock 48kHz */
- snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K );
+ snd_emu1010_fpga_write(emu, EMU_HANA_DEFCLOCK, EMU_HANA_DEFCLOCK_48K);
/* Word Clock source, sync to ADAT input */
snd_emu1010_fpga_write(emu, EMU_HANA_WCLOCK,
- EMU_HANA_WCLOCK_HANA_ADAT_IN | EMU_HANA_WCLOCK_1X );
+ EMU_HANA_WCLOCK_HANA_ADAT_IN | EMU_HANA_WCLOCK_1X);
/* Set LEDs on Audio Dock */
- snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK );
- /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
+ snd_emu1010_fpga_write(emu, EMU_HANA_DOCK_LEDS_2, EMU_HANA_DOCK_LEDS_2_EXT | EMU_HANA_DOCK_LEDS_2_LOCK);
+ /* FIXME: We should set EMU_HANA_DOCK_LEDS_2_LOCK only when clock signal is present and valid */
/* Allow DLL to settle */
msleep(10);
/* Unmute all */
- snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE );
-
-
- break;
+ snd_emu1010_fpga_write(emu, EMU_HANA_UNMUTE, EMU_UNMUTE);
+
+
+ break;
}
}
return change;
@@ -958,7 +958,7 @@ static int snd_audigy_i2c_volume_put(struct snd_kcontrol *kcontrol,
return 0;
if (ogain != ngain) {
if (emu->i2c_capture_source == source_id)
- snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff) );
+ snd_emu10k1_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff));
emu->i2c_capture_volume[source_id][0] = ngain;
change = 1;
}
@@ -1014,7 +1014,7 @@ static int snd_audigy_spdif_output_rate_get(struct snd_kcontrol *kcontrol,
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
unsigned int tmp;
unsigned long flags;
-
+
spin_lock_irqsave(&emu->reg_lock, flags);
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
@@ -1058,7 +1058,7 @@ static int snd_audigy_spdif_output_rate_put(struct snd_kcontrol *kcontrol,
break;
}
-
+
spin_lock_irqsave(&emu->reg_lock, flags);
reg = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, 0);
tmp = reg & ~A_SPDIF_RATE_MASK;
@@ -1182,7 +1182,7 @@ static int snd_emu10k1_send_routing_get(struct snd_kcontrol *kcontrol,
spin_lock_irqsave(&emu->reg_lock, flags);
for (voice = 0; voice < 3; voice++)
for (idx = 0; idx < num_efx; idx++)
- ucontrol->value.integer.value[(voice * num_efx) + idx] =
+ ucontrol->value.integer.value[(voice * num_efx) + idx] =
mix->send_routing[voice][idx] & mask;
spin_unlock_irqrestore(&emu->reg_lock, flags);
return 0;
@@ -1207,7 +1207,7 @@ static int snd_emu10k1_send_routing_put(struct snd_kcontrol *kcontrol,
mix->send_routing[voice][idx] = val;
change = 1;
}
- }
+ }
if (change && mix->epcm) {
if (mix->epcm->voices[0] && mix->epcm->voices[1]) {
update_emu10k1_fxrt(emu, mix->epcm->voices[0]->number,
@@ -1395,7 +1395,7 @@ static int snd_emu10k1_efx_send_routing_get(struct snd_kcontrol *kcontrol,
spin_lock_irqsave(&emu->reg_lock, flags);
for (idx = 0; idx < num_efx; idx++)
- ucontrol->value.integer.value[idx] =
+ ucontrol->value.integer.value[idx] =
mix->send_routing[0][idx] & mask;
spin_unlock_irqrestore(&emu->reg_lock, flags);
return 0;
@@ -1419,7 +1419,7 @@ static int snd_emu10k1_efx_send_routing_put(struct snd_kcontrol *kcontrol,
mix->send_routing[0][idx] = val;
change = 1;
}
- }
+ }
if (change && mix->epcm) {
if (mix->epcm->voices[ch]) {
@@ -1581,7 +1581,7 @@ static int snd_emu10k1_shared_spdif_get(struct snd_kcontrol *kcontrol,
if (emu->card_capabilities->invert_shared_spdif)
ucontrol->value.integer.value[0] =
!ucontrol->value.integer.value[0];
-
+
return 0;
}
@@ -1597,7 +1597,7 @@ static int snd_emu10k1_shared_spdif_put(struct snd_kcontrol *kcontrol,
if (emu->card_capabilities->invert_shared_spdif)
sw = !sw;
spin_lock_irqsave(&emu->reg_lock, flags);
- if ( emu->card_capabilities->i2c_adc) {
+ if (emu->card_capabilities->i2c_adc) {
/* Do nothing for Audigy 2 ZS Notebook */
} else if (emu->audigy) {
reg = inl(emu->port + A_IOCFG);
@@ -1738,7 +1738,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
NULL
};
static char *audigy_rename_ctls_i2c_adc[] = {
- //"Analog Mix Capture Volume","OLD Analog Mix Capture Volume",
+ /*"Analog Mix Capture Volume","OLD Analog Mix Capture Volume", */
"Line Capture Volume", "Analog Mix Capture Volume",
"Wave Playback Volume", "OLD PCM Playback Volume",
"Wave Master Playback Volume", "Master Playback Volume",
@@ -1808,7 +1808,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
if ((err = snd_ac97_bus(emu->card, 0, &ops, NULL, &pbus)) < 0)
return err;
pbus->no_vra = 1; /* we don't need VRA */
-
+
memset(&ac97, 0, sizeof(ac97));
ac97.private_data = emu;
ac97.private_free = snd_emu10k1_mixer_free_ac97;
@@ -1828,7 +1828,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
snd_ac97_write_cache(emu->ac97, AC97_REC_SEL, 0x0000);
if (emu->card_capabilities->adc_1361t)
c = audigy_remove_ctls_1361t_adc;
- else
+ else
c = audigy_remove_ctls;
} else {
/*
@@ -1906,13 +1906,13 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
kctl->id.device = multi_device;
if ((err = snd_ctl_add(card, kctl)))
return err;
-
+
if ((kctl = emu->ctl_efx_send_volume = snd_ctl_new1(&snd_emu10k1_efx_send_volume_control, emu)) == NULL)
return -ENOMEM;
kctl->id.device = multi_device;
if ((err = snd_ctl_add(card, kctl)))
return err;
-
+
if ((kctl = emu->ctl_efx_attn = snd_ctl_new1(&snd_emu10k1_efx_attn_control, emu)) == NULL)
return -ENOMEM;
kctl->id.device = multi_device;
@@ -1923,27 +1923,27 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
for (pcm = 0; pcm < 32; pcm++) {
struct snd_emu10k1_pcm_mixer *mix;
int v;
-
+
mix = &emu->pcm_mixer[pcm];
mix->epcm = NULL;
for (v = 0; v < 4; v++)
- mix->send_routing[0][v] =
- mix->send_routing[1][v] =
+ mix->send_routing[0][v] =
+ mix->send_routing[1][v] =
mix->send_routing[2][v] = v;
-
+
memset(&mix->send_volume, 0, sizeof(mix->send_volume));
mix->send_volume[0][0] = mix->send_volume[0][1] =
mix->send_volume[1][0] = mix->send_volume[2][1] = 255;
-
+
mix->attn[0] = mix->attn[1] = mix->attn[2] = 0xffff;
}
-
+
/* initialize the routing and volume table for the multichannel playback stream */
for (pcm = 0; pcm < NUM_EFX_PLAYBACK; pcm++) {
struct snd_emu10k1_pcm_mixer *mix;
int v;
-
+
mix = &emu->efx_pcm_mixer[pcm];
mix->epcm = NULL;
@@ -1954,14 +1954,14 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
if (emu->audigy)
for (v = 0; v < 4; v++)
mix->send_routing[0][4+v] = 60+v;
-
+
memset(&mix->send_volume, 0, sizeof(mix->send_volume));
mix->send_volume[0][0] = 255;
-
+
mix->attn[0] = 0xffff;
}
-
- if (! emu->card_capabilities->ecard) { /* FIXME: APS has these controls? */
+
+ if (!emu->card_capabilities->ecard) { /* FIXME: APS has these controls? */
/* sb live! and audigy */
if ((kctl = snd_ctl_new1(&snd_emu10k1_spdif_mask_control, emu)) == NULL)
return -ENOMEM;
@@ -1990,7 +1990,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
if ((err = snd_ctl_add(card, kctl)))
return err;
#endif
- } else if (! emu->card_capabilities->ecard) {
+ } else if (!emu->card_capabilities->ecard) {
/* sb live! */
if ((kctl = snd_ctl_new1(&snd_emu10k1_shared_spdif, emu)) == NULL)
return -ENOMEM;
@@ -2073,7 +2073,7 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
return err;
}
- if ( emu->card_capabilities->i2c_adc) {
+ if (emu->card_capabilities->i2c_adc) {
int i;
err = snd_ctl_add(card, snd_ctl_new1(&snd_audigy_i2c_capture_source, emu));
@@ -2086,6 +2086,6 @@ int __devinit snd_emu10k1_mixer(struct snd_emu10k1 *emu,
return err;
}
}
-
+
return 0;
}
diff --git a/sound/pci/emu10k1/emumpu401.c b/sound/pci/emu10k1/emumpu401.c
index 8578c70..18495b4 100644
--- a/sound/pci/emu10k1/emumpu401.c
+++ b/sound/pci/emu10k1/emumpu401.c
@@ -277,7 +277,7 @@ static void snd_emu10k1_midi_output_trigger(struct snd_rawmidi_substream *substr
if (up) {
int max = 4;
unsigned char byte;
-
+
/* try to send some amount of bytes here before interrupts */
spin_lock_irqsave(&midi->output_lock, flags);
while (max > 0) {
diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c
index cf9276d..f9144dc 100644
--- a/sound/pci/emu10k1/emupcm.c
+++ b/sound/pci/emu10k1/emupcm.c
@@ -86,7 +86,7 @@ static void snd_emu10k1_pcm_efx_interrupt(struct snd_emu10k1 *emu,
}
#endif
snd_pcm_period_elapsed(emu->pcm_capture_efx_substream);
-}
+}
static snd_pcm_uframes_t snd_emu10k1_efx_playback_pointer(struct snd_pcm_substream *substream)
{
@@ -130,7 +130,7 @@ static int snd_emu10k1_pcm_channel_alloc(struct snd_emu10k1_pcm * epcm, int voic
epcm->type == PLAYBACK_EMUVOICE ? EMU10K1_PCM : EMU10K1_EFX,
voices,
&epcm->voices[0]);
-
+
if (err < 0)
return err;
epcm->voices[0]->epcm = epcm;
@@ -253,12 +253,12 @@ static unsigned int emu10k1_select_interprom(unsigned int pitch_target)
return CCCA_INTERPROM_4;
else if (pitch_target >= PITCH_57081)
return CCCA_INTERPROM_3;
- else
+ else
return CCCA_INTERPROM_2;
}
/*
- * calculate cache invalidate size
+ * calculate cache invalidate size
*
* stereo: channel is stereo
* w_16: using 16bit samples
@@ -323,7 +323,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
}
ccis = emu10k1_ccis(stereo, w_16);
-
+
if (master) {
evoice->epcm->ccca_start_addr = start_addr + ccis;
if (extra) {
@@ -359,7 +359,7 @@ static void snd_emu10k1_pcm_init_voice(struct snd_emu10k1 *emu,
snd_emu10k1_ptr_write(emu, PSST, voice, start_addr | (send_amount[2] << 24));
if (emu->card_capabilities->emu_model)
pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */
- else
+ else
pitch_target = emu10k1_calc_pitch_target(runtime->rate);
if (extra)
snd_emu10k1_ptr_write(emu, CCCA, voice, start_addr |
@@ -416,7 +416,7 @@ static int snd_emu10k1_playback_hw_params(struct snd_pcm_substream *substream,
snd_emu10k1_free_pages(emu, epcm->memblk);
epcm->memblk = snd_emu10k1_alloc_pages(emu, substream);
epcm->start_addr = 0;
- if (! epcm->memblk)
+ if (!epcm->memblk)
return -ENOMEM;
mapped = ((struct snd_emu10k1_memblk *)epcm->memblk)->mapped_page;
if (mapped < 0)
@@ -602,7 +602,7 @@ static int snd_emu10k1_capture_prepare(struct snd_pcm_substream *substream)
break;
default:
break;
- }
+ }
snd_emu10k1_ptr_write(emu, epcm->capture_ba_reg, 0, runtime->dma_addr);
epcm->capture_bufsize = snd_pcm_lib_buffer_bytes(substream);
epcm->capture_bs_val = 0;
@@ -685,7 +685,7 @@ static void snd_emu10k1_playback_prepare_voice(struct snd_emu10k1 *emu, struct s
snd_emu10k1_ptr_write(emu, CVCF, voice, vattn | 0xffff);
snd_emu10k1_ptr_write(emu, DCYSUSV, voice, 0x7f7f);
snd_emu10k1_voice_clear_loop_stop(emu, voice);
-}
+}
static void snd_emu10k1_playback_trigger_voice(struct snd_emu10k1 *emu, struct snd_emu10k1_voice *evoice, int master, int extra)
{
@@ -702,7 +702,7 @@ static void snd_emu10k1_playback_trigger_voice(struct snd_emu10k1 *emu, struct s
pitch = snd_emu10k1_rate_to_pitch(runtime->rate) >> 8;
if (emu->card_capabilities->emu_model)
pitch_target = PITCH_48000; /* Disable interpolators on emu1010 card */
- else
+ else
pitch_target = emu10k1_calc_pitch_target(runtime->rate);
snd_emu10k1_ptr_write(emu, PTRX_PITCHTARGET, voice, pitch_target);
if (master || evoice->epcm->type == PLAYBACK_EFX)
@@ -799,7 +799,7 @@ static int snd_emu10k1_capture_trigger(struct snd_pcm_substream *substream,
} else
snd_emu10k1_ptr_write(emu, FXWC, 0, epcm->capture_cr_val);
break;
- default:
+ default:
break;
}
snd_emu10k1_ptr_write(emu, epcm->capture_bs_reg, 0, epcm->capture_bs_val);
@@ -875,7 +875,7 @@ static int snd_emu10k1_efx_playback_trigger(struct snd_pcm_substream *substream,
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
/* prepare voices */
- for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
+ for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
snd_emu10k1_playback_invalidate_cache(emu, 0, epcm->voices[i]);
}
snd_emu10k1_playback_invalidate_cache(emu, 1, epcm->extra);
@@ -899,7 +899,7 @@ static int snd_emu10k1_efx_playback_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
epcm->running = 0;
- for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
+ for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
snd_emu10k1_playback_stop_voice(emu, epcm->voices[i]);
}
snd_emu10k1_playback_stop_voice(emu, epcm->extra);
@@ -985,8 +985,8 @@ static struct snd_pcm_hardware snd_emu10k1_capture_efx =
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
- .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
+ .rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000 |
SNDRV_PCM_RATE_176400 | SNDRV_PCM_RATE_192000,
.rate_min = 44100,
.rate_max = 192000,
@@ -1008,7 +1008,7 @@ static void snd_emu10k1_pcm_mixer_notify1(struct snd_emu10k1 *emu, struct snd_kc
{
struct snd_ctl_elem_id id;
- if (! kctl)
+ if (!kctl)
return;
if (activate)
kctl->vd[idx].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
@@ -1066,13 +1066,13 @@ static int snd_emu10k1_efx_playback_open(struct snd_pcm_substream *substream)
epcm->emu = emu;
epcm->type = PLAYBACK_EFX;
epcm->substream = substream;
-
+
emu->pcm_playback_efx_substream = substream;
runtime->private_data = epcm;
runtime->private_free = snd_emu10k1_pcm_free_substream;
runtime->hw = snd_emu10k1_efx_playback;
-
+
for (i = 0; i < NUM_EFX_PLAYBACK; i++) {
mix = &emu->efx_pcm_mixer[i];
mix->send_routing[0][0] = i;
@@ -1243,7 +1243,7 @@ static int snd_emu10k1_capture_efx_open(struct snd_pcm_substream *substream)
* channels_min = 16,
* channels_max = 16,
* Need to add mixer control to fix sample rate
- *
+ *
* There are 32 mono channels of 16bits each.
* 24bit Audio uses 2x channels over 16bit
* 96kHz uses 2x channels over 48kHz
@@ -1470,7 +1470,7 @@ static int snd_emu10k1_pcm_efx_voices_mask_get(struct snd_kcontrol *kcontrol, st
struct snd_emu10k1 *emu = snd_kcontrol_chip(kcontrol);
int nefx = emu->audigy ? 64 : 32;
int idx;
-
+
spin_lock_irq(&emu->reg_lock);
for (idx = 0; idx < nefx; idx++)
ucontrol->value.integer.value[idx] = (emu->efx_voices_mask[idx / 32] & (1 << (idx % 32))) ? 1 : 0;
@@ -1485,18 +1485,18 @@ static int snd_emu10k1_pcm_efx_voices_mask_put(struct snd_kcontrol *kcontrol, st
int nefx = emu->audigy ? 64 : 32;
int nefxb = emu->audigy ? 7 : 6;
int change, idx;
-
+
nval[0] = nval[1] = 0;
for (idx = 0, bits = 0; idx < nefx; idx++)
if (ucontrol->value.integer.value[idx]) {
nval[idx / 32] |= 1 << (idx % 32);
bits++;
}
-
+
for (idx = 0; idx < nefxb; idx++)
if (1 << idx == bits)
break;
-
+
if (idx >= nefxb)
return -EINVAL;
@@ -1622,7 +1622,7 @@ static int snd_emu10k1_fx8010_playback_prepare(struct snd_pcm_substream *substre
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_emu10k1_fx8010_pcm *pcm = &emu->fx8010.pcm[substream->number];
unsigned int i;
-
+
/* printk("prepare: etram_pages = 0x%p, dma_area = 0x%x, buffer_size = 0x%x (0x%x)\n", emu->fx8010.etram_pages, runtime->dma_area, runtime->buffer_size, runtime->buffer_size << 2); */
memset(&pcm->pcm_rec, 0, sizeof(pcm->pcm_rec));
pcm->pcm_rec.hw_buffer_size = pcm->buffer_size * 2; /* byte size */
@@ -1682,7 +1682,7 @@ static int snd_emu10k1_fx8010_playback_trigger(struct snd_pcm_substream *substre
result = -EINVAL;
break;
}
- __err:
+__err:
spin_unlock(&emu->reg_lock);
return result;
}
@@ -1783,10 +1783,10 @@ int __devinit snd_emu10k1_pcm_efx(struct snd_emu10k1 * emu, int device, struct s
if (rpcm)
*rpcm = pcm;
- /* EFX capture - record the "FXBUS2" channels, by default we connect the EXTINs
+ /* EFX capture - record the "FXBUS2" channels, by default we connect the EXTINs
* to these
- */
-
+ */
+
/* emu->efx_voices_mask[0] = FXWC_DEFAULTROUTE_C | FXWC_DEFAULTROUTE_A; */
if (emu->audigy) {
emu->efx_voices_mask[0] = 0;
diff --git a/sound/pci/emu10k1/emuproc.c b/sound/pci/emu10k1/emuproc.c
index 216f974..012c0c3 100644
--- a/sound/pci/emu10k1/emuproc.c
+++ b/sound/pci/emu10k1/emuproc.c
@@ -46,7 +46,7 @@ static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
static char *channel[16] = { "unspec", "left", "right", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" };
static char *emphasis[8] = { "none", "50/15 usec 2 channel", "2", "3", "4", "5", "6", "7" };
unsigned int status, rate = 0;
-
+
status = snd_emu10k1_ptr_read(emu, status_reg, 0);
snd_iprintf(buffer, "\n%s\n", title);
@@ -70,7 +70,7 @@ static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
snd_iprintf(buffer, "S/PDIF Locked : %s\n", rate & SRCS_SPDIFLOCKED ? "on" : "off");
snd_iprintf(buffer, "Rate Locked : %s\n", rate & SRCS_RATELOCKED ? "on" : "off");
/* From ((Rate * 48000 ) / 262144); */
- snd_iprintf(buffer, "Estimated Sample Rate : %d\n", ((rate & 0xFFFFF ) * 375) >> 11);
+ snd_iprintf(buffer, "Estimated Sample Rate : %d\n", ((rate & 0xFFFFF ) * 375) >> 11);
}
} else {
snd_iprintf(buffer, "No signal detected.\n");
@@ -78,7 +78,7 @@ static void snd_emu10k1_proc_spdif_status(struct snd_emu10k1 * emu,
}
-static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
/* FIXME - output names are in emufx.c too */
@@ -189,7 +189,7 @@ static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
int nefx = emu->audigy ? 64 : 32;
char **outputs = emu->audigy ? audigy_outs : creative_outs;
int idx;
-
+
snd_iprintf(buffer, "EMU10K1\n\n");
snd_iprintf(buffer, "Card : %s\n",
emu->audigy ? "Audigy" : (emu->card_capabilities->ecard ? "EMU APS" : "Creative"));
@@ -235,7 +235,7 @@ static void snd_emu10k1_proc_read(struct snd_info_entry *entry,
snd_iprintf(buffer, " Output %02i [%s]\n", idx, outputs[idx]);
}
-static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_emu10k1 *emu = entry->private_data;
@@ -253,7 +253,7 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
snd_emu1010_fpga_read(emu, 0x2a, &value);
snd_emu1010_fpga_read(emu, 0x2b, &value2);
spin_unlock_irqrestore(&emu->emu_lock, flags);
- rate = 0x1770000 / (((value << 5) | value2)+1);
+ rate = 0x1770000 / (((value << 5) | value2)+1);
snd_iprintf(buffer, "ADAT Locked : %u\n", rate);
} else {
snd_iprintf(buffer, "ADAT Unlocked\n");
@@ -266,7 +266,7 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
snd_emu1010_fpga_read(emu, 0x28, &value);
snd_emu1010_fpga_read(emu, 0x29, &value2);
spin_unlock_irqrestore(&emu->emu_lock, flags);
- rate = 0x1770000 / (((value << 5) | value2)+1);
+ rate = 0x1770000 / (((value << 5) | value2)+1);
snd_iprintf(buffer, "SPDIF Locked : %d\n", rate);
} else {
snd_iprintf(buffer, "SPDIF Unlocked\n");
@@ -283,7 +283,7 @@ static void snd_emu10k1_proc_spdif_read(struct snd_info_entry *entry,
#endif
}
-static void snd_emu10k1_proc_rates_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_rates_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
static int samplerate[8] = { 44100, 48000, 96000, 192000, 4, 5, 6, 7 };
@@ -298,7 +298,7 @@ static void snd_emu10k1_proc_rates_read(struct snd_info_entry *entry,
}
}
-static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
u32 pc;
@@ -308,7 +308,7 @@ static void snd_emu10k1_proc_acode_read(struct snd_info_entry *entry,
snd_iprintf(buffer, " Code dump :\n");
for (pc = 0; pc < (emu->audigy ? 1024 : 512); pc++) {
u32 low, high;
-
+
low = snd_emu10k1_efx_read(emu, pc * 2);
high = snd_emu10k1_efx_read(emu, pc * 2 + 1);
if (emu->audigy)
@@ -350,7 +350,7 @@ static long snd_emu10k1_fx8010_read(struct snd_info_entry *entry,
struct snd_emu10k1 *emu = entry->private_data;
unsigned int offset;
int tram_addr = 0;
-
+
if (!strcmp(entry->name, "fx8010_tram_addr")) {
offset = TANKMEMADDRREGBASE;
tram_addr = 1;
@@ -374,7 +374,7 @@ static long snd_emu10k1_fx8010_read(struct snd_info_entry *entry,
if (tram_addr && emu->audigy) {
tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0) >> 11;
tmp[idx] |= snd_emu10k1_ptr_read(emu, 0x100 + idx + (pos >> 2), 0) << 20;
- } else
+ } else
tmp[idx] = snd_emu10k1_ptr_read(emu, offset + idx + (pos >> 2), 0);
if (copy_to_user(buf, ((char *)tmp) + (pos & 3), size))
res = -EFAULT;
@@ -387,13 +387,13 @@ static long snd_emu10k1_fx8010_read(struct snd_info_entry *entry,
return 0;
}
-static void snd_emu10k1_proc_voices_read(struct snd_info_entry *entry,
+static void snd_emu10k1_proc_voices_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_emu10k1 *emu = entry->private_data;
struct snd_emu10k1_voice *voice;
int idx;
-
+
snd_iprintf(buffer, "ch\tuse\tpcm\tefx\tsynth\tmidi\n");
for (idx = 0; idx < NUM_G; idx++) {
voice = &emu->voices[idx];
@@ -417,7 +417,7 @@ static void snd_emu_proc_emu1010_reg_read(struct snd_info_entry *entry,
int i;
snd_iprintf(buffer, "EMU1010 Registers:\n\n");
- for(i = 0; i < 0x40; i+=1) {
+ for (i = 0; i < 0x40; i++) {
spin_lock_irqsave(&emu->emu_lock, flags);
snd_emu1010_fpga_read(emu, i, &value);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -433,7 +433,7 @@ static void snd_emu_proc_io_reg_read(struct snd_info_entry *entry,
unsigned long flags;
int i;
snd_iprintf(buffer, "IO Registers:\n\n");
- for(i = 0; i < 0x40; i+=4) {
+ for (i = 0; i < 0x40; i += 4) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inl(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -451,7 +451,7 @@ static void snd_emu_proc_io_reg_write(struct snd_info_entry *entry,
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%x %x", ®, &val) != 2)
continue;
- if ((reg < 0x40) && (reg >= 0) && (val <= 0xffffffff) ) {
+ if ((reg < 0x40) && (reg >= 0) && (val <= 0xffffffff)) {
spin_lock_irqsave(&emu->emu_lock, flags);
outl(val, emu->port + (reg & 0xfffffffc));
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -505,10 +505,10 @@ static void snd_emu_proc_ptr_reg_read(struct snd_info_entry *entry,
return;
}
snd_iprintf(buffer, "Registers 0x%x\n", iobase);
- for(i = offset; i < offset+length; i++) {
+ for (i = offset; i < offset+length; i++) {
snd_iprintf(buffer, "%02X: ",i);
for (j = 0; j < voices; j++) {
- if(iobase == 0)
+ if (iobase == 0)
value = snd_ptr_read(emu, 0, i, j);
else
value = snd_ptr_read(emu, 0x20, i, j);
@@ -527,7 +527,7 @@ static void snd_emu_proc_ptr_reg_write(struct snd_info_entry *entry,
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3)
continue;
- if ((reg < 0xa0) && (reg >= 0) && (val <= 0xffffffff) && (channel_id >= 0) && (channel_id <= 3) )
+ if ((reg < 0xa0) && (reg >= 0) && (val <= 0xffffffff) && (channel_id >= 0) && (channel_id <= 3))
snd_ptr_write(emu, iobase, reg, channel_id, val);
}
}
@@ -543,7 +543,7 @@ static void snd_emu_proc_ptr_reg_write20(struct snd_info_entry *entry,
{
snd_emu_proc_ptr_reg_write(entry, buffer, 0x20);
}
-
+
static void snd_emu_proc_ptr_reg_read00a(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
@@ -585,85 +585,85 @@ int __devinit snd_emu10k1_proc_init(struct snd_emu10k1 * emu)
struct snd_info_entry *entry;
#ifdef CONFIG_SND_DEBUG
if (emu->card_capabilities->emu_model) {
- if (! snd_card_proc_new(emu->card, "emu1010_regs", &entry))
+ if (!snd_card_proc_new(emu->card, "emu1010_regs", &entry))
snd_info_set_text_ops(entry, emu, snd_emu_proc_emu1010_reg_read);
}
- if (! snd_card_proc_new(emu->card, "io_regs", &entry)) {
+ if (!snd_card_proc_new(emu->card, "io_regs", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_io_reg_read);
entry->c.text.write = snd_emu_proc_io_reg_write;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs00a", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00a);
entry->c.text.write = snd_emu_proc_ptr_reg_write00;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs00b", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read00b);
entry->c.text.write = snd_emu_proc_ptr_reg_write00;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs20a", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20a);
entry->c.text.write = snd_emu_proc_ptr_reg_write20;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs20b", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20b);
entry->c.text.write = snd_emu_proc_ptr_reg_write20;
entry->mode |= S_IWUSR;
}
- if (! snd_card_proc_new(emu->card, "ptr_regs20c", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ptr_regs20c", &entry)) {
snd_info_set_text_ops(entry, emu, snd_emu_proc_ptr_reg_read20c);
entry->c.text.write = snd_emu_proc_ptr_reg_write20;
entry->mode |= S_IWUSR;
}
#endif
-
- if (! snd_card_proc_new(emu->card, "emu10k1", &entry))
+
+ if (!snd_card_proc_new(emu->card, "emu10k1", &entry))
snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_read);
if (emu->card_capabilities->emu10k2_chip) {
- if (! snd_card_proc_new(emu->card, "spdif-in", &entry))
+ if (!snd_card_proc_new(emu->card, "spdif-in", &entry))
snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_spdif_read);
}
if (emu->card_capabilities->ca0151_chip) {
- if (! snd_card_proc_new(emu->card, "capture-rates", &entry))
+ if (!snd_card_proc_new(emu->card, "capture-rates", &entry))
snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_rates_read);
}
- if (! snd_card_proc_new(emu->card, "voices", &entry))
+ if (!snd_card_proc_new(emu->card, "voices", &entry))
snd_info_set_text_ops(entry, emu, snd_emu10k1_proc_voices_read);
- if (! snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_gpr", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
entry->size = emu->audigy ? A_TOTAL_SIZE_GPR : TOTAL_SIZE_GPR;
entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
}
- if (! snd_card_proc_new(emu->card, "fx8010_tram_data", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_tram_data", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
- entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_DATA : TOTAL_SIZE_TANKMEM_DATA ;
+ entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_DATA : TOTAL_SIZE_TANKMEM_DATA;
entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
}
- if (! snd_card_proc_new(emu->card, "fx8010_tram_addr", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_tram_addr", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
- entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_ADDR : TOTAL_SIZE_TANKMEM_ADDR ;
+ entry->size = emu->audigy ? A_TOTAL_SIZE_TANKMEM_ADDR : TOTAL_SIZE_TANKMEM_ADDR;
entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
}
- if (! snd_card_proc_new(emu->card, "fx8010_code", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_code", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
entry->size = emu->audigy ? A_TOTAL_SIZE_CODE : TOTAL_SIZE_CODE;
entry->c.ops = &snd_emu10k1_proc_ops_fx8010;
}
- if (! snd_card_proc_new(emu->card, "fx8010_acode", &entry)) {
+ if (!snd_card_proc_new(emu->card, "fx8010_acode", &entry)) {
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->private_data = emu;
entry->mode = S_IFREG | S_IRUGO /*| S_IWUSR*/;
diff --git a/sound/pci/emu10k1/io.c b/sound/pci/emu10k1/io.c
index b5a802b..c77f5f2 100644
--- a/sound/pci/emu10k1/io.c
+++ b/sound/pci/emu10k1/io.c
@@ -42,16 +42,16 @@ unsigned int snd_emu10k1_ptr_read(struct snd_emu10k1 * emu, unsigned int reg, un
if (reg & 0xff000000) {
unsigned char size, offset;
-
+
size = (reg >> 24) & 0x3f;
offset = (reg >> 16) & 0x1f;
mask = ((1 << size) - 1) << offset;
-
+
spin_lock_irqsave(&emu->emu_lock, flags);
outl(regptr, emu->port + PTR);
val = inl(emu->port + DATA);
spin_unlock_irqrestore(&emu->emu_lock, flags);
-
+
return (val & mask) >> offset;
} else {
spin_lock_irqsave(&emu->emu_lock, flags);
@@ -90,7 +90,7 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
outl(regptr, emu->port + PTR);
data |= inl(emu->port + DATA) & ~mask;
outl(data, emu->port + DATA);
- spin_unlock_irqrestore(&emu->emu_lock, flags);
+ spin_unlock_irqrestore(&emu->emu_lock, flags);
} else {
spin_lock_irqsave(&emu->emu_lock, flags);
outl(regptr, emu->port + PTR);
@@ -101,13 +101,13 @@ void snd_emu10k1_ptr_write(struct snd_emu10k1 *emu, unsigned int reg, unsigned i
EXPORT_SYMBOL(snd_emu10k1_ptr_write);
-unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
- unsigned int reg,
+unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
+ unsigned int reg,
unsigned int chn)
{
unsigned long flags;
unsigned int regptr, val;
-
+
regptr = (reg << 16) | chn;
spin_lock_irqsave(&emu->emu_lock, flags);
@@ -117,9 +117,9 @@ unsigned int snd_emu10k1_ptr20_read(struct snd_emu10k1 * emu,
return val;
}
-void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu,
- unsigned int reg,
- unsigned int chn,
+void snd_emu10k1_ptr20_write(struct snd_emu10k1 *emu,
+ unsigned int reg,
+ unsigned int chn,
unsigned int data)
{
unsigned int regptr;
@@ -230,7 +230,7 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
break;
}
}
- //Read back and see if the transaction is successful
+ /* Read back and see if the transaction is successful */
if ((status & I2C_A_ADC_ABORT) == 0)
break;
}
@@ -242,7 +242,7 @@ int snd_emu10k1_i2c_write(struct snd_emu10k1 *emu,
/* dump_stack(); */
err = -EINVAL;
}
-
+
spin_unlock(&emu->i2c_lock);
return err;
}
@@ -291,10 +291,10 @@ int snd_emu1010_fpga_read(struct snd_emu10k1 * emu, u32 reg, u32 *value)
*/
int snd_emu1010_fpga_link_dst_src_write(struct snd_emu10k1 * emu, u32 dst, u32 src)
{
- snd_emu1010_fpga_write(emu, 0x00, ((dst >> 8) & 0x3f) );
- snd_emu1010_fpga_write(emu, 0x01, (dst & 0x3f) );
- snd_emu1010_fpga_write(emu, 0x02, ((src >> 8) & 0x3f) );
- snd_emu1010_fpga_write(emu, 0x03, (src & 0x3f) );
+ snd_emu1010_fpga_write(emu, 0x00, ((dst >> 8) & 0x3f));
+ snd_emu1010_fpga_write(emu, 0x01, (dst & 0x3f));
+ snd_emu1010_fpga_write(emu, 0x02, ((src >> 8) & 0x3f));
+ snd_emu1010_fpga_write(emu, 0x03, (src & 0x3f));
return 0;
}
diff --git a/sound/pci/emu10k1/irq.c b/sound/pci/emu10k1/irq.c
index 30bfed6..e4947a6 100644
--- a/sound/pci/emu10k1/irq.c
+++ b/sound/pci/emu10k1/irq.c
@@ -157,19 +157,19 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
struct snd_emu10k1_voice *pvoice = &(emu->p16v_voices[0]);
struct snd_emu10k1_voice *cvoice = &(emu->p16v_capture_voice);
- //printk(KERN_INFO "status2=0x%x\n", status2);
+ /* printk(KERN_INFO "status2=0x%x\n", status2); */
orig_status2 = status2;
- if(status2 & mask) {
- if(pvoice->use) {
+ if (status2 & mask) {
+ if (pvoice->use) {
snd_pcm_period_elapsed(pvoice->epcm->substream);
- } else {
+ } else {
snd_printk(KERN_ERR "p16v: status: 0x%08x, mask=0x%08x, pvoice=%p, use=%d\n", status2, mask, pvoice, pvoice->use);
}
}
- if(status2 & 0x110000) {
- //printk(KERN_INFO "capture int found\n");
- if(cvoice->use) {
- //printk(KERN_INFO "capture period_elapsed\n");
+ if (status2 & 0x110000) {
+ /* printk(KERN_INFO "capture int found\n"); */
+ if (cvoice->use) {
+ /* printk(KERN_INFO "capture period_elapsed\n"); */
snd_pcm_period_elapsed(cvoice->epcm->substream);
}
}
@@ -181,7 +181,7 @@ irqreturn_t snd_emu10k1_interrupt(int irq, void *dev_id)
if (status) {
unsigned int bits;
snd_printk(KERN_ERR "emu10k1: unhandled interrupt: 0x%08x\n", status);
- //make sure any interrupts we don't handle are disabled:
+ /* make sure any interrupts we don't handle are disabled: */
bits = INTE_FXDSPENABLE |
INTE_PCIERRORENABLE |
INTE_VOLINCRENABLE |
diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c
index 6a47672..e6067f6 100644
--- a/sound/pci/emu10k1/memory.c
+++ b/sound/pci/emu10k1/memory.c
@@ -323,7 +323,7 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst
unsigned long ofs = idx << PAGE_SHIFT;
dma_addr_t addr;
addr = snd_pcm_sgbuf_get_addr(substream, ofs);
- if (! is_valid_page(emu, addr)) {
+ if (!is_valid_page(emu, addr)) {
printk(KERN_ERR "emu: failure page = %d\n", idx);
mutex_unlock(&hdr->block_mutex);
return NULL;
@@ -368,7 +368,7 @@ struct snd_util_memblk *
snd_emu10k1_synth_alloc(struct snd_emu10k1 *hw, unsigned int size)
{
struct snd_emu10k1_memblk *blk;
- struct snd_util_memhdr *hdr = hw->memhdr;
+ struct snd_util_memhdr *hdr = hw->memhdr;
mutex_lock(&hdr->block_mutex);
blk = (struct snd_emu10k1_memblk *)__snd_util_mem_alloc(hdr, size);
@@ -394,7 +394,7 @@ EXPORT_SYMBOL(snd_emu10k1_synth_alloc);
int
snd_emu10k1_synth_free(struct snd_emu10k1 *emu, struct snd_util_memblk *memblk)
{
- struct snd_util_memhdr *hdr = emu->memhdr;
+ struct snd_util_memhdr *hdr = emu->memhdr;
struct snd_emu10k1_memblk *blk = (struct snd_emu10k1_memblk *)memblk;
unsigned long flags;
@@ -499,7 +499,7 @@ static inline void *offset_ptr(struct snd_emu10k1 *emu, int page, int offset)
if (snd_BUG_ON(page < 0 || page >= emu->max_cache_pages))
return NULL;
ptr = emu->page_ptr_table[page];
- if (! ptr) {
+ if (!ptr) {
printk(KERN_ERR "emu10k1: access to NULL ptr: page = %d\n", page);
return NULL;
}
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c
index 749a21b..dd71b65 100644
--- a/sound/pci/emu10k1/p16v.c
+++ b/sound/pci/emu10k1/p16v.c
@@ -123,17 +123,17 @@
/* hardware definition */
static struct snd_pcm_hardware snd_p16v_playback_hw = {
- .info = SNDRV_PCM_INFO_MMAP |
+ .info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_SYNC_START,
.formats = SNDRV_PCM_FMTBIT_S32_LE, /* Only supports 24-bit samples padded to 32 bits. */
- .rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
+ .rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
.rate_min = 44100,
.rate_max = 192000,
- .channels_min = 8,
+ .channels_min = 8,
.channels_max = 8,
.buffer_bytes_max = ((65536 - 64) * 8),
.period_bytes_min = 64,
@@ -150,7 +150,7 @@ static struct snd_pcm_hardware snd_p16v_capture_hw = {
SNDRV_PCM_INFO_RESUME |
SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S32_LE,
- .rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
+ .rates = SNDRV_PCM_RATE_192000 | SNDRV_PCM_RATE_96000 | SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_44100,
.rate_min = 44100,
.rate_max = 192000,
.channels_min = 2,
@@ -166,9 +166,9 @@ static struct snd_pcm_hardware snd_p16v_capture_hw = {
static void snd_p16v_pcm_free_substream(struct snd_pcm_runtime *runtime)
{
struct snd_emu10k1_pcm *epcm = runtime->private_data;
-
+
if (epcm) {
- //snd_printk("epcm free: %p\n", epcm);
+ /* snd_printk("epcm free: %p\n", epcm); */
kfree(epcm);
}
}
@@ -183,26 +183,26 @@ static int snd_p16v_pcm_open_playback_channel(struct snd_pcm_substream *substrea
int err;
epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
- //snd_printk("epcm kcalloc: %p\n", epcm);
+ /* snd_printk("epcm kcalloc: %p\n", epcm); */
if (epcm == NULL)
return -ENOMEM;
epcm->emu = emu;
epcm->substream = substream;
- //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id);
-
+ /* snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); */
+
runtime->private_data = epcm;
runtime->private_free = snd_p16v_pcm_free_substream;
-
+
runtime->hw = snd_p16v_playback_hw;
channel->emu = emu;
channel->number = channel_id;
channel->use=1;
- //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use);
- //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
- //channel->interrupt = snd_p16v_pcm_channel_interrupt;
+ /* snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); */
+ /* printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); */
+ /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
channel->epcm=epcm;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
@@ -224,26 +224,26 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
int err;
epcm = kzalloc(sizeof(*epcm), GFP_KERNEL);
- //snd_printk("epcm kcalloc: %p\n", epcm);
+ /* snd_printk("epcm kcalloc: %p\n", epcm); */
if (epcm == NULL)
return -ENOMEM;
epcm->emu = emu;
epcm->substream = substream;
- //snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id);
+ /* snd_printk("epcm device=%d, channel_id=%d\n", substream->pcm->device, channel_id); */
runtime->private_data = epcm;
runtime->private_free = snd_p16v_pcm_free_substream;
-
+
runtime->hw = snd_p16v_capture_hw;
channel->emu = emu;
channel->number = channel_id;
channel->use=1;
- //snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use);
- //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
- //channel->interrupt = snd_p16v_pcm_channel_interrupt;
+ /* snd_printk("p16v: open channel_id=%d, channel=%p, use=0x%x\n", channel_id, channel, channel->use); */
+ /* printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); */
+ /* channel->interrupt = snd_p16v_pcm_channel_interrupt; */
channel->epcm=epcm;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
@@ -256,8 +256,8 @@ static int snd_p16v_pcm_open_capture_channel(struct snd_pcm_substream *substream
static int snd_p16v_pcm_close_playback(struct snd_pcm_substream *substream)
{
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
- //struct snd_pcm_runtime *runtime = substream->runtime;
- //struct snd_emu10k1_pcm *epcm = runtime->private_data;
+ /* struct snd_pcm_runtime *runtime = substream->runtime; */
+ /* struct snd_emu10k1_pcm *epcm = runtime->private_data; */
emu->p16v_voices[substream->pcm->device - emu->p16v_device_offset].use = 0;
/* FIXME: maybe zero others */
return 0;
@@ -267,8 +267,8 @@ static int snd_p16v_pcm_close_playback(struct snd_pcm_substream *substream)
static int snd_p16v_pcm_close_capture(struct snd_pcm_substream *substream)
{
struct snd_emu10k1 *emu = snd_pcm_substream_chip(substream);
- //struct snd_pcm_runtime *runtime = substream->runtime;
- //struct snd_emu10k1_pcm *epcm = runtime->private_data;
+ /* struct snd_pcm_runtime *runtime = substream->runtime; */
+ /* struct snd_emu10k1_pcm *epcm = runtime->private_data; */
emu->p16v_capture_voice.use = 0;
/* FIXME: maybe zero others */
return 0;
@@ -281,7 +281,7 @@ static int snd_p16v_pcm_open_playback_front(struct snd_pcm_substream *substream)
static int snd_p16v_pcm_open_capture(struct snd_pcm_substream *substream)
{
- // Only using channel 0 for now, but the card has 2 channels.
+ /* Only using channel 0 for now, but the card has 2 channels. */
return snd_p16v_pcm_open_capture_channel(substream, 0);
}
@@ -333,10 +333,10 @@ static int snd_p16v_pcm_prepare_playback(struct snd_pcm_substream *substream)
u32 period_size_bytes = frames_to_bytes(runtime, runtime->period_size);
int i;
u32 tmp;
-
- //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
- //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
- //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->p16v_buffer.addr, emu->p16v_buffer.area, emu->p16v_buffer.bytes);
+
+ /* snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->p16v_buffer.addr, emu->p16v_buffer.area, emu->p16v_buffer.bytes); */
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
switch (runtime->rate) {
case 44100:
@@ -354,17 +354,17 @@ static int snd_p16v_pcm_prepare_playback(struct snd_pcm_substream *substream)
break;
}
/* FIXME: Check emu->buffer.size before actually writing to it. */
- for(i = 0; i < runtime->periods; i++) {
+ for (i = 0; i < runtime->periods; i++) {
table_base[i*2]=runtime->dma_addr+(i*period_size_bytes);
table_base[(i*2)+1]=period_size_bytes<<16;
}
-
+
snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_ADDR, channel, emu->p16v_buffer.addr+(8*16*channel));
snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19);
snd_emu10k1_ptr20_write(emu, PLAYBACK_LIST_PTR, channel, 0);
snd_emu10k1_ptr20_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr);
- //snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); // buffer size in bytes
- snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); // buffer size in bytes
+ /* snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); buffer size in bytes */
+ snd_emu10k1_ptr20_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); /* buffer size in bytes */
snd_emu10k1_ptr20_write(emu, PLAYBACK_POINTER, channel, 0);
snd_emu10k1_ptr20_write(emu, 0x07, channel, 0x0);
snd_emu10k1_ptr20_write(emu, 0x08, channel, 0);
@@ -379,7 +379,7 @@ static int snd_p16v_pcm_prepare_capture(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
int channel = substream->pcm->device - emu->p16v_device_offset;
u32 tmp;
- //printk("prepare capture:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1));
+ /* printk("prepare capture:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1)); */
tmp = snd_emu10k1_ptr_read(emu, A_SPDIF_SAMPLERATE, channel);
switch (runtime->rate) {
case 44100:
@@ -399,10 +399,10 @@ static int snd_p16v_pcm_prepare_capture(struct snd_pcm_substream *substream)
/* FIXME: Check emu->buffer.size before actually writing to it. */
snd_emu10k1_ptr20_write(emu, 0x13, channel, 0);
snd_emu10k1_ptr20_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr);
- snd_emu10k1_ptr20_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size) << 16); // buffer size in bytes
+ snd_emu10k1_ptr20_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size) << 16); /* buffer size in bytes */
snd_emu10k1_ptr20_write(emu, CAPTURE_POINTER, channel, 0);
- //snd_emu10k1_ptr20_write(emu, CAPTURE_SOURCE, 0x0, 0x333300e4); /* Select MIC or Line in */
- //snd_emu10k1_ptr20_write(emu, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) | (0x110000<<channel));
+ /* snd_emu10k1_ptr20_write(emu, CAPTURE_SOURCE, 0x0, 0x333300e4); Select MIC or Line in */
+ /* snd_emu10k1_ptr20_write(emu, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) | (0x110000<<channel)); */
return 0;
}
@@ -459,13 +459,13 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream,
runtime = s->runtime;
epcm = runtime->private_data;
channel = substream->pcm->device-emu->p16v_device_offset;
- //snd_printk("p16v channel=%d\n",channel);
+ /* snd_printk("p16v channel=%d\n",channel); */
epcm->running = running;
basic |= (0x1<<channel);
inte |= (INTE2_PLAYBACK_CH_0_LOOP<<channel);
snd_pcm_trigger_done(s, substream);
}
- //snd_printk("basic=0x%x, inte=0x%x\n",basic, inte);
+ /* snd_printk("basic=0x%x, inte=0x%x\n",basic, inte); */
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
@@ -503,7 +503,7 @@ static int snd_p16v_pcm_trigger_capture(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_STOP:
snd_emu10k1_ptr20_write(emu, BASIC_INTERRUPT, 0, snd_emu10k1_ptr20_read(emu, BASIC_INTERRUPT, 0) & ~(0x100<<channel));
snd_p16v_intr_disable(emu, inte);
- //snd_emu10k1_ptr20_write(emu, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) & ~(0x110000<<channel));
+ /* snd_emu10k1_ptr20_write(emu, EXTENDED_INT_MASK, 0, snd_emu10k1_ptr20_read(emu, EXTENDED_INT_MASK, 0) & ~(0x110000<<channel)); */
epcm->running = 0;
break;
default:
@@ -558,7 +558,7 @@ snd_p16v_pcm_pointer_capture(struct snd_pcm_substream *substream)
ptr -= runtime->buffer_size;
printk(KERN_WARNING "buffer capture limited!\n");
}
- //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate);
+ /* printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); */
return ptr;
}
@@ -589,10 +589,10 @@ static struct snd_pcm_ops snd_p16v_capture_ops = {
int snd_p16v_free(struct snd_emu10k1 *chip)
{
- // release the data
+ /* release the data */
if (chip->p16v_buffer.area) {
snd_dma_free_pages(&chip->p16v_buffer);
- //snd_printk("period lables free: %p\n", &chip->p16v_buffer);
+ /* snd_printk("period lables free: %p\n", &chip->p16v_buffer); */
}
return 0;
}
@@ -603,18 +603,18 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
struct snd_pcm_substream *substream;
int err;
int capture=1;
-
- //snd_printk("snd_p16v_pcm called. device=%d\n", device);
+
+ /* snd_printk("snd_p16v_pcm called. device=%d\n", device); */
emu->p16v_device_offset = device;
if (rpcm)
*rpcm = NULL;
if ((err = snd_pcm_new(emu->card, "p16v", device, 1, capture, &pcm)) < 0)
return err;
-
+
pcm->private_data = emu;
- // Single playback 8 channel device.
- // Single capture 2 channel device.
+ /* Single playback 8 channel device. */
+ /* Single capture 2 channel device. */
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_p16v_playback_front_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_p16v_capture_ops);
@@ -623,31 +623,31 @@ int __devinit snd_p16v_pcm(struct snd_emu10k1 *emu, int device, struct snd_pcm *
strcpy(pcm->name, "p16v");
emu->pcm_p16v = pcm;
- for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
- substream;
+ for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
+ substream;
substream = substream->next) {
- if ((err = snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
- ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0)
+ if ((err = snd_pcm_lib_preallocate_pages(substream,
+ SNDRV_DMA_TYPE_DEV,
+ snd_dma_pci_data(emu->pci),
+ ((65536 - 64) * 8), ((65536 - 64) * 8))) < 0)
return err;
- //snd_printk("preallocate playback substream: err=%d\n", err);
+ /* snd_printk("preallocate playback substream: err=%d\n", err); */
}
- for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
- substream;
+ for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
+ substream;
substream = substream->next) {
- if ((err = snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
+ if ((err = snd_pcm_lib_preallocate_pages(substream,
+ SNDRV_DMA_TYPE_DEV,
+ snd_dma_pci_data(emu->pci),
65536 - 64, 65536 - 64)) < 0)
return err;
- //snd_printk("preallocate capture substream: err=%d\n", err);
+ /* snd_printk("preallocate capture substream: err=%d\n", err); */
}
-
+
if (rpcm)
*rpcm = pcm;
-
+
return 0;
}
@@ -696,7 +696,7 @@ static int snd_p16v_volume_put(struct snd_kcontrol *kcontrol,
} else {
value &= 0xffff0000;
value |= ((0xff - ucontrol->value.integer.value[0]) << 8) |
- ((0xff - ucontrol->value.integer.value[1]) );
+ ((0xff - ucontrol->value.integer.value[1]));
}
if (value != oval) {
snd_emu10k1_ptr20_write(emu, reg, 0, value);
@@ -740,7 +740,7 @@ static int snd_p16v_capture_source_put(struct snd_kcontrol *kcontrol,
u32 mask;
u32 source;
- val = ucontrol->value.enumerated.item[0] ;
+ val = ucontrol->value.enumerated.item[0];
if (val > 7)
return -EINVAL;
change = (emu->p16v_capture_source != val);
@@ -784,7 +784,7 @@ static int snd_p16v_capture_channel_put(struct snd_kcontrol *kcontrol,
int change = 0;
u32 tmp;
- val = ucontrol->value.enumerated.item[0] ;
+ val = ucontrol->value.enumerated.item[0];
if (val > 3)
return -EINVAL;
change = (emu->p16v_capture_channel != val);
@@ -854,7 +854,7 @@ int __devinit snd_p16v_mixer(struct snd_emu10k1 *emu)
int __devinit snd_p16v_alloc_pm_buffer(struct snd_emu10k1 *emu)
{
emu->p16v_saved = vmalloc(NUM_CHS * 4 * 0x80);
- if (! emu->p16v_saved)
+ if (!emu->p16v_saved)
return -ENOMEM;
return 0;
}
diff --git a/sound/pci/emu10k1/p16v.h b/sound/pci/emu10k1/p16v.h
index 1532149..7964c8e 100644
--- a/sound/pci/emu10k1/p16v.h
+++ b/sound/pci/emu10k1/p16v.h
@@ -81,14 +81,14 @@
/********************************************************************************************************/
/* Audigy2 P16V pointer-offset register set, accessed through the PTR2 and DATA2 registers */
/********************************************************************************************************/
-
+
/* The sample rate of the SPDIF outputs is set by modifying a register in the EMU10K2 PTR register A_SPDIF_SAMPLERATE.
* The sample rate is also controlled by the same registers that control the rate of the EMU10K2 sample rate converters.
*/
/* Initally all registers from 0x00 to 0x3f have zero contents. */
#define PLAYBACK_LIST_ADDR 0x00 /* Base DMA address of a list of pointers to each period/size */
- /* One list entry: 4 bytes for DMA address,
+ /* One list entry: 4 bytes for DMA address,
* 4 bytes for period_size << 16.
* One list entry is 8 bytes long.
* One list entry for each period in the buffer.
@@ -167,11 +167,11 @@
* 3 - 192 khz
* 7 - undefined rate.
* [19] Channel 0. 1 - Valid, 0 - Not Valid.
- * [22:20] Channel 1 Detected sample rate.
+ * [22:20] Channel 1 Detected sample rate.
* [23] Channel 1. 1 - Valid, 0 - Not Valid.
- * [26:24] Channel 2 Detected sample rate.
+ * [26:24] Channel 2 Detected sample rate.
* [27] Channel 2. 1 - Valid, 0 - Not Valid.
- * [30:28] Channel 3 Detected sample rate.
+ * [30:28] Channel 3 Detected sample rate.
* [31] Channel 3. 1 - Valid, 0 - Not Valid.
*/
/* 0x18 - 0x1f unused */
@@ -204,7 +204,7 @@
/* 0x43,0x48 do not remember settings */
/* 0x41-45 unused */
#define WATERMARK 0x46 /* Test bit to indicate cache level usage */
- /* Values it can have while playing on channel 0.
+ /* Values it can have while playing on channel 0.
* 0000f000, 0000f004, 0000f008, 0000f00c.
* Readonly.
*/
@@ -253,7 +253,7 @@
* [23:16] The corresponding P16V channel to SRCMulti SPDIF enabled.
* [31:24] The corresponding E10K2 channel to SRCMulti SPDIF enabled.
*/
- /* Bypass P16V 0xff00ff00
+ /* Bypass P16V 0xff00ff00
* Bitmap. 0 = Off, 1 = On.
* P16V playback outputs:
* 0xXXXXXXX1 = PCM0 Left. (Front)
diff --git a/sound/pci/emu10k1/p17v.h b/sound/pci/emu10k1/p17v.h
index 4ef5f68..0a28974 100644
--- a/sound/pci/emu10k1/p17v.h
+++ b/sound/pci/emu10k1/p17v.h
@@ -27,11 +27,11 @@
/* 00 - 07: Not used */
#define P17V_PLAYBACK_FIFO_PTR 0x08 /* Current playback fifo pointer
* and number of sound samples in cache.
- */
+ */
/* 09 - 12: Not used */
#define P17V_CAPTURE_FIFO_PTR 0x13 /* Current capture fifo pointer
* and number of sound samples in cache.
- */
+ */
/* 14 - 17: Not used */
#define P17V_PB_CHN_SEL 0x18 /* P17v playback channel select */
#define P17V_SE_SLOT_SEL_L 0x19 /* Sound Engine slot select low */
@@ -58,7 +58,7 @@
#define I2C_A_ADC_LAST 0x00000400 /*I2C last transaction */
#define I2C_A_ADC_BYTE 0x00000800 /*I2C one byte mode */
-#define I2C_D_ADC_REG_MASK 0xfe000000 /*ADC address register */
+#define I2C_D_ADC_REG_MASK 0xfe000000 /*ADC address register */
#define I2C_D_ADC_DAT_MASK 0x01ff0000 /*ADC data register */
#define ADC_TIMEOUT 0x00000007 /*ADC Timeout Clock Disable */
diff --git a/sound/pci/emu10k1/voice.c b/sound/pci/emu10k1/voice.c
index d7300a1..de271d0 100644
--- a/sound/pci/emu10k1/voice.c
+++ b/sound/pci/emu10k1/voice.c
@@ -5,7 +5,7 @@
* Routines for control of EMU10K1 chips - voice manager
*
* Rewrote voice allocator for multichannel support - rlrevell 12/2004
- *
+ *
* BUGS:
* --
*
@@ -32,14 +32,14 @@
#include <sound/core.h>
#include <sound/emu10k1.h>
-/* Previously the voice allocator started at 0 every time. The new voice
- * allocator uses a round robin scheme. The next free voice is tracked in
- * the card record and each allocation begins where the last left off. The
- * hardware requires stereo interleaved voices be aligned to an even/odd
- * boundary. For multichannel voice allocation we ensure than the block of
- * voices does not cross the 32 voice boundary. This simplifies the
- * multichannel support and ensures we can use a single write to the
- * (set|clear)_loop_stop registers. Otherwise (for example) the voices would
+/* Previously the voice allocator started at 0 every time. The new voice
+ * allocator uses a round robin scheme. The next free voice is tracked in
+ * the card record and each allocation begins where the last left off. The
+ * hardware requires stereo interleaved voices be aligned to an even/odd
+ * boundary. For multichannel voice allocation we ensure than the block of
+ * voices does not cross the 32 voice boundary. This simplifies the
+ * multichannel support and ensures we can use a single write to the
+ * (set|clear)_loop_stop registers. Otherwise (for example) the voices would
* get out of sync when pausing/resuming a stream.
* --rlrevell
*/
@@ -52,8 +52,8 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
*rvoice = NULL;
first_voice = last_voice = 0;
- for (i = emu->next_free_voice, j = 0; j < NUM_G ; i += number, j += number) {
- // printk("i %d j %d next free %d!\n", i, j, emu->next_free_voice);
+ for (i = emu->next_free_voice, j = 0; j < NUM_G; i += number, j += number) {
+ /* printk("i %d j %d next free %d!\n", i, j, emu->next_free_voice); */
i %= NUM_G;
/* stereo voices must be even/odd */
@@ -61,7 +61,7 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
i++;
continue;
}
-
+
skip = 0;
for (k = 0; k < number; k++) {
voice = &emu->voices[(i+k) % NUM_G];
@@ -71,20 +71,20 @@ static int voice_alloc(struct snd_emu10k1 *emu, int type, int number,
}
}
if (!skip) {
- // printk("allocated voice %d\n", i);
+ /* printk("allocated voice %d\n", i); */
first_voice = i;
last_voice = (i + number) % NUM_G;
emu->next_free_voice = last_voice;
break;
}
}
-
+
if (first_voice == last_voice)
return -ENOMEM;
-
+
for (i = 0; i < number; i++) {
voice = &emu->voices[(first_voice + i) % NUM_G];
- // printk("voice alloc - %i, %i of %i\n", voice->number, idx-first_voice+1, number);
+ /* printk("voice alloc - %i, %i of %i\n", voice->number, idx-first_voice+1, number); */
voice->use = 1;
switch (type) {
case EMU10K1_PCM:
1
0

[alsa-devel] [PATCH 07/24] sound/pci: coding style fixes: echoaudio
by Alexander Beregalov 09 Sep '08
by Alexander Beregalov 09 Sep '08
09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/echoaudio/darla20.c | 2 +-
sound/pci/echoaudio/darla24.c | 2 +-
sound/pci/echoaudio/echo3g.c | 2 +-
sound/pci/echoaudio/echoaudio.c | 2 +-
sound/pci/echoaudio/echoaudio.h | 2 +-
sound/pci/echoaudio/echoaudio_dsp.h | 16 ++++++++--------
sound/pci/echoaudio/gina20.c | 2 +-
sound/pci/echoaudio/gina24.c | 2 +-
sound/pci/echoaudio/indigo.c | 2 +-
sound/pci/echoaudio/indigodj.c | 2 +-
sound/pci/echoaudio/indigoio.c | 2 +-
sound/pci/echoaudio/layla20.c | 2 +-
sound/pci/echoaudio/layla24.c | 2 +-
sound/pci/echoaudio/layla24_dsp.c | 4 ++--
sound/pci/echoaudio/mia.c | 2 +-
sound/pci/echoaudio/midi.c | 2 +-
sound/pci/echoaudio/mona.c | 2 +-
sound/pci/echoaudio/mona_dsp.c | 2 +-
18 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/sound/pci/echoaudio/darla20.c b/sound/pci/echoaudio/darla20.c
index 8c6db3a..c9a128a 100644
--- a/sound/pci/echoaudio/darla20.c
+++ b/sound/pci/echoaudio/darla20.c
@@ -51,7 +51,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/darla24.c b/sound/pci/echoaudio/darla24.c
index 04cbf3e..3771d02 100644
--- a/sound/pci/echoaudio/darla24.c
+++ b/sound/pci/echoaudio/darla24.c
@@ -55,7 +55,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/echo3g.c b/sound/pci/echoaudio/echo3g.c
index 4022e43..eb9bf6e 100644
--- a/sound/pci/echoaudio/echo3g.c
+++ b/sound/pci/echoaudio/echo3g.c
@@ -63,7 +63,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 8dbc5c4..3004a58 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1098,7 +1098,7 @@ static struct snd_kcontrol_new snd_echo_line_input_gain __devinitdata = {
#ifdef ECHOCARD_HAS_OUTPUT_NOMINAL_LEVEL
/************ Analog output nominal level (+4dBu / -10dBV) ***************/
-static int snd_echo_output_nominal_info (struct snd_kcontrol *kcontrol,
+static int snd_echo_output_nominal_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
struct echoaudio *chip;
diff --git a/sound/pci/echoaudio/echoaudio.h b/sound/pci/echoaudio/echoaudio.h
index 1c88e05..674ebf4 100644
--- a/sound/pci/echoaudio/echoaudio.h
+++ b/sound/pci/echoaudio/echoaudio.h
@@ -218,7 +218,7 @@
/****************************************************************************
-
+
Clocks
*****************************************************************************/
diff --git a/sound/pci/echoaudio/echoaudio_dsp.h b/sound/pci/echoaudio/echoaudio_dsp.h
index e352f3a..09ddbd3 100644
--- a/sound/pci/echoaudio/echoaudio_dsp.h
+++ b/sound/pci/echoaudio/echoaudio_dsp.h
@@ -103,7 +103,7 @@
#define CHI32_STATUS_IRQ 0x00000040
-/*
+/*
*
* DSP commands sent via slave mode; these are sent to the DSP by write_dsp()
*
@@ -369,7 +369,7 @@ SET_LAYLA24_FREQUENCY_REG command.
* via input and output pipes. LE means little-endian,
* BE means big-endian.
*
- * DSP_AUDIOFORM_MS_8
+ * DSP_AUDIOFORM_MS_8
*
* 8-bit mono unsigned samples. For playback,
* mono data is duplicated out the left and right channels
@@ -388,10 +388,10 @@ SET_LAYLA24_FREQUENCY_REG command.
* they would be stored in memory like this: 33 22 11 66 55 44.
*
* DSP_AUDIOFORM_MS_32LE
- *
- * 24-bit signed little-endian mono samples in a 32-bit
- * container. In other words, each sample is a 32-bit signed
- * integer, where the actual audio data is left-justified
+ *
+ * 24-bit signed little-endian mono samples in a 32-bit
+ * container. In other words, each sample is a 32-bit signed
+ * integer, where the actual audio data is left-justified
* in the 32 bits and only the 24 most significant bits are valid.
*
* DSP_AUDIOFORM_SS_8
@@ -435,8 +435,8 @@ SET_LAYLA24_FREQUENCY_REG command.
* Super-interleave is defined as interleaving by 4 or more. Darla20 and Gina20
* do not support super interleave.
*
- * 16 bit, 24 bit, and 32 bit little endian samples are supported for super
- * interleave. The interleave factor must be even. 16 - way interleave is the
+ * 16 bit, 24 bit, and 32 bit little endian samples are supported for super
+ * interleave. The interleave factor must be even. 16 - way interleave is the
* current maximum, so you can interleave by 4, 6, 8, 10, 12, 14, and 16.
*
* The actual format code is derived by taking the define below and or-ing with
diff --git a/sound/pci/echoaudio/gina20.c b/sound/pci/echoaudio/gina20.c
index c0e64b8..fa70fb1 100644
--- a/sound/pci/echoaudio/gina20.c
+++ b/sound/pci/echoaudio/gina20.c
@@ -55,7 +55,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/gina24.c b/sound/pci/echoaudio/gina24.c
index c36a78d..a33cc5a 100644
--- a/sound/pci/echoaudio/gina24.c
+++ b/sound/pci/echoaudio/gina24.c
@@ -61,7 +61,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/indigo.c b/sound/pci/echoaudio/indigo.c
index 0a58a7c..9097281 100644
--- a/sound/pci/echoaudio/indigo.c
+++ b/sound/pci/echoaudio/indigo.c
@@ -53,7 +53,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/indigodj.c b/sound/pci/echoaudio/indigodj.c
index 2db24d2..b3ff9a2 100644
--- a/sound/pci/echoaudio/indigodj.c
+++ b/sound/pci/echoaudio/indigodj.c
@@ -53,7 +53,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/indigoio.c b/sound/pci/echoaudio/indigoio.c
index a60c0a0..bd0c403 100644
--- a/sound/pci/echoaudio/indigoio.c
+++ b/sound/pci/echoaudio/indigoio.c
@@ -54,7 +54,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/layla20.c b/sound/pci/echoaudio/layla20.c
index 5061946..4a32154 100644
--- a/sound/pci/echoaudio/layla20.c
+++ b/sound/pci/echoaudio/layla20.c
@@ -61,7 +61,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/layla24.c b/sound/pci/echoaudio/layla24.c
index e09e3ea..a9b0ec0 100644
--- a/sound/pci/echoaudio/layla24.c
+++ b/sound/pci/echoaudio/layla24.c
@@ -63,7 +63,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/layla24_dsp.c b/sound/pci/echoaudio/layla24_dsp.c
index d61b5cb..03a3b38 100644
--- a/sound/pci/echoaudio/layla24_dsp.c
+++ b/sound/pci/echoaudio/layla24_dsp.c
@@ -149,7 +149,7 @@ static int load_asic(struct echoaudio *chip)
if (!err)
err = write_control_reg(chip, GML_CONVERTER_ENABLE | GML_48KHZ,
TRUE);
-
+
DE_INIT(("load_asic() done\n"));
return err;
}
@@ -307,7 +307,7 @@ static int switch_asic(struct echoaudio *chip, const struct firmware *asic)
if (asic != chip->asic_code) {
monitors = kmemdup(chip->comm_page->monitors,
MONITOR_ARRAY_SIZE, GFP_KERNEL);
- if (! monitors)
+ if (!monitors)
return -ENOMEM;
memset(chip->comm_page->monitors, ECHOGAIN_MUTED,
diff --git a/sound/pci/echoaudio/mia.c b/sound/pci/echoaudio/mia.c
index f3b9b45..021b926 100644
--- a/sound/pci/echoaudio/mia.c
+++ b/sound/pci/echoaudio/mia.c
@@ -61,7 +61,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
#include <sound/rawmidi.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/midi.c b/sound/pci/echoaudio/midi.c
index 77bf2a8..837d239 100644
--- a/sound/pci/echoaudio/midi.c
+++ b/sound/pci/echoaudio/midi.c
@@ -66,7 +66,7 @@ static int write_midi(struct echoaudio *chip, u8 *data, int bytes)
return -EIO;
/* HF4 indicates that it is safe to write MIDI output data */
- if (! (get_dsp_register(chip, CHI32_STATUS_REG) & CHI32_STATUS_REG_HF4))
+ if (!(get_dsp_register(chip, CHI32_STATUS_REG) & CHI32_STATUS_REG_HF4))
return 0;
chip->comm_page->midi_output[0] = bytes;
diff --git a/sound/pci/echoaudio/mona.c b/sound/pci/echoaudio/mona.c
index b05bad9..ead9ed4 100644
--- a/sound/pci/echoaudio/mona.c
+++ b/sound/pci/echoaudio/mona.c
@@ -59,7 +59,7 @@
#include <sound/pcm_params.h>
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/atomic.h>
#include "echoaudio.h"
diff --git a/sound/pci/echoaudio/mona_dsp.c b/sound/pci/echoaudio/mona_dsp.c
index eaa619b..dc99bc0 100644
--- a/sound/pci/echoaudio/mona_dsp.c
+++ b/sound/pci/echoaudio/mona_dsp.c
@@ -114,7 +114,7 @@ static u32 detect_input_clocks(const struct echoaudio *chip)
-/* Mona has an ASIC on the PCI card and another ASIC in the external box;
+/* Mona has an ASIC on the PCI card and another ASIC in the external box;
both need to be loaded. */
static int load_asic(struct echoaudio *chip)
{
1
0