Alsa-devel
Threads by month
- ----- 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
September 2008
- 101 participants
- 247 discussions
[alsa-devel] [PATCH 20/24] sound/pci: coding style fixes: sonicvibes
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/sonicvibes.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index cd408b8..e6ed3a2 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -39,7 +39,7 @@
#include <sound/opl3.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
MODULE_AUTHOR("Jaroslav Kysela <perex(a)perex.cz>");
MODULE_DESCRIPTION("S3 SonicVibes PCI");
@@ -523,7 +523,7 @@ static int snd_sonicvibes_hw_constraint_dac_rate(struct snd_pcm_hw_params *param
{
unsigned int rate, div, r, m, n;
- if (hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->min ==
+ if (hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->min ==
hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->max) {
rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE)->min;
div = 48000 / rate;
@@ -895,7 +895,7 @@ static int snd_sonicvibes_info_mux(struct snd_kcontrol *kcontrol, struct snd_ctl
static int snd_sonicvibes_get_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&sonic->reg_lock);
ucontrol->value.enumerated.item[0] = ((snd_sonicvibes_in1(sonic, SV_IREG_LEFT_ADC) & SV_RECSRC_OUT) >> 5) - 1;
ucontrol->value.enumerated.item[1] = ((snd_sonicvibes_in1(sonic, SV_IREG_RIGHT_ADC) & SV_RECSRC_OUT) >> 5) - 1;
@@ -908,7 +908,7 @@ static int snd_sonicvibes_put_mux(struct snd_kcontrol *kcontrol, struct snd_ctl_
struct sonicvibes *sonic = snd_kcontrol_chip(kcontrol);
unsigned short left, right, oval1, oval2;
int change;
-
+
if (ucontrol->value.enumerated.item[0] >= 7 ||
ucontrol->value.enumerated.item[1] >= 7)
return -EINVAL;
@@ -950,7 +950,7 @@ static int snd_sonicvibes_get_single(struct snd_kcontrol *kcontrol, struct snd_c
int shift = (kcontrol->private_value >> 8) & 0xff;
int mask = (kcontrol->private_value >> 16) & 0xff;
int invert = (kcontrol->private_value >> 24) & 0xff;
-
+
spin_lock_irq(&sonic->reg_lock);
ucontrol->value.integer.value[0] = (snd_sonicvibes_in1(sonic, reg)>> shift) & mask;
spin_unlock_irq(&sonic->reg_lock);
@@ -968,7 +968,7 @@ static int snd_sonicvibes_put_single(struct snd_kcontrol *kcontrol, struct snd_c
int invert = (kcontrol->private_value >> 24) & 0xff;
int change;
unsigned short val, oval;
-
+
val = (ucontrol->value.integer.value[0] & mask);
if (invert)
val = mask - val;
@@ -1008,7 +1008,7 @@ static int snd_sonicvibes_get_double(struct snd_kcontrol *kcontrol, struct snd_c
int shift_right = (kcontrol->private_value >> 19) & 0x07;
int mask = (kcontrol->private_value >> 24) & 0xff;
int invert = (kcontrol->private_value >> 22) & 1;
-
+
spin_lock_irq(&sonic->reg_lock);
ucontrol->value.integer.value[0] = (snd_sonicvibes_in1(sonic, left_reg) >> shift_left) & mask;
ucontrol->value.integer.value[1] = (snd_sonicvibes_in1(sonic, right_reg) >> shift_right) & mask;
@@ -1031,7 +1031,7 @@ static int snd_sonicvibes_put_double(struct snd_kcontrol *kcontrol, struct snd_c
int invert = (kcontrol->private_value >> 22) & 1;
int change;
unsigned short val1, val2, oval1, oval2;
-
+
val1 = ucontrol->value.integer.value[0] & mask;
val2 = ucontrol->value.integer.value[1] & mask;
if (invert) {
@@ -1110,7 +1110,7 @@ static int __devinit snd_sonicvibes_mixer(struct sonicvibes * sonic)
*/
-static void snd_sonicvibes_proc_read(struct snd_info_entry *entry,
+static void snd_sonicvibes_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct sonicvibes *sonic = entry->private_data;
@@ -1144,7 +1144,7 @@ static void __devinit snd_sonicvibes_proc_init(struct sonicvibes * sonic)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(sonic->card, "sonicvibes", &entry))
+ if (!snd_card_proc_new(sonic->card, "sonicvibes", &entry))
snd_info_set_text_ops(entry, sonic, snd_sonicvibes_proc_read);
}
@@ -1422,7 +1422,7 @@ static int __devinit snd_sonic_probe(struct pci_dev *pci,
dev++;
return -ENOENT;
}
-
+
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
@@ -1482,7 +1482,7 @@ static int __devinit snd_sonic_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
pci_set_drvdata(pci, card);
dev++;
return 0;
1
0
[alsa-devel] [PATCH 19/24] sound/pci: coding style fixes: sound/pci/r*
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/riptide/riptide.c | 22 +++---
sound/pci/rme32.c | 128 +++++++++++++-------------
sound/pci/rme96.c | 210 +++++++++++++++++++++---------------------
3 files changed, 180 insertions(+), 180 deletions(-)
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index e9f0706..04b21de 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -21,29 +21,29 @@
/*
History:
- 02/15/2004 first release
-
+
This Driver is based on the OSS Driver version from Linuxant (riptide-0.6lnxtbeta03111100)
credits from the original files:
-
- MODULE NAME: cnxt_rt.h
+
+ MODULE NAME: cnxt_rt.h
AUTHOR: K. Lazarev (Transcribed by KNL)
HISTORY: Major Revision Date By
----------------------------- -------- -----
Created 02/1/2000 KNL
- MODULE NAME: int_mdl.c
+ MODULE NAME: int_mdl.c
AUTHOR: Konstantin Lazarev (Transcribed by KNL)
HISTORY: Major Revision Date By
----------------------------- -------- -----
Created 10/01/99 KNL
-
- MODULE NAME: riptide.h
+
+ MODULE NAME: riptide.h
AUTHOR: O. Druzhinin (Transcribed by OLD)
HISTORY: Major Revision Date By
----------------------------- -------- -----
Created 10/16/97 OLD
- MODULE NAME: Rp_Cmdif.cpp
+ MODULE NAME: Rp_Cmdif.cpp
AUTHOR: O. Druzhinin (Transcribed by OLD)
K. Lazarev (Transcribed by KNL)
HISTORY: Major Revision Date By
@@ -51,7 +51,7 @@
Adopted from NT4 driver 6/22/99 OLD
Ported to Linux 9/01/99 KNL
- MODULE NAME: rt_hw.c
+ MODULE NAME: rt_hw.c
AUTHOR: O. Druzhinin (Transcribed by OLD)
C. Lazarev (Transcribed by CNL)
HISTORY: Major Revision Date By
@@ -73,13 +73,13 @@
----------------------------- -------- -----
Created 11/18/97 CNL
- MODULE NAME: rt_mdl.c
+ MODULE NAME: rt_mdl.c
AUTHOR: Konstantin Lazarev (Transcribed by KNL)
HISTORY: Major Revision Date By
----------------------------- -------- -----
Created 10/01/99 KNL
- MODULE NAME: mixer.h
+ MODULE NAME: mixer.h
AUTHOR: K. Kenney
HISTORY: Major Revision Date By
----------------------------- -------- -----
@@ -97,7 +97,7 @@
#include <linux/gameport.h>
#include <linux/device.h>
#include <linux/firmware.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/info.h>
#include <sound/control.h>
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c
index e7ef3a1..21ec1e2 100644
--- a/sound/pci/rme32.c
+++ b/sound/pci/rme32.c
@@ -6,7 +6,7 @@
*
* Thanks to : Anders Torger <torger(a)ludd.luth.se>,
* Henk Hesselink <henk(a)anda.nl>
- * for writing the digi96-driver
+ * for writing the digi96-driver
* and RME for all informations.
*
* This program is free software; you can redistribute it and/or modify
@@ -22,36 +22,36 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *
+ *
+ *
* ****************************************************************************
- *
+ *
* Note #1 "Sek'd models" ................................... martin 2002-12-07
- *
+ *
* Identical soundcards by Sek'd were labeled:
* RME Digi 32 = Sek'd Prodif 32
* RME Digi 32 Pro = Sek'd Prodif 96
* RME Digi 32/8 = Sek'd Prodif Gold
- *
+ *
* ****************************************************************************
- *
+ *
* Note #2 "full duplex mode" ............................... martin 2002-12-07
- *
+ *
* Full duplex doesn't work. All cards (32, 32/8, 32Pro) are working identical
* in this mode. Rec data and play data are using the same buffer therefore. At
* first you have got the playing bits in the buffer and then (after playing
- * them) they were overwitten by the captured sound of the CS8412/14. Both
+ * them) they were overwitten by the captured sound of the CS8412/14. Both
* modes (play/record) are running harmonically hand in hand in the same buffer
- * and you have only one start bit plus one interrupt bit to control this
+ * and you have only one start bit plus one interrupt bit to control this
* paired action.
* This is opposite to the latter rme96 where playing and capturing is totally
- * separated and so their full duplex mode is supported by alsa (using two
- * start bits and two interrupts for two different buffers).
+ * separated and so their full duplex mode is supported by alsa (using two
+ * start bits and two interrupts for two different buffers).
* But due to the wrong sequence of playing and capturing ALSA shows no solved
* full duplex support for the rme32 at the moment. That's bad, but I'm not
* able to solve it. Are you motivated enough to solve this problem now? Your
* patch would be welcome!
- *
+ *
* ****************************************************************************
*
* "The story after the long seeking" -- tiwai
@@ -85,12 +85,12 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */
-static int fullduplex[SNDRV_CARDS]; // = {[0 ... (SNDRV_CARDS - 1)] = 1};
+static int fullduplex[SNDRV_CARDS]; /* = {[0 ... (SNDRV_CARDS - 1)] = 1}; */
module_param_array(index, int, NULL, 0444);
MODULE_PARM_DESC(index, "Index value for RME Digi32 soundcard.");
@@ -126,10 +126,10 @@ MODULE_SUPPORTED_DEVICE("{{RME,Digi32}," "{RME,Digi32/8}," "{RME,Digi32 PRO}}");
#define RME32_WCR_MONO (1 << 1) /* 0=stereo, 1=mono
Setting the whole card to mono
doesn't seem to be very useful.
- A software-solution can handle
+ A software-solution can handle
full-duplex with one direction in
- stereo and the other way in mono.
- So, the hardware should work all
+ stereo and the other way in mono.
+ So, the hardware should work all
the time in stereo! */
#define RME32_WCR_MODE24 (1 << 2) /* 0=16bit, 1=32bit */
#define RME32_WCR_SEL (1 << 3) /* 0=input on output, 1=normal playback/capture */
@@ -304,13 +304,13 @@ static int snd_rme32_capture_copy(struct snd_pcm_substream *substream, int chann
static struct snd_pcm_hardware snd_rme32_spdif_info = {
.info = (SNDRV_PCM_INFO_MMAP_IOMEM |
SNDRV_PCM_INFO_MMAP_VALID |
- SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
- .formats = (SNDRV_PCM_FMTBIT_S16_LE |
+ .formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 32000,
.rate_max = 48000,
@@ -335,7 +335,7 @@ static struct snd_pcm_hardware snd_rme32_adat_info =
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
.formats= SNDRV_PCM_FMTBIT_S16_LE,
- .rates = (SNDRV_PCM_RATE_44100 |
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 44100,
.rate_max = 48000,
@@ -355,13 +355,13 @@ static struct snd_pcm_hardware snd_rme32_adat_info =
static struct snd_pcm_hardware snd_rme32_spdif_fd_info = {
.info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_MMAP_VALID |
- SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
- .formats = (SNDRV_PCM_FMTBIT_S16_LE |
+ .formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 32000,
.rate_max = 48000,
@@ -386,7 +386,7 @@ static struct snd_pcm_hardware snd_rme32_adat_fd_info =
SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
.formats= SNDRV_PCM_FMTBIT_S16_LE,
- .rates = (SNDRV_PCM_RATE_44100 |
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 44100,
.rate_max = 48000,
@@ -434,7 +434,7 @@ static int snd_rme32_capture_getrate(struct rme32 * rme32, int *is_adat)
int n;
*is_adat = 0;
- if (rme32->rcreg & RME32_RCR_LOCK) {
+ if (rme32->rcreg & RME32_RCR_LOCK) {
/* ADAT rate */
*is_adat = 1;
}
@@ -466,7 +466,7 @@ static int snd_rme32_capture_getrate(struct rme32 * rme32, int *is_adat)
default:
return -1;
break;
- }
+ }
else
switch (n) { /* supporting the CS8412 */
case 0:
@@ -499,38 +499,38 @@ static int snd_rme32_playback_setrate(struct rme32 * rme32, int rate)
switch (rate) {
case 32000:
rme32->wcreg &= ~RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
~RME32_WCR_FREQ_1;
break;
case 44100:
rme32->wcreg &= ~RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
~RME32_WCR_FREQ_0;
break;
case 48000:
rme32->wcreg &= ~RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
RME32_WCR_FREQ_1;
break;
case 64000:
if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO)
return -EINVAL;
rme32->wcreg |= RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
~RME32_WCR_FREQ_1;
break;
case 88200:
if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO)
return -EINVAL;
rme32->wcreg |= RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) &
~RME32_WCR_FREQ_0;
break;
case 96000:
if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO)
return -EINVAL;
rme32->wcreg |= RME32_WCR_DS_BM;
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
RME32_WCR_FREQ_1;
break;
default:
@@ -552,22 +552,22 @@ static int snd_rme32_setclockmode(struct rme32 * rme32, int mode)
switch (mode) {
case RME32_CLOCKMODE_SLAVE:
/* AutoSync */
- rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) &
+ rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) &
~RME32_WCR_FREQ_1;
break;
case RME32_CLOCKMODE_MASTER_32:
/* Internal 32.0kHz */
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) &
~RME32_WCR_FREQ_1;
break;
case RME32_CLOCKMODE_MASTER_44:
/* Internal 44.1kHz */
- rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) |
+ rme32->wcreg = (rme32->wcreg & ~RME32_WCR_FREQ_0) |
RME32_WCR_FREQ_1;
break;
case RME32_CLOCKMODE_MASTER_48:
/* Internal 48.0kHz */
- rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) |
RME32_WCR_FREQ_1;
break;
default:
@@ -587,19 +587,19 @@ static int snd_rme32_setinputtype(struct rme32 * rme32, int type)
{
switch (type) {
case RME32_INPUT_OPTICAL:
- rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) &
+ rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) &
~RME32_WCR_INP_1;
break;
case RME32_INPUT_COAXIAL:
- rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) &
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) &
~RME32_WCR_INP_1;
break;
case RME32_INPUT_INTERNAL:
- rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) |
+ rme32->wcreg = (rme32->wcreg & ~RME32_WCR_INP_0) |
RME32_WCR_INP_1;
break;
case RME32_INPUT_XLR:
- rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) |
+ rme32->wcreg = (rme32->wcreg | RME32_WCR_INP_0) |
RME32_WCR_INP_1;
break;
default:
@@ -741,7 +741,7 @@ snd_rme32_capture_hw_params(struct snd_pcm_substream *substream,
if ((rate = snd_rme32_capture_getrate(rme32, &isadat)) > 0) {
if ((int)params_rate(params) != rate) {
spin_unlock_irq(&rme32->lock);
- return -EIO;
+ return -EIO;
}
if ((isadat && runtime->hw.channels_min == 2) ||
(!isadat && runtime->hw.channels_min == 8)) {
@@ -771,7 +771,7 @@ snd_rme32_capture_hw_params(struct snd_pcm_substream *substream,
static int snd_rme32_pcm_hw_free(struct snd_pcm_substream *substream)
{
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
- if (! rme32->fullduplex_mode)
+ if (!rme32->fullduplex_mode)
return 0;
return snd_pcm_lib_free_pages(substream);
}
@@ -800,7 +800,7 @@ static void snd_rme32_pcm_stop(struct rme32 * rme32, int to_pause)
if (rme32->wcreg & RME32_WCR_SEL)
rme32->wcreg |= RME32_WCR_MUTE;
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
- if (! to_pause)
+ if (!to_pause)
writel(0, rme32->iobase + RME32_IO_RESET_POS);
}
@@ -834,7 +834,7 @@ static struct snd_pcm_hw_constraint_list hw_constraints_period_bytes = {
static void snd_rme32_set_buffer_constraint(struct rme32 *rme32, struct snd_pcm_runtime *runtime)
{
- if (! rme32->fullduplex_mode) {
+ if (!rme32->fullduplex_mode) {
snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_BUFFER_BYTES,
RME32_BUFFER_SIZE, RME32_BUFFER_SIZE);
@@ -876,7 +876,7 @@ static int snd_rme32_playback_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
- }
+ }
snd_rme32_set_buffer_constraint(rme32, runtime);
@@ -931,10 +931,10 @@ snd_rme32_playback_adat_open(struct snd_pcm_substream *substream)
int rate, dummy;
struct rme32 *rme32 = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
-
+
snd_pcm_set_sync(substream);
- spin_lock_irq(&rme32->lock);
+ spin_lock_irq(&rme32->lock);
if (rme32->playback_substream != NULL) {
spin_unlock_irq(&rme32->lock);
return -EBUSY;
@@ -943,7 +943,7 @@ snd_rme32_playback_adat_open(struct snd_pcm_substream *substream)
writel(rme32->wcreg, rme32->iobase + RME32_IO_CONTROL_REGISTER);
rme32->playback_substream = substream;
spin_unlock_irq(&rme32->lock);
-
+
if (rme32->fullduplex_mode)
runtime->hw = snd_rme32_adat_fd_info;
else
@@ -954,7 +954,7 @@ snd_rme32_playback_adat_open(struct snd_pcm_substream *substream)
runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
- }
+ }
snd_rme32_set_buffer_constraint(rme32, runtime);
return 0;
@@ -981,8 +981,8 @@ snd_rme32_capture_adat_open(struct snd_pcm_substream *substream)
}
snd_pcm_set_sync(substream);
-
- spin_lock_irq(&rme32->lock);
+
+ spin_lock_irq(&rme32->lock);
if (rme32->capture_substream != NULL) {
spin_unlock_irq(&rme32->lock);
return -EBUSY;
@@ -1091,7 +1091,7 @@ snd_rme32_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
}
snd_pcm_trigger_done(s, substream);
}
-
+
/* prefill playback buffer */
if (cmd == SNDRV_PCM_TRIGGER_START && rme32->fullduplex_mode) {
snd_pcm_group_for_each_entry(s, substream) {
@@ -1108,7 +1108,7 @@ snd_rme32_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
snd_rme32_pcm_start(rme32, 0);
break;
case SNDRV_PCM_TRIGGER_STOP:
- if (! rme32->running && RME32_ISWORKING(rme32))
+ if (!rme32->running && RME32_ISWORKING(rme32))
snd_rme32_pcm_stop(rme32, 0);
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
@@ -1402,23 +1402,23 @@ static int __devinit snd_rme32_create(struct rme32 * rme32)
1, 1, &rme32->adat_pcm)) < 0)
{
return err;
- }
+ }
rme32->adat_pcm->private_data = rme32;
rme32->adat_pcm->private_free = snd_rme32_free_adat_pcm;
strcpy(rme32->adat_pcm->name, "Digi32 ADAT");
if (rme32->fullduplex_mode) {
- snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
+ snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
&snd_rme32_playback_adat_fd_ops);
- snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
+ snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
&snd_rme32_capture_adat_fd_ops);
snd_pcm_lib_preallocate_pages_for_all(rme32->adat_pcm, SNDRV_DMA_TYPE_CONTINUOUS,
snd_dma_continuous_data(GFP_KERNEL),
0, RME32_MID_BUFFER_SIZE);
rme32->adat_pcm->info_flags = SNDRV_PCM_INFO_JOINT_DUPLEX;
} else {
- snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
+ snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK,
&snd_rme32_playback_adat_ops);
- snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
+ snd_pcm_set_ops(rme32->adat_pcm, SNDRV_PCM_STREAM_CAPTURE,
&snd_rme32_capture_adat_ops);
rme32->adat_pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
}
@@ -1561,7 +1561,7 @@ static void __devinit snd_rme32_proc_init(struct rme32 * rme32)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(rme32->card, "rme32", &entry))
+ if (!snd_card_proc_new(rme32->card, "rme32", &entry))
snd_info_set_text_ops(entry, rme32, snd_rme32_proc_read);
}
@@ -1697,9 +1697,9 @@ static int
snd_rme32_info_clockmode_control(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
- static char *texts[4] = { "AutoSync",
- "Internal 32.0kHz",
- "Internal 44.1kHz",
+ static char *texts[4] = { "AutoSync",
+ "Internal 32.0kHz",
+ "Internal 44.1kHz",
"Internal 48.0kHz" };
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c
index 3fdd488..fb8767e 100644
--- a/sound/pci/rme96.c
+++ b/sound/pci/rme96.c
@@ -1,9 +1,9 @@
/*
* ALSA driver for RME Digi96, Digi96/8 and Digi96/8 PRO/PAD/PST audio
- * interfaces
+ * interfaces
*
* Copyright (c) 2000, 2001 Anders Torger <torger(a)ludd.luth.se>
- *
+ *
* Thanks to Henk Hesselink <henk(a)anda.nl> for the analog volume control
* code.
*
@@ -21,7 +21,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/delay.h>
#include <linux/init.h>
@@ -38,7 +38,7 @@
#include <sound/asoundef.h>
#include <sound/initval.h>
-#include <asm/io.h>
+#include <linux/io.h>
/* note, two last pcis should be equal, it is not a bug */
@@ -205,7 +205,7 @@ struct rme96 {
int irq;
unsigned long port;
void __iomem *iobase;
-
+
u32 wcreg; /* cached write control register value */
u32 wcreg_spdif; /* S/PDIF setup */
u32 wcreg_spdif_stream; /* S/PDIF setup (temporary) */
@@ -220,13 +220,13 @@ struct rme96 {
int playback_frlog; /* log2 of framesize */
int capture_frlog;
-
+
size_t playback_periodsize; /* in bytes, zero if not used */
size_t capture_periodsize; /* in bytes, zero if not used */
struct snd_card *card;
struct snd_pcm *spdif_pcm;
- struct snd_pcm *adat_pcm;
+ struct snd_pcm *adat_pcm;
struct pci_dev *pci;
struct snd_kcontrol *spdif_ctl;
};
@@ -239,7 +239,7 @@ static struct pci_device_id snd_rme96_ids[] = {
{ PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PRO,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
{ PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST,
- PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, },
{ 0, }
};
@@ -262,11 +262,11 @@ static int
snd_rme96_capture_prepare(struct snd_pcm_substream *substream);
static int
-snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
+snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
int cmd);
static int
-snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
+snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
int cmd);
static snd_pcm_uframes_t
@@ -275,7 +275,7 @@ snd_rme96_playback_pointer(struct snd_pcm_substream *substream);
static snd_pcm_uframes_t
snd_rme96_capture_pointer(struct snd_pcm_substream *substream);
-static void __devinit
+static void __devinit
snd_rme96_proc_init(struct rme96 *rme96);
static int
@@ -355,10 +355,10 @@ static struct snd_pcm_hardware snd_rme96_playback_spdif_info =
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
SNDRV_PCM_RATE_64000 |
- SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
@@ -384,10 +384,10 @@ static struct snd_pcm_hardware snd_rme96_capture_spdif_info =
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
SNDRV_PCM_RATE_64000 |
- SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
@@ -412,7 +412,7 @@ static struct snd_pcm_hardware snd_rme96_playback_adat_info =
SNDRV_PCM_INFO_PAUSE),
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
- .rates = (SNDRV_PCM_RATE_44100 |
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 44100,
.rate_max = 48000,
@@ -437,7 +437,7 @@ static struct snd_pcm_hardware snd_rme96_capture_adat_info =
SNDRV_PCM_INFO_PAUSE),
.formats = (SNDRV_PCM_FMTBIT_S16_LE |
SNDRV_PCM_FMTBIT_S32_LE),
- .rates = (SNDRV_PCM_RATE_44100 |
+ .rates = (SNDRV_PCM_RATE_44100 |
SNDRV_PCM_RATE_48000),
.rate_min = 44100,
.rate_max = 48000,
@@ -573,7 +573,7 @@ snd_rme96_setattenuation(struct rme96 *rme96,
static int
snd_rme96_capture_getrate(struct rme96 *rme96,
int *is_adat)
-{
+{
int n, rate;
*is_adat = 0;
@@ -610,14 +610,14 @@ snd_rme96_capture_getrate(struct rme96 *rme96,
if (rme96->rcreg & RME96_RCR_VERF) {
return -1;
}
-
+
/* S/PDIF rate */
n = ((rme96->rcreg >> RME96_RCR_BITPOS_F0) & 1) +
(((rme96->rcreg >> RME96_RCR_BITPOS_F1) & 1) << 1) +
(((rme96->rcreg >> RME96_RCR_BITPOS_F2) & 1) << 2);
-
+
switch (n) {
- case 0:
+ case 0:
if (rme96->rcreg & RME96_RCR_T_OUT) {
return 64000;
}
@@ -763,7 +763,7 @@ snd_rme96_setclockmode(struct rme96 *rme96,
{
switch (mode) {
case RME96_CLOCKMODE_SLAVE:
- /* AutoSync */
+ /* AutoSync */
rme96->wcreg &= ~RME96_WCR_MASTER;
rme96->areg &= ~RME96_AR_WSEL;
break;
@@ -774,7 +774,7 @@ snd_rme96_setclockmode(struct rme96 *rme96,
break;
case RME96_CLOCKMODE_WORDCLOCK:
/* Word clock is a master mode */
- rme96->wcreg |= RME96_WCR_MASTER;
+ rme96->wcreg |= RME96_WCR_MASTER;
rme96->areg |= RME96_AR_WSEL;
break;
default:
@@ -872,7 +872,7 @@ snd_rme96_setframelog(struct rme96 *rme96,
int is_playback)
{
int frlog;
-
+
if (n_channels == 2) {
frlog = 1;
} else {
@@ -964,7 +964,7 @@ snd_rme96_playback_hw_params(struct snd_pcm_substream *substream,
/* slave clock */
if ((int)params_rate(params) != rate) {
spin_unlock_irq(&rme96->lock);
- return -EIO;
+ return -EIO;
}
} else if ((err = snd_rme96_playback_setrate(rme96, params_rate(params))) < 0) {
spin_unlock_irq(&rme96->lock);
@@ -992,7 +992,7 @@ snd_rme96_playback_hw_params(struct snd_pcm_substream *substream,
writel(rme96->wcreg |= rme96->wcreg_spdif_stream, rme96->iobase + RME96_IO_CONTROL_REGISTER);
}
spin_unlock_irq(&rme96->lock);
-
+
return 0;
}
@@ -1003,7 +1003,7 @@ snd_rme96_capture_hw_params(struct snd_pcm_substream *substream,
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int err, isadat, rate;
-
+
runtime->dma_area = (void __force *)(rme96->iobase +
RME96_IO_REC_BUFFER);
runtime->dma_addr = rme96->port + RME96_IO_REC_BUFFER;
@@ -1024,7 +1024,7 @@ snd_rme96_capture_hw_params(struct snd_pcm_substream *substream,
} else if ((rate = snd_rme96_capture_getrate(rme96, &isadat)) > 0) {
if ((int)params_rate(params) != rate) {
spin_unlock_irq(&rme96->lock);
- return -EIO;
+ return -EIO;
}
if ((isadat && runtime->hw.channels_min == 2) ||
(!isadat && runtime->hw.channels_min == 8))
@@ -1084,7 +1084,7 @@ snd_rme96_playback_stop(struct rme96 *rme96)
rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
if (rme96->rcreg & RME96_RCR_IRQ) {
writel(0, rme96->iobase + RME96_IO_CONFIRM_PLAY_IRQ);
- }
+ }
rme96->wcreg &= ~RME96_WCR_START;
writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
}
@@ -1095,7 +1095,7 @@ snd_rme96_capture_stop(struct rme96 *rme96)
rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
if (rme96->rcreg & RME96_RCR_IRQ_2) {
writel(0, rme96->iobase + RME96_IO_CONFIRM_REC_IRQ);
- }
+ }
rme96->wcreg &= ~RME96_WCR_START_2;
writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
}
@@ -1113,7 +1113,7 @@ snd_rme96_interrupt(int irq,
{
return IRQ_NONE;
}
-
+
if (rme96->rcreg & RME96_RCR_IRQ) {
/* playback */
snd_pcm_period_elapsed(rme96->playback_substream);
@@ -1121,7 +1121,7 @@ snd_rme96_interrupt(int irq,
}
if (rme96->rcreg & RME96_RCR_IRQ_2) {
/* capture */
- snd_pcm_period_elapsed(rme96->capture_substream);
+ snd_pcm_period_elapsed(rme96->capture_substream);
writel(0, rme96->iobase + RME96_IO_CONFIRM_REC_IRQ);
}
return IRQ_HANDLED;
@@ -1161,7 +1161,7 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
- spin_lock_irq(&rme96->lock);
+ spin_lock_irq(&rme96->lock);
if (rme96->playback_substream != NULL) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
@@ -1180,7 +1180,7 @@ snd_rme96_playback_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
- }
+ }
rme96_set_buffer_size_constraint(rme96, runtime);
rme96->wcreg_spdif_stream = rme96->wcreg_spdif;
@@ -1208,7 +1208,7 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
}
-
+
spin_lock_irq(&rme96->lock);
if (rme96->capture_substream != NULL) {
spin_unlock_irq(&rme96->lock);
@@ -1216,7 +1216,7 @@ snd_rme96_capture_spdif_open(struct snd_pcm_substream *substream)
}
rme96->capture_substream = substream;
spin_unlock_irq(&rme96->lock);
-
+
rme96_set_buffer_size_constraint(rme96, runtime);
return 0;
}
@@ -1226,9 +1226,9 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
{
int rate, dummy;
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
- struct snd_pcm_runtime *runtime = substream->runtime;
-
- spin_lock_irq(&rme96->lock);
+ struct snd_pcm_runtime *runtime = substream->runtime;
+
+ spin_lock_irq(&rme96->lock);
if (rme96->playback_substream != NULL) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
@@ -1237,7 +1237,7 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
rme96->playback_substream = substream;
spin_unlock_irq(&rme96->lock);
-
+
runtime->hw = snd_rme96_playback_adat_info;
if (!(rme96->wcreg & RME96_WCR_MASTER) &&
snd_rme96_getinputtype(rme96) != RME96_INPUT_ANALOG &&
@@ -1247,7 +1247,7 @@ snd_rme96_playback_adat_open(struct snd_pcm_substream *substream)
runtime->hw.rates = snd_pcm_rate_to_rate_bit(rate);
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
- }
+ }
rme96_set_buffer_size_constraint(rme96, runtime);
return 0;
}
@@ -1273,8 +1273,8 @@ snd_rme96_capture_adat_open(struct snd_pcm_substream *substream)
runtime->hw.rate_min = rate;
runtime->hw.rate_max = rate;
}
-
- spin_lock_irq(&rme96->lock);
+
+ spin_lock_irq(&rme96->lock);
if (rme96->capture_substream != NULL) {
spin_unlock_irq(&rme96->lock);
return -EBUSY;
@@ -1292,7 +1292,7 @@ snd_rme96_playback_close(struct snd_pcm_substream *substream)
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
int spdif = 0;
- spin_lock_irq(&rme96->lock);
+ spin_lock_irq(&rme96->lock);
if (RME96_ISPLAYING(rme96)) {
snd_rme96_playback_stop(rme96);
}
@@ -1312,8 +1312,8 @@ static int
snd_rme96_capture_close(struct snd_pcm_substream *substream)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
-
- spin_lock_irq(&rme96->lock);
+
+ spin_lock_irq(&rme96->lock);
if (RME96_ISRECORDING(rme96)) {
snd_rme96_capture_stop(rme96);
}
@@ -1327,8 +1327,8 @@ static int
snd_rme96_playback_prepare(struct snd_pcm_substream *substream)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
-
- spin_lock_irq(&rme96->lock);
+
+ spin_lock_irq(&rme96->lock);
if (RME96_ISPLAYING(rme96)) {
snd_rme96_playback_stop(rme96);
}
@@ -1341,8 +1341,8 @@ static int
snd_rme96_capture_prepare(struct snd_pcm_substream *substream)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
-
- spin_lock_irq(&rme96->lock);
+
+ spin_lock_irq(&rme96->lock);
if (RME96_ISRECORDING(rme96)) {
snd_rme96_capture_stop(rme96);
}
@@ -1352,7 +1352,7 @@ snd_rme96_capture_prepare(struct snd_pcm_substream *substream)
}
static int
-snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
+snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
int cmd)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
@@ -1387,7 +1387,7 @@ snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
snd_rme96_playback_start(rme96, 1);
}
break;
-
+
default:
return -EINVAL;
}
@@ -1395,7 +1395,7 @@ snd_rme96_playback_trigger(struct snd_pcm_substream *substream,
}
static int
-snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
+snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
int cmd)
{
struct rme96 *rme96 = snd_pcm_substream_chip(substream);
@@ -1430,7 +1430,7 @@ snd_rme96_capture_trigger(struct snd_pcm_substream *substream,
snd_rme96_capture_start(rme96, 1);
}
break;
-
+
default:
return -EINVAL;
}
@@ -1573,8 +1573,8 @@ snd_rme96_create(struct rme96 *rme96)
rme96->irq = pci->irq;
/* read the card's revision number */
- pci_read_config_byte(pci, 8, &rme96->rev);
-
+ pci_read_config_byte(pci, 8, &rme96->rev);
+
/* set up ALSA pcm device for S/PDIF */
if ((err = snd_pcm_new(rme96->card, "Digi96 IEC958", 0,
1, 1, &rme96->spdif_pcm)) < 0)
@@ -1598,23 +1598,23 @@ snd_rme96_create(struct rme96 *rme96)
1, 1, &rme96->adat_pcm)) < 0)
{
return err;
- }
+ }
rme96->adat_pcm->private_data = rme96;
rme96->adat_pcm->private_free = snd_rme96_free_adat_pcm;
strcpy(rme96->adat_pcm->name, "Digi96 ADAT");
snd_pcm_set_ops(rme96->adat_pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_rme96_playback_adat_ops);
snd_pcm_set_ops(rme96->adat_pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_rme96_capture_adat_ops);
-
+
rme96->adat_pcm->info_flags = 0;
}
rme96->playback_periodsize = 0;
rme96->capture_periodsize = 0;
-
+
/* make sure playback/capture is stopped, if by some reason active */
snd_rme96_playback_stop(rme96);
snd_rme96_capture_stop(rme96);
-
+
/* set default values in registers */
rme96->wcreg =
RME96_WCR_FREQ_1 | /* set 44.1 kHz playback */
@@ -1626,11 +1626,11 @@ snd_rme96_create(struct rme96 *rme96)
writel(rme96->wcreg, rme96->iobase + RME96_IO_CONTROL_REGISTER);
writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG);
-
+
/* reset the ADC */
writel(rme96->areg | RME96_AR_PD2,
rme96->iobase + RME96_IO_ADDITIONAL_REG);
- writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG);
+ writel(rme96->areg, rme96->iobase + RME96_IO_ADDITIONAL_REG);
/* reset and enable the DAC (order is important). */
snd_rme96_reset_dac(rme96);
@@ -1646,7 +1646,7 @@ snd_rme96_create(struct rme96 *rme96)
if (RME96_HAS_ANALOG_OUT(rme96)) {
snd_rme96_apply_dac_volume(rme96);
}
-
+
/* init switch interface */
if ((err = snd_rme96_create_switches(rme96->card, rme96)) < 0) {
return err;
@@ -1654,7 +1654,7 @@ snd_rme96_create(struct rme96 *rme96)
/* init proc interface */
snd_rme96_proc_init(rme96);
-
+
return 0;
}
@@ -1662,12 +1662,12 @@ snd_rme96_create(struct rme96 *rme96)
* proc interface
*/
-static void
+static void
snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
{
int n;
struct rme96 *rme96 = (struct rme96 *)entry->private_data;
-
+
rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
snd_iprintf(buffer, rme96->card->longname);
@@ -1681,7 +1681,7 @@ snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer
snd_iprintf(buffer, " period size: 2048 bytes\n");
} else {
snd_iprintf(buffer, " period size: 8192 bytes\n");
- }
+ }
snd_iprintf(buffer, "\nInput settings\n");
switch (snd_rme96_getinputtype(rme96)) {
case RME96_INPUT_OPTICAL:
@@ -1716,7 +1716,7 @@ snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer
} else {
snd_iprintf(buffer, " sample format: 16 bit\n");
}
-
+
snd_iprintf(buffer, "\nOutput settings\n");
if (rme96->wcreg & RME96_WCR_SEL) {
snd_iprintf(buffer, " output signal: normal playback\n");
@@ -1791,12 +1791,12 @@ snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer
}
}
-static void __devinit
+static void __devinit
snd_rme96_proc_init(struct rme96 *rme96)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(rme96->card, "rme96", &entry))
+ if (!snd_card_proc_new(rme96->card, "rme96", &entry))
snd_info_set_text_ops(entry, rme96, snd_rme96_proc_read);
}
@@ -1810,7 +1810,7 @@ static int
snd_rme96_get_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.integer.value[0] = rme96->wcreg & RME96_WCR_SEL ? 0 : 1;
spin_unlock_irq(&rme96->lock);
@@ -1822,7 +1822,7 @@ snd_rme96_put_loopback_control(struct snd_kcontrol *kcontrol, struct snd_ctl_ele
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change;
-
+
val = ucontrol->value.integer.value[0] ? 0 : RME96_WCR_SEL;
spin_lock_irq(&rme96->lock);
val = (rme96->wcreg & ~RME96_WCR_SEL) | val;
@@ -1839,7 +1839,7 @@ snd_rme96_info_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_e
static char *_texts[5] = { "Optical", "Coaxial", "Internal", "XLR", "Analog" };
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
char *texts[5] = { _texts[0], _texts[1], _texts[2], _texts[3], _texts[4] };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
switch (rme96->pci->device) {
@@ -1875,10 +1875,10 @@ snd_rme96_get_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int items = 3;
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.enumerated.item[0] = snd_rme96_getinputtype(rme96);
-
+
switch (rme96->pci->device) {
case PCI_DEVICE_ID_RME_DIGI96:
case PCI_DEVICE_ID_RME_DIGI96_8:
@@ -1905,7 +1905,7 @@ snd_rme96_get_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
if (ucontrol->value.enumerated.item[0] >= items) {
ucontrol->value.enumerated.item[0] = items - 1;
}
-
+
spin_unlock_irq(&rme96->lock);
return 0;
}
@@ -1915,7 +1915,7 @@ snd_rme96_put_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change, items = 3;
-
+
switch (rme96->pci->device) {
case PCI_DEVICE_ID_RME_DIGI96:
case PCI_DEVICE_ID_RME_DIGI96_8:
@@ -1936,14 +1936,14 @@ snd_rme96_put_inputtype_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
break;
}
val = ucontrol->value.enumerated.item[0] % items;
-
+
/* special case for PST */
if (rme96->pci->device == PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST && rme96->rev > 4) {
if (val == RME96_INPUT_XLR) {
val = RME96_INPUT_ANALOG;
}
}
-
+
spin_lock_irq(&rme96->lock);
change = (int)val != snd_rme96_getinputtype(rme96);
snd_rme96_setinputtype(rme96, val);
@@ -1955,7 +1955,7 @@ static int
snd_rme96_info_clockmode_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[3] = { "AutoSync", "Internal", "Word" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -1969,7 +1969,7 @@ static int
snd_rme96_get_clockmode_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.enumerated.item[0] = snd_rme96_getclockmode(rme96);
spin_unlock_irq(&rme96->lock);
@@ -1981,7 +1981,7 @@ snd_rme96_put_clockmode_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change;
-
+
val = ucontrol->value.enumerated.item[0] % 3;
spin_lock_irq(&rme96->lock);
change = (int)val != snd_rme96_getclockmode(rme96);
@@ -1994,7 +1994,7 @@ static int
snd_rme96_info_attenuation_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[4] = { "0 dB", "-6 dB", "-12 dB", "-18 dB" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 4;
@@ -2008,7 +2008,7 @@ static int
snd_rme96_get_attenuation_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.enumerated.item[0] = snd_rme96_getattenuation(rme96);
spin_unlock_irq(&rme96->lock);
@@ -2020,7 +2020,7 @@ snd_rme96_put_attenuation_control(struct snd_kcontrol *kcontrol, struct snd_ctl_
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change;
-
+
val = ucontrol->value.enumerated.item[0] % 4;
spin_lock_irq(&rme96->lock);
@@ -2034,7 +2034,7 @@ static int
snd_rme96_info_montracks_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[4] = { "1+2", "3+4", "5+6", "7+8" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 4;
@@ -2048,7 +2048,7 @@ static int
snd_rme96_get_montracks_control(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme96->lock);
ucontrol->value.enumerated.item[0] = snd_rme96_getmontracks(rme96);
spin_unlock_irq(&rme96->lock);
@@ -2060,7 +2060,7 @@ snd_rme96_put_montracks_control(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
unsigned int val;
int change;
-
+
val = ucontrol->value.enumerated.item[0] % 4;
spin_lock_irq(&rme96->lock);
change = (int)val != snd_rme96_getmontracks(rme96);
@@ -2101,7 +2101,7 @@ static int snd_rme96_control_spdif_info(struct snd_kcontrol *kcontrol, struct sn
static int snd_rme96_control_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
snd_rme96_convert_to_aes(&ucontrol->value.iec958, rme96->wcreg_spdif);
return 0;
}
@@ -2111,7 +2111,7 @@ static int snd_rme96_control_spdif_put(struct snd_kcontrol *kcontrol, struct snd
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_rme96_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&rme96->lock);
change = val != rme96->wcreg_spdif;
@@ -2130,7 +2130,7 @@ static int snd_rme96_control_spdif_stream_info(struct snd_kcontrol *kcontrol, st
static int snd_rme96_control_spdif_stream_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
snd_rme96_convert_to_aes(&ucontrol->value.iec958, rme96->wcreg_spdif_stream);
return 0;
}
@@ -2140,7 +2140,7 @@ static int snd_rme96_control_spdif_stream_put(struct snd_kcontrol *kcontrol, str
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_rme96_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&rme96->lock);
change = val != rme96->wcreg_spdif_stream;
@@ -2169,7 +2169,7 @@ static int
snd_rme96_dac_volume_info(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
struct rme96 *rme96 = snd_kcontrol_chip(kcontrol);
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
uinfo->count = 2;
uinfo->value.integer.min = 0;
@@ -2258,9 +2258,9 @@ static struct snd_kcontrol_new snd_rme96_controls[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Input Connector",
- .info = snd_rme96_info_inputtype_control,
+ .info = snd_rme96_info_inputtype_control,
.get = snd_rme96_get_inputtype_control,
- .put = snd_rme96_put_inputtype_control
+ .put = snd_rme96_put_inputtype_control
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -2272,21 +2272,21 @@ static struct snd_kcontrol_new snd_rme96_controls[] = {
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Sample Clock Source",
- .info = snd_rme96_info_clockmode_control,
+ .info = snd_rme96_info_clockmode_control,
.get = snd_rme96_get_clockmode_control,
.put = snd_rme96_put_clockmode_control
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Monitor Tracks",
- .info = snd_rme96_info_montracks_control,
+ .info = snd_rme96_info_montracks_control,
.get = snd_rme96_get_montracks_control,
.put = snd_rme96_put_montracks_control
},
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Attenuation",
- .info = snd_rme96_info_attenuation_control,
+ .info = snd_rme96_info_attenuation_control,
.get = snd_rme96_get_attenuation_control,
.put = snd_rme96_put_attenuation_control
},
@@ -2318,7 +2318,7 @@ snd_rme96_create_switches(struct snd_card *card,
if ((err = snd_ctl_add(card, snd_ctl_new1(&snd_rme96_controls[idx], rme96))) < 0)
return err;
}
-
+
return 0;
}
@@ -2352,7 +2352,7 @@ snd_rme96_probe(struct pci_dev *pci,
sizeof(struct rme96))) == NULL)
return -ENOMEM;
card->private_free = snd_rme96_card_free;
- rme96 = (struct rme96 *)card->private_data;
+ rme96 = (struct rme96 *)card->private_data;
rme96->card = card;
rme96->pci = pci;
snd_card_set_dev(card, &pci->dev);
@@ -2360,7 +2360,7 @@ snd_rme96_probe(struct pci_dev *pci,
snd_card_free(card);
return err;
}
-
+
strcpy(card->driver, "Digi96");
switch (rme96->pci->device) {
case PCI_DEVICE_ID_RME_DIGI96:
@@ -2383,10 +2383,10 @@ snd_rme96_probe(struct pci_dev *pci,
}
sprintf(card->longname, "%s at 0x%lx, irq %d", card->shortname,
rme96->port, rme96->irq);
-
+
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
- return err;
+ return err;
}
pci_set_drvdata(pci, card);
dev++;
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/rme9652/hdsp.c | 530 +++++++++++++++++++++---------------------
sound/pci/rme9652/hdspm.c | 114 +++++-----
sound/pci/rme9652/rme9652.c | 146 ++++++------
3 files changed, 395 insertions(+), 395 deletions(-)
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index d723543..de05602 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -41,7 +41,7 @@
#include <asm/byteorder.h>
#include <asm/current.h>
-#include <asm/io.h>
+#include <linux/io.h>
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
@@ -113,7 +113,7 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
/* the meters are regular i/o-mapped registers, but offset
considerably from the rest. the peak registers are reset
- when read; the least-significant 4 bits are full-scale counters;
+ when read; the least-significant 4 bits are full-scale counters;
the actual peak value is in the most-significant 24 bits.
*/
@@ -131,7 +131,7 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
26*3 values are read in ss mode
14*3 in ds mode, with no gap between values
*/
-#define HDSP_9652_peakBase 7164
+#define HDSP_9652_peakBase 7164
#define HDSP_9652_rmsBase 4096
/* c.f. the hdsp_9632_meters_t struct */
@@ -173,12 +173,12 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
#define HDSP_SPDIFEmphasis (1<<10) /* 0=none, 1=on */
#define HDSP_SPDIFNonAudio (1<<11) /* 0=off, 1=on */
#define HDSP_SPDIFOpticalOut (1<<12) /* 1=use 1st ADAT connector for SPDIF, 0=do not */
-#define HDSP_SyncRef2 (1<<13)
-#define HDSP_SPDIFInputSelect0 (1<<14)
-#define HDSP_SPDIFInputSelect1 (1<<15)
-#define HDSP_SyncRef0 (1<<16)
+#define HDSP_SyncRef2 (1<<13)
+#define HDSP_SPDIFInputSelect0 (1<<14)
+#define HDSP_SPDIFInputSelect1 (1<<15)
+#define HDSP_SyncRef0 (1<<16)
#define HDSP_SyncRef1 (1<<17)
-#define HDSP_AnalogExtensionBoard (1<<18) /* For H9632 cards */
+#define HDSP_AnalogExtensionBoard (1<<18) /* For H9632 cards */
#define HDSP_XLRBreakoutCable (1<<20) /* For H9632 cards */
#define HDSP_Midi0InterruptEnable (1<<22)
#define HDSP_Midi1InterruptEnable (1<<23)
@@ -314,7 +314,7 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
#define HDSP_TimecodeSync (1<<27)
#define HDSP_AEBO (1<<28) /* H9632 specific Analog Extension Boards */
#define HDSP_AEBI (1<<29) /* 0 = present, 1 = absent */
-#define HDSP_midi0IRQPending (1<<30)
+#define HDSP_midi0IRQPending (1<<30)
#define HDSP_midi1IRQPending (1<<31)
#define HDSP_spdifFrequencyMask (HDSP_spdifFrequency0|HDSP_spdifFrequency1|HDSP_spdifFrequency2)
@@ -391,7 +391,7 @@ MODULE_FIRMWARE("digiface_firmware_rev11.bin");
#define HDSP_CHANNEL_BUFFER_BYTES (4*HDSP_CHANNEL_BUFFER_SAMPLES)
/* the size of the area we need to allocate for DMA transfers. the
- size is the same regardless of the number of channels - the
+ size is the same regardless of the number of channels - the
Multiface still uses the same memory area.
Note that we allocate 1 more channel than is apparently needed
@@ -460,7 +460,7 @@ struct hdsp {
unsigned char qs_in_channels; /* quad speed mode for H9632 */
unsigned char ds_in_channels;
unsigned char ss_in_channels; /* different for multiface/digiface */
- unsigned char qs_out_channels;
+ unsigned char qs_out_channels;
unsigned char ds_out_channels;
unsigned char ss_out_channels;
@@ -502,9 +502,9 @@ static char channel_map_df_ss[HDSP_MAX_CHANNELS] = {
static char channel_map_mf_ss[HDSP_MAX_CHANNELS] = { /* Multiface */
/* Analog */
- 0, 1, 2, 3, 4, 5, 6, 7,
+ 0, 1, 2, 3, 4, 5, 6, 7,
/* ADAT 2 */
- 16, 17, 18, 19, 20, 21, 22, 23,
+ 16, 17, 18, 19, 20, 21, 22, 23,
/* SPDIF */
24, 25,
-1, -1, -1, -1, -1, -1, -1, -1
@@ -525,11 +525,11 @@ static char channel_map_H9632_ss[HDSP_MAX_CHANNELS] = {
/* SPDIF */
8, 9,
/* Analog */
- 10, 11,
+ 10, 11,
/* AO4S-192 and AI4S-192 extension boards */
12, 13, 14, 15,
/* others don't exist */
- -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1
};
@@ -539,7 +539,7 @@ static char channel_map_H9632_ds[HDSP_MAX_CHANNELS] = {
/* SPDIF */
8, 9,
/* Analog */
- 10, 11,
+ 10, 11,
/* AO4S-192 and AI4S-192 extension boards */
12, 13, 14, 15,
/* others don't exist */
@@ -587,7 +587,7 @@ static void snd_hammerfall_free_buffer(struct snd_dma_buffer *dmab, struct pci_d
static struct pci_device_id snd_hdsp_ids[] = {
{
.vendor = PCI_VENDOR_ID_XILINX,
- .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP,
+ .device = PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP,
.subvendor = PCI_ANY_ID,
.subdevice = PCI_ANY_ID,
}, /* RME Hammerfall-DSP */
@@ -599,15 +599,15 @@ MODULE_DEVICE_TABLE(pci, snd_hdsp_ids);
/* prototypes */
static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp);
static int snd_hdsp_create_pcm(struct snd_card *card, struct hdsp *hdsp);
-static int snd_hdsp_enable_io (struct hdsp *hdsp);
-static void snd_hdsp_initialize_midi_flush (struct hdsp *hdsp);
-static void snd_hdsp_initialize_channels (struct hdsp *hdsp);
+static int snd_hdsp_enable_io(struct hdsp *hdsp);
+static void snd_hdsp_initialize_midi_flush(struct hdsp *hdsp);
+static void snd_hdsp_initialize_channels(struct hdsp *hdsp);
static int hdsp_fifo_wait(struct hdsp *hdsp, int count, int timeout);
static int hdsp_autosync_ref(struct hdsp *hdsp);
static int snd_hdsp_set_defaults(struct hdsp *hdsp);
-static void snd_hdsp_9652_enable_mixer (struct hdsp *hdsp);
+static void snd_hdsp_9652_enable_mixer(struct hdsp *hdsp);
-static int hdsp_playback_to_output_key (struct hdsp *hdsp, int in, int out)
+static int hdsp_playback_to_output_key(struct hdsp *hdsp, int in, int out)
{
switch (hdsp->io_type) {
case Multiface:
@@ -624,7 +624,7 @@ static int hdsp_playback_to_output_key (struct hdsp *hdsp, int in, int out)
}
}
-static int hdsp_input_to_output_key (struct hdsp *hdsp, int in, int out)
+static int hdsp_input_to_output_key(struct hdsp *hdsp, int in, int out)
{
switch (hdsp->io_type) {
case Multiface:
@@ -651,7 +651,7 @@ static unsigned int hdsp_read(struct hdsp *hdsp, int reg)
return readl (hdsp->iobase + reg);
}
-static int hdsp_check_for_iobox (struct hdsp *hdsp)
+static int hdsp_check_for_iobox(struct hdsp *hdsp)
{
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return 0;
@@ -670,19 +670,19 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
unsigned long flags;
if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
-
+
snd_printk ("Hammerfall-DSP: loading firmware\n");
hdsp_write (hdsp, HDSP_control2Reg, HDSP_S_PROGRAM);
hdsp_write (hdsp, HDSP_fifoData, 0);
-
+
if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) {
snd_printk ("Hammerfall-DSP: timeout waiting for download preparation\n");
return -EIO;
}
-
+
hdsp_write (hdsp, HDSP_control2Reg, HDSP_S_LOAD);
-
+
for (i = 0; i < 24413; ++i) {
hdsp_write(hdsp, HDSP_fifoData, hdsp->firmware_cache[i]);
if (hdsp_fifo_wait (hdsp, 127, HDSP_LONG_WAIT)) {
@@ -692,7 +692,7 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
}
ssleep(3);
-
+
if (hdsp_fifo_wait (hdsp, 0, HDSP_LONG_WAIT)) {
snd_printk ("Hammerfall-DSP: timeout at end of firmware loading\n");
return -EIO;
@@ -705,15 +705,15 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
#endif
hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register);
snd_printk ("Hammerfall-DSP: finished firmware loading\n");
-
+
}
if (hdsp->state & HDSP_InitializationComplete) {
snd_printk(KERN_INFO "Hammerfall-DSP: firmware loaded from cache, restoring defaults\n");
spin_lock_irqsave(&hdsp->lock, flags);
snd_hdsp_set_defaults(hdsp);
- spin_unlock_irqrestore(&hdsp->lock, flags);
+ spin_unlock_irqrestore(&hdsp->lock, flags);
}
-
+
hdsp->state |= HDSP_FirmwareLoaded;
return 0;
@@ -722,7 +722,7 @@ static int snd_hdsp_load_firmware_from_cache(struct hdsp *hdsp) {
static int hdsp_get_iobox_version (struct hdsp *hdsp)
{
if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
-
+
hdsp_write (hdsp, HDSP_control2Reg, HDSP_PROGRAM);
hdsp_write (hdsp, HDSP_fifoData, 0);
if (hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT) < 0)
@@ -738,7 +738,7 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)
hdsp_fifo_wait (hdsp, 0, HDSP_SHORT_WAIT);
} else {
hdsp->io_type = Digiface;
- }
+ }
} else {
/* firmware was already loaded, get iobox type */
if (hdsp_read(hdsp, HDSP_status2Register) & HDSP_version1)
@@ -754,19 +754,19 @@ static int hdsp_get_iobox_version (struct hdsp *hdsp)
static int hdsp_request_fw_loader(struct hdsp *hdsp);
#endif
-static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
+static int hdsp_check_for_firmware(struct hdsp *hdsp, int load_on_demand)
{
if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
return 0;
if ((hdsp_read (hdsp, HDSP_statusRegister) & HDSP_DllError) != 0) {
hdsp->state &= ~HDSP_FirmwareLoaded;
- if (! load_on_demand)
+ if (!load_on_demand)
return -EIO;
snd_printk(KERN_ERR "Hammerfall-DSP: firmware not present.\n");
/* try to load firmware */
- if (! (hdsp->state & HDSP_FirmwareCached)) {
+ if (!(hdsp->state & HDSP_FirmwareCached)) {
#ifdef HDSP_FW_LOADER
- if (! hdsp_request_fw_loader(hdsp))
+ if (!hdsp_request_fw_loader(hdsp))
return 0;
#endif
snd_printk(KERN_ERR
@@ -786,13 +786,13 @@ static int hdsp_check_for_firmware (struct hdsp *hdsp, int load_on_demand)
static int hdsp_fifo_wait(struct hdsp *hdsp, int count, int timeout)
-{
+{
int i;
/* the fifoStatus registers reports on how many words
are available in the command FIFO.
*/
-
+
for (i = 0; i < timeout; i++) {
if ((int)(hdsp_read (hdsp, HDSP_fifoStatus) & 0xff) <= count)
@@ -824,11 +824,11 @@ static int hdsp_write_gain(struct hdsp *hdsp, unsigned int addr, unsigned short
if (addr >= HDSP_MATRIX_MIXER_SIZE)
return -1;
-
+
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) {
/* from martin bjornsen:
-
+
"You can only write dwords to the
mixer memory which contain two
mixer values in the low and high
@@ -847,7 +847,7 @@ static int hdsp_write_gain(struct hdsp *hdsp, unsigned int addr, unsigned short
hdsp->mixer_matrix[addr] = data;
-
+
/* `addr' addresses a 16-bit wide address, but
the address space accessed via hdsp_write
uses byte offsets. put another way, addr
@@ -856,17 +856,17 @@ static int hdsp_write_gain(struct hdsp *hdsp, unsigned int addr, unsigned short
to access 0 to 2703 ...
*/
ad = addr/2;
-
- hdsp_write (hdsp, 4096 + (ad*4),
- (hdsp->mixer_matrix[(addr&0x7fe)+1] << 16) +
+
+ hdsp_write (hdsp, 4096 + (ad*4),
+ (hdsp->mixer_matrix[(addr&0x7fe)+1] << 16) +
hdsp->mixer_matrix[addr&0x7fe]);
-
+
return 0;
} else {
ad = (addr << 16) + data;
-
+
if (hdsp_fifo_wait(hdsp, 127, HDSP_LONG_WAIT))
return -1;
@@ -902,7 +902,7 @@ static int hdsp_spdif_sample_rate(struct hdsp *hdsp)
if (status & HDSP_SPDIFErrorFlag)
return 0;
-
+
switch (rate_bits) {
case HDSP_spdifFrequency32KHz: return 32000;
case HDSP_spdifFrequency44_1KHz: return 44100;
@@ -910,13 +910,13 @@ static int hdsp_spdif_sample_rate(struct hdsp *hdsp)
case HDSP_spdifFrequency64KHz: return 64000;
case HDSP_spdifFrequency88_2KHz: return 88200;
case HDSP_spdifFrequency96KHz: return 96000;
- case HDSP_spdifFrequency128KHz:
+ case HDSP_spdifFrequency128KHz:
if (hdsp->io_type == H9632) return 128000;
break;
- case HDSP_spdifFrequency176_4KHz:
+ case HDSP_spdifFrequency176_4KHz:
if (hdsp->io_type == H9632) return 176400;
break;
- case HDSP_spdifFrequency192KHz:
+ case HDSP_spdifFrequency192KHz:
if (hdsp->io_type == H9632) return 192000;
break;
default:
@@ -1027,7 +1027,7 @@ static void hdsp_set_dds_value(struct hdsp *hdsp, int rate)
{
u64 n;
u32 r;
-
+
if (rate >= 112000)
rate /= 4;
else if (rate >= 56000)
@@ -1053,35 +1053,35 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
there is no need for it (e.g. during module
initialization).
*/
-
- if (!(hdsp->control_register & HDSP_ClockModeMaster)) {
+
+ if (!(hdsp->control_register & HDSP_ClockModeMaster)) {
if (called_internally) {
/* request from ctl or card initialization */
snd_printk(KERN_ERR "Hammerfall-DSP: device is not running as a clock master: cannot set sample rate.\n");
return -1;
- } else {
+ } else {
/* hw_param request while in AutoSync mode */
int external_freq = hdsp_external_sample_rate(hdsp);
int spdif_freq = hdsp_spdif_sample_rate(hdsp);
-
+
if ((spdif_freq == external_freq*2) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1))
snd_printk(KERN_INFO "Hammerfall-DSP: Detected ADAT in double speed mode\n");
else if (hdsp->io_type == H9632 && (spdif_freq == external_freq*4) && (hdsp_autosync_ref(hdsp) >= HDSP_AUTOSYNC_FROM_ADAT1))
- snd_printk(KERN_INFO "Hammerfall-DSP: Detected ADAT in quad speed mode\n");
+ snd_printk(KERN_INFO "Hammerfall-DSP: Detected ADAT in quad speed mode\n");
else if (rate != external_freq) {
snd_printk(KERN_INFO "Hammerfall-DSP: No AutoSync source for requested rate\n");
return -1;
- }
- }
+ }
+ }
}
current_rate = hdsp->system_sample_rate;
/* Changing from a "single speed" to a "double speed" rate is
not allowed if any substreams are open. This is because
- such a change causes a shift in the location of
+ such a change causes a shift in the location of
the DMA buffers and a reduction in the number of available
- buffers.
+ buffers.
Note that a similar but essentially insoluble problem
exists for externally-driven rate changes. All we can do
@@ -1089,7 +1089,7 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
if (rate > 96000 && hdsp->io_type != H9632)
return -EINVAL;
-
+
switch (rate) {
case 32000:
if (current_rate > 48000)
@@ -1179,7 +1179,7 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
break;
}
}
-
+
hdsp->system_sample_rate = rate;
return 0;
@@ -1189,7 +1189,7 @@ static int hdsp_set_rate(struct hdsp *hdsp, int rate, int called_internally)
MIDI
----------------------------------------------------------------------------*/
-static unsigned char snd_hdsp_midi_read_byte (struct hdsp *hdsp, int id)
+static unsigned char snd_hdsp_midi_read_byte(struct hdsp *hdsp, int id)
{
/* the hardware already does the relevant bit-mask with 0xff */
if (id)
@@ -1198,7 +1198,7 @@ static unsigned char snd_hdsp_midi_read_byte (struct hdsp *hdsp, int id)
return hdsp_read(hdsp, HDSP_midiDataIn0);
}
-static void snd_hdsp_midi_write_byte (struct hdsp *hdsp, int id, int val)
+static void snd_hdsp_midi_write_byte(struct hdsp *hdsp, int id, int val)
{
/* the hardware already does the relevant bit-mask with 0xff */
if (id)
@@ -1207,7 +1207,7 @@ static void snd_hdsp_midi_write_byte (struct hdsp *hdsp, int id, int val)
hdsp_write(hdsp, HDSP_midiDataOut0, val);
}
-static int snd_hdsp_midi_input_available (struct hdsp *hdsp, int id)
+static int snd_hdsp_midi_input_available(struct hdsp *hdsp, int id)
{
if (id)
return (hdsp_read(hdsp, HDSP_midiStatusIn1) & 0xff);
@@ -1215,7 +1215,7 @@ static int snd_hdsp_midi_input_available (struct hdsp *hdsp, int id)
return (hdsp_read(hdsp, HDSP_midiStatusIn0) & 0xff);
}
-static int snd_hdsp_midi_output_possible (struct hdsp *hdsp, int id)
+static int snd_hdsp_midi_output_possible(struct hdsp *hdsp, int id)
{
int fifo_bytes_used;
@@ -1230,13 +1230,13 @@ static int snd_hdsp_midi_output_possible (struct hdsp *hdsp, int id)
return 0;
}
-static void snd_hdsp_flush_midi_input (struct hdsp *hdsp, int id)
+static void snd_hdsp_flush_midi_input(struct hdsp *hdsp, int id)
{
while (snd_hdsp_midi_input_available (hdsp, id))
snd_hdsp_midi_read_byte (hdsp, id);
}
-static int snd_hdsp_midi_output_write (struct hdsp_midi *hmidi)
+static int snd_hdsp_midi_output_write(struct hdsp_midi *hmidi)
{
unsigned long flags;
int n_pending;
@@ -1245,16 +1245,16 @@ static int snd_hdsp_midi_output_write (struct hdsp_midi *hmidi)
unsigned char buf[128];
/* Output is not interrupt driven */
-
+
spin_lock_irqsave (&hmidi->lock, flags);
if (hmidi->output) {
if (!snd_rawmidi_transmit_empty (hmidi->output)) {
if ((n_pending = snd_hdsp_midi_output_possible (hmidi->hdsp, hmidi->id)) > 0) {
if (n_pending > (int)sizeof (buf))
n_pending = sizeof (buf);
-
+
if ((to_write = snd_rawmidi_transmit (hmidi->output, buf, n_pending)) > 0) {
- for (i = 0; i < to_write; ++i)
+ for (i = 0; i < to_write; ++i)
snd_hdsp_midi_write_byte (hmidi->hdsp, hmidi->id, buf[i]);
}
}
@@ -1264,7 +1264,7 @@ static int snd_hdsp_midi_output_write (struct hdsp_midi *hmidi)
return 0;
}
-static int snd_hdsp_midi_input_read (struct hdsp_midi *hmidi)
+static int snd_hdsp_midi_input_read(struct hdsp_midi *hmidi)
{
unsigned char buf[128]; /* this buffer is designed to match the MIDI input FIFO size */
unsigned long flags;
@@ -1325,14 +1325,14 @@ static void snd_hdsp_midi_output_timer(unsigned long data)
{
struct hdsp_midi *hmidi = (struct hdsp_midi *) data;
unsigned long flags;
-
+
snd_hdsp_midi_output_write(hmidi);
spin_lock_irqsave (&hmidi->lock, flags);
/* this does not bump hmidi->istimer, because the
kernel automatically removed the timer when it
expired, and we are now adding it back, thus
- leaving istimer wherever it was set before.
+ leaving istimer wherever it was set before.
*/
if (hmidi->istimer) {
@@ -1435,7 +1435,7 @@ static struct snd_rawmidi_ops snd_hdsp_midi_input =
.trigger = snd_hdsp_midi_input_trigger,
};
-static int snd_hdsp_create_midi (struct snd_card *card, struct hdsp *hdsp, int id)
+static int snd_hdsp_create_midi(struct snd_card *card, struct hdsp *hdsp, int id)
{
char buf[32];
@@ -1501,7 +1501,7 @@ static int snd_hdsp_control_spdif_info(struct snd_kcontrol *kcontrol, struct snd
static int snd_hdsp_control_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
snd_hdsp_convert_to_aes(&ucontrol->value.iec958, hdsp->creg_spdif);
return 0;
}
@@ -1511,7 +1511,7 @@ static int snd_hdsp_control_spdif_put(struct snd_kcontrol *kcontrol, struct snd_
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_hdsp_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&hdsp->lock);
change = val != hdsp->creg_spdif;
@@ -1530,7 +1530,7 @@ static int snd_hdsp_control_spdif_stream_info(struct snd_kcontrol *kcontrol, str
static int snd_hdsp_control_spdif_stream_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
snd_hdsp_convert_to_aes(&ucontrol->value.iec958, hdsp->creg_spdif_stream);
return 0;
}
@@ -1540,7 +1540,7 @@ static int snd_hdsp_control_spdif_stream_put(struct snd_kcontrol *kcontrol, stru
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_hdsp_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&hdsp->lock);
change = val != hdsp->creg_spdif_stream;
@@ -1602,7 +1602,7 @@ static int snd_hdsp_info_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_
static int snd_hdsp_get_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_spdif_in(hdsp);
return 0;
}
@@ -1612,7 +1612,7 @@ static int snd_hdsp_put_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_e
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0] % ((hdsp->io_type == H9632) ? 4 : 3);
@@ -1649,7 +1649,7 @@ static int hdsp_set_spdif_output(struct hdsp *hdsp, int out)
static int snd_hdsp_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp_spdif_out(hdsp);
return 0;
}
@@ -1659,7 +1659,7 @@ static int snd_hdsp_put_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1693,7 +1693,7 @@ static int hdsp_set_spdif_professional(struct hdsp *hdsp, int val)
static int snd_hdsp_get_spdif_professional(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp_spdif_professional(hdsp);
return 0;
}
@@ -1703,7 +1703,7 @@ static int snd_hdsp_put_spdif_professional(struct snd_kcontrol *kcontrol, struct
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1737,7 +1737,7 @@ static int hdsp_set_spdif_emphasis(struct hdsp *hdsp, int val)
static int snd_hdsp_get_spdif_emphasis(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp_spdif_emphasis(hdsp);
return 0;
}
@@ -1747,7 +1747,7 @@ static int snd_hdsp_put_spdif_emphasis(struct snd_kcontrol *kcontrol, struct snd
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1781,7 +1781,7 @@ static int hdsp_set_spdif_nonaudio(struct hdsp *hdsp, int val)
static int snd_hdsp_get_spdif_nonaudio(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp_spdif_nonaudio(hdsp);
return 0;
}
@@ -1791,7 +1791,7 @@ static int snd_hdsp_put_spdif_nonaudio(struct snd_kcontrol *kcontrol, struct snd
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1828,7 +1828,7 @@ static int snd_hdsp_info_spdif_sample_rate(struct snd_kcontrol *kcontrol, struct
static int snd_hdsp_get_spdif_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
switch (hdsp_spdif_sample_rate(hdsp)) {
case 32000:
ucontrol->value.enumerated.item[0] = 0;
@@ -1858,7 +1858,7 @@ static int snd_hdsp_get_spdif_sample_rate(struct snd_kcontrol *kcontrol, struct
ucontrol->value.enumerated.item[0] = 9;
break;
default:
- ucontrol->value.enumerated.item[0] = 6;
+ ucontrol->value.enumerated.item[0] = 6;
}
return 0;
}
@@ -1882,7 +1882,7 @@ static int snd_hdsp_info_system_sample_rate(struct snd_kcontrol *kcontrol, struc
static int snd_hdsp_get_system_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp->system_sample_rate;
return 0;
}
@@ -1899,10 +1899,10 @@ static int snd_hdsp_get_system_sample_rate(struct snd_kcontrol *kcontrol, struct
static int snd_hdsp_info_autosync_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
- static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"};
+ static char *texts[] = {"32000", "44100", "48000", "64000", "88200", "96000", "None", "128000", "176400", "192000"};
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
- uinfo->value.enumerated.items = (hdsp->io_type == H9632) ? 10 : 7 ;
+ uinfo->value.enumerated.items = (hdsp->io_type == H9632) ? 10 : 7;
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -1912,7 +1912,7 @@ static int snd_hdsp_info_autosync_sample_rate(struct snd_kcontrol *kcontrol, str
static int snd_hdsp_get_autosync_sample_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
switch (hdsp_external_sample_rate(hdsp)) {
case 32000:
ucontrol->value.enumerated.item[0] = 0;
@@ -1940,9 +1940,9 @@ static int snd_hdsp_get_autosync_sample_rate(struct snd_kcontrol *kcontrol, stru
break;
case 192000:
ucontrol->value.enumerated.item[0] = 9;
- break;
+ break;
default:
- ucontrol->value.enumerated.item[0] = 6;
+ ucontrol->value.enumerated.item[0] = 6;
}
return 0;
}
@@ -1968,7 +1968,7 @@ static int hdsp_system_clock_mode(struct hdsp *hdsp)
static int snd_hdsp_info_system_clock_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"Master", "Slave" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 2;
@@ -1981,7 +1981,7 @@ static int snd_hdsp_info_system_clock_mode(struct snd_kcontrol *kcontrol, struct
static int snd_hdsp_get_system_clock_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_system_clock_mode(hdsp);
return 0;
}
@@ -2018,7 +2018,7 @@ static int hdsp_clock_source(struct hdsp *hdsp)
case 192000:
return 9;
default:
- return 3;
+ return 3;
}
} else {
return 0;
@@ -2032,7 +2032,7 @@ static int hdsp_set_clock_source(struct hdsp *hdsp, int mode)
case HDSP_CLOCK_SOURCE_AUTOSYNC:
if (hdsp_external_sample_rate(hdsp) != 0) {
if (!hdsp_set_rate(hdsp, hdsp_external_sample_rate(hdsp), 1)) {
- hdsp->control_register &= ~HDSP_ClockModeMaster;
+ hdsp->control_register &= ~HDSP_ClockModeMaster;
hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
return 0;
}
@@ -2043,7 +2043,7 @@ static int hdsp_set_clock_source(struct hdsp *hdsp, int mode)
break;
case HDSP_CLOCK_SOURCE_INTERNAL_44_1KHZ:
rate = 44100;
- break;
+ break;
case HDSP_CLOCK_SOURCE_INTERNAL_48KHZ:
rate = 48000;
break;
@@ -2078,13 +2078,13 @@ static int snd_hdsp_info_clock_source(struct snd_kcontrol *kcontrol, struct snd_
{
static char *texts[] = {"AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz", "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz", "Internal 96.0 kHz", "Internal 128 kHz", "Internal 176.4 kHz", "Internal 192.0 KHz" };
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
if (hdsp->io_type == H9632)
uinfo->value.enumerated.items = 10;
else
- uinfo->value.enumerated.items = 7;
+ uinfo->value.enumerated.items = 7;
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -2094,7 +2094,7 @@ static int snd_hdsp_info_clock_source(struct snd_kcontrol *kcontrol, struct snd_
static int snd_hdsp_get_clock_source(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_clock_source(hdsp);
return 0;
}
@@ -2104,7 +2104,7 @@ static int snd_hdsp_put_clock_source(struct snd_kcontrol *kcontrol, struct snd_c
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -2130,7 +2130,7 @@ static int snd_hdsp_put_clock_source(struct snd_kcontrol *kcontrol, struct snd_c
static int snd_hdsp_get_clock_source_lock(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.integer.value[0] = hdsp->clock_source_locked;
return 0;
}
@@ -2165,7 +2165,7 @@ static int hdsp_da_gain(struct hdsp *hdsp)
case HDSP_DAGainMinus10dBV:
return 2;
default:
- return 1;
+ return 1;
}
}
@@ -2180,8 +2180,8 @@ static int hdsp_set_da_gain(struct hdsp *hdsp, int mode)
hdsp->control_register |= HDSP_DAGainPlus4dBu;
break;
case 2:
- hdsp->control_register |= HDSP_DAGainMinus10dBV;
- break;
+ hdsp->control_register |= HDSP_DAGainMinus10dBV;
+ break;
default:
return -1;
@@ -2193,7 +2193,7 @@ static int hdsp_set_da_gain(struct hdsp *hdsp, int mode)
static int snd_hdsp_info_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"Hi Gain", "+4 dBu", "-10 dbV"};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -2206,7 +2206,7 @@ static int snd_hdsp_info_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_e
static int snd_hdsp_get_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_da_gain(hdsp);
return 0;
}
@@ -2216,7 +2216,7 @@ static int snd_hdsp_put_da_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -2250,7 +2250,7 @@ static int hdsp_ad_gain(struct hdsp *hdsp)
case HDSP_ADGainLowGain:
return 2;
default:
- return 1;
+ return 1;
}
}
@@ -2262,11 +2262,11 @@ static int hdsp_set_ad_gain(struct hdsp *hdsp, int mode)
hdsp->control_register |= HDSP_ADGainMinus10dBV;
break;
case 1:
- hdsp->control_register |= HDSP_ADGainPlus4dBu;
+ hdsp->control_register |= HDSP_ADGainPlus4dBu;
break;
case 2:
- hdsp->control_register |= HDSP_ADGainLowGain;
- break;
+ hdsp->control_register |= HDSP_ADGainLowGain;
+ break;
default:
return -1;
@@ -2278,7 +2278,7 @@ static int hdsp_set_ad_gain(struct hdsp *hdsp, int mode)
static int snd_hdsp_info_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"-10 dBV", "+4 dBu", "Lo Gain"};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -2291,7 +2291,7 @@ static int snd_hdsp_info_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_e
static int snd_hdsp_get_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_ad_gain(hdsp);
return 0;
}
@@ -2301,7 +2301,7 @@ static int snd_hdsp_put_ad_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_el
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -2335,7 +2335,7 @@ static int hdsp_phone_gain(struct hdsp *hdsp)
case HDSP_PhoneGainMinus12dB:
return 2;
default:
- return 0;
+ return 0;
}
}
@@ -2347,11 +2347,11 @@ static int hdsp_set_phone_gain(struct hdsp *hdsp, int mode)
hdsp->control_register |= HDSP_PhoneGain0dB;
break;
case 1:
- hdsp->control_register |= HDSP_PhoneGainMinus6dB;
+ hdsp->control_register |= HDSP_PhoneGainMinus6dB;
break;
case 2:
- hdsp->control_register |= HDSP_PhoneGainMinus12dB;
- break;
+ hdsp->control_register |= HDSP_PhoneGainMinus12dB;
+ break;
default:
return -1;
@@ -2363,7 +2363,7 @@ static int hdsp_set_phone_gain(struct hdsp *hdsp, int mode)
static int snd_hdsp_info_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"0 dB", "-6 dB", "-12 dB"};
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -2376,7 +2376,7 @@ static int snd_hdsp_info_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ct
static int snd_hdsp_get_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_phone_gain(hdsp);
return 0;
}
@@ -2386,7 +2386,7 @@ static int snd_hdsp_put_phone_gain(struct snd_kcontrol *kcontrol, struct snd_ctl
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -2432,7 +2432,7 @@ static int hdsp_set_xlr_breakout_cable(struct hdsp *hdsp, int mode)
static int snd_hdsp_get_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_xlr_breakout_cable(hdsp);
return 0;
}
@@ -2442,7 +2442,7 @@ static int snd_hdsp_put_xlr_breakout_cable(struct snd_kcontrol *kcontrol, struct
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2488,7 +2488,7 @@ static int hdsp_set_aeb(struct hdsp *hdsp, int mode)
static int snd_hdsp_get_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_aeb(hdsp);
return 0;
}
@@ -2498,7 +2498,7 @@ static int snd_hdsp_put_aeb(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_v
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2576,7 +2576,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd
{
static char *texts[] = {"Word", "IEC958", "ADAT1", "ADAT Sync", "ADAT2", "ADAT3" };
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
@@ -2595,7 +2595,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd
uinfo->value.enumerated.items = 0;
break;
}
-
+
if (uinfo->value.enumerated.item >= uinfo->value.enumerated.items)
uinfo->value.enumerated.item = uinfo->value.enumerated.items - 1;
strcpy(uinfo->value.enumerated.name, texts[uinfo->value.enumerated.item]);
@@ -2605,7 +2605,7 @@ static int snd_hdsp_info_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd
static int snd_hdsp_get_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_pref_sync_ref(hdsp);
return 0;
}
@@ -2615,7 +2615,7 @@ static int snd_hdsp_put_pref_sync_ref(struct snd_kcontrol *kcontrol, struct snd_
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change, max;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
@@ -2664,7 +2664,7 @@ static int hdsp_autosync_ref(struct hdsp *hdsp)
case HDSP_SelSyncRef_SPDIF:
return HDSP_AUTOSYNC_FROM_SPDIF;
case HDSP_SelSyncRefMask:
- return HDSP_AUTOSYNC_FROM_NONE;
+ return HDSP_AUTOSYNC_FROM_NONE;
case HDSP_SelSyncRef_ADAT1:
return HDSP_AUTOSYNC_FROM_ADAT1;
case HDSP_SelSyncRef_ADAT2:
@@ -2680,7 +2680,7 @@ static int hdsp_autosync_ref(struct hdsp *hdsp)
static int snd_hdsp_info_autosync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
static char *texts[] = {"Word", "ADAT Sync", "IEC958", "None", "ADAT1", "ADAT2", "ADAT3" };
-
+
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 7;
@@ -2693,7 +2693,7 @@ static int snd_hdsp_info_autosync_ref(struct snd_kcontrol *kcontrol, struct snd_
static int snd_hdsp_get_autosync_ref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_autosync_ref(hdsp);
return 0;
}
@@ -2727,7 +2727,7 @@ static int hdsp_set_line_output(struct hdsp *hdsp, int out)
static int snd_hdsp_get_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&hdsp->lock);
ucontrol->value.integer.value[0] = hdsp_line_out(hdsp);
spin_unlock_irq(&hdsp->lock);
@@ -2739,7 +2739,7 @@ static int snd_hdsp_put_line_out(struct snd_kcontrol *kcontrol, struct snd_ctl_e
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2773,7 +2773,7 @@ static int hdsp_set_precise_pointer(struct hdsp *hdsp, int precise)
static int snd_hdsp_get_precise_pointer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&hdsp->lock);
ucontrol->value.integer.value[0] = hdsp->precise_ptr;
spin_unlock_irq(&hdsp->lock);
@@ -2785,7 +2785,7 @@ static int snd_hdsp_put_precise_pointer(struct snd_kcontrol *kcontrol, struct sn
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2819,7 +2819,7 @@ static int hdsp_set_use_midi_tasklet(struct hdsp *hdsp, int use_tasklet)
static int snd_hdsp_get_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&hdsp->lock);
ucontrol->value.integer.value[0] = hdsp->use_midi_tasklet;
spin_unlock_irq(&hdsp->lock);
@@ -2831,7 +2831,7 @@ static int snd_hdsp_put_use_midi_tasklet(struct snd_kcontrol *kcontrol, struct s
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -2873,12 +2873,12 @@ static int snd_hdsp_get_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
source = ucontrol->value.integer.value[0];
destination = ucontrol->value.integer.value[1];
-
+
if (source >= hdsp->max_channels)
addr = hdsp_playback_to_output_key(hdsp,source-hdsp->max_channels,destination);
else
addr = hdsp_input_to_output_key(hdsp,source, destination);
-
+
spin_lock_irq(&hdsp->lock);
ucontrol->value.integer.value[2] = hdsp_read_gain (hdsp, addr);
spin_unlock_irq(&hdsp->lock);
@@ -2926,7 +2926,7 @@ static int snd_hdsp_put_mixer(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
static int snd_hdsp_info_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_info *uinfo)
{
- static char *texts[] = {"No Lock", "Lock", "Sync" };
+ static char *texts[] = {"No Lock", "Lock", "Sync" };
uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED;
uinfo->count = 1;
uinfo->value.enumerated.items = 3;
@@ -2971,7 +2971,7 @@ static int hdsp_spdif_sync_check(struct hdsp *hdsp)
int status = hdsp_read(hdsp, HDSP_statusRegister);
if (status & HDSP_SPDIFErrorFlag)
return 0;
- else {
+ else {
if (status & HDSP_SPDIFSync)
return 2;
else
@@ -3007,7 +3007,7 @@ static int hdsp_adatsync_sync_check(struct hdsp *hdsp)
return 1;
} else
return 0;
-}
+}
static int snd_hdsp_get_adatsync_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
@@ -3025,17 +3025,17 @@ static int snd_hdsp_get_adatsync_sync_check(struct snd_kcontrol *kcontrol, struc
}
static int hdsp_adat_sync_check(struct hdsp *hdsp, int idx)
-{
+{
int status = hdsp_read(hdsp, HDSP_statusRegister);
-
+
if (status & (HDSP_Lock0>>idx)) {
if (status & (HDSP_Sync0>>idx))
return 2;
else
- return 1;
+ return 1;
} else
return 0;
-}
+}
static int snd_hdsp_get_adat_sync_check(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
@@ -3053,7 +3053,7 @@ static int snd_hdsp_get_adat_sync_check(struct snd_kcontrol *kcontrol, struct sn
break;
case Multiface:
case H9632:
- if (offset >= 1)
+ if (offset >= 1)
return -EINVAL;
break;
default:
@@ -3115,7 +3115,7 @@ static int snd_hdsp_info_dds_offset(struct snd_kcontrol *kcontrol, struct snd_ct
static int snd_hdsp_get_dds_offset(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
-
+
ucontrol->value.enumerated.item[0] = hdsp_dds_offset(hdsp);
return 0;
}
@@ -3125,7 +3125,7 @@ static int snd_hdsp_put_dds_offset(struct snd_kcontrol *kcontrol, struct snd_ctl
struct hdsp *hdsp = snd_kcontrol_chip(kcontrol);
int change;
int val;
-
+
if (!snd_hdsp_use_is_exclusive(hdsp))
return -EBUSY;
val = ucontrol->value.enumerated.item[0];
@@ -3170,7 +3170,7 @@ static struct snd_kcontrol_new snd_hdsp_controls[] = {
.get = snd_hdsp_control_spdif_mask_get,
.private_value = IEC958_AES0_NONAUDIO |
IEC958_AES0_PROFESSIONAL |
- IEC958_AES0_CON_EMPHASIS,
+ IEC958_AES0_CON_EMPHASIS,
},
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
@@ -3188,7 +3188,7 @@ HDSP_SPDIF_OUT("IEC958 Output also on ADAT1", 0),
HDSP_SPDIF_PROFESSIONAL("IEC958 Professional Bit", 0),
HDSP_SPDIF_EMPHASIS("IEC958 Emphasis Bit", 0),
HDSP_SPDIF_NON_AUDIO("IEC958 Non-audio Bit", 0),
-/* 'Sample Clock Source' complies with the alsa control naming scheme */
+/* 'Sample Clock Source' complies with the alsa control naming scheme */
HDSP_CLOCK_SOURCE("Sample Clock Source", 0),
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
@@ -3240,7 +3240,7 @@ static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp)
return err;
}
}
-
+
/* DA, AD and Phone gain and XLR breakout cable controls for H9632 cards */
if (hdsp->io_type == H9632) {
for (idx = 0; idx < ARRAY_SIZE(snd_hdsp_9632_controls); idx++) {
@@ -3259,7 +3259,7 @@ static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp)
}
/*------------------------------------------------------------
- /proc interface
+ /proc interface
------------------------------------------------------------*/
static void
@@ -3298,7 +3298,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
}
}
}
-
+
status = hdsp_read(hdsp, HDSP_statusRegister);
status2 = hdsp_read(hdsp, HDSP_status2Register);
@@ -3362,17 +3362,17 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
case HDSP_CLOCK_SOURCE_INTERNAL_192KHZ:
clock_source = "Internal 192 kHz";
- break;
+ break;
default:
- clock_source = "Error";
+ clock_source = "Error";
}
snd_iprintf (buffer, "Sample Clock Source: %s\n", clock_source);
-
+
if (hdsp_system_clock_mode(hdsp))
system_clock_mode = "Slave";
else
system_clock_mode = "Master";
-
+
switch (hdsp_pref_sync_ref (hdsp)) {
case HDSP_SYNC_FROM_WORD:
pref_sync_ref = "Word Clock";
@@ -3397,7 +3397,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
}
snd_iprintf (buffer, "Preferred Sync Reference: %s\n", pref_sync_ref);
-
+
switch (hdsp_autosync_ref (hdsp)) {
case HDSP_AUTOSYNC_FROM_WORD:
autosync_ref = "Word Clock";
@@ -3410,7 +3410,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
case HDSP_AUTOSYNC_FROM_NONE:
autosync_ref = "None";
- break;
+ break;
case HDSP_AUTOSYNC_FROM_ADAT1:
autosync_ref = "ADAT1";
break;
@@ -3425,14 +3425,14 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
}
snd_iprintf (buffer, "AutoSync Reference: %s\n", autosync_ref);
-
+
snd_iprintf (buffer, "AutoSync Frequency: %d\n", hdsp_external_sample_rate(hdsp));
-
+
snd_iprintf (buffer, "System Clock Mode: %s\n", system_clock_mode);
snd_iprintf (buffer, "System Clock Frequency: %d\n", hdsp->system_sample_rate);
snd_iprintf (buffer, "System Clock Locked: %s\n", hdsp->clock_source_locked ? "Yes" : "No");
-
+
snd_iprintf(buffer, "\n");
switch (hdsp_spdif_in(hdsp)) {
@@ -3452,7 +3452,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
snd_iprintf(buffer, "IEC958 input: ???\n");
break;
}
-
+
if (hdsp->control_register & HDSP_SPDIFOpticalOut)
snd_iprintf(buffer, "IEC958 output: Coaxial & ADAT1\n");
else
@@ -3510,13 +3510,13 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
snd_iprintf (buffer, "SPDIF: No Lock\n");
else
snd_iprintf (buffer, "SPDIF: %s\n", x ? "Sync" : "Lock");
-
+
x = status2 & HDSP_wc_sync;
if (status2 & HDSP_wc_lock)
snd_iprintf (buffer, "Word Clock: %s\n", x ? "Sync" : "Lock");
else
snd_iprintf (buffer, "Word Clock: No Lock\n");
-
+
x = status & HDSP_TimecodeSync;
if (status & HDSP_TimecodeLock)
snd_iprintf(buffer, "ADAT Sync: %s\n", x ? "Sync" : "Lock");
@@ -3524,11 +3524,11 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
snd_iprintf(buffer, "ADAT Sync: No Lock\n");
snd_iprintf(buffer, "\n");
-
+
/* Informations about H9632 specific controls */
if (hdsp->io_type == H9632) {
char *tmp;
-
+
switch (hdsp_ad_gain(hdsp)) {
case 0:
tmp = "-10 dBV";
@@ -3554,7 +3554,7 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
break;
}
snd_iprintf(buffer, "DA Gain : %s\n", tmp);
-
+
switch (hdsp_phone_gain(hdsp)) {
case 0:
tmp = "0 dB";
@@ -3568,8 +3568,8 @@ snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
}
snd_iprintf(buffer, "Phones Gain : %s\n", tmp);
- snd_iprintf(buffer, "XLR Breakout Cable : %s\n", hdsp_xlr_breakout_cable(hdsp) ? "yes" : "no");
-
+ snd_iprintf(buffer, "XLR Breakout Cable : %s\n", hdsp_xlr_breakout_cable(hdsp) ? "yes" : "no");
+
if (hdsp->control_register & HDSP_AnalogExtensionBoard)
snd_iprintf(buffer, "AEB : on (ADAT1 internal)\n");
else
@@ -3583,7 +3583,7 @@ static void snd_hdsp_proc_init(struct hdsp *hdsp)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(hdsp->card, "hdsp", &entry))
+ if (!snd_card_proc_new(hdsp->card, "hdsp", &entry))
snd_info_set_text_ops(entry, hdsp, snd_hdsp_proc_read);
}
@@ -3632,18 +3632,18 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
/* set defaults:
- SPDIF Input via Coax
+ SPDIF Input via Coax
Master clock mode
maximum latency (7 => 2^7 = 8192 samples, 64Kbyte buffer,
which implies 2 4096 sample, 32Kbyte periods).
- Enable line out.
+ Enable line out.
*/
- hdsp->control_register = HDSP_ClockModeMaster |
- HDSP_SPDIFInputCoaxial |
- hdsp_encode_latency(7) |
+ hdsp->control_register = HDSP_ClockModeMaster |
+ HDSP_SPDIFInputCoaxial |
+ hdsp_encode_latency(7) |
HDSP_LineOut;
-
+
hdsp_write(hdsp, HDSP_controlRegister, hdsp->control_register);
@@ -3661,7 +3661,7 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
hdsp_compute_period_size(hdsp);
/* silence everything */
-
+
for (i = 0; i < HDSP_MATRIX_MIXER_SIZE; ++i)
hdsp->mixer_matrix[i] = MINUS_INFINITY_GAIN;
@@ -3669,7 +3669,7 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
if (hdsp_write_gain (hdsp, i, MINUS_INFINITY_GAIN))
return -EIO;
}
-
+
/* H9632 specific defaults */
if (hdsp->io_type == H9632) {
hdsp->control_register |= (HDSP_DAGainPlus4dBu | HDSP_ADGainPlus4dBu | HDSP_PhoneGain0dB);
@@ -3687,12 +3687,12 @@ static int snd_hdsp_set_defaults(struct hdsp *hdsp)
static void hdsp_midi_tasklet(unsigned long arg)
{
struct hdsp *hdsp = (struct hdsp *)arg;
-
+
if (hdsp->midi[0].pending)
snd_hdsp_midi_input_read (&hdsp->midi[0]);
if (hdsp->midi[1].pending)
snd_hdsp_midi_input_read (&hdsp->midi[1]);
-}
+}
static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id)
{
@@ -3704,7 +3704,7 @@ static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id)
unsigned int midi0status;
unsigned int midi1status;
int schedule = 0;
-
+
status = hdsp_read(hdsp, HDSP_statusRegister);
audio = status & HDSP_audioIRQPending;
@@ -3718,15 +3718,15 @@ static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id)
midi0status = hdsp_read (hdsp, HDSP_midiStatusIn0) & 0xff;
midi1status = hdsp_read (hdsp, HDSP_midiStatusIn1) & 0xff;
-
+
if (audio) {
if (hdsp->capture_substream)
snd_pcm_period_elapsed(hdsp->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
-
+
if (hdsp->playback_substream)
snd_pcm_period_elapsed(hdsp->pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream);
}
-
+
if (midi0 && midi0status) {
if (hdsp->use_midi_tasklet) {
/* we disable interrupts for this input until processing is done */
@@ -3769,10 +3769,10 @@ static char *hdsp_channel_buffer_location(struct hdsp *hdsp,
if (snd_BUG_ON(channel < 0 || channel >= hdsp->max_channels))
return NULL;
-
+
if ((mapped_channel = hdsp->channel_map[channel]) < 0)
return NULL;
-
+
if (stream == SNDRV_PCM_STREAM_CAPTURE)
return hdsp->capture_buffer + (mapped_channel * HDSP_CHANNEL_BUFFER_BYTES);
else
@@ -3910,7 +3910,7 @@ static int snd_hdsp_hw_params(struct snd_pcm_substream *substream,
*/
spin_lock_irq(&hdsp->lock);
- if (! hdsp->clock_source_locked) {
+ if (!hdsp->clock_source_locked) {
if ((err = hdsp_set_rate(hdsp, params_rate(params), 0)) < 0) {
spin_unlock_irq(&hdsp->lock);
_snd_pcm_hw_param_setempty(params, SNDRV_PCM_HW_PARAM_RATE);
@@ -3965,7 +3965,7 @@ static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd)
struct hdsp *hdsp = snd_pcm_substream_chip(substream);
struct snd_pcm_substream *other;
int running;
-
+
if (hdsp_check_for_iobox (hdsp))
return -EIO;
@@ -4016,7 +4016,7 @@ static int snd_hdsp_trigger(struct snd_pcm_substream *substream, int cmd)
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
hdsp_silence_playback(hdsp);
}
- _ok:
+_ok:
snd_pcm_trigger_done(substream, substream);
if (!hdsp->running && running)
hdsp_start_audio(hdsp);
@@ -4059,10 +4059,10 @@ static struct snd_pcm_hardware snd_hdsp_playback_subinfo =
.formats = SNDRV_PCM_FMTBIT_S32_LE,
#endif
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_64000 |
- SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_64000 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
@@ -4088,10 +4088,10 @@ static struct snd_pcm_hardware snd_hdsp_capture_subinfo =
.formats = SNDRV_PCM_FMTBIT_S32_LE,
#endif
.rates = (SNDRV_PCM_RATE_32000 |
- SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_64000 |
- SNDRV_PCM_RATE_88200 |
+ SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_64000 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 32000,
.rate_max = 96000,
@@ -4170,7 +4170,7 @@ static int snd_hdsp_hw_rule_in_channels_rate(struct snd_pcm_hw_params *params,
.max = hdsp->qs_in_channels,
.integer = 1,
};
- return snd_interval_refine(c, &t);
+ return snd_interval_refine(c, &t);
} else if (r->min > 48000 && r->max <= 96000) {
struct snd_interval t = {
.min = hdsp->ds_in_channels,
@@ -4201,7 +4201,7 @@ static int snd_hdsp_hw_rule_out_channels_rate(struct snd_pcm_hw_params *params,
.max = hdsp->qs_out_channels,
.integer = 1,
};
- return snd_interval_refine(c, &t);
+ return snd_interval_refine(c, &t);
} else if (r->min > 48000 && r->max <= 96000) {
struct snd_interval t = {
.min = hdsp->ds_out_channels,
@@ -4318,8 +4318,8 @@ static int snd_hdsp_playback_open(struct snd_pcm_substream *substream)
if (hdsp->io_type == H9632) {
runtime->hw.channels_min = hdsp->qs_out_channels;
runtime->hw.channels_max = hdsp->ss_out_channels;
- }
-
+ }
+
snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS,
snd_hdsp_hw_rule_out_channels, hdsp,
SNDRV_PCM_HW_PARAM_CHANNELS, -1);
@@ -4536,7 +4536,7 @@ static int hdsp_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rm
hdsp->iobase + HDSP_playbackRmsLevel + i * 8 + 4,
hdsp->iobase + HDSP_playbackRmsLevel + i * 8))
return -EFAULT;
- if (copy_u64_le(&peak_rms->input_rms[i],
+ if (copy_u64_le(&peak_rms->input_rms[i],
hdsp->iobase + HDSP_inputRmsLevel + i * 8 + 4,
hdsp->iobase + HDSP_inputRmsLevel + i * 8))
return -EFAULT;
@@ -4546,7 +4546,7 @@ static int hdsp_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rm
static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigned int cmd, unsigned long arg)
{
- struct hdsp *hdsp = (struct hdsp *)hw->private_data;
+ struct hdsp *hdsp = (struct hdsp *)hw->private_data;
void __user *argp = (void __user *)arg;
switch (cmd) {
@@ -4571,9 +4571,9 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
struct hdsp_config_info info;
unsigned long flags;
int i;
-
+
if (!(hdsp->state & HDSP_FirmwareLoaded)) {
- snd_printk(KERN_ERR "Hammerfall-DSP: Firmware needs to be uploaded to the card.\n");
+ snd_printk(KERN_ERR "Hammerfall-DSP: Firmware needs to be uploaded to the card.\n");
return -EINVAL;
}
spin_lock_irqsave(&hdsp->lock, flags);
@@ -4601,7 +4601,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
info.ad_gain = (unsigned char)hdsp_ad_gain(hdsp);
info.phone_gain = (unsigned char)hdsp_phone_gain(hdsp);
info.xlr_breakout_cable = (unsigned char)hdsp_xlr_breakout_cable(hdsp);
-
+
}
if (hdsp->io_type == H9632 || hdsp->io_type == H9652)
info.analog_extension_board = (unsigned char)hdsp_aeb(hdsp);
@@ -4612,7 +4612,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
}
case SNDRV_HDSP_IOCTL_GET_9632_AEB: {
struct hdsp_9632_aeb h9632_aeb;
-
+
if (hdsp->io_type != H9632) return -EINVAL;
h9632_aeb.aebi = hdsp->ss_in_channels - H9632_SS_CHANNELS;
h9632_aeb.aebo = hdsp->ss_out_channels - H9632_SS_CHANNELS;
@@ -4623,7 +4623,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
case SNDRV_HDSP_IOCTL_GET_VERSION: {
struct hdsp_version hdsp_version;
int err;
-
+
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL;
if (hdsp->io_type == Undefined) {
if ((err = hdsp_get_iobox_version(hdsp)) < 0)
@@ -4639,7 +4639,7 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
struct hdsp_firmware __user *firmware;
u32 __user *firmware_data;
int err;
-
+
if (hdsp->io_type == H9652 || hdsp->io_type == H9632) return -EINVAL;
/* SNDRV_HDSP_IOCTL_GET_VERSION must have been called */
if (hdsp->io_type == Undefined) return -EINVAL;
@@ -4652,25 +4652,25 @@ static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigne
if (get_user(firmware_data, &firmware->firmware_data))
return -EFAULT;
-
+
if (hdsp_check_for_iobox (hdsp))
return -EIO;
if (copy_from_user(hdsp->firmware_cache, firmware_data, sizeof(hdsp->firmware_cache)) != 0)
return -EFAULT;
-
+
hdsp->state |= HDSP_FirmwareCached;
if ((err = snd_hdsp_load_firmware_from_cache(hdsp)) < 0)
return err;
-
+
if (!(hdsp->state & HDSP_InitializationComplete)) {
if ((err = snd_hdsp_enable_io(hdsp)) < 0)
return err;
-
- snd_hdsp_initialize_channels(hdsp);
+
+ snd_hdsp_initialize_channels(hdsp);
snd_hdsp_initialize_midi_flush(hdsp);
-
+
if ((err = snd_hdsp_create_alsa_devices(hdsp->card, hdsp)) < 0) {
snd_printk(KERN_ERR "Hammerfall-DSP: error creating alsa devices\n");
return err;
@@ -4717,10 +4717,10 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp)
{
struct snd_hwdep *hw;
int err;
-
+
if ((err = snd_hwdep_new(card, "HDSP hwdep", 0, &hw)) < 0)
return err;
-
+
hdsp->hwdep = hw;
hw->private_data = hdsp;
strcpy(hw->name, "HDSP hwdep interface");
@@ -4728,7 +4728,7 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp)
hw->ops.open = snd_hdsp_hwdep_dummy_op;
hw->ops.ioctl = snd_hdsp_hwdep_ioctl;
hw->ops.release = snd_hdsp_hwdep_dummy_op;
-
+
return 0;
}
@@ -4752,33 +4752,33 @@ static int snd_hdsp_create_pcm(struct snd_card *card, struct hdsp *hdsp)
return 0;
}
-static void snd_hdsp_9652_enable_mixer (struct hdsp *hdsp)
+static void snd_hdsp_9652_enable_mixer(struct hdsp *hdsp)
{
hdsp->control2_register |= HDSP_9652_ENABLE_MIXER;
hdsp_write (hdsp, HDSP_control2Reg, hdsp->control2_register);
}
-static int snd_hdsp_enable_io (struct hdsp *hdsp)
+static int snd_hdsp_enable_io(struct hdsp *hdsp)
{
int i;
-
+
if (hdsp_fifo_wait (hdsp, 0, 100)) {
snd_printk(KERN_ERR "Hammerfall-DSP: enable_io fifo_wait failed\n");
return -EIO;
}
-
+
for (i = 0; i < hdsp->max_channels; ++i) {
hdsp_write (hdsp, HDSP_inputEnable + (4 * i), 1);
hdsp_write (hdsp, HDSP_outputEnable + (4 * i), 1);
}
-
+
return 0;
}
static void snd_hdsp_initialize_channels(struct hdsp *hdsp)
{
int status, aebi_channels, aebo_channels;
-
+
switch (hdsp->io_type) {
case Digiface:
hdsp->card_name = "RME Hammerfall DSP + Digiface";
@@ -4791,7 +4791,7 @@ static void snd_hdsp_initialize_channels(struct hdsp *hdsp)
hdsp->ss_in_channels = hdsp->ss_out_channels = H9652_SS_CHANNELS;
hdsp->ds_in_channels = hdsp->ds_out_channels = H9652_DS_CHANNELS;
break;
-
+
case H9632:
status = hdsp_read(hdsp, HDSP_statusRegister);
/* HDSP_AEBx bits are low when AEB are connected */
@@ -4811,14 +4811,14 @@ static void snd_hdsp_initialize_channels(struct hdsp *hdsp)
hdsp->ss_in_channels = hdsp->ss_out_channels = MULTIFACE_SS_CHANNELS;
hdsp->ds_in_channels = hdsp->ds_out_channels = MULTIFACE_DS_CHANNELS;
break;
-
+
default:
/* should never get here */
break;
}
}
-static void snd_hdsp_initialize_midi_flush (struct hdsp *hdsp)
+static void snd_hdsp_initialize_midi_flush(struct hdsp *hdsp)
{
snd_hdsp_flush_midi_input (hdsp, 0);
snd_hdsp_flush_midi_input (hdsp, 1);
@@ -4827,12 +4827,12 @@ static void snd_hdsp_initialize_midi_flush (struct hdsp *hdsp)
static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp)
{
int err;
-
+
if ((err = snd_hdsp_create_pcm(card, hdsp)) < 0) {
snd_printk(KERN_ERR "Hammerfall-DSP: Error creating pcm interface\n");
return err;
}
-
+
if ((err = snd_hdsp_create_midi(card, hdsp, 0)) < 0) {
snd_printk(KERN_ERR "Hammerfall-DSP: Error creating first midi interface\n");
@@ -4863,19 +4863,19 @@ static int snd_hdsp_create_alsa_devices(struct snd_card *card, struct hdsp *hdsp
snd_printk(KERN_ERR "Hammerfall-DSP: Error setting default values\n");
return err;
}
-
+
if (!(hdsp->state & HDSP_InitializationComplete)) {
strcpy(card->shortname, "Hammerfall DSP");
- sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name,
+ sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name,
hdsp->port, hdsp->irq);
-
+
if ((err = snd_card_register(card)) < 0) {
snd_printk(KERN_ERR "Hammerfall-DSP: error registering card\n");
return err;
}
hdsp->state |= HDSP_InitializationComplete;
}
-
+
return 0;
}
@@ -4886,7 +4886,7 @@ static int hdsp_request_fw_loader(struct hdsp *hdsp)
const char *fwfile;
const struct firmware *fw;
int err;
-
+
if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
return 0;
if (hdsp->io_type == Undefined) {
@@ -4895,7 +4895,7 @@ static int hdsp_request_fw_loader(struct hdsp *hdsp)
if (hdsp->io_type == H9652 || hdsp->io_type == H9632)
return 0;
}
-
+
/* caution: max length of firmware filename is 30! */
switch (hdsp->io_type) {
case Multiface:
@@ -4929,12 +4929,12 @@ static int hdsp_request_fw_loader(struct hdsp *hdsp)
memcpy(hdsp->firmware_cache, fw->data, sizeof(hdsp->firmware_cache));
release_firmware(fw);
-
+
hdsp->state |= HDSP_FirmwareCached;
if ((err = snd_hdsp_load_firmware_from_cache(hdsp)) < 0)
return err;
-
+
if (!(hdsp->state & HDSP_InitializationComplete)) {
if ((err = snd_hdsp_enable_io(hdsp)) < 0)
return err;
@@ -4981,14 +4981,14 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
hdsp->max_channels = 26;
hdsp->card = card;
-
+
spin_lock_init(&hdsp->lock);
tasklet_init(&hdsp->midi_tasklet, hdsp_midi_tasklet, (unsigned long)hdsp);
-
+
pci_read_config_word(hdsp->pci, PCI_CLASS_REVISION, &hdsp->firmware_rev);
hdsp->firmware_rev &= 0xff;
-
+
/* From Martin Bjoernsen :
"It is important that the card's latency timer register in
the PCI configuration space is set to a value much larger
@@ -4997,7 +4997,7 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
to its maximum 255 to avoid problems with some computers."
*/
pci_write_config_byte(hdsp->pci, PCI_LATENCY_TIMER, 0xFF);
-
+
strcpy(card->driver, "H-DSP");
strcpy(card->mixername, "Xilinx FPGA");
@@ -5011,7 +5011,7 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
} else {
hdsp->card_name = "RME HDSP 9632";
hdsp->max_channels = 16;
- is_9632 = 1;
+ is_9632 = 1;
}
if ((err = pci_enable_device(pci)) < 0)
@@ -5040,7 +5040,7 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
if ((err = snd_hdsp_initialize_memory(hdsp)) < 0)
return err;
-
+
if (!is_9652 && !is_9632) {
/* we wait 2 seconds to let freshly inserted cardbus cards do their hardware init */
ssleep(2);
@@ -5063,35 +5063,35 @@ static int __devinit snd_hdsp_create(struct snd_card *card,
return err;
return 0;
} else {
- snd_printk(KERN_INFO "Hammerfall-DSP: Firmware already present, initializing card.\n");
+ snd_printk(KERN_INFO "Hammerfall-DSP: Firmware already present, initializing card.\n");
if (hdsp_read(hdsp, HDSP_status2Register) & HDSP_version1)
hdsp->io_type = Multiface;
- else
+ else
hdsp->io_type = Digiface;
}
}
-
+
if ((err = snd_hdsp_enable_io(hdsp)) != 0)
return err;
-
+
if (is_9652)
hdsp->io_type = H9652;
-
+
if (is_9632)
hdsp->io_type = H9632;
if ((err = snd_hdsp_create_hwdep(card, hdsp)) < 0)
return err;
-
+
snd_hdsp_initialize_channels(hdsp);
snd_hdsp_initialize_midi_flush(hdsp);
- hdsp->state |= HDSP_FirmwareLoaded;
+ hdsp->state |= HDSP_FirmwareLoaded;
if ((err = snd_hdsp_create_alsa_devices(card, hdsp)) < 0)
return err;
- return 0;
+ return 0;
}
static int snd_hdsp_free(struct hdsp *hdsp)
@@ -5107,13 +5107,13 @@ static int snd_hdsp_free(struct hdsp *hdsp)
free_irq(hdsp->irq, (void *)hdsp);
snd_hdsp_free_buffers(hdsp);
-
+
if (hdsp->iobase)
iounmap(hdsp->iobase);
if (hdsp->port)
pci_release_regions(hdsp->pci);
-
+
pci_disable_device(hdsp->pci);
return 0;
}
@@ -5156,7 +5156,7 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci,
}
strcpy(card->shortname, "Hammerfall DSP");
- sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name,
+ sprintf(card->longname, "%s at 0x%lx, irq %d", hdsp->card_name,
hdsp->port, hdsp->irq);
if ((err = snd_card_register(card)) < 0) {
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 98762f9..16ca8ab 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -29,7 +29,7 @@
#include <linux/moduleparam.h>
#include <linux/slab.h>
#include <linux/pci.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/control.h>
@@ -84,7 +84,7 @@ MODULE_DESCRIPTION("RME HDSPM");
MODULE_LICENSE("GPL");
MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
-/* --- Write registers. ---
+/* --- Write registers. ---
These are defined as byte-offsets from the iobase value. */
#define HDSPM_controlRegister 64
@@ -96,10 +96,10 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
#define HDSPM_eeprom_wr 384 /* for AES32 */
/* DMA enable for 64 channels, only Bit 0 is relevant */
-#define HDSPM_outputEnableBase 512 /* 512-767 input DMA */
+#define HDSPM_outputEnableBase 512 /* 512-767 input DMA */
#define HDSPM_inputEnableBase 768 /* 768-1023 output DMA */
-/* 16 page addresses for each of the 64 channels DMA buffer in and out
+/* 16 page addresses for each of the 64 channels DMA buffer in and out
(each 64k=16*4k) Buffer must be 4k aligned (which is default i386 ????) */
#define HDSPM_pageAddressBufferOut 8192
#define HDSPM_pageAddressBufferIn (HDSPM_pageAddressBufferOut+64*16*4)
@@ -122,15 +122,15 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
#define HDSPM_midiDataIn1 364
/* status is data bytes in MIDI-FIFO (0-128) */
-#define HDSPM_midiStatusOut0 384
-#define HDSPM_midiStatusOut1 388
-#define HDSPM_midiStatusIn0 392
-#define HDSPM_midiStatusIn1 396
+#define HDSPM_midiStatusOut0 384
+#define HDSPM_midiStatusOut1 388
+#define HDSPM_midiStatusIn0 392
+#define HDSPM_midiStatusIn1 396
/* the meters are regular i/o-mapped registers, but offset
considerably from the rest. the peak registers are reset
- when read; the least-significant 4 bits are full-scale counters;
+ when read; the least-significant 4 bits are full-scale counters;
the actual peak value is in the most-significant 24 bits.
*/
#define HDSPM_MADI_peakrmsbase 4096 /* 4096-8191 2x64x32Bit Meters */
@@ -156,7 +156,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
56channelMODE=0 */ /* MADI ONLY*/
#define HDSPM_Emphasis (1<<10) /* Emphasis */ /* AES32 ONLY */
-#define HDSPM_AutoInp (1<<11) /* Auto Input (takeover) == Safe Mode,
+#define HDSPM_AutoInp (1<<11) /* Auto Input (takeover) == Safe Mode,
0=off, 1=on */ /* MADI ONLY */
#define HDSPM_Dolby (1<<11) /* Dolby = "NonAudio" ?? */ /* AES32 ONLY */
@@ -171,7 +171,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
#define HDSPM_SyncRef3 (1<<25)
#define HDSPM_SMUX (1<<18) /* Frame ??? */ /* MADI ONY */
-#define HDSPM_clr_tms (1<<19) /* clear track marker, do not use
+#define HDSPM_clr_tms (1<<19) /* clear track marker, do not use
AES additional bits in
lower 5 Audiodatabits ??? */
#define HDSPM_taxi_reset (1<<20) /* ??? */ /* MADI ONLY ? */
@@ -272,7 +272,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
#define HDSPM_madiLock (1<<3) /* MADI Locked =1, no=0 */
#define HDSPM_BufferPositionMask 0x000FFC0 /* Bit 6..15 : h/w buffer pointer */
- /* since 64byte accurate last 6 bits
+ /* since 64byte accurate last 6 bits
are not used */
#define HDSPM_madiSync (1<<18) /* MADI is in sync */
@@ -344,7 +344,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
/* status */
#define HDSPM_AES32_wcLock 0x0200000
#define HDSPM_AES32_wcFreq_bit 22
-/* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function
+/* (status >> HDSPM_AES32_wcFreq_bit) & 0xF gives WC frequency (cf function
HDSPM_bit2freq */
#define HDSPM_AES32_syncref_bit 16
/* (status >> HDSPM_AES32_syncref_bit) & 0xF gives sync source */
@@ -403,7 +403,7 @@ MODULE_SUPPORTED_DEVICE("{{RME HDSPM-MADI}}");
/* the size of the area we need to allocate for DMA transfers. the
size is the same regardless of the number of channels, and
- also the latency to use.
+ also the latency to use.
for one direction !!!
*/
#define HDSPM_DMA_AREA_BYTES (HDSPM_MAX_CHANNELS * HDSPM_CHANNEL_BUFFER_BYTES)
@@ -563,8 +563,8 @@ static inline unsigned int hdspm_read(struct hdspm * hdspm, unsigned int reg)
return readl(hdspm->iobase + reg);
}
-/* for each output channel (chan) I have an Input (in) and Playback (pb) Fader
- mixer is write only on hardware so we have to cache him for read
+/* for each output channel (chan) I have an Input (in) and Playback (pb) Fader
+ mixer is write only on hardware so we have to cache him for read
each fader is a u32, but uses only the first 16 bit */
static inline int hdspm_read_in_gain(struct hdspm * hdspm, unsigned int chan,
@@ -764,7 +764,7 @@ static snd_pcm_uframes_t hdspm_hw_pointer(struct hdspm * hdspm)
/* hwpointer comes in bytes and is 64Bytes accurate (by docu since
PCI Burst)
- i have experimented that it is at most 64 Byte to much for playing
+ i have experimented that it is at most 64 Byte to much for playing
so substraction of 64 byte should be ok for ALSA, but use it only
for application where you know what you do since if you come to
near with record pointer it can be a disaster */
@@ -832,16 +832,16 @@ static void hdspm_set_dds_value(struct hdspm *hdspm, int rate)
{
u64 n;
u32 r;
-
+
if (rate >= 112000)
rate /= 4;
else if (rate >= 56000)
rate /= 2;
/* RME says n = 104857600000000, but in the windows MADI driver, I see:
-// return 104857600000000 / rate; // 100 MHz
- return 110100480000000 / rate; // 105 MHz
- */
+// return 104857600000000 / rate; //100 MHz
+ return 110100480000000 / rate; //105 MHz
+ */
/* n = 104857600000000ULL; */ /* = 2^20 * 10^8 */
n = 110100480000000ULL; /* Value checked for AES32 and MADI */
div64_32(&n, rate, &r);
@@ -864,13 +864,13 @@ static int hdspm_set_rate(struct hdspm * hdspm, int rate, int called_internally)
if (!(hdspm->control_register & HDSPM_ClockModeMaster)) {
- /* SLAVE --- */
+ /* SLAVE --- */
if (called_internally) {
- /* request from ctl or card initialization
- just make a warning an remember setting
+ /* request from ctl or card initialization
+ just make a warning an remember setting
for future master mode switching */
-
+
snd_printk(KERN_WARNING "HDSPM: "
"Warning: device is not running "
"as a clock master.\n");
@@ -907,7 +907,7 @@ static int hdspm_set_rate(struct hdspm * hdspm, int rate, int called_internally)
Note that a similar but essentially insoluble problem exists for
externally-driven rate changes. All we can do is to flag rate
- changes in the read/write routines.
+ changes in the read/write routines.
*/
if (current_rate <= 48000)
@@ -975,10 +975,10 @@ static int hdspm_set_rate(struct hdspm * hdspm, int rate, int called_internally)
/* For AES32, need to set DDS value in FREQ register
For MADI, also apparently */
hdspm_set_dds_value(hdspm, rate);
-
+
if (hdspm->is_aes32 && rate != current_rate)
hdspm_write(hdspm, HDSPM_eeprom_wr, 0);
-
+
/* For AES32 and for MADI (at least rev 204), channel_map needs to
* always be channel_map_madi_ss, whatever the sample rate */
hdspm->channel_map = channel_map_madi_ss;
@@ -1015,7 +1015,7 @@ static void all_in_all_mixer(struct hdspm * hdspm, int sgain)
MIDI
----------------------------------------------------------------------------*/
-static inline unsigned char snd_hdspm_midi_read_byte (struct hdspm *hdspm,
+static inline unsigned char snd_hdspm_midi_read_byte(struct hdspm *hdspm,
int id)
{
/* the hardware already does the relevant bit-mask with 0xff */
@@ -1025,7 +1025,7 @@ static inline unsigned char snd_hdspm_midi_read_byte (struct hdspm *hdspm,
return hdspm_read(hdspm, HDSPM_midiDataIn0);
}
-static inline void snd_hdspm_midi_write_byte (struct hdspm *hdspm, int id,
+static inline void snd_hdspm_midi_write_byte(struct hdspm *hdspm, int id,
int val)
{
/* the hardware already does the relevant bit-mask with 0xff */
@@ -1035,7 +1035,7 @@ static inline void snd_hdspm_midi_write_byte (struct hdspm *hdspm, int id,
hdspm_write(hdspm, HDSPM_midiDataOut0, val);
}
-static inline int snd_hdspm_midi_input_available (struct hdspm *hdspm, int id)
+static inline int snd_hdspm_midi_input_available(struct hdspm *hdspm, int id)
{
if (id)
return (hdspm_read(hdspm, HDSPM_midiStatusIn1) & 0xff);
@@ -1043,7 +1043,7 @@ static inline int snd_hdspm_midi_input_available (struct hdspm *hdspm, int id)
return (hdspm_read(hdspm, HDSPM_midiStatusIn0) & 0xff);
}
-static inline int snd_hdspm_midi_output_possible (struct hdspm *hdspm, int id)
+static inline int snd_hdspm_midi_output_possible(struct hdspm *hdspm, int id)
{
int fifo_bytes_used;
@@ -1065,7 +1065,7 @@ static void snd_hdspm_flush_midi_input(struct hdspm *hdspm, int id)
snd_hdspm_midi_read_byte (hdspm, id);
}
-static int snd_hdspm_midi_output_write (struct hdspm_midi *hmidi)
+static int snd_hdspm_midi_output_write(struct hdspm_midi *hmidi)
{
unsigned long flags;
int n_pending;
@@ -1074,7 +1074,7 @@ static int snd_hdspm_midi_output_write (struct hdspm_midi *hmidi)
unsigned char buf[128];
/* Output is not interrupt driven */
-
+
spin_lock_irqsave (&hmidi->lock, flags);
if (hmidi->output &&
!snd_rawmidi_transmit_empty (hmidi->output)) {
@@ -1083,11 +1083,11 @@ static int snd_hdspm_midi_output_write (struct hdspm_midi *hmidi)
if (n_pending > 0) {
if (n_pending > (int)sizeof (buf))
n_pending = sizeof (buf);
-
+
to_write = snd_rawmidi_transmit (hmidi->output, buf,
n_pending);
if (to_write > 0) {
- for (i = 0; i < to_write; ++i)
+ for (i = 0; i < to_write; ++i)
snd_hdspm_midi_write_byte (hmidi->hdspm,
hmidi->id,
buf[i]);
@@ -1098,7 +1098,7 @@ static int snd_hdspm_midi_output_write (struct hdspm_midi *hmidi)
return 0;
}
-static int snd_hdspm_midi_input_read (struct hdspm_midi *hmidi)
+static int snd_hdspm_midi_input_read(struct hdspm_midi *hmidi)
{
unsigned char buf[128]; /* this buffer is designed to match the MIDI
* input FIFO size
@@ -1167,14 +1167,14 @@ static void snd_hdspm_midi_output_timer(unsigned long data)
{
struct hdspm_midi *hmidi = (struct hdspm_midi *) data;
unsigned long flags;
-
+
snd_hdspm_midi_output_write(hmidi);
spin_lock_irqsave (&hmidi->lock, flags);
/* this does not bump hmidi->istimer, because the
kernel automatically removed the timer when it
expired, and we are now adding it back, thus
- leaving istimer wherever it was set before.
+ leaving istimer wherever it was set before.
*/
if (hmidi->istimer) {
@@ -1278,7 +1278,7 @@ static struct snd_rawmidi_ops snd_hdspm_midi_input =
.trigger = snd_hdspm_midi_input_trigger,
};
-static int __devinit snd_hdspm_create_midi (struct snd_card *card,
+static int __devinit snd_hdspm_create_midi(struct snd_card *card,
struct hdspm *hdspm, int id)
{
int err;
@@ -1312,12 +1312,12 @@ static int __devinit snd_hdspm_create_midi (struct snd_card *card,
static void hdspm_midi_tasklet(unsigned long arg)
{
struct hdspm *hdspm = (struct hdspm *)arg;
-
+
if (hdspm->midi[0].pending)
snd_hdspm_midi_input_read (&hdspm->midi[0]);
if (hdspm->midi[1].pending)
snd_hdspm_midi_input_read (&hdspm->midi[1]);
-}
+}
/*-----------------------------------------------------------------------------
@@ -2475,8 +2475,8 @@ static int snd_hdspm_put_qs_wire(struct snd_kcontrol *kcontrol,
/* Simple Mixer
deprecated since to much faders ???
MIXER interface says output (source, destination, value)
- where source > MAX_channels are playback channels
- on MADICARD
+ where source > MAX_channels are playback channels
+ on MADICARD
- playback mixer matrix: [channelout+64] [output] [value]
- input(thru) mixer matrix: [channelin] [output] [value]
(better do 2 kontrols for seperation ?)
@@ -2586,7 +2586,7 @@ static int snd_hdspm_put_mixer(struct snd_kcontrol *kcontrol,
/* The simple mixer control(s) provide gain control for the
basic 1:1 mappings of playback streams to output
- streams.
+ streams.
*/
#define HDSPM_PLAYBACK_MIXER \
@@ -2634,7 +2634,7 @@ static int snd_hdspm_get_playback_mixer(struct snd_kcontrol *kcontrol,
snd_printdd("get pb mixer index %d, channel %d, mapped_channel %d, "
"value %d\n",
ucontrol->id.index, channel, mapped_channel,
- ucontrol->value.integer.value[0]);
+ ucontrol->value.integer.value[0]);
*/
return 0;
}
@@ -2906,7 +2906,7 @@ static int snd_hdspm_create_controls(struct snd_card *card, struct hdspm * hdspm
}
}
- /* Channel playback mixer as default control
+ /* Channel playback mixer as default control
Note: the whole matrix would be 128*HDSPM_MIXER_CHANNELS Faders,
thats too * big for any alsamixer they are accesible via special
IOCTL on hwdep and the mixer 2dimensional mixer control
@@ -2934,7 +2934,7 @@ static int snd_hdspm_create_controls(struct snd_card *card, struct hdspm * hdspm
}
/*------------------------------------------------------------
- /proc interface
+ /proc interface
------------------------------------------------------------*/
static void
@@ -3341,7 +3341,7 @@ static void __devinit snd_hdspm_proc_init(struct hdspm * hdspm)
}
/*------------------------------------------------------------
- hdspm intitialize
+ hdspm intitialize
------------------------------------------------------------*/
static int snd_hdspm_set_defaults(struct hdspm * hdspm)
@@ -3417,7 +3417,7 @@ static int snd_hdspm_set_defaults(struct hdspm * hdspm)
/*------------------------------------------------------------
- interrupt
+ interrupt
------------------------------------------------------------*/
static irqreturn_t snd_hdspm_interrupt(int irq, void *dev_id)
@@ -3481,7 +3481,7 @@ static irqreturn_t snd_hdspm_interrupt(int irq, void *dev_id)
}
/*------------------------------------------------------------
- pcm interface
+ pcm interface
------------------------------------------------------------*/
@@ -3719,7 +3719,7 @@ static int snd_hdspm_hw_free(struct snd_pcm_substream *substream)
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
- /* params_channels(params) should be enough,
+ /* params_channels(params) should be enough,
but to get sure in case of error */
for (i = 0; i < HDSPM_MAX_CHANNELS; ++i)
snd_hdspm_enable_out(hdspm, i, 0);
@@ -3827,7 +3827,7 @@ static int snd_hdspm_trigger(struct snd_pcm_substream *substream, int cmd)
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
hdspm_silence_playback(hdspm);
}
- _ok:
+_ok:
snd_pcm_trigger_done(substream, substream);
if (!hdspm->running && running)
hdspm_start_audio(hdspm);
@@ -4124,13 +4124,13 @@ static int snd_hdspm_hwdep_ioctl(struct snd_hwdep * hw, struct file *file,
/* maybe there is a chance to memorymap in future
* so dont touch just copy
*/
- if(copy_to_user_fromio((void __user *)rms.peak,
+ if (copy_to_user_fromio((void __user *)rms.peak,
hdspm->iobase+HDSPM_MADI_peakrmsbase,
- sizeof(struct hdspm_peak_rms)) != 0 )
+ sizeof(struct hdspm_peak_rms)) != 0)
return -EFAULT;
break;
-
+
case SNDRV_HDSPM_IOCTL_GET_CONFIG_INFO:
@@ -4222,7 +4222,7 @@ static int __devinit snd_hdspm_create_hwdep(struct snd_card *card,
/*------------------------------------------------------------
- memory interface
+ memory interface
------------------------------------------------------------*/
static int __devinit snd_hdspm_preallocate_memory(struct hdspm * hdspm)
{
diff --git a/sound/pci/rme9652/rme9652.c b/sound/pci/rme9652/rme9652.c
index 2570907..7a4fdad 100644
--- a/sound/pci/rme9652/rme9652.c
+++ b/sound/pci/rme9652/rme9652.c
@@ -1,5 +1,5 @@
/*
- * ALSA driver for RME Digi9652 audio interfaces
+ * ALSA driver for RME Digi9652 audio interfaces
*
* Copyright (c) 1999 IEM - Winfried Ritsch
* Copyright (c) 1999-2001 Paul Davis
@@ -35,7 +35,7 @@
#include <sound/initval.h>
#include <asm/current.h>
-#include <asm/io.h>
+#include <linux/io.h>
static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */
static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */
@@ -60,7 +60,7 @@ MODULE_SUPPORTED_DEVICE("{{RME,Hammerfall},"
capture, one for playback. Both the ADAT and S/PDIF channels appear
to the host CPU in the same block of memory. There is no functional
difference between them in terms of access.
-
+
The Hammerfall Light is identical to the Hammerfall, except that it
has 2 sets 18 channels (16 ADAT + 2 S/PDIF) for capture and playback.
*/
@@ -115,7 +115,7 @@ MODULE_SUPPORTED_DEVICE("{{RME,Hammerfall},"
/* Bits 31,30,29 are bits 5,4,3 of h/w pointer position on later
Rev G EEPROMS and Rev 1.5 cards or later.
-*/
+*/
#define RME9652_REV15_buf_pos(x) ((((x)&0xE0000000)>>26)|((x)&RME9652_buf_pos))
@@ -186,7 +186,7 @@ MODULE_SUPPORTED_DEVICE("{{RME,Hammerfall},"
#define RME9652_CHANNEL_BUFFER_BYTES (4*RME9652_CHANNEL_BUFFER_SAMPLES)
/* the size of the area we need to allocate for DMA transfers. the
- size is the same regardless of the number of channels - the
+ size is the same regardless of the number of channels - the
9636 still uses the same memory area.
Note that we allocate 1 more channel than is apparently needed
@@ -204,7 +204,7 @@ struct snd_rme9652 {
int irq;
unsigned long port;
void __iomem *iobase;
-
+
int precise_ptr;
u32 control_register; /* cached value */
@@ -217,7 +217,7 @@ struct snd_rme9652 {
size_t hw_offsetmask; /* &-with status register to get real hw_offset */
size_t prev_hw_offset; /* previous hw offset */
- size_t max_jitter; /* maximum jitter in frames for
+ size_t max_jitter; /* maximum jitter in frames for
hw pointer */
size_t period_bytes; /* guess what this is */
@@ -266,7 +266,7 @@ static char channel_map_9652_ss[26] = {
};
static char channel_map_9636_ss[26] = {
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
/* channels 16 and 17 are S/PDIF */
24, 25,
/* channels 18-25 don't exist */
@@ -367,7 +367,7 @@ static inline void rme9652_compute_period_size(struct snd_rme9652 *rme9652)
i = rme9652->control_register & RME9652_latency;
rme9652->period_bytes = 1 << ((rme9652_decode_latency(i) + 8));
- rme9652->hw_offsetmask =
+ rme9652->hw_offsetmask =
(rme9652->period_bytes * 2 - 1) & RME9652_buf_pos;
rme9652->max_jitter = 80;
}
@@ -426,7 +426,7 @@ static inline void rme9652_reset_hw_pointer(struct snd_rme9652 *rme9652)
/* reset the FIFO pointer to zero. We do this by writing to 8
registers, each of which is a 32bit wide register, and set
them all to zero. Note that s->iobase is a pointer to
- int32, not pointer to char.
+ int32, not pointer to char.
*/
for (i = 0; i < 8; i++) {
@@ -494,9 +494,9 @@ static int rme9652_set_rate(struct snd_rme9652 *rme9652, int rate)
/* Changing from a "single speed" to a "double speed" rate is
not allowed if any substreams are open. This is because
- such a change causes a shift in the location of
+ such a change causes a shift in the location of
the DMA buffers and a reduction in the number of available
- buffers.
+ buffers.
Note that a similar but essentially insoluble problem
exists for externally-driven rate changes. All we can do
@@ -605,7 +605,7 @@ static void rme9652_set_thru(struct snd_rme9652 *rme9652, int channel, int enabl
rme9652_write(rme9652,
RME9652_thru_base + mapped_channel * 4,
- enable ? 1 : 0);
+ enable ? 1 : 0);
}
}
@@ -619,7 +619,7 @@ static int rme9652_set_passthru(struct snd_rme9652 *rme9652, int onoff)
*/
rme9652->control_register =
- RME9652_inp_0 |
+ RME9652_inp_0 |
rme9652_encode_latency(7) |
RME9652_start_bit;
@@ -630,24 +630,24 @@ static int rme9652_set_passthru(struct snd_rme9652 *rme9652, int onoff)
rme9652->passthru = 1;
} else {
rme9652_set_thru(rme9652, -1, 0);
- rme9652_stop(rme9652);
+ rme9652_stop(rme9652);
rme9652->passthru = 0;
}
return 0;
}
-static void rme9652_spdif_set_bit (struct snd_rme9652 *rme9652, int mask, int onoff)
+static void rme9652_spdif_set_bit(struct snd_rme9652 *rme9652, int mask, int onoff)
{
- if (onoff)
+ if (onoff)
rme9652->control_register |= mask;
- else
+ else
rme9652->control_register &= ~mask;
-
+
rme9652_write(rme9652, RME9652_control_register, rme9652->control_register);
}
-static void rme9652_spdif_write_byte (struct snd_rme9652 *rme9652, const int val)
+static void rme9652_spdif_write_byte(struct snd_rme9652 *rme9652, const int val)
{
long mask;
long i;
@@ -655,7 +655,7 @@ static void rme9652_spdif_write_byte (struct snd_rme9652 *rme9652, const int val
for (i = 0, mask = 0x80; i < 8; i++, mask >>= 1) {
if (val & mask)
rme9652_spdif_set_bit (rme9652, RME9652_SPDIF_WRITE, 1);
- else
+ else
rme9652_spdif_set_bit (rme9652, RME9652_SPDIF_WRITE, 0);
rme9652_spdif_set_bit (rme9652, RME9652_SPDIF_CLOCK, 1);
@@ -663,7 +663,7 @@ static void rme9652_spdif_write_byte (struct snd_rme9652 *rme9652, const int val
}
}
-static int rme9652_spdif_read_byte (struct snd_rme9652 *rme9652)
+static int rme9652_spdif_read_byte(struct snd_rme9652 *rme9652)
{
long mask;
long val;
@@ -681,7 +681,7 @@ static int rme9652_spdif_read_byte (struct snd_rme9652 *rme9652)
return val;
}
-static void rme9652_write_spdif_codec (struct snd_rme9652 *rme9652, const int address, const int data)
+static void rme9652_write_spdif_codec(struct snd_rme9652 *rme9652, const int address, const int data)
{
rme9652_spdif_set_bit (rme9652, RME9652_SPDIF_SELECT, 1);
rme9652_spdif_write_byte (rme9652, 0x20);
@@ -691,7 +691,7 @@ static void rme9652_write_spdif_codec (struct snd_rme9652 *rme9652, const int ad
}
-static int rme9652_spdif_read_codec (struct snd_rme9652 *rme9652, const int address)
+static int rme9652_spdif_read_codec(struct snd_rme9652 *rme9652, const int address)
{
int ret;
@@ -708,7 +708,7 @@ static int rme9652_spdif_read_codec (struct snd_rme9652 *rme9652, const int addr
return ret;
}
-static void rme9652_initialize_spdif_receiver (struct snd_rme9652 *rme9652)
+static void rme9652_initialize_spdif_receiver(struct snd_rme9652 *rme9652)
{
/* XXX what unsets this ? */
@@ -726,19 +726,19 @@ static inline int rme9652_spdif_sample_rate(struct snd_rme9652 *s)
if (rme9652_read(s, RME9652_status_register) & RME9652_ERF) {
return -1; /* error condition */
}
-
+
if (s->hw_rev == 15) {
int x, y, ret;
-
+
x = rme9652_spdif_read_codec (s, 30);
- if (x != 0)
+ if (x != 0)
y = 48000 * 64 / x;
else
y = 0;
- if (y > 30400 && y < 33600) ret = 32000;
+ if (y > 30400 && y < 33600) ret = 32000;
else if (y > 41900 && y < 46000) ret = 44100;
else if (y > 46000 && y < 50400) ret = 48000;
else if (y > 60800 && y < 67200) ret = 64000;
@@ -819,7 +819,7 @@ static int snd_rme9652_control_spdif_info(struct snd_kcontrol *kcontrol, struct
static int snd_rme9652_control_spdif_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
snd_rme9652_convert_to_aes(&ucontrol->value.iec958, rme9652->creg_spdif);
return 0;
}
@@ -829,7 +829,7 @@ static int snd_rme9652_control_spdif_put(struct snd_kcontrol *kcontrol, struct s
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_rme9652_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&rme9652->lock);
change = val != rme9652->creg_spdif;
@@ -848,7 +848,7 @@ static int snd_rme9652_control_spdif_stream_info(struct snd_kcontrol *kcontrol,
static int snd_rme9652_control_spdif_stream_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
snd_rme9652_convert_to_aes(&ucontrol->value.iec958, rme9652->creg_spdif_stream);
return 0;
}
@@ -858,7 +858,7 @@ static int snd_rme9652_control_spdif_stream_put(struct snd_kcontrol *kcontrol, s
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
u32 val;
-
+
val = snd_rme9652_convert_from_aes(&ucontrol->value.iec958);
spin_lock_irq(&rme9652->lock);
change = val != rme9652->creg_spdif_stream;
@@ -891,7 +891,7 @@ static int snd_rme9652_control_spdif_mask_get(struct snd_kcontrol *kcontrol, str
static unsigned int rme9652_adat1_in(struct snd_rme9652 *rme9652)
{
if (rme9652->control_register & RME9652_ADAT1_INTERNAL)
- return 1;
+ return 1;
return 0;
}
@@ -936,7 +936,7 @@ static int snd_rme9652_info_adat1_in(struct snd_kcontrol *kcontrol, struct snd_c
static int snd_rme9652_get_adat1_in(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.enumerated.item[0] = rme9652_adat1_in(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -948,7 +948,7 @@ static int snd_rme9652_put_adat1_in(struct snd_kcontrol *kcontrol, struct snd_ct
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_rme9652_use_is_exclusive(rme9652))
return -EBUSY;
val = ucontrol->value.enumerated.item[0] % 2;
@@ -1007,7 +1007,7 @@ static int snd_rme9652_info_spdif_in(struct snd_kcontrol *kcontrol, struct snd_c
static int snd_rme9652_get_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.enumerated.item[0] = rme9652_spdif_in(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1019,7 +1019,7 @@ static int snd_rme9652_put_spdif_in(struct snd_kcontrol *kcontrol, struct snd_ct
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_rme9652_use_is_exclusive(rme9652))
return -EBUSY;
val = ucontrol->value.enumerated.item[0] % 3;
@@ -1069,7 +1069,7 @@ static int rme9652_set_spdif_output(struct snd_rme9652 *rme9652, int out)
static int snd_rme9652_get_spdif_out(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.integer.value[0] = rme9652_spdif_out(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1081,7 +1081,7 @@ static int snd_rme9652_put_spdif_out(struct snd_kcontrol *kcontrol, struct snd_c
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
if (!snd_rme9652_use_is_exclusive(rme9652))
return -EBUSY;
val = ucontrol->value.integer.value[0] & 1;
@@ -1156,7 +1156,7 @@ static int snd_rme9652_info_sync_mode(struct snd_kcontrol *kcontrol, struct snd_
static int snd_rme9652_get_sync_mode(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.enumerated.item[0] = rme9652_sync_mode(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1168,7 +1168,7 @@ static int snd_rme9652_put_sync_mode(struct snd_kcontrol *kcontrol, struct snd_c
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change;
unsigned int val;
-
+
val = ucontrol->value.enumerated.item[0] % 3;
spin_lock_irq(&rme9652->lock);
change = (int)val != rme9652_sync_mode(rme9652);
@@ -1248,7 +1248,7 @@ static int snd_rme9652_info_sync_pref(struct snd_kcontrol *kcontrol, struct snd_
static int snd_rme9652_get_sync_pref(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.enumerated.item[0] = rme9652_sync_pref(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1260,7 +1260,7 @@ static int snd_rme9652_put_sync_pref(struct snd_kcontrol *kcontrol, struct snd_c
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
int change, max;
unsigned int val;
-
+
if (!snd_rme9652_use_is_exclusive(rme9652))
return -EBUSY;
max = rme9652->ss_channels == RME9652_NCHANNELS ? 4 : 3;
@@ -1308,7 +1308,7 @@ static int snd_rme9652_put_thru(struct snd_kcontrol *kcontrol, struct snd_ctl_el
if (ucontrol->value.integer.value[chn])
thru_bits |= 1 << chn;
}
-
+
spin_lock_irq(&rme9652->lock);
change = thru_bits ^ rme9652->thru_bits;
if (change) {
@@ -1379,7 +1379,7 @@ static int snd_rme9652_info_spdif_rate(struct snd_kcontrol *kcontrol, struct snd
static int snd_rme9652_get_spdif_rate(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&rme9652->lock);
ucontrol->value.integer.value[0] = rme9652_spdif_sample_rate(rme9652);
spin_unlock_irq(&rme9652->lock);
@@ -1409,11 +1409,11 @@ static int snd_rme9652_get_adat_sync(struct snd_kcontrol *kcontrol, struct snd_c
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
unsigned int mask1, mask2, val;
-
+
switch (kcontrol->private_value) {
- case 0: mask1 = RME9652_lock_0; mask2 = RME9652_sync_0; break;
- case 1: mask1 = RME9652_lock_1; mask2 = RME9652_sync_1; break;
- case 2: mask1 = RME9652_lock_2; mask2 = RME9652_sync_2; break;
+ case 0: mask1 = RME9652_lock_0; mask2 = RME9652_sync_0; break;
+ case 1: mask1 = RME9652_lock_1; mask2 = RME9652_sync_1; break;
+ case 2: mask1 = RME9652_lock_2; mask2 = RME9652_sync_2; break;
default: return -EINVAL;
}
val = rme9652_read(rme9652, RME9652_status_register);
@@ -1433,8 +1433,8 @@ static int snd_rme9652_get_adat_sync(struct snd_kcontrol *kcontrol, struct snd_c
static int snd_rme9652_get_tc_valid(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_rme9652 *rme9652 = snd_kcontrol_chip(kcontrol);
-
- ucontrol->value.integer.value[0] =
+
+ ucontrol->value.integer.value[0] =
(rme9652_read(rme9652, RME9652_status_register) & RME9652_tc_valid) ? 1 : 0;
return 0;
}
@@ -1520,7 +1520,7 @@ static struct snd_kcontrol_new snd_rme9652_controls[] = {
.get = snd_rme9652_control_spdif_mask_get,
.private_value = IEC958_AES0_NONAUDIO |
IEC958_AES0_PROFESSIONAL |
- IEC958_AES0_CON_EMPHASIS,
+ IEC958_AES0_CON_EMPHASIS,
},
{
.access = SNDRV_CTL_ELEM_ACCESS_READ,
@@ -1582,7 +1582,7 @@ static int snd_rme9652_create_controls(struct snd_card *card, struct snd_rme9652
}
/*------------------------------------------------------------
- /proc interface
+ /proc interface
------------------------------------------------------------*/
static void
@@ -1606,10 +1606,10 @@ snd_rme9652_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buff
snd_iprintf(buffer, "\n");
- x = 1 << (6 + rme9652_decode_latency(rme9652->control_register &
+ x = 1 << (6 + rme9652_decode_latency(rme9652->control_register &
RME9652_latency));
- snd_iprintf(buffer, "Latency: %d samples (2 periods of %lu bytes)\n",
+ snd_iprintf(buffer, "Latency: %d samples (2 periods of %lu bytes)\n",
x, (unsigned long) rme9652->period_bytes);
snd_iprintf(buffer, "Hardware pointer (frames): %ld\n",
rme9652_hw_pointer(rme9652));
@@ -1655,7 +1655,7 @@ snd_rme9652_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buff
snd_iprintf(buffer, "\n");
- switch (rme9652_decode_spdif_in(rme9652->control_register &
+ switch (rme9652_decode_spdif_in(rme9652->control_register &
RME9652_inp)) {
case RME9652_SPDIFIN_OPTICAL:
snd_iprintf(buffer, "IEC958 input: ADAT1\n");
@@ -1762,7 +1762,7 @@ static void __devinit snd_rme9652_proc_init(struct snd_rme9652 *rme9652)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(rme9652->card, "rme9652", &entry))
+ if (!snd_card_proc_new(rme9652->card, "rme9652", &entry))
snd_info_set_text_ops(entry, rme9652, snd_rme9652_proc_read);
}
@@ -1828,11 +1828,11 @@ static void snd_rme9652_set_defaults(struct snd_rme9652 *rme9652)
/* set defaults:
- SPDIF Input via Coax
+ SPDIF Input via Coax
autosync clock mode
maximum latency (7 = 8192 samples, 64Kbyte buffer,
which implies 2 4096 sample, 32Kbyte periods).
-
+
if rev 1.5, initialize the S/PDIF receiver.
*/
@@ -1893,11 +1893,11 @@ static char *rme9652_channel_buffer_location(struct snd_rme9652 *rme9652,
if (snd_BUG_ON(channel < 0 || channel >= RME9652_NCHANNELS))
return NULL;
-
+
if ((mapped_channel = rme9652->channel_map[channel]) < 0) {
return NULL;
}
-
+
if (stream == SNDRV_PCM_STREAM_CAPTURE) {
return rme9652->capture_buffer +
(mapped_channel * RME9652_CHANNEL_BUFFER_BYTES);
@@ -2142,10 +2142,10 @@ static int snd_rme9652_trigger(struct snd_pcm_substream *substream,
rme9652_silence_playback(rme9652);
}
} else {
- if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+ if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
rme9652_silence_playback(rme9652);
}
- _ok:
+_ok:
snd_pcm_trigger_done(substream, substream);
if (!rme9652->running && running)
rme9652_start(rme9652);
@@ -2178,9 +2178,9 @@ static struct snd_pcm_hardware snd_rme9652_playback_subinfo =
SNDRV_PCM_INFO_SYNC_START |
SNDRV_PCM_INFO_DOUBLE),
.formats = SNDRV_PCM_FMTBIT_S32_LE,
- .rates = (SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_88200 |
+ .rates = (SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 44100,
.rate_max = 96000,
@@ -2201,9 +2201,9 @@ static struct snd_pcm_hardware snd_rme9652_capture_subinfo =
SNDRV_PCM_INFO_NONINTERLEAVED |
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_S32_LE,
- .rates = (SNDRV_PCM_RATE_44100 |
- SNDRV_PCM_RATE_48000 |
- SNDRV_PCM_RATE_88200 |
+ .rates = (SNDRV_PCM_RATE_44100 |
+ SNDRV_PCM_RATE_48000 |
+ SNDRV_PCM_RATE_88200 |
SNDRV_PCM_RATE_96000),
.rate_min = 44100,
.rate_max = 96000,
@@ -2478,7 +2478,7 @@ static int __devinit snd_rme9652_create(struct snd_card *card,
snd_printk(KERN_ERR "unable to remap region 0x%lx-0x%lx\n", rme9652->port, rme9652->port + RME9652_IO_EXTENT - 1);
return -EBUSY;
}
-
+
if (request_irq(pci->irq, snd_rme9652_interrupt, IRQF_SHARED,
"rme9652", rme9652)) {
snd_printk(KERN_ERR "unable to request IRQ %d\n", pci->irq);
@@ -2503,7 +2503,7 @@ static int __devinit snd_rme9652_create(struct snd_card *card,
"Light", which does not have the expansion board. This
method comes from information received from Mathhias
Clausen at RME. Display the EEPROM and h/w revID where
- relevant.
+ relevant.
*/
switch (rev) {
@@ -2616,7 +2616,7 @@ static int __devinit snd_rme9652_probe(struct pci_dev *pci,
sprintf(card->longname, "%s at 0x%lx, irq %d",
card->shortname, rme9652->port, rme9652->irq);
-
+
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
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/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