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

[alsa-devel] [PATCH 1/8] ASoC: Make all codecs depend on rather than selecting I2C
by Mark Brown 09 Sep '08
by Mark Brown 09 Sep '08
09 Sep '08
The I2C layer uses I/O operations that aren't available on all
architectures and since select bypasses Kconfig dependency checking
selecting I2C breaks builds like allmodconfig on some architectures.
Signed-off-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
sound/soc/codecs/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 5d77dc3..13ae4fd 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -1,6 +1,6 @@
config SND_SOC_ALL_CODECS
tristate "Build all ASoC CODEC drivers"
- select I2C
+ depends on I2C
select SPI
select SND_SOC_AK4535
select SND_SOC_UDA1380
--
1.5.6.5
6
20

[alsa-devel] how is 'dir' in snd_pcm_hw_params_set_periods_near() supposed to work?
by Lennart Poettering 09 Sep '08
by Lennart Poettering 09 Sep '08
09 Sep '08
Heya!
How is the 'dir' argument in snd_pcm_hw_params_set_periods_near()
supposed to work?
I'd assume that passing dir=1 would mean that it is looked for a
number of periods that is greater *or equal* to what we request. If we
pass dir=-1 we'd be looking for a number of periods that is smaller
*or equal* to what we request.
However, what I am experiencing is that there is no "or equal". On my
softvol on hda setup here if I ask for 5 periods I will always get 6
if I pass dir=1 -- even if the could give me 5 and will give me five
if I pass dir=0.
The docs don't really elaborate on this much.
I'd certainly think that having ">=" and "<=" here is much more useful
and natural than ">" and "<", and hence I was wondering: is this just
a bug in the software or is it really intended to be this way?
Lennart
--
Lennart Poettering Red Hat, Inc.
lennart [at] poettering [dot] net ICQ# 11060553
http://0pointer.net/lennart/ GnuPG 0x1A015CC4
2
1

[alsa-devel] [PATCH 09/24] sound/pci: coding style fixes: sound/pci/e*
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/ens1370.c | 60 ++++++++++++++++++++--------------------
sound/pci/es1938.c | 68 +++++++++++++++++++++++-----------------------
sound/pci/es1968.c | 74 +++++++++++++++++++++++++-------------------------
3 files changed, 101 insertions(+), 101 deletions(-)
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 9bf9536..56a8f7c 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -26,7 +26,7 @@
* by Kurt J. Bosch
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -467,13 +467,13 @@ MODULE_DEVICE_TABLE(pci, snd_audiopci_ids);
static unsigned int snd_es1370_fixed_rates[] =
{5512, 11025, 22050, 44100};
static struct snd_pcm_hw_constraint_list snd_es1370_hw_constraints_rates = {
- .count = 4,
+ .count = 4,
.list = snd_es1370_fixed_rates,
.mask = 0,
};
static struct snd_ratnum es1370_clock = {
.num = ES_1370_SRCLOCK,
- .den_min = 29,
+ .den_min = 29,
.den_max = 353,
.den_step = 1,
};
@@ -494,7 +494,7 @@ static struct snd_pcm_hw_constraint_ratdens snd_es1371_hw_constraints_dac_clock
};
static struct snd_ratnum es1371_adc_clock = {
.num = 48000 << 15,
- .den_min = 32768,
+ .den_min = 32768,
.den_max = 393216,
.den_step = 1,
};
@@ -542,7 +542,7 @@ static unsigned int snd_es1371_src_read(struct ensoniq * ensoniq, unsigned short
/* now, wait for busy and the correct time to read */
temp = snd_es1371_wait_src_ready(ensoniq);
-
+
if ((temp & 0x00870000) != 0x00010000) {
/* wait for the right state */
for (i = 0; i < POLL_COUNT; i++) {
@@ -552,12 +552,12 @@ static unsigned int snd_es1371_src_read(struct ensoniq * ensoniq, unsigned short
}
}
- /* hide the state bits */
+ /* hide the state bits */
r = orig & (ES_1371_SRC_DISABLE | ES_1371_DIS_P1 |
ES_1371_DIS_P2 | ES_1371_DIS_R1);
r |= ES_1371_SRC_RAM_ADDRO(reg);
outl(r, ES_REG(ensoniq, 1371_SMPRATE));
-
+
return temp;
}
@@ -648,7 +648,7 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97,
struct ensoniq *ensoniq = ac97->private_data;
unsigned int t, x, fail = 0;
- __again:
+__again:
mutex_lock(&ensoniq->src_mutex);
for (t = 0; t < POLL_COUNT; t++) {
if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP)) {
@@ -677,7 +677,7 @@ static unsigned short snd_es1371_codec_read(struct snd_ac97 *ac97,
/* wait for WIP again */
for (t = 0; t < POLL_COUNT; t++) {
if (!(inl(ES_REG(ensoniq, 1371_CODEC)) & ES_1371_CODEC_WIP))
- break;
+ break;
}
/* now wait for the stinkin' data (RDY) */
for (t = 0; t < POLL_COUNT; t++) {
@@ -1053,7 +1053,7 @@ static struct snd_pcm_hardware snd_ensoniq_playback1 =
SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
#else
(SNDRV_PCM_RATE_KNOT | /* 5512Hz rate */
- SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_22050 |
+ SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_22050 |
SNDRV_PCM_RATE_44100),
#endif
.rate_min = 4000,
@@ -1072,7 +1072,7 @@ static struct snd_pcm_hardware snd_ensoniq_playback2 =
{
.info = (SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
- SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
+ SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
SNDRV_PCM_INFO_SYNC_START),
.formats = SNDRV_PCM_FMTBIT_U8 | SNDRV_PCM_FMTBIT_S16_LE,
.rates = SNDRV_PCM_RATE_CONTINUOUS | SNDRV_PCM_RATE_8000_48000,
@@ -1424,7 +1424,7 @@ static int snd_es1371_spdif_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
-
+
spin_lock_irq(&ensoniq->reg_lock);
ucontrol->value.integer.value[0] = ensoniq->ctrl & ES_1373_SPDIF_THRU ? 1 : 0;
spin_unlock_irq(&ensoniq->reg_lock);
@@ -1437,7 +1437,7 @@ static int snd_es1371_spdif_put(struct snd_kcontrol *kcontrol,
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
unsigned int nval1, nval2;
int change;
-
+
nval1 = ucontrol->value.integer.value[0] ? ES_1373_SPDIF_THRU : 0;
nval2 = ucontrol->value.integer.value[0] ? ES_1373_SPDIF_EN : 0;
spin_lock_irq(&ensoniq->reg_lock);
@@ -1487,7 +1487,7 @@ static int snd_es1373_rear_get(struct snd_kcontrol *kcontrol,
{
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
int val = 0;
-
+
spin_lock_irq(&ensoniq->reg_lock);
if ((ensoniq->cssr & (ES_1373_REAR_BIT27|ES_1373_REAR_BIT26|
ES_1373_REAR_BIT24)) == ES_1373_REAR_BIT26)
@@ -1503,7 +1503,7 @@ static int snd_es1373_rear_put(struct snd_kcontrol *kcontrol,
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
unsigned int nval1;
int change;
-
+
nval1 = ucontrol->value.integer.value[0] ?
ES_1373_REAR_BIT26 : (ES_1373_REAR_BIT27|ES_1373_REAR_BIT24);
spin_lock_irq(&ensoniq->reg_lock);
@@ -1532,7 +1532,7 @@ static int snd_es1373_line_get(struct snd_kcontrol *kcontrol,
{
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
int val = 0;
-
+
spin_lock_irq(&ensoniq->reg_lock);
if ((ensoniq->ctrl & ES_1371_GPIO_OUTM) >= 4)
val = 1;
@@ -1547,7 +1547,7 @@ static int snd_es1373_line_put(struct snd_kcontrol *kcontrol,
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
int changed;
unsigned int ctrl;
-
+
spin_lock_irq(&ensoniq->reg_lock);
ctrl = ensoniq->ctrl;
if (ucontrol->value.integer.value[0])
@@ -1690,7 +1690,7 @@ static int snd_ensoniq_control_get(struct snd_kcontrol *kcontrol,
{
struct ensoniq *ensoniq = snd_kcontrol_chip(kcontrol);
int mask = kcontrol->private_value;
-
+
spin_lock_irq(&ensoniq->reg_lock);
ucontrol->value.integer.value[0] = ensoniq->ctrl & mask ? 1 : 0;
spin_unlock_irq(&ensoniq->reg_lock);
@@ -1704,7 +1704,7 @@ static int snd_ensoniq_control_put(struct snd_kcontrol *kcontrol,
int mask = kcontrol->private_value;
unsigned int nval;
int change;
-
+
nval = ucontrol->value.integer.value[0] ? mask : 0;
spin_lock_irq(&ensoniq->reg_lock);
change = (ensoniq->ctrl & mask) != nval;
@@ -1864,7 +1864,7 @@ static inline void snd_ensoniq_free_gameport(struct ensoniq *ensoniq) { }
*/
-static void snd_ensoniq_proc_read(struct snd_info_entry *entry,
+static void snd_ensoniq_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct ensoniq *ensoniq = entry->private_data;
@@ -1891,7 +1891,7 @@ static void __devinit snd_ensoniq_proc_init(struct ensoniq * ensoniq)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(ensoniq->card, "audiopci", &entry))
+ if (!snd_card_proc_new(ensoniq->card, "audiopci", &entry))
snd_info_set_text_ops(entry, ensoniq, snd_ensoniq_proc_read);
}
@@ -1914,7 +1914,7 @@ static int snd_ensoniq_free(struct ensoniq *ensoniq)
if (ensoniq->irq >= 0)
synchronize_irq(ensoniq->irq);
pci_set_power_state(ensoniq->pci, 3);
- __hw_end:
+__hw_end:
#ifdef CHIP1370
if (ensoniq->dma_bug.area)
snd_dma_free_pages(&ensoniq->dma_bug);
@@ -1982,7 +1982,7 @@ static void snd_ensoniq_chip_init(struct ensoniq *ensoniq)
udelay(20);
outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
/* Init the sample rate converter */
- snd_es1371_wait_src_ready(ensoniq);
+ snd_es1371_wait_src_ready(ensoniq);
outl(ES_1371_SRC_DISABLE, ES_REG(ensoniq, 1371_SMPRATE));
for (idx = 0; idx < 0x80; idx++)
snd_es1371_src_write(ensoniq, idx, 0);
@@ -2021,13 +2021,13 @@ static int snd_ensoniq_suspend(struct pci_dev *pci, pm_message_t state)
{
struct snd_card *card = pci_get_drvdata(pci);
struct ensoniq *ensoniq = card->private_data;
-
+
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(ensoniq->pcm1);
snd_pcm_suspend_all(ensoniq->pcm2);
-
-#ifdef CHIP1371
+
+#ifdef CHIP1371
snd_ac97_suspend(ensoniq->u.es1371.ac97);
#else
/* try to reset AK4531 */
@@ -2038,7 +2038,7 @@ static int snd_ensoniq_suspend(struct pci_dev *pci, pm_message_t state)
inw(ES_REG(ensoniq, 1370_CODEC));
udelay(100);
snd_ak4531_suspend(ensoniq->u.es1370.ak4531);
-#endif
+#endif
pci_disable_device(pci);
pci_save_state(pci);
@@ -2063,11 +2063,11 @@ static int snd_ensoniq_resume(struct pci_dev *pci)
snd_ensoniq_chip_init(ensoniq);
-#ifdef CHIP1371
+#ifdef CHIP1371
snd_ac97_resume(ensoniq->u.es1371.ac97);
#else
snd_ak4531_resume(ensoniq->u.es1370.ak4531);
-#endif
+#endif
snd_power_change_state(card, SNDRV_CTL_POWER_D0);
return 0;
}
@@ -2482,7 +2482,7 @@ static struct pci_driver driver = {
.resume = snd_ensoniq_resume,
#endif
};
-
+
static int __init alsa_card_ens137x_init(void)
{
return pci_register_driver(&driver);
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 4cd9a1f..87effdc 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -5,7 +5,7 @@
* Thomas Sailer <sailer(a)ife.ee.ethz.ch>,
* Abramo Bagnara <abramo(a)alsa-project.org>,
* Markus Gruber <gruber(a)eikon.tum.de>
- *
+ *
* Rewritten from sonicvibes.c source.
*
* TODO:
@@ -63,7 +63,7 @@
#include <sound/initval.h>
#include <sound/tlv.h>
-#include <asm/io.h>
+#include <linux/io.h>
MODULE_AUTHOR("Jaromir Koutek <miri(a)punknet.cz>");
MODULE_DESCRIPTION("ESS Solo-1");
@@ -167,7 +167,7 @@ MODULE_PARM_DESC(enable, "Enable ESS Solo-1 soundcard.");
#define ESS_CMD_SETFORMAT2 0xb7
#define ESS_CMD_DMACONTROL 0xb8
#define ESS_CMD_DMATYPE 0xb9
-#define ESS_CMD_OFFSETLEFT 0xba
+#define ESS_CMD_OFFSETLEFT 0xba
#define ESS_CMD_OFFSETRIGHT 0xbb
#define ESS_CMD_READREG 0xc0
#define ESS_CMD_ENABLEEXT 0xc6
@@ -418,7 +418,7 @@ static void snd_es1938_reset(struct es1938 *chip)
}
snd_printk(KERN_ERR "ESS Solo-1 reset failed\n");
- __next:
+__next:
snd_es1938_write_cmd(chip, ESS_CMD_ENABLEEXT);
/* Demand transfer DMA: 4 bytes per DMA request */
@@ -426,7 +426,7 @@ static void snd_es1938_reset(struct es1938 *chip)
/* Change behaviour of register A1
4x oversampling
- 2nd channel DAC asynchronous */
+ 2nd channel DAC asynchronous */
snd_es1938_mixer_write(chip, ESSSB_IREG_AUDIO2MODE, 0x32);
/* enable/select DMA channel and IRQ channel */
snd_es1938_bits(chip, ESS_CMD_IRQCONTROL, 0xf0, 0x50);
@@ -469,7 +469,7 @@ static struct snd_pcm_hw_constraint_ratnums hw_constraints_clocks = {
};
-static void snd_es1938_rate_set(struct es1938 *chip,
+static void snd_es1938_rate_set(struct es1938 *chip,
struct snd_pcm_substream *substream,
int mode)
{
@@ -482,7 +482,7 @@ static void snd_es1938_rate_set(struct es1938 *chip,
/* set filter register */
div0 = 256 - 7160000*20/(8*82*runtime->rate);
-
+
if (mode == DAC2) {
snd_es1938_mixer_write(chip, 0x70, bits);
snd_es1938_mixer_write(chip, 0x72, div0);
@@ -650,7 +650,7 @@ static int snd_es1938_capture_prepare(struct snd_pcm_substream *substream)
chip->dma1_shift = 2 - mono - is8;
snd_es1938_reset_fifo(chip);
-
+
/* program type */
snd_es1938_bits(chip, ESS_CMD_ANALOGCONTROL, 0x03, (mono ? 2 : 1));
@@ -663,12 +663,12 @@ static int snd_es1938_capture_prepare(struct snd_pcm_substream *substream)
/* initialize and configure ADC */
snd_es1938_write(chip, ESS_CMD_SETFORMAT2, u ? 0x51 : 0x71);
- snd_es1938_write(chip, ESS_CMD_SETFORMAT2, 0x90 |
- (u ? 0x00 : 0x20) |
- (is8 ? 0x00 : 0x04) |
+ snd_es1938_write(chip, ESS_CMD_SETFORMAT2, 0x90 |
+ (u ? 0x00 : 0x20) |
+ (is8 ? 0x00 : 0x04) |
(mono ? 0x40 : 0x08));
- // snd_es1938_reset_fifo(chip);
+ /* snd_es1938_reset_fifo(chip); */
/* 11. configure system interrupt controller and DMA controller */
snd_es1938_capture_setdma(chip);
@@ -713,7 +713,7 @@ static int snd_es1938_playback1_prepare(struct snd_pcm_substream *substream)
/* program DMA */
snd_es1938_playback1_setdma(chip);
-
+
return 0;
}
@@ -735,10 +735,10 @@ static int snd_es1938_playback2_prepare(struct snd_pcm_substream *substream)
chip->dma1_shift = 2 - mono - is8;
count = 0x10000 - count;
-
+
/* reset */
snd_es1938_reset_fifo(chip);
-
+
snd_es1938_bits(chip, ESS_CMD_ANALOGCONTROL, 0x03, (mono ? 2 : 1));
/* set clock and counters */
@@ -749,13 +749,13 @@ static int snd_es1938_playback2_prepare(struct snd_pcm_substream *substream)
/* initialized and configure DAC */
snd_es1938_write(chip, ESS_CMD_SETFORMAT, u ? 0x80 : 0x00);
snd_es1938_write(chip, ESS_CMD_SETFORMAT, u ? 0x51 : 0x71);
- snd_es1938_write(chip, ESS_CMD_SETFORMAT2,
+ snd_es1938_write(chip, ESS_CMD_SETFORMAT2,
0x90 | (mono ? 0x40 : 0x08) |
(is8 ? 0x00 : 0x04) | (u ? 0x00 : 0x20));
/* program DMA */
snd_es1938_playback2_setdma(chip);
-
+
return 0;
}
@@ -1036,7 +1036,7 @@ static int __devinit snd_es1938_new_pcm(struct es1938 *chip, int device)
return err;
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, &snd_es1938_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_es1938_capture_ops);
-
+
pcm->private_data = chip;
pcm->info_flags = 0;
strcpy(pcm->name, "ESS Solo-1");
@@ -1049,7 +1049,7 @@ static int __devinit snd_es1938_new_pcm(struct es1938 *chip, int device)
}
/* -------------------------------------------------------------------
- *
+ *
* *** Mixer part ***
*/
@@ -1083,7 +1083,7 @@ static int snd_es1938_put_mux(struct snd_kcontrol *kcontrol,
{
struct es1938 *chip = snd_kcontrol_chip(kcontrol);
unsigned char val = ucontrol->value.enumerated.item[0];
-
+
if (val > 7)
return -EINVAL;
return snd_es1938_mixer_bits(chip, 0x1c, 0x07, val) != val;
@@ -1207,7 +1207,7 @@ static int snd_es1938_get_single(struct snd_kcontrol *kcontrol,
int mask = (kcontrol->private_value >> 16) & 0xff;
int invert = (kcontrol->private_value >> 24) & 0xff;
int val;
-
+
val = snd_es1938_reg_read(chip, reg);
ucontrol->value.integer.value[0] = (val >> shift) & mask;
if (invert)
@@ -1224,7 +1224,7 @@ static int snd_es1938_put_single(struct snd_kcontrol *kcontrol,
int mask = (kcontrol->private_value >> 16) & 0xff;
int invert = (kcontrol->private_value >> 24) & 0xff;
unsigned char val;
-
+
val = (ucontrol->value.integer.value[0] & mask);
if (invert)
val = mask - val;
@@ -1270,7 +1270,7 @@ static int snd_es1938_get_double(struct snd_kcontrol *kcontrol,
int mask = (kcontrol->private_value >> 24) & 0xff;
int invert = (kcontrol->private_value >> 22) & 1;
unsigned char left, right;
-
+
left = snd_es1938_reg_read(chip, left_reg);
if (left_reg != right_reg)
right = snd_es1938_reg_read(chip, right_reg);
@@ -1297,7 +1297,7 @@ static int snd_es1938_put_double(struct snd_kcontrol *kcontrol,
int invert = (kcontrol->private_value >> 22) & 1;
int change;
unsigned char val1, val2, mask1, mask2;
-
+
val1 = ucontrol->value.integer.value[0] & mask;
val2 = ucontrol->value.integer.value[1] & mask;
if (invert) {
@@ -1315,7 +1315,7 @@ static int snd_es1938_put_double(struct snd_kcontrol *kcontrol,
if (snd_es1938_reg_bits(chip, right_reg, mask2, val2) != val2)
change = 1;
} else {
- change = (snd_es1938_reg_bits(chip, left_reg, mask1 | mask2,
+ change = (snd_es1938_reg_bits(chip, left_reg, mask1 | mask2,
val1 | val2) != (val1 | val2));
}
return change;
@@ -1675,7 +1675,7 @@ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id)
#if 0
printk("Es1938debug - interrupt status: =0x%x\n", status);
#endif
-
+
/* AUDIO 1 */
if (status & 0x10) {
#if 0
@@ -1695,7 +1695,7 @@ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id)
else if (chip->active & DAC1)
snd_pcm_period_elapsed(chip->playback2_substream);
}
-
+
/* AUDIO 2 */
if (status & 0x20) {
#if 0
@@ -1731,10 +1731,10 @@ static irqreturn_t snd_es1938_interrupt(int irq, void *dev_id)
/* MPU401 */
if (status & 0x80) {
- // the following line is evil! It switches off MIDI interrupt handling after the first interrupt received.
- // replacing the last 0 by 0x40 works for ESS-Solo1, but just doing nothing works as well!
- // andreas(a)flying-snail.de
- // snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0); /* ack? */
+ /* the following line is evil! It switches off MIDI interrupt handling after the first interrupt received. */
+ /* replacing the last 0 by 0x40 works for ESS-Solo1, but just doing nothing works as well! */
+ /* andreas(a)flying-snail.de */
+ /* snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0); ack? */
if (chip->rmidi) {
handled = 1;
snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data);
@@ -1781,7 +1781,7 @@ static int __devinit snd_es1938_mixer(struct es1938 *chip)
}
return 0;
}
-
+
static int __devinit snd_es1938_probe(struct pci_dev *pci,
const struct pci_device_id *pci_id)
@@ -1851,8 +1851,8 @@ static int __devinit snd_es1938_probe(struct pci_dev *pci,
chip->irq, 0, &chip->rmidi) < 0) {
printk(KERN_ERR "es1938: unable to initialize MPU-401\n");
} else {
- // this line is vital for MIDI interrupt handling on ess-solo1
- // andreas(a)flying-snail.de
+ /* this line is vital for MIDI interrupt handling on ess-solo1 */
+ /* andreas(a)flying-snail.de */
snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0x40);
}
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 20ee759..46c383f 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -2,7 +2,7 @@
* Driver for ESS Maestro 1/2/2E Sound Card (started 21.8.99)
* Copyright (c) by Matze Braun <MatzeBraun(a)gmx.de>.
* Takashi Iwai <tiwai(a)suse.de>
- *
+ *
* Most of the driver code comes from Zach Brown(zab(a)redhat.com)
* Alan Cox OSS Driver
* Rewritted from card-es1938.c source.
@@ -29,7 +29,7 @@
*
* Hardware Description
*
- * A working Maestro setup contains the Maestro chip wired to a
+ * A working Maestro setup contains the Maestro chip wired to a
* codec or 2. In the Maestro we have the APUs, the ASSP, and the
* Wavecache. The APUs can be though of as virtual audio routing
* channels. They can take data from a number of sources and perform
@@ -38,7 +38,7 @@
* APUs. The ASSP is a wacky DSP like device that ESS is loth
* to release docs on. Thankfully it isn't required on the Maestro
* until you start doing insane things like FM emulation and surround
- * encoding. The codecs are almost always AC-97 compliant codecs,
+ * encoding. The codecs are almost always AC-97 compliant codecs,
* but it appears that early Maestros may have had PT101 (an ESS
* part?) wired to them. The only real difference in the Maestro
* families is external goop like docking capability, memory for
@@ -76,7 +76,7 @@
* on open time. The sonicvibes OSS routines we inherited really want
* power of 2 buffers, so we have all those next to each other, then
* 512 byte regions for the recording wavecaches. This ends up
- * wasting quite a bit of memory. The only fixes I can see would be
+ * wasting quite a bit of memory. The only fixes I can see would be
* getting a kernel allocator that could work in zones, or figuring out
* just how to coerce the WP into doing what we want.
*
@@ -86,7 +86,7 @@
* like the APU interface that is indirect registers gotten at through
* the main maestro indirection. Ouch. We spinlock around the actual
* ports on a per card basis. This means spinlock activity at each IO
- * operation, but the only IO operation clusters are in non critical
+ * operation, but the only IO operation clusters are in non critical
* paths and it makes the code far easier to follow. Interrupts are
* blocked while holding the locks because the int handler has to
* get at some of them :(. The mixer interface doesn't, however.
@@ -94,7 +94,7 @@
* places.
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -896,7 +896,7 @@ snd_es1968_calc_bob_rate(struct es1968 *chip, struct esschan *es,
static u32 snd_es1968_compute_rate(struct es1968 *chip, u32 freq)
{
u32 rate = (freq << 16) / chip->clock;
-#if 0 /* XXX: do we need this? */
+#if 0 /* XXX: do we need this? */
if (rate > 0x10000)
rate = 0x10000;
#endif
@@ -971,7 +971,7 @@ static void snd_es1968_program_wavecache(struct es1968 *chip, struct esschan *es
{
u32 tmpval = (addr - 0x10) & 0xFFF8;
- if (! capture) {
+ if (!capture) {
if (!(es->fmt & ESS_FMT_16BIT))
tmpval |= 4; /* 8bit */
if (es->fmt & ESS_FMT_STEREO)
@@ -1059,7 +1059,7 @@ static void snd_es1968_playback_setup(struct es1968 *chip, struct esschan *es,
and not the APU Regs 4-5. */
apu_set_register(chip, apu, 10,
0x8F00 | (channel ? 0 : 0x10));
- es->apu_mode[channel] += 1; /* stereo */
+ es->apu_mode[channel]++; /* stereo */
} else
apu_set_register(chip, apu, 10, 0x8F08);
}
@@ -1255,7 +1255,7 @@ static int snd_es1968_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
- if (! es->running)
+ if (!es->running)
break;
snd_es1968_pcm_stop(chip, es);
es->running = 0;
@@ -1273,7 +1273,7 @@ static snd_pcm_uframes_t snd_es1968_pcm_pointer(struct snd_pcm_substream *substr
unsigned int ptr;
ptr = snd_es1968_get_dma_ptr(chip, es) << es->wav_shift;
-
+
return bytes_to_frames(substream->runtime, ptr % es->dma_size);
}
@@ -1407,7 +1407,7 @@ static void snd_es1968_free_dmabuf(struct es1968 *chip)
{
struct list_head *p;
- if (! chip->dma.area)
+ if (!chip->dma.area)
return;
snd_dma_reserve_buf(&chip->dma, snd_dma_pci_buf_id(chip->pci));
while ((p = chip->buf_list.next) != &chip->buf_list) {
@@ -1425,11 +1425,11 @@ snd_es1968_init_dmabuf(struct es1968 *chip)
chip->dma.dev.type = SNDRV_DMA_TYPE_DEV;
chip->dma.dev.dev = snd_dma_pci_data(chip->pci);
- if (! snd_dma_get_reserved_buf(&chip->dma, snd_dma_pci_buf_id(chip->pci))) {
+ if (!snd_dma_get_reserved_buf(&chip->dma, snd_dma_pci_buf_id(chip->pci))) {
err = snd_dma_alloc_pages_fallback(SNDRV_DMA_TYPE_DEV,
snd_dma_pci_data(chip->pci),
chip->total_bufsize, &chip->dma);
- if (err < 0 || ! chip->dma.area) {
+ if (err < 0 || !chip->dma.area) {
snd_printk(KERN_ERR "es1968: can't allocate dma pages for size %d\n",
chip->total_bufsize);
return -ENOMEM;
@@ -1478,7 +1478,7 @@ static int snd_es1968_hw_params(struct snd_pcm_substream *substream,
}
chan->memory = snd_es1968_new_memory(chip, size);
if (chan->memory == NULL) {
- // snd_printd("cannot allocate dma buffer: size = %d\n", size);
+ /* snd_printd("cannot allocate dma buffer: size = %d\n", size); */
return -ENOMEM;
}
snd_pcm_set_runtime_buffer(substream, &chan->memory->buf);
@@ -1491,7 +1491,7 @@ static int snd_es1968_hw_free(struct snd_pcm_substream *substream)
struct es1968 *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct esschan *chan;
-
+
if (runtime->private_data == NULL)
return 0;
chan = runtime->private_data;
@@ -1586,7 +1586,7 @@ static int snd_es1968_capture_open(struct snd_pcm_substream *substream)
snd_es1968_free_apu_pair(chip, apu1);
return apu2;
}
-
+
es = kzalloc(sizeof(*es), GFP_KERNEL);
if (!es) {
snd_es1968_free_apu_pair(chip, apu1);
@@ -1854,7 +1854,7 @@ static void snd_es1968_update_pcm(struct es1968 *chip, struct esschan *es)
unsigned int hwptr;
unsigned int diff;
struct snd_pcm_substream *subs = es->substream;
-
+
if (subs == NULL || !es->running)
return;
@@ -1895,7 +1895,7 @@ static void es1968_update_hw_volume(unsigned long private_data)
if (chip->in_suspend)
return;
- if (! chip->master_switch || ! chip->master_volume)
+ if (!chip->master_switch || ! chip->master_volume)
return;
/* FIXME: we can't call snd_ac97_* functions since here is in tasklet. */
@@ -2038,7 +2038,7 @@ static void snd_es1968_ac97_reset(struct es1968 *chip)
/* save configuration */
save_ringbus_a = inw(ioaddr + 0x36);
- //outw(inw(ioaddr + 0x38) & 0xfffc, ioaddr + 0x38); /* clear second codec id? */
+ /* outw(inw(ioaddr + 0x38) & 0xfffc, ioaddr + 0x38); clear second codec id? */
/* set command/status address i/o to 1st codec */
outw(inw(ioaddr + 0x3a) & 0xfffc, ioaddr + 0x3a);
outw(inw(ioaddr + 0x3c) & 0xfffc, ioaddr + 0x3c);
@@ -2072,7 +2072,7 @@ static void snd_es1968_ac97_reset(struct es1968 *chip)
udelay(20);
outw(0x0009, ioaddr + 0x60); /* write 9 to gpio */
msleep(500);
- //outw(inw(ioaddr + 0x38) & 0xfffc, ioaddr + 0x38);
+ /* outw(inw(ioaddr + 0x38) & 0xfffc, ioaddr + 0x38); */
outw(inw(ioaddr + 0x3a) & 0xfffc, ioaddr + 0x3a);
outw(inw(ioaddr + 0x3c) & 0xfffc, ioaddr + 0x3c);
@@ -2154,15 +2154,15 @@ static void snd_es1968_chip_init(struct es1968 *chip)
/* We used to muck around with pci config space that
* we had no business messing with. We don't know enough
- * about the machine to know which DMA mode is appropriate,
+ * about the machine to know which DMA mode is appropriate,
* etc. We were guessing wrong on some machines and making
* them unhappy. We now trust in the BIOS to do things right,
* which almost certainly means a new host of problems will
- * arise with broken BIOS implementations. screw 'em.
+ * arise with broken BIOS implementations. screw 'em.
* We're already intolerant of machines that don't assign
* IRQs.
*/
-
+
/* Config Reg A */
pci_read_config_word(pci, ESM_CONFIG_A, &w);
@@ -2172,7 +2172,7 @@ static void snd_es1968_chip_init(struct es1968 *chip)
w |= POST_WRITE; /* Posted write */
w |= PCI_TIMING; /* PCI timing on */
/* XXX huh? claims to be reserved.. */
- w &= ~SWAP_LR; /* swap left/right
+ w &= ~SWAP_LR; /* swap left/right
seems to only have effect on SB
Emulation */
w &= ~SUBTR_DECODE; /* Subtractive decode off */
@@ -2223,7 +2223,7 @@ static void snd_es1968_chip_init(struct es1968 *chip)
w|=1<<3; /* Turn on 978 hardware volume control. */
w&=~(1<<11); /* Turn on 978 mixer volume control. */
pci_write_config_word(pci, 0x58, w);
-
+
/* Sound Reset */
snd_es1968_reset(chip);
@@ -2241,14 +2241,14 @@ static void snd_es1968_chip_init(struct es1968 *chip)
/*
* Reset the CODEC
*/
-
+
snd_es1968_ac97_reset(chip);
/* Ring Bus Control B */
n = inl(iobase + ESM_RING_BUS_CONTR_B);
n &= ~RINGB_EN_SPDIF; /* SPDIF off */
- //w |= RINGB_EN_2CODEC; /* enable 2nd codec */
+ /* w |= RINGB_EN_2CODEC; enable 2nd codec */
outl(n, iobase + ESM_RING_BUS_CONTR_B);
/* Set hardware volume control registers to midpoints.
@@ -2306,7 +2306,7 @@ static void snd_es1968_chip_init(struct es1968 *chip)
maestro_write(chip, 0x0D, 0x7632);
- /* Wave cache control on - test off, sg off,
+ /* Wave cache control on - test off, sg off,
enable, enable extra chans 1Mb */
w = inw(iobase + WC_CONTROL);
@@ -2353,7 +2353,7 @@ static int es1968_suspend(struct pci_dev *pci, pm_message_t state)
struct snd_card *card = pci_get_drvdata(pci);
struct es1968 *chip = card->private_data;
- if (! chip->do_pm)
+ if (!chip->do_pm)
return 0;
chip->in_suspend = 1;
@@ -2374,7 +2374,7 @@ static int es1968_resume(struct pci_dev *pci)
struct es1968 *chip = card->private_data;
struct esschan *es;
- if (! chip->do_pm)
+ if (!chip->do_pm)
return 0;
/* restore all our config */
@@ -2390,7 +2390,7 @@ static int es1968_resume(struct pci_dev *pci)
snd_es1968_chip_init(chip);
- /* need to restore the base pointers.. */
+ /* need to restore the base pointers.. */
if (chip->dma.addr) {
/* set PCMBAR */
wave_set_register(chip, 0x01FC, chip->dma.addr >> 12);
@@ -2547,7 +2547,7 @@ static int __devinit snd_es1968_create(struct snd_card *card,
}
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
- if (! chip) {
+ if (!chip) {
pci_disable_device(pci);
return -ENOMEM;
}
@@ -2581,7 +2581,7 @@ static int __devinit snd_es1968_create(struct snd_card *card,
return -EBUSY;
}
chip->irq = pci->irq;
-
+
/* Clear Maestro_map */
for (i = 0; i < 32; i++)
chip->maestro_map[i] = 0;
@@ -2648,14 +2648,14 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (!card)
return -ENOMEM;
-
+
if (total_bufsize[dev] < 128)
total_bufsize[dev] = 128;
if (total_bufsize[dev] > 4096)
total_bufsize[dev] = 4096;
if ((err = snd_es1968_create(card, pci,
total_bufsize[dev] * 1024, /* in bytes */
- pcm_substreams_p[dev],
+ pcm_substreams_p[dev],
pcm_substreams_c[dev],
pci_id->driver_data,
use_pm[dev],
@@ -2716,7 +2716,7 @@ static int __devinit snd_es1968_probe(struct pci_dev *pci,
snd_es1968_start_irq(chip);
chip->clock = clock[dev];
- if (! chip->clock)
+ if (!chip->clock)
es1968_measure_clock(chip);
sprintf(card->longname, "%s at 0x%lx, 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/ymfpci/ymfpci_main.c | 98 ++++++++++++++++++++--------------------
1 files changed, 49 insertions(+), 49 deletions(-)
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 90d0d62..baf64b9 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -36,7 +36,7 @@
#include <sound/asoundef.h>
#include <sound/mpu401.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <asm/byteorder.h>
/*
@@ -79,7 +79,7 @@ static int snd_ymfpci_codec_ready(struct snd_ymfpci *chip, int secondary)
{
unsigned long end_time;
u32 reg = secondary ? YDSXGR_SECSTATUSADR : YDSXGR_PRISTATUSADR;
-
+
end_time = jiffies + msecs_to_jiffies(750);
do {
if ((snd_ymfpci_readw(chip, reg) & 0x8000) == 0)
@@ -94,7 +94,7 @@ static void snd_ymfpci_codec_write(struct snd_ac97 *ac97, u16 reg, u16 val)
{
struct snd_ymfpci *chip = ac97->private_data;
u32 cmd;
-
+
snd_ymfpci_codec_ready(chip, 0);
cmd = ((YDSXG_AC97WRITECMD | reg) << 16) | val;
snd_ymfpci_writel(chip, YDSXGR_AC97CMDDATA, cmd);
@@ -145,7 +145,7 @@ static u32 snd_ymfpci_calc_lpfK(u32 rate)
0x00570000, 0x06AA0000, 0x18B20000, 0x20930000,
0x2B9A0000, 0x35A10000, 0x3EAA0000, 0x40000000
};
-
+
if (rate == 44100)
return 0x40000000; /* FIXME: What's the right value? */
for (i = 0; i < 8; i++)
@@ -161,7 +161,7 @@ static u32 snd_ymfpci_calc_lpfQ(u32 rate)
0x35280000, 0x34A70000, 0x32020000, 0x31770000,
0x31390000, 0x31C90000, 0x33D00000, 0x40000000
};
-
+
if (rate == 44100)
return 0x370A0000;
for (i = 0; i < 8; i++)
@@ -184,7 +184,7 @@ static void snd_ymfpci_hw_start(struct snd_ymfpci *chip)
snd_ymfpci_writel(chip, YDSXGR_MODE,
snd_ymfpci_readl(chip, YDSXGR_MODE) | 3);
chip->active_bank = snd_ymfpci_readl(chip, YDSXGR_CTRLSELECT) & 1;
- __end:
+__end:
spin_unlock_irqrestore(&chip->reg_lock, flags);
}
@@ -206,7 +206,7 @@ static void snd_ymfpci_hw_stop(struct snd_ymfpci *chip)
atomic_set(&chip->interrupt_sleep_count, 0);
wake_up(&chip->interrupt_sleep);
}
- __end:
+__end:
spin_unlock_irqrestore(&chip->reg_lock, flags);
}
@@ -220,7 +220,7 @@ static int voice_alloc(struct snd_ymfpci *chip,
{
struct snd_ymfpci_voice *voice, *voice2;
int idx;
-
+
*rvoice = NULL;
for (idx = 0; idx < YDSXG_PLAYBACK_VOICES; idx += pair ? 2 : 1) {
voice = &chip->voices[idx];
@@ -258,12 +258,12 @@ static int snd_ymfpci_voice_alloc(struct snd_ymfpci *chip,
{
unsigned long flags;
int result;
-
+
if (snd_BUG_ON(!rvoice))
return -EINVAL;
if (snd_BUG_ON(pair && type != YMFPCI_PCM))
return -EINVAL;
-
+
spin_lock_irqsave(&chip->voice_lock, flags);
for (;;) {
result = voice_alloc(chip, type, pair, rvoice);
@@ -272,14 +272,14 @@ static int snd_ymfpci_voice_alloc(struct snd_ymfpci *chip,
/* TODO: synth/midi voice deallocation */
break;
}
- spin_unlock_irqrestore(&chip->voice_lock, flags);
- return result;
+ spin_unlock_irqrestore(&chip->voice_lock, flags);
+ return result;
}
static int snd_ymfpci_voice_free(struct snd_ymfpci *chip, struct snd_ymfpci_voice *pvoice)
{
unsigned long flags;
-
+
if (snd_BUG_ON(!pvoice))
return -EINVAL;
snd_ymfpci_hw_stop(chip);
@@ -303,7 +303,7 @@ static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_
{
struct snd_ymfpci_pcm *ypcm;
u32 pos, delta;
-
+
if ((ypcm = voice->ypcm) == NULL)
return;
if (ypcm->substream == NULL)
@@ -318,7 +318,7 @@ static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_
ypcm->period_pos += delta;
ypcm->last_pos = pos;
if (ypcm->period_pos >= ypcm->period_size) {
- // printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start);
+ /* printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start); */
ypcm->period_pos %= ypcm->period_size;
spin_unlock(&chip->reg_lock);
snd_pcm_period_elapsed(ypcm->substream);
@@ -330,7 +330,7 @@ static void snd_ymfpci_pcm_interrupt(struct snd_ymfpci *chip, struct snd_ymfpci_
unsigned int next_bank = 1 - chip->active_bank;
struct snd_ymfpci_playback_bank *bank;
u32 volume;
-
+
bank = &voice->bank[next_bank];
volume = cpu_to_le32(chip->pcm_mixer[subs].left << 15);
bank->left_gain_end = volume;
@@ -354,7 +354,7 @@ static void snd_ymfpci_pcm_capture_interrupt(struct snd_pcm_substream *substream
struct snd_ymfpci_pcm *ypcm = runtime->private_data;
struct snd_ymfpci *chip = ypcm->chip;
u32 pos, delta;
-
+
spin_lock(&chip->reg_lock);
if (ypcm->running) {
pos = le32_to_cpu(chip->bank_capture[ypcm->capture_bank_number][chip->active_bank]->start) >> ypcm->shift;
@@ -366,7 +366,7 @@ static void snd_ymfpci_pcm_capture_interrupt(struct snd_pcm_substream *substream
ypcm->last_pos = pos;
if (ypcm->period_pos >= ypcm->period_size) {
ypcm->period_pos %= ypcm->period_size;
- // printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start);
+ /* printk("done - active_bank = 0x%x, start = 0x%x\n", chip->active_bank, voice->bank[chip->active_bank].start); */
spin_unlock(&chip->reg_lock);
snd_pcm_period_elapsed(substream);
spin_lock(&chip->reg_lock);
@@ -414,7 +414,7 @@ static int snd_ymfpci_playback_trigger(struct snd_pcm_substream *substream,
result = -EINVAL;
break;
}
- __unlock:
+__unlock:
spin_unlock(&chip->reg_lock);
if (kctl)
snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_INFO, &kctl->id);
@@ -468,7 +468,7 @@ static int snd_ymfpci_pcm_voice_alloc(struct snd_ymfpci_pcm *ypcm, int voices)
if (ypcm->voices[0] != NULL && ypcm->voices[1] == NULL) {
snd_ymfpci_voice_free(ypcm->chip, ypcm->voices[0]);
ypcm->voices[0] = NULL;
- }
+ }
}
err = snd_ymfpci_voice_alloc(ypcm->chip, YMFPCI_PCM, voices > 1, &ypcm->voices[0]);
if (err < 0)
@@ -615,7 +615,7 @@ static int snd_ymfpci_ac3_done(struct snd_ymfpci *chip)
snd_ymfpci_writel(chip, YDSXGR_MAPOFEFFECT,
snd_ymfpci_readl(chip, YDSXGR_MAPOFEFFECT) & ~(3 << 3));
spin_unlock_irq(&chip->reg_lock);
- // snd_ymfpci_irq_wait(chip);
+ /* snd_ymfpci_irq_wait(chip); */
if (chip->ac3_tmp_base.area) {
snd_dma_free_pages(&chip->ac3_tmp_base);
chip->ac3_tmp_base.area = NULL;
@@ -642,7 +642,7 @@ static int snd_ymfpci_playback_hw_free(struct snd_pcm_substream *substream)
struct snd_ymfpci *chip = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_ymfpci_pcm *ypcm;
-
+
if (runtime->private_data == NULL)
return 0;
ypcm = runtime->private_data;
@@ -836,7 +836,7 @@ static irqreturn_t snd_ymfpci_interrupt(int irq, void *dev_id)
static struct snd_pcm_hardware snd_ymfpci_playback =
{
.info = (SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_MMAP_VALID |
+ SNDRV_PCM_INFO_MMAP_VALID |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_PAUSE |
@@ -905,8 +905,8 @@ static int snd_ymfpci_playback_open_1(struct snd_pcm_substream *substream)
/* call with spinlock held */
static void ymfpci_open_extension(struct snd_ymfpci *chip)
{
- if (! chip->rear_opened) {
- if (! chip->spdif_opened) /* set AC3 */
+ if (!chip->rear_opened) {
+ if (!chip->spdif_opened) /* set AC3 */
snd_ymfpci_writel(chip, YDSXGR_MODE,
snd_ymfpci_readl(chip, YDSXGR_MODE) | (1 << 30));
/* enable second codec (4CHEN) */
@@ -918,8 +918,8 @@ static void ymfpci_open_extension(struct snd_ymfpci *chip)
/* call with spinlock held */
static void ymfpci_close_extension(struct snd_ymfpci *chip)
{
- if (! chip->rear_opened) {
- if (! chip->spdif_opened)
+ if (!chip->rear_opened) {
+ if (!chip->spdif_opened)
snd_ymfpci_writel(chip, YDSXGR_MODE,
snd_ymfpci_readl(chip, YDSXGR_MODE) & ~(1 << 30));
snd_ymfpci_writew(chip, YDSXGR_SECCONFIG,
@@ -933,7 +933,7 @@ static int snd_ymfpci_playback_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_ymfpci_pcm *ypcm;
int err;
-
+
if ((err = snd_ymfpci_playback_open_1(substream)) < 0)
return err;
ypcm = runtime->private_data;
@@ -955,7 +955,7 @@ static int snd_ymfpci_playback_spdif_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_ymfpci_pcm *ypcm;
int err;
-
+
if ((err = snd_ymfpci_playback_open_1(substream)) < 0)
return err;
ypcm = runtime->private_data;
@@ -983,7 +983,7 @@ static int snd_ymfpci_playback_4ch_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_ymfpci_pcm *ypcm;
int err;
-
+
if ((err = snd_ymfpci_playback_open_1(substream)) < 0)
return err;
ypcm = runtime->private_data;
@@ -1009,7 +1009,7 @@ static int snd_ymfpci_capture_open(struct snd_pcm_substream *substream,
return -ENOMEM;
ypcm->chip = chip;
ypcm->type = capture_bank_number + CAPTURE_REC;
- ypcm->substream = substream;
+ ypcm->substream = substream;
ypcm->capture_bank_number = capture_bank_number;
chip->capture_substream[capture_bank_number] = substream;
runtime->hw = snd_ymfpci_capture;
@@ -1449,7 +1449,7 @@ static int snd_ymfpci_get_single(struct snd_kcontrol *kcontrol,
int reg = kcontrol->private_value & 0xffff;
unsigned int shift = (kcontrol->private_value >> 16) & 0xff;
unsigned int mask = 1;
-
+
switch (reg) {
case YDSXGR_SPDIFOUTCTRL: break;
case YDSXGR_SPDIFINCTRL: break;
@@ -1469,7 +1469,7 @@ static int snd_ymfpci_put_single(struct snd_kcontrol *kcontrol,
unsigned int mask = 1;
int change;
unsigned int val, oval;
-
+
switch (reg) {
case YDSXGR_SPDIFOUTCTRL: break;
case YDSXGR_SPDIFINCTRL: break;
@@ -1515,7 +1515,7 @@ static int snd_ymfpci_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_e
unsigned int reg = kcontrol->private_value;
unsigned int shift_left = 0, shift_right = 16, mask = 16383;
unsigned int val;
-
+
if (reg < 0x80 || reg >= 0xc0)
return -EINVAL;
spin_lock_irq(&chip->reg_lock);
@@ -1533,7 +1533,7 @@ static int snd_ymfpci_put_double(struct snd_kcontrol *kcontrol, struct snd_ctl_e
unsigned int shift_left = 0, shift_right = 16, mask = 16383;
int change;
unsigned int val1, val2, oval;
-
+
if (reg < 0x80 || reg >= 0xc0)
return -EINVAL;
val1 = ucontrol->value.integer.value[0] & mask;
@@ -1557,7 +1557,7 @@ static int snd_ymfpci_put_nativedacvol(struct snd_kcontrol *kcontrol,
unsigned int reg2 = YDSXGR_BUF441OUTVOL;
int change;
unsigned int value, oval;
-
+
value = ucontrol->value.integer.value[0] & 0x3fff;
value |= (ucontrol->value.integer.value[1] & 0x3fff) << 16;
spin_lock_irq(&chip->reg_lock);
@@ -1937,12 +1937,12 @@ int __devinit snd_ymfpci_timer(struct snd_ymfpci *chip, int device)
* proc interface
*/
-static void snd_ymfpci_proc_read(struct snd_info_entry *entry,
+static void snd_ymfpci_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ymfpci *chip = entry->private_data;
int i;
-
+
snd_iprintf(buffer, "YMFPCI\n\n");
for (i = 0; i <= YDSXGR_WORKBASE; i += 4)
snd_iprintf(buffer, "%04x: %04x\n", i, snd_ymfpci_readl(chip, i));
@@ -1951,8 +1951,8 @@ static void snd_ymfpci_proc_read(struct snd_info_entry *entry,
static int __devinit snd_ymfpci_proc_init(struct snd_card *card, struct snd_ymfpci *chip)
{
struct snd_info_entry *entry;
-
- if (! snd_card_proc_new(card, "ymfpci", &entry))
+
+ if (!snd_card_proc_new(card, "ymfpci", &entry))
snd_info_set_text_ops(entry, chip, snd_ymfpci_proc_read);
return 0;
}
@@ -1966,7 +1966,7 @@ static void snd_ymfpci_aclink_reset(struct pci_dev * pci)
u8 cmd;
pci_read_config_byte(pci, PCIR_DSXG_CTRL, &cmd);
-#if 0 // force to reset
+#if 0 /* force to reset */
if (cmd & 0x03) {
#endif
pci_write_config_byte(pci, PCIR_DSXG_CTRL, cmd & 0xfc);
@@ -2082,7 +2082,7 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip)
chip->bank_size_capture = snd_ymfpci_readl(chip, YDSXGR_RECCTRLSIZE) << 2;
chip->bank_size_effect = snd_ymfpci_readl(chip, YDSXGR_EFFCTRLSIZE) << 2;
chip->work_size = YDSXG_DEFAULT_WORK_SIZE;
-
+
size = ALIGN(playback_ctrl_size, 0x100) +
ALIGN(chip->bank_size_playback * 2 * YDSXG_PLAYBACK_VOICES, 0x100) +
ALIGN(chip->bank_size_capture * 2 * YDSXG_CAPTURE_VOICES, 0x100) +
@@ -2091,7 +2091,7 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip)
/* work_ptr must be aligned to 256 bytes, but it's already
covered with the kernel page allocation mechanism */
if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(chip->pci),
- size, &chip->work_ptr) < 0)
+ size, &chip->work_ptr) < 0)
return -ENOMEM;
ptr = chip->work_ptr.area;
ptr_addr = chip->work_ptr.addr;
@@ -2137,7 +2137,7 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip)
ptr_addr = ALIGN(ptr_addr, 0x100);
chip->work_base = ptr;
chip->work_base_addr = ptr_addr;
-
+
snd_BUG_ON(ptr + chip->work_size !=
chip->work_ptr.area + chip->work_ptr.bytes);
@@ -2166,7 +2166,7 @@ static int __devinit snd_ymfpci_memalloc(struct snd_ymfpci *chip)
snd_ymfpci_writel(chip, YDSXGR_NATIVEDACINVOL, 0x3fff3fff);
snd_ymfpci_writel(chip, YDSXGR_PRIADCLOOPVOL, 0x3fff3fff);
snd_ymfpci_writel(chip, YDSXGR_LEGACYOUTVOL, 0x3fff3fff);
-
+
return 0;
}
@@ -2214,11 +2214,11 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip)
iounmap(chip->reg_area_virt);
if (chip->work_ptr.area)
snd_dma_free_pages(&chip->work_ptr);
-
+
release_and_free_resource(chip->res_reg_area);
pci_write_config_word(chip->pci, 0x40, chip->old_legacy_ctrl);
-
+
pci_disable_device(chip->pci);
release_firmware(chip->dsp_microcode);
release_firmware(chip->controller_microcode);
@@ -2267,7 +2267,7 @@ int snd_ymfpci_suspend(struct pci_dev *pci, pm_message_t state)
struct snd_card *card = pci_get_drvdata(pci);
struct snd_ymfpci *chip = card->private_data;
unsigned int i;
-
+
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
snd_pcm_suspend_all(chip->pcm);
snd_pcm_suspend_all(chip->pcm2);
@@ -2333,7 +2333,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card,
static struct snd_device_ops ops = {
.dev_free = snd_ymfpci_dev_free,
};
-
+
*rchip = NULL;
/* enable PCI device */
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/vx222/vx222.c | 2 +-
sound/pci/vx222/vx222_ops.c | 330 +++++++++++++++++++++---------------------
2 files changed, 166 insertions(+), 166 deletions(-)
diff --git a/sound/pci/vx222/vx222.c b/sound/pci/vx222/vx222.c
index acc352f..ec7c743 100644
--- a/sound/pci/vx222/vx222.c
+++ b/sound/pci/vx222/vx222.c
@@ -154,7 +154,7 @@ static int __devinit snd_vx222_create(struct snd_card *card, struct pci_dev *pci
vx_ops = hw->type == VX_TYPE_BOARD ? &vx222_old_ops : &vx222_ops;
chip = snd_vx_create(card, hw, vx_ops,
sizeof(struct snd_vx222) - sizeof(struct vx_core));
- if (! chip) {
+ if (!chip) {
pci_disable_device(pci);
return -ENOMEM;
}
diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c
index 7e87f39..7d1350a 100644
--- a/sound/pci/vx222/vx222_ops.c
+++ b/sound/pci/vx222/vx222_ops.c
@@ -28,7 +28,7 @@
#include <sound/core.h>
#include <sound/control.h>
#include <sound/tlv.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "vx222.h"
@@ -50,12 +50,12 @@ static int vx2_reg_offset[VX_REG_MAX] = {
[VX_HIFREQ] = 0x38,
[VX_CSUER] = 0x3c,
[VX_SELMIC] = 0x40,
- [VX_COMPOT] = 0x44, // Write: POTENTIOMETER ; Read: COMPRESSION LEVEL activate
- [VX_SCOMPR] = 0x48, // Read: COMPRESSION THRESHOLD activate
- [VX_GLIMIT] = 0x4c, // Read: LEVEL LIMITATION activate
- [VX_INTCSR] = 0x4c, // VX_INTCSR_REGISTER_OFFSET
- [VX_CNTRL] = 0x50, // VX_CNTRL_REGISTER_OFFSET
- [VX_GPIOC] = 0x54, // VX_GPIOC (new with PLX9030)
+ [VX_COMPOT] = 0x44, /* Write: POTENTIOMETER; Read: COMPRESSION LEVEL activate */
+ [VX_SCOMPR] = 0x48, /* Read: COMPRESSION THRESHOLD activate */
+ [VX_GLIMIT] = 0x4c, /* Read: LEVEL LIMITATION activate */
+ [VX_INTCSR] = 0x4c, /* VX_INTCSR_REGISTER_OFFSET */
+ [VX_CNTRL] = 0x50, /* VX_CNTRL_REGISTER_OFFSET */
+ [VX_GPIOC] = 0x54, /* VX_GPIOC (new with PLX9030) */
};
static int vx2_reg_index[VX_REG_MAX] = {
@@ -107,7 +107,7 @@ static unsigned char vx2_inb(struct vx_core *chip, int offset)
static void vx2_outb(struct vx_core *chip, int offset, unsigned char val)
{
outb(val, vx2_reg_addr(chip, offset));
- //printk("outb: %x -> %x\n", val, vx2_reg_addr(chip, offset));
+ /* printk("outb: %x -> %x\n", val, vx2_reg_addr(chip, offset)); */
}
/**
@@ -126,7 +126,7 @@ static unsigned int vx2_inl(struct vx_core *chip, int offset)
*/
static void vx2_outl(struct vx_core *chip, int offset, unsigned int val)
{
- // printk("outl: %x -> %x\n", val, vx2_reg_addr(chip, offset));
+ /* printk("outl: %x -> %x\n", val, vx2_reg_addr(chip, offset)); */
outl(val, vx2_reg_addr(chip, offset));
}
@@ -187,7 +187,7 @@ static int vx2_test_xilinx(struct vx_core *_chip)
vx_outl(chip, CDSP, chip->regCDSP & ~VX_CDSP_TEST0_MASK);
vx_inl(chip, ISR);
data = vx_inl(chip, STATUS);
- if (! (data & VX_STATUS_VAL_TEST0_MASK)) {
+ if (!(data & VX_STATUS_VAL_TEST0_MASK)) {
snd_printdd("bad! #2\n");
return -ENODEV;
}
@@ -207,7 +207,7 @@ static int vx2_test_xilinx(struct vx_core *_chip)
vx_outl(chip, CDSP, chip->regCDSP & ~VX_CDSP_TEST1_MASK);
vx_inl(chip, ISR);
data = vx_inl(chip, STATUS);
- if (! (data & VX_STATUS_VAL_TEST1_MASK)) {
+ if (!(data & VX_STATUS_VAL_TEST1_MASK)) {
snd_printdd("bad! #4\n");
return -ENODEV;
}
@@ -400,7 +400,7 @@ static int vx2_load_xilinx_binary(struct vx_core *chip, const struct firmware *x
return 0;
}
-
+
/*
* load the boot/dsp images
*/
@@ -439,12 +439,12 @@ static int vx2_load_dsp(struct vx_core *vx, int index, const struct firmware *ds
static int vx2_test_and_ack(struct vx_core *chip)
{
/* not booted yet? */
- if (! (chip->chip_status & VX_STAT_XILINX_LOADED))
+ if (!(chip->chip_status & VX_STAT_XILINX_LOADED))
return -ENXIO;
- if (! (vx_inl(chip, STATUS) & VX_STATUS_MEMIRQ_MASK))
+ if (!(vx_inl(chip, STATUS) & VX_STATUS_MEMIRQ_MASK))
return -EIO;
-
+
/* ok, interrupts generated, now ack it */
/* set ACQUIT bit up and down */
vx_outl(chip, STATUS, 0);
@@ -512,154 +512,154 @@ static void vx2_write_codec_reg(struct vx_core *chip, unsigned int data)
#define AKM_CODEC_RIGHT_LEVEL_CMD 0xA500
static const u8 vx2_akm_gains_lut[VX2_AKM_LEVEL_MAX+1] = {
- 0x7f, // [000] = +0.000 dB -> AKM(0x7f) = +0.000 dB error(+0.000 dB)
- 0x7d, // [001] = -0.500 dB -> AKM(0x7d) = -0.572 dB error(-0.072 dB)
- 0x7c, // [002] = -1.000 dB -> AKM(0x7c) = -0.873 dB error(+0.127 dB)
- 0x7a, // [003] = -1.500 dB -> AKM(0x7a) = -1.508 dB error(-0.008 dB)
- 0x79, // [004] = -2.000 dB -> AKM(0x79) = -1.844 dB error(+0.156 dB)
- 0x77, // [005] = -2.500 dB -> AKM(0x77) = -2.557 dB error(-0.057 dB)
- 0x76, // [006] = -3.000 dB -> AKM(0x76) = -2.937 dB error(+0.063 dB)
- 0x75, // [007] = -3.500 dB -> AKM(0x75) = -3.334 dB error(+0.166 dB)
- 0x73, // [008] = -4.000 dB -> AKM(0x73) = -4.188 dB error(-0.188 dB)
- 0x72, // [009] = -4.500 dB -> AKM(0x72) = -4.648 dB error(-0.148 dB)
- 0x71, // [010] = -5.000 dB -> AKM(0x71) = -5.134 dB error(-0.134 dB)
- 0x70, // [011] = -5.500 dB -> AKM(0x70) = -5.649 dB error(-0.149 dB)
- 0x6f, // [012] = -6.000 dB -> AKM(0x6f) = -6.056 dB error(-0.056 dB)
- 0x6d, // [013] = -6.500 dB -> AKM(0x6d) = -6.631 dB error(-0.131 dB)
- 0x6c, // [014] = -7.000 dB -> AKM(0x6c) = -6.933 dB error(+0.067 dB)
- 0x6a, // [015] = -7.500 dB -> AKM(0x6a) = -7.571 dB error(-0.071 dB)
- 0x69, // [016] = -8.000 dB -> AKM(0x69) = -7.909 dB error(+0.091 dB)
- 0x67, // [017] = -8.500 dB -> AKM(0x67) = -8.626 dB error(-0.126 dB)
- 0x66, // [018] = -9.000 dB -> AKM(0x66) = -9.008 dB error(-0.008 dB)
- 0x65, // [019] = -9.500 dB -> AKM(0x65) = -9.407 dB error(+0.093 dB)
- 0x64, // [020] = -10.000 dB -> AKM(0x64) = -9.826 dB error(+0.174 dB)
- 0x62, // [021] = -10.500 dB -> AKM(0x62) = -10.730 dB error(-0.230 dB)
- 0x61, // [022] = -11.000 dB -> AKM(0x61) = -11.219 dB error(-0.219 dB)
- 0x60, // [023] = -11.500 dB -> AKM(0x60) = -11.738 dB error(-0.238 dB)
- 0x5f, // [024] = -12.000 dB -> AKM(0x5f) = -12.149 dB error(-0.149 dB)
- 0x5e, // [025] = -12.500 dB -> AKM(0x5e) = -12.434 dB error(+0.066 dB)
- 0x5c, // [026] = -13.000 dB -> AKM(0x5c) = -13.033 dB error(-0.033 dB)
- 0x5b, // [027] = -13.500 dB -> AKM(0x5b) = -13.350 dB error(+0.150 dB)
- 0x59, // [028] = -14.000 dB -> AKM(0x59) = -14.018 dB error(-0.018 dB)
- 0x58, // [029] = -14.500 dB -> AKM(0x58) = -14.373 dB error(+0.127 dB)
- 0x56, // [030] = -15.000 dB -> AKM(0x56) = -15.130 dB error(-0.130 dB)
- 0x55, // [031] = -15.500 dB -> AKM(0x55) = -15.534 dB error(-0.034 dB)
- 0x54, // [032] = -16.000 dB -> AKM(0x54) = -15.958 dB error(+0.042 dB)
- 0x53, // [033] = -16.500 dB -> AKM(0x53) = -16.404 dB error(+0.096 dB)
- 0x52, // [034] = -17.000 dB -> AKM(0x52) = -16.874 dB error(+0.126 dB)
- 0x51, // [035] = -17.500 dB -> AKM(0x51) = -17.371 dB error(+0.129 dB)
- 0x50, // [036] = -18.000 dB -> AKM(0x50) = -17.898 dB error(+0.102 dB)
- 0x4e, // [037] = -18.500 dB -> AKM(0x4e) = -18.605 dB error(-0.105 dB)
- 0x4d, // [038] = -19.000 dB -> AKM(0x4d) = -18.905 dB error(+0.095 dB)
- 0x4b, // [039] = -19.500 dB -> AKM(0x4b) = -19.538 dB error(-0.038 dB)
- 0x4a, // [040] = -20.000 dB -> AKM(0x4a) = -19.872 dB error(+0.128 dB)
- 0x48, // [041] = -20.500 dB -> AKM(0x48) = -20.583 dB error(-0.083 dB)
- 0x47, // [042] = -21.000 dB -> AKM(0x47) = -20.961 dB error(+0.039 dB)
- 0x46, // [043] = -21.500 dB -> AKM(0x46) = -21.356 dB error(+0.144 dB)
- 0x44, // [044] = -22.000 dB -> AKM(0x44) = -22.206 dB error(-0.206 dB)
- 0x43, // [045] = -22.500 dB -> AKM(0x43) = -22.664 dB error(-0.164 dB)
- 0x42, // [046] = -23.000 dB -> AKM(0x42) = -23.147 dB error(-0.147 dB)
- 0x41, // [047] = -23.500 dB -> AKM(0x41) = -23.659 dB error(-0.159 dB)
- 0x40, // [048] = -24.000 dB -> AKM(0x40) = -24.203 dB error(-0.203 dB)
- 0x3f, // [049] = -24.500 dB -> AKM(0x3f) = -24.635 dB error(-0.135 dB)
- 0x3e, // [050] = -25.000 dB -> AKM(0x3e) = -24.935 dB error(+0.065 dB)
- 0x3c, // [051] = -25.500 dB -> AKM(0x3c) = -25.569 dB error(-0.069 dB)
- 0x3b, // [052] = -26.000 dB -> AKM(0x3b) = -25.904 dB error(+0.096 dB)
- 0x39, // [053] = -26.500 dB -> AKM(0x39) = -26.615 dB error(-0.115 dB)
- 0x38, // [054] = -27.000 dB -> AKM(0x38) = -26.994 dB error(+0.006 dB)
- 0x37, // [055] = -27.500 dB -> AKM(0x37) = -27.390 dB error(+0.110 dB)
- 0x36, // [056] = -28.000 dB -> AKM(0x36) = -27.804 dB error(+0.196 dB)
- 0x34, // [057] = -28.500 dB -> AKM(0x34) = -28.699 dB error(-0.199 dB)
- 0x33, // [058] = -29.000 dB -> AKM(0x33) = -29.183 dB error(-0.183 dB)
- 0x32, // [059] = -29.500 dB -> AKM(0x32) = -29.696 dB error(-0.196 dB)
- 0x31, // [060] = -30.000 dB -> AKM(0x31) = -30.241 dB error(-0.241 dB)
- 0x31, // [061] = -30.500 dB -> AKM(0x31) = -30.241 dB error(+0.259 dB)
- 0x30, // [062] = -31.000 dB -> AKM(0x30) = -30.823 dB error(+0.177 dB)
- 0x2e, // [063] = -31.500 dB -> AKM(0x2e) = -31.610 dB error(-0.110 dB)
- 0x2d, // [064] = -32.000 dB -> AKM(0x2d) = -31.945 dB error(+0.055 dB)
- 0x2b, // [065] = -32.500 dB -> AKM(0x2b) = -32.659 dB error(-0.159 dB)
- 0x2a, // [066] = -33.000 dB -> AKM(0x2a) = -33.038 dB error(-0.038 dB)
- 0x29, // [067] = -33.500 dB -> AKM(0x29) = -33.435 dB error(+0.065 dB)
- 0x28, // [068] = -34.000 dB -> AKM(0x28) = -33.852 dB error(+0.148 dB)
- 0x27, // [069] = -34.500 dB -> AKM(0x27) = -34.289 dB error(+0.211 dB)
- 0x25, // [070] = -35.000 dB -> AKM(0x25) = -35.235 dB error(-0.235 dB)
- 0x24, // [071] = -35.500 dB -> AKM(0x24) = -35.750 dB error(-0.250 dB)
- 0x24, // [072] = -36.000 dB -> AKM(0x24) = -35.750 dB error(+0.250 dB)
- 0x23, // [073] = -36.500 dB -> AKM(0x23) = -36.297 dB error(+0.203 dB)
- 0x22, // [074] = -37.000 dB -> AKM(0x22) = -36.881 dB error(+0.119 dB)
- 0x21, // [075] = -37.500 dB -> AKM(0x21) = -37.508 dB error(-0.008 dB)
- 0x20, // [076] = -38.000 dB -> AKM(0x20) = -38.183 dB error(-0.183 dB)
- 0x1f, // [077] = -38.500 dB -> AKM(0x1f) = -38.726 dB error(-0.226 dB)
- 0x1e, // [078] = -39.000 dB -> AKM(0x1e) = -39.108 dB error(-0.108 dB)
- 0x1d, // [079] = -39.500 dB -> AKM(0x1d) = -39.507 dB error(-0.007 dB)
- 0x1c, // [080] = -40.000 dB -> AKM(0x1c) = -39.926 dB error(+0.074 dB)
- 0x1b, // [081] = -40.500 dB -> AKM(0x1b) = -40.366 dB error(+0.134 dB)
- 0x1a, // [082] = -41.000 dB -> AKM(0x1a) = -40.829 dB error(+0.171 dB)
- 0x19, // [083] = -41.500 dB -> AKM(0x19) = -41.318 dB error(+0.182 dB)
- 0x18, // [084] = -42.000 dB -> AKM(0x18) = -41.837 dB error(+0.163 dB)
- 0x17, // [085] = -42.500 dB -> AKM(0x17) = -42.389 dB error(+0.111 dB)
- 0x16, // [086] = -43.000 dB -> AKM(0x16) = -42.978 dB error(+0.022 dB)
- 0x15, // [087] = -43.500 dB -> AKM(0x15) = -43.610 dB error(-0.110 dB)
- 0x14, // [088] = -44.000 dB -> AKM(0x14) = -44.291 dB error(-0.291 dB)
- 0x14, // [089] = -44.500 dB -> AKM(0x14) = -44.291 dB error(+0.209 dB)
- 0x13, // [090] = -45.000 dB -> AKM(0x13) = -45.031 dB error(-0.031 dB)
- 0x12, // [091] = -45.500 dB -> AKM(0x12) = -45.840 dB error(-0.340 dB)
- 0x12, // [092] = -46.000 dB -> AKM(0x12) = -45.840 dB error(+0.160 dB)
- 0x11, // [093] = -46.500 dB -> AKM(0x11) = -46.731 dB error(-0.231 dB)
- 0x11, // [094] = -47.000 dB -> AKM(0x11) = -46.731 dB error(+0.269 dB)
- 0x10, // [095] = -47.500 dB -> AKM(0x10) = -47.725 dB error(-0.225 dB)
- 0x10, // [096] = -48.000 dB -> AKM(0x10) = -47.725 dB error(+0.275 dB)
- 0x0f, // [097] = -48.500 dB -> AKM(0x0f) = -48.553 dB error(-0.053 dB)
- 0x0e, // [098] = -49.000 dB -> AKM(0x0e) = -49.152 dB error(-0.152 dB)
- 0x0d, // [099] = -49.500 dB -> AKM(0x0d) = -49.796 dB error(-0.296 dB)
- 0x0d, // [100] = -50.000 dB -> AKM(0x0d) = -49.796 dB error(+0.204 dB)
- 0x0c, // [101] = -50.500 dB -> AKM(0x0c) = -50.491 dB error(+0.009 dB)
- 0x0b, // [102] = -51.000 dB -> AKM(0x0b) = -51.247 dB error(-0.247 dB)
- 0x0b, // [103] = -51.500 dB -> AKM(0x0b) = -51.247 dB error(+0.253 dB)
- 0x0a, // [104] = -52.000 dB -> AKM(0x0a) = -52.075 dB error(-0.075 dB)
- 0x0a, // [105] = -52.500 dB -> AKM(0x0a) = -52.075 dB error(+0.425 dB)
- 0x09, // [106] = -53.000 dB -> AKM(0x09) = -52.990 dB error(+0.010 dB)
- 0x09, // [107] = -53.500 dB -> AKM(0x09) = -52.990 dB error(+0.510 dB)
- 0x08, // [108] = -54.000 dB -> AKM(0x08) = -54.013 dB error(-0.013 dB)
- 0x08, // [109] = -54.500 dB -> AKM(0x08) = -54.013 dB error(+0.487 dB)
- 0x07, // [110] = -55.000 dB -> AKM(0x07) = -55.173 dB error(-0.173 dB)
- 0x07, // [111] = -55.500 dB -> AKM(0x07) = -55.173 dB error(+0.327 dB)
- 0x06, // [112] = -56.000 dB -> AKM(0x06) = -56.512 dB error(-0.512 dB)
- 0x06, // [113] = -56.500 dB -> AKM(0x06) = -56.512 dB error(-0.012 dB)
- 0x06, // [114] = -57.000 dB -> AKM(0x06) = -56.512 dB error(+0.488 dB)
- 0x05, // [115] = -57.500 dB -> AKM(0x05) = -58.095 dB error(-0.595 dB)
- 0x05, // [116] = -58.000 dB -> AKM(0x05) = -58.095 dB error(-0.095 dB)
- 0x05, // [117] = -58.500 dB -> AKM(0x05) = -58.095 dB error(+0.405 dB)
- 0x05, // [118] = -59.000 dB -> AKM(0x05) = -58.095 dB error(+0.905 dB)
- 0x04, // [119] = -59.500 dB -> AKM(0x04) = -60.034 dB error(-0.534 dB)
- 0x04, // [120] = -60.000 dB -> AKM(0x04) = -60.034 dB error(-0.034 dB)
- 0x04, // [121] = -60.500 dB -> AKM(0x04) = -60.034 dB error(+0.466 dB)
- 0x04, // [122] = -61.000 dB -> AKM(0x04) = -60.034 dB error(+0.966 dB)
- 0x03, // [123] = -61.500 dB -> AKM(0x03) = -62.532 dB error(-1.032 dB)
- 0x03, // [124] = -62.000 dB -> AKM(0x03) = -62.532 dB error(-0.532 dB)
- 0x03, // [125] = -62.500 dB -> AKM(0x03) = -62.532 dB error(-0.032 dB)
- 0x03, // [126] = -63.000 dB -> AKM(0x03) = -62.532 dB error(+0.468 dB)
- 0x03, // [127] = -63.500 dB -> AKM(0x03) = -62.532 dB error(+0.968 dB)
- 0x03, // [128] = -64.000 dB -> AKM(0x03) = -62.532 dB error(+1.468 dB)
- 0x02, // [129] = -64.500 dB -> AKM(0x02) = -66.054 dB error(-1.554 dB)
- 0x02, // [130] = -65.000 dB -> AKM(0x02) = -66.054 dB error(-1.054 dB)
- 0x02, // [131] = -65.500 dB -> AKM(0x02) = -66.054 dB error(-0.554 dB)
- 0x02, // [132] = -66.000 dB -> AKM(0x02) = -66.054 dB error(-0.054 dB)
- 0x02, // [133] = -66.500 dB -> AKM(0x02) = -66.054 dB error(+0.446 dB)
- 0x02, // [134] = -67.000 dB -> AKM(0x02) = -66.054 dB error(+0.946 dB)
- 0x02, // [135] = -67.500 dB -> AKM(0x02) = -66.054 dB error(+1.446 dB)
- 0x02, // [136] = -68.000 dB -> AKM(0x02) = -66.054 dB error(+1.946 dB)
- 0x02, // [137] = -68.500 dB -> AKM(0x02) = -66.054 dB error(+2.446 dB)
- 0x02, // [138] = -69.000 dB -> AKM(0x02) = -66.054 dB error(+2.946 dB)
- 0x01, // [139] = -69.500 dB -> AKM(0x01) = -72.075 dB error(-2.575 dB)
- 0x01, // [140] = -70.000 dB -> AKM(0x01) = -72.075 dB error(-2.075 dB)
- 0x01, // [141] = -70.500 dB -> AKM(0x01) = -72.075 dB error(-1.575 dB)
- 0x01, // [142] = -71.000 dB -> AKM(0x01) = -72.075 dB error(-1.075 dB)
- 0x01, // [143] = -71.500 dB -> AKM(0x01) = -72.075 dB error(-0.575 dB)
- 0x01, // [144] = -72.000 dB -> AKM(0x01) = -72.075 dB error(-0.075 dB)
- 0x01, // [145] = -72.500 dB -> AKM(0x01) = -72.075 dB error(+0.425 dB)
- 0x01, // [146] = -73.000 dB -> AKM(0x01) = -72.075 dB error(+0.925 dB)
- 0x00}; // [147] = -73.500 dB -> AKM(0x00) = mute error(+infini)
+ 0x7f, /* [000] = +0.000 dB -> AKM(0x7f) = +0.000 dB error(+0.000 dB) */
+ 0x7d, /* [001] = -0.500 dB -> AKM(0x7d) = -0.572 dB error(-0.072 dB) */
+ 0x7c, /* [002] = -1.000 dB -> AKM(0x7c) = -0.873 dB error(+0.127 dB) */
+ 0x7a, /* [003] = -1.500 dB -> AKM(0x7a) = -1.508 dB error(-0.008 dB) */
+ 0x79, /* [004] = -2.000 dB -> AKM(0x79) = -1.844 dB error(+0.156 dB) */
+ 0x77, /* [005] = -2.500 dB -> AKM(0x77) = -2.557 dB error(-0.057 dB) */
+ 0x76, /* [006] = -3.000 dB -> AKM(0x76) = -2.937 dB error(+0.063 dB) */
+ 0x75, /* [007] = -3.500 dB -> AKM(0x75) = -3.334 dB error(+0.166 dB) */
+ 0x73, /* [008] = -4.000 dB -> AKM(0x73) = -4.188 dB error(-0.188 dB) */
+ 0x72, /* [009] = -4.500 dB -> AKM(0x72) = -4.648 dB error(-0.148 dB) */
+ 0x71, /* [010] = -5.000 dB -> AKM(0x71) = -5.134 dB error(-0.134 dB) */
+ 0x70, /* [011] = -5.500 dB -> AKM(0x70) = -5.649 dB error(-0.149 dB) */
+ 0x6f, /* [012] = -6.000 dB -> AKM(0x6f) = -6.056 dB error(-0.056 dB) */
+ 0x6d, /* [013] = -6.500 dB -> AKM(0x6d) = -6.631 dB error(-0.131 dB) */
+ 0x6c, /* [014] = -7.000 dB -> AKM(0x6c) = -6.933 dB error(+0.067 dB) */
+ 0x6a, /* [015] = -7.500 dB -> AKM(0x6a) = -7.571 dB error(-0.071 dB) */
+ 0x69, /* [016] = -8.000 dB -> AKM(0x69) = -7.909 dB error(+0.091 dB) */
+ 0x67, /* [017] = -8.500 dB -> AKM(0x67) = -8.626 dB error(-0.126 dB) */
+ 0x66, /* [018] = -9.000 dB -> AKM(0x66) = -9.008 dB error(-0.008 dB) */
+ 0x65, /* [019] = -9.500 dB -> AKM(0x65) = -9.407 dB error(+0.093 dB) */
+ 0x64, /* [020] = -10.000 dB -> AKM(0x64) = -9.826 dB error(+0.174 dB) */
+ 0x62, /* [021] = -10.500 dB -> AKM(0x62) = -10.730 dB error(-0.230 dB) */
+ 0x61, /* [022] = -11.000 dB -> AKM(0x61) = -11.219 dB error(-0.219 dB) */
+ 0x60, /* [023] = -11.500 dB -> AKM(0x60) = -11.738 dB error(-0.238 dB) */
+ 0x5f, /* [024] = -12.000 dB -> AKM(0x5f) = -12.149 dB error(-0.149 dB) */
+ 0x5e, /* [025] = -12.500 dB -> AKM(0x5e) = -12.434 dB error(+0.066 dB) */
+ 0x5c, /* [026] = -13.000 dB -> AKM(0x5c) = -13.033 dB error(-0.033 dB) */
+ 0x5b, /* [027] = -13.500 dB -> AKM(0x5b) = -13.350 dB error(+0.150 dB) */
+ 0x59, /* [028] = -14.000 dB -> AKM(0x59) = -14.018 dB error(-0.018 dB) */
+ 0x58, /* [029] = -14.500 dB -> AKM(0x58) = -14.373 dB error(+0.127 dB) */
+ 0x56, /* [030] = -15.000 dB -> AKM(0x56) = -15.130 dB error(-0.130 dB) */
+ 0x55, /* [031] = -15.500 dB -> AKM(0x55) = -15.534 dB error(-0.034 dB) */
+ 0x54, /* [032] = -16.000 dB -> AKM(0x54) = -15.958 dB error(+0.042 dB) */
+ 0x53, /* [033] = -16.500 dB -> AKM(0x53) = -16.404 dB error(+0.096 dB) */
+ 0x52, /* [034] = -17.000 dB -> AKM(0x52) = -16.874 dB error(+0.126 dB) */
+ 0x51, /* [035] = -17.500 dB -> AKM(0x51) = -17.371 dB error(+0.129 dB) */
+ 0x50, /* [036] = -18.000 dB -> AKM(0x50) = -17.898 dB error(+0.102 dB) */
+ 0x4e, /* [037] = -18.500 dB -> AKM(0x4e) = -18.605 dB error(-0.105 dB) */
+ 0x4d, /* [038] = -19.000 dB -> AKM(0x4d) = -18.905 dB error(+0.095 dB) */
+ 0x4b, /* [039] = -19.500 dB -> AKM(0x4b) = -19.538 dB error(-0.038 dB) */
+ 0x4a, /* [040] = -20.000 dB -> AKM(0x4a) = -19.872 dB error(+0.128 dB) */
+ 0x48, /* [041] = -20.500 dB -> AKM(0x48) = -20.583 dB error(-0.083 dB) */
+ 0x47, /* [042] = -21.000 dB -> AKM(0x47) = -20.961 dB error(+0.039 dB) */
+ 0x46, /* [043] = -21.500 dB -> AKM(0x46) = -21.356 dB error(+0.144 dB) */
+ 0x44, /* [044] = -22.000 dB -> AKM(0x44) = -22.206 dB error(-0.206 dB) */
+ 0x43, /* [045] = -22.500 dB -> AKM(0x43) = -22.664 dB error(-0.164 dB) */
+ 0x42, /* [046] = -23.000 dB -> AKM(0x42) = -23.147 dB error(-0.147 dB) */
+ 0x41, /* [047] = -23.500 dB -> AKM(0x41) = -23.659 dB error(-0.159 dB) */
+ 0x40, /* [048] = -24.000 dB -> AKM(0x40) = -24.203 dB error(-0.203 dB) */
+ 0x3f, /* [049] = -24.500 dB -> AKM(0x3f) = -24.635 dB error(-0.135 dB) */
+ 0x3e, /* [050] = -25.000 dB -> AKM(0x3e) = -24.935 dB error(+0.065 dB) */
+ 0x3c, /* [051] = -25.500 dB -> AKM(0x3c) = -25.569 dB error(-0.069 dB) */
+ 0x3b, /* [052] = -26.000 dB -> AKM(0x3b) = -25.904 dB error(+0.096 dB) */
+ 0x39, /* [053] = -26.500 dB -> AKM(0x39) = -26.615 dB error(-0.115 dB) */
+ 0x38, /* [054] = -27.000 dB -> AKM(0x38) = -26.994 dB error(+0.006 dB) */
+ 0x37, /* [055] = -27.500 dB -> AKM(0x37) = -27.390 dB error(+0.110 dB) */
+ 0x36, /* [056] = -28.000 dB -> AKM(0x36) = -27.804 dB error(+0.196 dB) */
+ 0x34, /* [057] = -28.500 dB -> AKM(0x34) = -28.699 dB error(-0.199 dB) */
+ 0x33, /* [058] = -29.000 dB -> AKM(0x33) = -29.183 dB error(-0.183 dB) */
+ 0x32, /* [059] = -29.500 dB -> AKM(0x32) = -29.696 dB error(-0.196 dB) */
+ 0x31, /* [060] = -30.000 dB -> AKM(0x31) = -30.241 dB error(-0.241 dB) */
+ 0x31, /* [061] = -30.500 dB -> AKM(0x31) = -30.241 dB error(+0.259 dB) */
+ 0x30, /* [062] = -31.000 dB -> AKM(0x30) = -30.823 dB error(+0.177 dB) */
+ 0x2e, /* [063] = -31.500 dB -> AKM(0x2e) = -31.610 dB error(-0.110 dB) */
+ 0x2d, /* [064] = -32.000 dB -> AKM(0x2d) = -31.945 dB error(+0.055 dB) */
+ 0x2b, /* [065] = -32.500 dB -> AKM(0x2b) = -32.659 dB error(-0.159 dB) */
+ 0x2a, /* [066] = -33.000 dB -> AKM(0x2a) = -33.038 dB error(-0.038 dB) */
+ 0x29, /* [067] = -33.500 dB -> AKM(0x29) = -33.435 dB error(+0.065 dB) */
+ 0x28, /* [068] = -34.000 dB -> AKM(0x28) = -33.852 dB error(+0.148 dB) */
+ 0x27, /* [069] = -34.500 dB -> AKM(0x27) = -34.289 dB error(+0.211 dB) */
+ 0x25, /* [070] = -35.000 dB -> AKM(0x25) = -35.235 dB error(-0.235 dB) */
+ 0x24, /* [071] = -35.500 dB -> AKM(0x24) = -35.750 dB error(-0.250 dB) */
+ 0x24, /* [072] = -36.000 dB -> AKM(0x24) = -35.750 dB error(+0.250 dB) */
+ 0x23, /* [073] = -36.500 dB -> AKM(0x23) = -36.297 dB error(+0.203 dB) */
+ 0x22, /* [074] = -37.000 dB -> AKM(0x22) = -36.881 dB error(+0.119 dB) */
+ 0x21, /* [075] = -37.500 dB -> AKM(0x21) = -37.508 dB error(-0.008 dB) */
+ 0x20, /* [076] = -38.000 dB -> AKM(0x20) = -38.183 dB error(-0.183 dB) */
+ 0x1f, /* [077] = -38.500 dB -> AKM(0x1f) = -38.726 dB error(-0.226 dB) */
+ 0x1e, /* [078] = -39.000 dB -> AKM(0x1e) = -39.108 dB error(-0.108 dB) */
+ 0x1d, /* [079] = -39.500 dB -> AKM(0x1d) = -39.507 dB error(-0.007 dB) */
+ 0x1c, /* [080] = -40.000 dB -> AKM(0x1c) = -39.926 dB error(+0.074 dB) */
+ 0x1b, /* [081] = -40.500 dB -> AKM(0x1b) = -40.366 dB error(+0.134 dB) */
+ 0x1a, /* [082] = -41.000 dB -> AKM(0x1a) = -40.829 dB error(+0.171 dB) */
+ 0x19, /* [083] = -41.500 dB -> AKM(0x19) = -41.318 dB error(+0.182 dB) */
+ 0x18, /* [084] = -42.000 dB -> AKM(0x18) = -41.837 dB error(+0.163 dB) */
+ 0x17, /* [085] = -42.500 dB -> AKM(0x17) = -42.389 dB error(+0.111 dB) */
+ 0x16, /* [086] = -43.000 dB -> AKM(0x16) = -42.978 dB error(+0.022 dB) */
+ 0x15, /* [087] = -43.500 dB -> AKM(0x15) = -43.610 dB error(-0.110 dB) */
+ 0x14, /* [088] = -44.000 dB -> AKM(0x14) = -44.291 dB error(-0.291 dB) */
+ 0x14, /* [089] = -44.500 dB -> AKM(0x14) = -44.291 dB error(+0.209 dB) */
+ 0x13, /* [090] = -45.000 dB -> AKM(0x13) = -45.031 dB error(-0.031 dB) */
+ 0x12, /* [091] = -45.500 dB -> AKM(0x12) = -45.840 dB error(-0.340 dB) */
+ 0x12, /* [092] = -46.000 dB -> AKM(0x12) = -45.840 dB error(+0.160 dB) */
+ 0x11, /* [093] = -46.500 dB -> AKM(0x11) = -46.731 dB error(-0.231 dB) */
+ 0x11, /* [094] = -47.000 dB -> AKM(0x11) = -46.731 dB error(+0.269 dB) */
+ 0x10, /* [095] = -47.500 dB -> AKM(0x10) = -47.725 dB error(-0.225 dB) */
+ 0x10, /* [096] = -48.000 dB -> AKM(0x10) = -47.725 dB error(+0.275 dB) */
+ 0x0f, /* [097] = -48.500 dB -> AKM(0x0f) = -48.553 dB error(-0.053 dB) */
+ 0x0e, /* [098] = -49.000 dB -> AKM(0x0e) = -49.152 dB error(-0.152 dB) */
+ 0x0d, /* [099] = -49.500 dB -> AKM(0x0d) = -49.796 dB error(-0.296 dB) */
+ 0x0d, /* [100] = -50.000 dB -> AKM(0x0d) = -49.796 dB error(+0.204 dB) */
+ 0x0c, /* [101] = -50.500 dB -> AKM(0x0c) = -50.491 dB error(+0.009 dB) */
+ 0x0b, /* [102] = -51.000 dB -> AKM(0x0b) = -51.247 dB error(-0.247 dB) */
+ 0x0b, /* [103] = -51.500 dB -> AKM(0x0b) = -51.247 dB error(+0.253 dB) */
+ 0x0a, /* [104] = -52.000 dB -> AKM(0x0a) = -52.075 dB error(-0.075 dB) */
+ 0x0a, /* [105] = -52.500 dB -> AKM(0x0a) = -52.075 dB error(+0.425 dB) */
+ 0x09, /* [106] = -53.000 dB -> AKM(0x09) = -52.990 dB error(+0.010 dB) */
+ 0x09, /* [107] = -53.500 dB -> AKM(0x09) = -52.990 dB error(+0.510 dB) */
+ 0x08, /* [108] = -54.000 dB -> AKM(0x08) = -54.013 dB error(-0.013 dB) */
+ 0x08, /* [109] = -54.500 dB -> AKM(0x08) = -54.013 dB error(+0.487 dB) */
+ 0x07, /* [110] = -55.000 dB -> AKM(0x07) = -55.173 dB error(-0.173 dB) */
+ 0x07, /* [111] = -55.500 dB -> AKM(0x07) = -55.173 dB error(+0.327 dB) */
+ 0x06, /* [112] = -56.000 dB -> AKM(0x06) = -56.512 dB error(-0.512 dB) */
+ 0x06, /* [113] = -56.500 dB -> AKM(0x06) = -56.512 dB error(-0.012 dB) */
+ 0x06, /* [114] = -57.000 dB -> AKM(0x06) = -56.512 dB error(+0.488 dB) */
+ 0x05, /* [115] = -57.500 dB -> AKM(0x05) = -58.095 dB error(-0.595 dB) */
+ 0x05, /* [116] = -58.000 dB -> AKM(0x05) = -58.095 dB error(-0.095 dB) */
+ 0x05, /* [117] = -58.500 dB -> AKM(0x05) = -58.095 dB error(+0.405 dB) */
+ 0x05, /* [118] = -59.000 dB -> AKM(0x05) = -58.095 dB error(+0.905 dB) */
+ 0x04, /* [119] = -59.500 dB -> AKM(0x04) = -60.034 dB error(-0.534 dB) */
+ 0x04, /* [120] = -60.000 dB -> AKM(0x04) = -60.034 dB error(-0.034 dB) */
+ 0x04, /* [121] = -60.500 dB -> AKM(0x04) = -60.034 dB error(+0.466 dB) */
+ 0x04, /* [122] = -61.000 dB -> AKM(0x04) = -60.034 dB error(+0.966 dB) */
+ 0x03, /* [123] = -61.500 dB -> AKM(0x03) = -62.532 dB error(-1.032 dB) */
+ 0x03, /* [124] = -62.000 dB -> AKM(0x03) = -62.532 dB error(-0.532 dB) */
+ 0x03, /* [125] = -62.500 dB -> AKM(0x03) = -62.532 dB error(-0.032 dB) */
+ 0x03, /* [126] = -63.000 dB -> AKM(0x03) = -62.532 dB error(+0.468 dB) */
+ 0x03, /* [127] = -63.500 dB -> AKM(0x03) = -62.532 dB error(+0.968 dB) */
+ 0x03, /* [128] = -64.000 dB -> AKM(0x03) = -62.532 dB error(+1.468 dB) */
+ 0x02, /* [129] = -64.500 dB -> AKM(0x02) = -66.054 dB error(-1.554 dB) */
+ 0x02, /* [130] = -65.000 dB -> AKM(0x02) = -66.054 dB error(-1.054 dB) */
+ 0x02, /* [131] = -65.500 dB -> AKM(0x02) = -66.054 dB error(-0.554 dB) */
+ 0x02, /* [132] = -66.000 dB -> AKM(0x02) = -66.054 dB error(-0.054 dB) */
+ 0x02, /* [133] = -66.500 dB -> AKM(0x02) = -66.054 dB error(+0.446 dB) */
+ 0x02, /* [134] = -67.000 dB -> AKM(0x02) = -66.054 dB error(+0.946 dB) */
+ 0x02, /* [135] = -67.500 dB -> AKM(0x02) = -66.054 dB error(+1.446 dB) */
+ 0x02, /* [136] = -68.000 dB -> AKM(0x02) = -66.054 dB error(+1.946 dB) */
+ 0x02, /* [137] = -68.500 dB -> AKM(0x02) = -66.054 dB error(+2.446 dB) */
+ 0x02, /* [138] = -69.000 dB -> AKM(0x02) = -66.054 dB error(+2.946 dB) */
+ 0x01, /* [139] = -69.500 dB -> AKM(0x01) = -72.075 dB error(-2.575 dB) */
+ 0x01, /* [140] = -70.000 dB -> AKM(0x01) = -72.075 dB error(-2.075 dB) */
+ 0x01, /* [141] = -70.500 dB -> AKM(0x01) = -72.075 dB error(-1.575 dB) */
+ 0x01, /* [142] = -71.000 dB -> AKM(0x01) = -72.075 dB error(-1.075 dB) */
+ 0x01, /* [143] = -71.500 dB -> AKM(0x01) = -72.075 dB error(-0.575 dB) */
+ 0x01, /* [144] = -72.000 dB -> AKM(0x01) = -72.075 dB error(-0.075 dB) */
+ 0x01, /* [145] = -72.500 dB -> AKM(0x01) = -72.075 dB error(+0.425 dB) */
+ 0x01, /* [146] = -73.000 dB -> AKM(0x01) = -72.075 dB error(+0.925 dB) */
+ 0x00}; /* [147] = -73.500 dB -> AKM(0x00) = mute error(+infini) */
/*
* pseudo-codec write entry
@@ -738,7 +738,7 @@ static void vx2_reset_codec(struct vx_core *_chip)
msleep(5); /* additionnel wait time for AKM's */
vx2_write_codec_reg(_chip, AKM_CODEC_POWER_CONTROL_CMD); /* DAC power up, ADC power up, Vref power down */
-
+
vx2_write_codec_reg(_chip, AKM_CODEC_CLOCK_FORMAT_CMD); /* default */
vx2_write_codec_reg(_chip, AKM_CODEC_MUTE_CMD); /* Mute = ON ,Deemphasis = OFF */
vx2_write_codec_reg(_chip, AKM_CODEC_RESET_OFF_CMD); /* DAC and ADC normal operation */
@@ -798,7 +798,7 @@ static void vx2_reset_board(struct vx_core *_chip, int cold_reset)
struct snd_vx222 *chip = (struct snd_vx222 *)_chip;
/* initialize the register values */
- chip->regCDSP = VX_CDSP_CODEC_RESET_MASK | VX_CDSP_DSP_RESET_MASK ;
+ chip->regCDSP = VX_CDSP_CODEC_RESET_MASK | VX_CDSP_DSP_RESET_MASK;
chip->regCFG = 0;
}
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/via82xx.c | 76 ++++++++++++++++++++++----------------------
sound/pci/via82xx_modem.c | 60 ++++++++++++++++++------------------
2 files changed, 68 insertions(+), 68 deletions(-)
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 1aafe95..8a84cb2 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -43,10 +43,10 @@
* routines for each chipset.
*
* Sep. 26, 2005 Karsten Wiese <annabellesgarden(a)yahoo.de>
- * - Optimize position calculation for the 823x chips.
+ * - Optimize position calculation for the 823x chips.
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -146,7 +146,7 @@ module_param(enable, bool, 0444);
#define VIA_REG_CTRL_TERMINATE 0x40 /* WO */
#define VIA_REG_CTRL_AUTOSTART 0x20
#define VIA_REG_CTRL_PAUSE 0x08 /* RW */
-#define VIA_REG_CTRL_INT_STOP 0x04
+#define VIA_REG_CTRL_INT_STOP 0x04
#define VIA_REG_CTRL_INT_EOL 0x02
#define VIA_REG_CTRL_INT_FLAG 0x01
#define VIA_REG_CTRL_RESET 0x01 /* RW - probably reset? undocumented */
@@ -310,7 +310,7 @@ DEFINE_VIA_REGSET(CAPTURE_8233, 0x60);
struct snd_via_sg_table {
unsigned int offset;
unsigned int size;
-} ;
+};
#define VIA_TABLE_SIZE 255
#define VIA_MAX_BUFSIZE (1<<24)
@@ -431,9 +431,9 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
&dev->table) < 0)
return -ENOMEM;
}
- if (! dev->idx_table) {
+ if (!dev->idx_table) {
dev->idx_table = kmalloc(sizeof(*dev->idx_table) * VIA_TABLE_SIZE, GFP_KERNEL);
- if (! dev->idx_table)
+ if (!dev->idx_table)
return -ENOMEM;
}
@@ -459,14 +459,14 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
((u32 *)dev->table.area)[idx << 1] = cpu_to_le32(addr);
r = snd_pcm_sgbuf_get_chunk_size(substream, ofs, rest);
rest -= r;
- if (! rest) {
+ if (!rest) {
if (i == periods - 1)
flag = VIA_TBL_BIT_EOL; /* buffer boundary */
else
flag = VIA_TBL_BIT_FLAG; /* period boundary */
} else
flag = 0; /* period continues to the next */
- // printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest);
+ /* printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest); */
((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag);
dev->idx_table[idx].offset = ofs;
dev->idx_table[idx].size = r;
@@ -502,17 +502,17 @@ static inline unsigned int snd_via82xx_codec_xread(struct via82xx *chip)
{
return inl(VIAREG(chip, AC97));
}
-
+
static inline void snd_via82xx_codec_xwrite(struct via82xx *chip, unsigned int val)
{
outl(val, VIAREG(chip, AC97));
}
-
+
static int snd_via82xx_codec_ready(struct via82xx *chip, int secondary)
{
unsigned int timeout = 1000; /* 1ms */
unsigned int val;
-
+
while (timeout-- > 0) {
udelay(1);
if (!((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY))
@@ -522,14 +522,14 @@ static int snd_via82xx_codec_ready(struct via82xx *chip, int secondary)
secondary, snd_via82xx_codec_xread(chip));
return -EIO;
}
-
+
static int snd_via82xx_codec_valid(struct via82xx *chip, int secondary)
{
unsigned int timeout = 1000; /* 1ms */
unsigned int val, val1;
unsigned int stat = !secondary ? VIA_REG_AC97_PRIMARY_VALID :
VIA_REG_AC97_SECONDARY_VALID;
-
+
while (timeout-- > 0) {
val = snd_via82xx_codec_xread(chip);
val1 = val & (VIA_REG_AC97_BUSY | stat);
@@ -539,7 +539,7 @@ static int snd_via82xx_codec_valid(struct via82xx *chip, int secondary)
}
return -EIO;
}
-
+
static void snd_via82xx_codec_wait(struct snd_ac97 *ac97)
{
struct via82xx *chip = ac97->private_data;
@@ -602,7 +602,7 @@ static void snd_via82xx_channel_reset(struct via82xx *chip, struct viadev *viade
/* clear interrupts */
outb(0x03, VIADEV_REG(viadev, OFFSET_STATUS));
outb(0x00, VIADEV_REG(viadev, OFFSET_TYPE)); /* for via686 */
- // outl(0, VIADEV_REG(viadev, OFFSET_CURR_PTR));
+ /* outl(0, VIADEV_REG(viadev, OFFSET_CURR_PTR)); */
viadev->lastpos = 0;
viadev->hwptr_done = 0;
}
@@ -619,7 +619,7 @@ static irqreturn_t snd_via686_interrupt(int irq, void *dev_id)
unsigned int i;
status = inl(VIAREG(chip, SGD_SHADOW));
- if (! (status & chip->intr_mask)) {
+ if (!(status & chip->intr_mask)) {
if (chip->rmidi)
/* check mpu401 interrupt */
return snd_mpu401_uart_interrupt(irq, chip->rmidi->private_data);
@@ -631,12 +631,12 @@ static irqreturn_t snd_via686_interrupt(int irq, void *dev_id)
for (i = 0; i < chip->num_devs; i++) {
struct viadev *viadev = &chip->devs[i];
unsigned char c_status = inb(VIADEV_REG(viadev, OFFSET_STATUS));
- if (! (c_status & (VIA_REG_STAT_EOL|VIA_REG_STAT_FLAG|VIA_REG_STAT_STOPPED)))
+ if (!(c_status & (VIA_REG_STAT_EOL|VIA_REG_STAT_FLAG|VIA_REG_STAT_STOPPED)))
continue;
if (viadev->substream && viadev->running) {
/*
* Update hwptr_done based on 'period elapsed'
- * interrupts. We'll use it, when the chip returns 0
+ * interrupts. We'll use it, when the chip returns 0
* for OFFSET_CURR_COUNT.
*/
if (c_status & VIA_REG_STAT_EOL)
@@ -685,7 +685,7 @@ static irqreturn_t snd_via8233_interrupt(int irq, void *dev_id)
if (substream && viadev->running) {
/*
* Update hwptr_done based on 'period elapsed'
- * interrupts. We'll use it, when the chip returns 0
+ * interrupts. We'll use it, when the chip returns 0
* for OFFSET_CURR_COUNT.
*/
if (c_status & VIA_REG_STAT_EOL)
@@ -783,7 +783,7 @@ static inline unsigned int calc_linear_pos(struct viadev *viadev, unsigned int i
(int)size, (int)count);
res = viadev->lastpos;
} else {
- if (! count) {
+ if (!count) {
/* Some mobos report count = 0 on the DMA boundary,
* i.e. count = size indeed.
* Let's check whether this step is above the expected size.
@@ -855,7 +855,7 @@ static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *subst
struct viadev *viadev = substream->runtime->private_data;
unsigned int idx, count, res;
int status;
-
+
if (snd_BUG_ON(!viadev->tbl_entries))
return 0;
@@ -865,7 +865,7 @@ static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *subst
if (!status)
status = inb(VIADEV_REG(viadev, OFFSET_STATUS));
- /* An apparent bug in the 8251 is worked around by sending a
+ /* An apparent bug in the 8251 is worked around by sending a
* REG_CTRL_START. */
if (chip->revision == VIA_REV_8251 && (status & VIA_REG_STAT_EOL))
snd_via82xx_pcm_trigger(substream, SNDRV_PCM_TRIGGER_START);
@@ -896,7 +896,7 @@ static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *subst
res += viadev->fragsize;
}
}
- }
+ }
unlock:
viadev->lastpos = res;
spin_unlock(&chip->reg_lock);
@@ -1166,7 +1166,7 @@ static int snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev,
struct via_rate_lock *ratep;
runtime->hw = snd_via82xx_hw;
-
+
/* set the hw rate condition */
ratep = &chip->rates[viadev->direction];
spin_lock_irq(&ratep->lock);
@@ -1185,7 +1185,7 @@ static int snd_via82xx_pcm_open(struct via82xx *chip, struct viadev *viadev,
SNDRV_PCM_RATE_8000_48000);
runtime->hw.rate_min = 8000;
runtime->hw.rate_max = 48000;
- } else if (! ratep->rate) {
+ } else if (!ratep->rate) {
int idx = viadev->direction ? AC97_RATES_ADC : AC97_RATES_FRONT_DAC;
runtime->hw.rates = chip->ac97->rates[idx];
snd_pcm_limit_hw_rates(runtime);
@@ -1276,11 +1276,11 @@ static int snd_via82xx_pcm_close(struct snd_pcm_substream *substream)
ratep = &chip->rates[viadev->direction];
spin_lock_irq(&ratep->lock);
ratep->used--;
- if (! ratep->used)
+ if (!ratep->used)
ratep->rate = 0;
spin_unlock_irq(&ratep->lock);
- if (! ratep->rate) {
- if (! viadev->direction) {
+ if (!ratep->rate) {
+ if (!viadev->direction) {
snd_ac97_update_power(chip->ac97,
AC97_PCM_FRONT_DAC_RATE, 0);
snd_ac97_update_power(chip->ac97,
@@ -1457,7 +1457,7 @@ static int __devinit snd_via8233a_pcm_new(struct via82xx *chip)
64*1024, VIA_MAX_BUFSIZE);
/* SPDIF supported? */
- if (! ac97_can_spdif(chip->ac97))
+ if (!ac97_can_spdif(chip->ac97))
return 0;
/* PCM #1: DXS3 playback (for spdif) */
@@ -1921,7 +1921,7 @@ static int __devinit snd_via8233_init_misc(struct via82xx *chip)
memset(&sid, 0, sizeof(sid));
strcpy(sid.name, "PCM Playback Volume");
sid.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
- if (! snd_ctl_find_id(chip->card, &sid)) {
+ if (!snd_ctl_find_id(chip->card, &sid)) {
snd_printd(KERN_INFO "Using DXS as PCM Playback\n");
err = snd_ctl_add(chip->card, snd_ctl_new1(&snd_via8233_pcmdxs_volume_control, chip));
if (err < 0)
@@ -2026,7 +2026,7 @@ static void snd_via82xx_proc_read(struct snd_info_entry *entry,
{
struct via82xx *chip = entry->private_data;
int i;
-
+
snd_iprintf(buffer, "%s\n\n", chip->card->longname);
for (i = 0; i < 0xa0; i += 4) {
snd_iprintf(buffer, "%02x: %08x\n", i, inl(chip->port + i));
@@ -2037,7 +2037,7 @@ static void __devinit snd_via82xx_proc_init(struct via82xx *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "via82xx", &entry))
+ if (!snd_card_proc_new(chip->card, "via82xx", &entry))
snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read);
}
@@ -2057,7 +2057,7 @@ static int snd_via82xx_chip_init(struct via82xx *chip)
pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, 0);
#endif
pci_read_config_byte(chip->pci, VIA_ACLINK_STAT, &pval);
- if (! (pval & VIA_ACLINK_C00_READY)) { /* codec not ready? */
+ if (!(pval & VIA_ACLINK_C00_READY)) { /* codec not ready? */
/* deassert ACLink reset, force SYNC */
pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL,
VIA_ACLINK_CTRL_ENABLE |
@@ -2078,7 +2078,7 @@ static int snd_via82xx_chip_init(struct via82xx *chip)
pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL, VIA_ACLINK_CTRL_INIT);
udelay(100);
}
-
+
/* Make sure VRA is enabled, in case we didn't do a
* complete codec reset, above */
pci_read_config_byte(chip->pci, VIA_ACLINK_CTRL, &pval);
@@ -2239,7 +2239,7 @@ static int snd_via82xx_free(struct via82xx *chip)
if (chip->irq >= 0)
free_irq(chip->irq, chip);
- __end_hw:
+__end_hw:
release_and_free_resource(chip->mpu_res);
pci_release_regions(chip->pci);
@@ -2477,7 +2477,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
err = -EINVAL;
goto __error;
}
-
+
if ((err = snd_via82xx_create(card, pci, chip_type, pci->revision,
ac97_clock, &chip)) < 0)
goto __error;
@@ -2493,7 +2493,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
if (chip_type == TYPE_VIA8233A) {
if ((err = snd_via8233a_pcm_new(chip)) < 0)
goto __error;
- // chip->dxs_fixed = 1; /* FIXME: use 48k for DXS #3? */
+ /* chip->dxs_fixed = 1; FIXME: use 48k for DXS #3? */
} else {
if ((err = snd_via8233_pcm_new(chip)) < 0)
goto __error;
@@ -2527,7 +2527,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
pci_set_drvdata(pci, card);
return 0;
- __error:
+__error:
snd_card_free(card);
return err;
}
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c
index 5bd79d2..833f56e 100644
--- a/sound/pci/via82xx_modem.c
+++ b/sound/pci/via82xx_modem.c
@@ -31,7 +31,7 @@
* modems.
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -90,7 +90,7 @@ module_param(enable, bool, 0444);
#define VIA_REG_CTRL_TERMINATE 0x40 /* WO */
#define VIA_REG_CTRL_AUTOSTART 0x20
#define VIA_REG_CTRL_PAUSE 0x08 /* RW */
-#define VIA_REG_CTRL_INT_STOP 0x04
+#define VIA_REG_CTRL_INT_STOP 0x04
#define VIA_REG_CTRL_INT_EOL 0x02
#define VIA_REG_CTRL_INT_FLAG 0x01
#define VIA_REG_CTRL_RESET 0x01 /* RW - probably reset? undocumented */
@@ -212,7 +212,7 @@ DEFINE_VIA_REGSET(MI, 0x50);
struct snd_via_sg_table {
unsigned int offset;
unsigned int size;
-} ;
+};
#define VIA_TABLE_SIZE 255
@@ -291,9 +291,9 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
&dev->table) < 0)
return -ENOMEM;
}
- if (! dev->idx_table) {
+ if (!dev->idx_table) {
dev->idx_table = kmalloc(sizeof(*dev->idx_table) * VIA_TABLE_SIZE, GFP_KERNEL);
- if (! dev->idx_table)
+ if (!dev->idx_table)
return -ENOMEM;
}
@@ -321,14 +321,14 @@ static int build_via_table(struct viadev *dev, struct snd_pcm_substream *substre
if (rest < r)
r = rest;
rest -= r;
- if (! rest) {
+ if (!rest) {
if (i == periods - 1)
flag = VIA_TBL_BIT_EOL; /* buffer boundary */
else
flag = VIA_TBL_BIT_FLAG; /* period boundary */
} else
flag = 0; /* period continues to the next */
- // printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest);
+ /* printk("via: tbl %d: at %d size %d (rest %d)\n", idx, ofs, r, rest); */
((u32 *)dev->table.area)[(idx<<1) + 1] = cpu_to_le32(r | flag);
dev->idx_table[idx].offset = ofs;
dev->idx_table[idx].size = r;
@@ -363,17 +363,17 @@ static inline unsigned int snd_via82xx_codec_xread(struct via82xx_modem *chip)
{
return inl(VIAREG(chip, AC97));
}
-
+
static inline void snd_via82xx_codec_xwrite(struct via82xx_modem *chip, unsigned int val)
{
outl(val, VIAREG(chip, AC97));
}
-
+
static int snd_via82xx_codec_ready(struct via82xx_modem *chip, int secondary)
{
unsigned int timeout = 1000; /* 1ms */
unsigned int val;
-
+
while (timeout-- > 0) {
udelay(1);
if (!((val = snd_via82xx_codec_xread(chip)) & VIA_REG_AC97_BUSY))
@@ -383,14 +383,14 @@ static int snd_via82xx_codec_ready(struct via82xx_modem *chip, int secondary)
secondary, snd_via82xx_codec_xread(chip));
return -EIO;
}
-
+
static int snd_via82xx_codec_valid(struct via82xx_modem *chip, int secondary)
{
unsigned int timeout = 1000; /* 1ms */
unsigned int val, val1;
unsigned int stat = !secondary ? VIA_REG_AC97_PRIMARY_VALID :
VIA_REG_AC97_SECONDARY_VALID;
-
+
while (timeout-- > 0) {
val = snd_via82xx_codec_xread(chip);
val1 = val & (VIA_REG_AC97_BUSY | stat);
@@ -400,7 +400,7 @@ static int snd_via82xx_codec_valid(struct via82xx_modem *chip, int secondary)
}
return -EIO;
}
-
+
static void snd_via82xx_codec_wait(struct snd_ac97 *ac97)
{
struct via82xx_modem *chip = ac97->private_data;
@@ -416,10 +416,10 @@ static void snd_via82xx_codec_write(struct snd_ac97 *ac97,
{
struct via82xx_modem *chip = ac97->private_data;
unsigned int xval;
- if(reg == AC97_GPIO_STATUS) {
+ if (reg == AC97_GPIO_STATUS) {
outl(val, VIAREG(chip, GPI_STATUS));
return;
- }
+ }
xval = !ac97->num ? VIA_REG_AC97_CODEC_ID_PRIMARY : VIA_REG_AC97_CODEC_ID_SECONDARY;
xval <<= VIA_REG_AC97_CODEC_ID_SHIFT;
xval |= reg << VIA_REG_AC97_CMD_SHIFT;
@@ -466,7 +466,7 @@ static void snd_via82xx_channel_reset(struct via82xx_modem *chip, struct viadev
/* clear interrupts */
outb(0x03, VIADEV_REG(viadev, OFFSET_STATUS));
outb(0x00, VIADEV_REG(viadev, OFFSET_TYPE)); /* for via686 */
- // outl(0, VIADEV_REG(viadev, OFFSET_CURR_PTR));
+ /* outl(0, VIADEV_REG(viadev, OFFSET_CURR_PTR)); */
viadev->lastpos = 0;
}
@@ -482,7 +482,7 @@ static irqreturn_t snd_via82xx_interrupt(int irq, void *dev_id)
unsigned int i;
status = inl(VIAREG(chip, SGD_SHADOW));
- if (! (status & chip->intr_mask)) {
+ if (!(status & chip->intr_mask)) {
return IRQ_NONE;
}
// _skip_sgd:
@@ -493,7 +493,7 @@ static irqreturn_t snd_via82xx_interrupt(int irq, void *dev_id)
struct viadev *viadev = &chip->devs[i];
unsigned char c_status = inb(VIADEV_REG(viadev, OFFSET_STATUS));
c_status &= (VIA_REG_STAT_EOL|VIA_REG_STAT_FLAG|VIA_REG_STAT_STOPPED);
- if (! c_status)
+ if (!c_status)
continue;
if (viadev->substream && viadev->running) {
spin_unlock(&chip->reg_lock);
@@ -583,7 +583,7 @@ static inline unsigned int calc_linear_pos(struct viadev *viadev, unsigned int i
"using last valid pointer\n");
res = viadev->lastpos;
} else {
- if (! count)
+ if (!count)
/* bogus count 0 on the DMA boundary? */
res = viadev->idx_table[idx].offset;
else
@@ -744,7 +744,7 @@ static int snd_via82xx_modem_pcm_open(struct via82xx_modem *chip, struct viadev
};
runtime->hw = snd_via82xx_hw;
-
+
if ((err = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE,
&hw_constraints_rates)) < 0)
return err;
@@ -918,7 +918,7 @@ static void snd_via82xx_proc_read(struct snd_info_entry *entry, struct snd_info_
{
struct via82xx_modem *chip = entry->private_data;
int i;
-
+
snd_iprintf(buffer, "%s\n\n", chip->card->longname);
for (i = 0; i < 0xa0; i += 4) {
snd_iprintf(buffer, "%02x: %08x\n", i, inl(chip->port + i));
@@ -929,7 +929,7 @@ static void __devinit snd_via82xx_proc_init(struct via82xx_modem *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "via82xx", &entry))
+ if (!snd_card_proc_new(chip->card, "via82xx", &entry))
snd_info_set_text_ops(entry, chip, snd_via82xx_proc_read);
}
@@ -944,13 +944,13 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip)
unsigned char pval;
pci_read_config_byte(chip->pci, VIA_MC97_CTRL, &pval);
- if((pval & VIA_MC97_CTRL_INIT) != VIA_MC97_CTRL_INIT) {
+ if ((pval & VIA_MC97_CTRL_INIT) != VIA_MC97_CTRL_INIT) {
pci_write_config_byte(chip->pci, 0x44, pval|VIA_MC97_CTRL_INIT);
udelay(100);
}
pci_read_config_byte(chip->pci, VIA_ACLINK_STAT, &pval);
- if (! (pval & VIA_ACLINK_C00_READY)) { /* codec not ready? */
+ if (!(pval & VIA_ACLINK_C00_READY)) { /* codec not ready? */
/* deassert ACLink reset, force SYNC */
pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL,
VIA_ACLINK_CTRL_ENABLE |
@@ -970,7 +970,7 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip)
pci_write_config_byte(chip->pci, VIA_ACLINK_CTRL, VIA_ACLINK_CTRL_INIT);
udelay(100);
}
-
+
pci_read_config_byte(chip->pci, VIA_ACLINK_CTRL, &pval);
if ((pval & VIA_ACLINK_CTRL_INIT) != VIA_ACLINK_CTRL_INIT) {
/* ACLink on, deassert ACLink reset, VSR, SGD data out */
@@ -1009,7 +1009,7 @@ static int snd_via82xx_chip_init(struct via82xx_modem *chip)
__ac97_ok2:
/* route FM trap to IRQ, disable FM trap */
- // pci_write_config_byte(chip->pci, VIA_FM_NMI_CTRL, 0);
+ /* pci_write_config_byte(chip->pci, VIA_FM_NMI_CTRL, 0); */
/* disable all GPI interrupts */
outl(0, VIAREG(chip, GPI_INTR));
@@ -1078,7 +1078,7 @@ static int snd_via82xx_free(struct via82xx_modem *chip)
for (i = 0; i < chip->num_devs; i++)
snd_via82xx_channel_reset(chip, &chip->devs[i]);
- __end_hw:
+__end_hw:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
pci_release_regions(chip->pci);
@@ -1182,7 +1182,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
err = -EINVAL;
goto __error;
}
-
+
if ((err = snd_via82xx_create(card, pci, chip_type, pci->revision,
ac97_clock, &chip)) < 0)
goto __error;
@@ -1190,7 +1190,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
if ((err = snd_via82xx_mixer_new(chip)) < 0)
goto __error;
- if ((err = snd_via686_pcm_new(chip)) < 0 )
+ if ((err = snd_via686_pcm_new(chip)) < 0)
goto __error;
/* disable interrupts */
@@ -1209,7 +1209,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci,
pci_set_drvdata(pci, card);
return 0;
- __error:
+__error:
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/trident/trident.c | 4 +-
sound/pci/trident/trident_main.c | 478 ++++++++++++++++++------------------
sound/pci/trident/trident_memory.c | 12 +-
3 files changed, 247 insertions(+), 247 deletions(-)
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index d94b16f..11b49f7 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -63,9 +63,9 @@ module_param_array(wavetable_size, int, NULL, 0444);
MODULE_PARM_DESC(wavetable_size, "Maximum memory size in kB for wavetable synth.");
static struct pci_device_id snd_trident_ids[] = {
- {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX),
+ {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_DX),
PCI_CLASS_MULTIMEDIA_AUDIO << 8, 0xffff00, 0},
- {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX),
+ {PCI_DEVICE(PCI_VENDOR_ID_TRIDENT, PCI_DEVICE_ID_TRIDENT_4DWAVE_NX),
0, 0, 0},
{PCI_DEVICE(PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_7018), 0, 0, 0},
{ 0, }
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index c612b43..863f34f 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -43,7 +43,7 @@
#include <sound/trident.h>
#include <sound/asoundef.h>
-#include <asm/io.h>
+#include <linux/io.h>
static int snd_trident_pcm_mixer_build(struct snd_trident *trident,
struct snd_trident_voice * voice,
@@ -87,7 +87,7 @@ static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
printk("ESO: 0x%x\n", val >> 16);
printk("Delta: 0x%x\n", val & 0xffff);
val = inl(TRID_REG(trident, CH_DX_FMC_RVOL_CVOL));
- } else { // TRIDENT_DEVICE_ID_NX
+ } else { /* TRIDENT_DEVICE_ID_NX */
val = inl(TRID_REG(trident, CH_NX_DELTA_CSO));
tmp = (val >> 24) & 0xff;
printk("CSO: 0x%x\n", val & 0x00ffffff);
@@ -107,15 +107,15 @@ static void snd_trident_print_voice_regs(struct snd_trident *trident, int voice)
/*---------------------------------------------------------------------------
unsigned short snd_trident_codec_read(struct snd_ac97 *ac97, unsigned short reg)
-
+
Description: This routine will do all of the reading from the external
CODEC (AC97).
-
+
Parameters: ac97 - ac97 codec structure
reg - CODEC register index, from AC97 Hal.
-
+
returns: 16 bit value read from the AC97.
-
+
---------------------------------------------------------------------------*/
static unsigned short snd_trident_codec_read(struct snd_ac97 *ac97, unsigned short reg)
{
@@ -167,16 +167,16 @@ static unsigned short snd_trident_codec_read(struct snd_ac97 *ac97, unsigned sho
/*---------------------------------------------------------------------------
void snd_trident_codec_write(struct snd_ac97 *ac97, unsigned short reg,
unsigned short wdata)
-
+
Description: This routine will do all of the writing to the external
CODEC (AC97).
-
+
Parameters: ac97 - ac97 codec structure
reg - CODEC register index, from AC97 Hal.
data - Lower 16 bits are the data to write to CODEC.
-
+
returns: TRUE if everything went ok, else FALSE.
-
+
---------------------------------------------------------------------------*/
static void snd_trident_codec_write(struct snd_ac97 *ac97, unsigned short reg,
unsigned short wdata)
@@ -236,14 +236,14 @@ static void snd_trident_codec_write(struct snd_ac97 *ac97, unsigned short reg,
/*---------------------------------------------------------------------------
void snd_trident_enable_eso(struct snd_trident *trident)
-
+
Description: This routine will enable end of loop interrupts.
End of loop interrupts will occur when a running
channel reaches ESO.
Also enables middle of loop interrupts.
-
+
Parameters: trident - pointer to target device class for 4DWave.
-
+
---------------------------------------------------------------------------*/
static void snd_trident_enable_eso(struct snd_trident * trident)
@@ -260,17 +260,17 @@ static void snd_trident_enable_eso(struct snd_trident * trident)
/*---------------------------------------------------------------------------
void snd_trident_disable_eso(struct snd_trident *trident)
-
+
Description: This routine will disable end of loop interrupts.
End of loop interrupts will occur when a running
channel reaches ESO.
Also disables middle of loop interrupts.
-
- Parameters:
+
+ Parameters:
trident - pointer to target device class for 4DWave.
-
+
returns: TRUE if everything went ok, else FALSE.
-
+
---------------------------------------------------------------------------*/
static void snd_trident_disable_eso(struct snd_trident * trident)
@@ -333,13 +333,13 @@ EXPORT_SYMBOL(snd_trident_stop_voice);
/*---------------------------------------------------------------------------
int snd_trident_allocate_pcm_channel(struct snd_trident *trident)
-
+
Description: Allocate hardware channel in Bank B (32-63).
-
+
Parameters : trident - pointer to target device class for 4DWave.
-
+
Return Value: hardware channel - 32-63 or -1 when no channel is available
-
+
---------------------------------------------------------------------------*/
static int snd_trident_allocate_pcm_channel(struct snd_trident * trident)
@@ -360,14 +360,14 @@ static int snd_trident_allocate_pcm_channel(struct snd_trident * trident)
/*---------------------------------------------------------------------------
void snd_trident_free_pcm_channel(int channel)
-
+
Description: Free hardware channel in Bank B (32-63)
-
+
Parameters : trident - pointer to target device class for 4DWave.
channel - hardware channel number 0-63
-
+
Return Value: none
-
+
---------------------------------------------------------------------------*/
static void snd_trident_free_pcm_channel(struct snd_trident *trident, int channel)
@@ -383,13 +383,13 @@ static void snd_trident_free_pcm_channel(struct snd_trident *trident, int channe
/*---------------------------------------------------------------------------
unsigned int snd_trident_allocate_synth_channel(void)
-
+
Description: Allocate hardware channel in Bank A (0-31).
-
+
Parameters : trident - pointer to target device class for 4DWave.
-
+
Return Value: hardware channel - 0-31 or -1 when no channel is available
-
+
---------------------------------------------------------------------------*/
static int snd_trident_allocate_synth_channel(struct snd_trident * trident)
@@ -407,15 +407,15 @@ static int snd_trident_allocate_synth_channel(struct snd_trident * trident)
}
/*---------------------------------------------------------------------------
- void snd_trident_free_synth_channel( int channel )
-
+ void snd_trident_free_synth_channel( int channel)
+
Description: Free hardware channel in Bank B (0-31).
-
+
Parameters : trident - pointer to target device class for 4DWave.
channel - hardware channel number 0-63
-
+
Return Value: none
-
+
---------------------------------------------------------------------------*/
static void snd_trident_free_synth_channel(struct snd_trident *trident, int channel)
@@ -431,14 +431,14 @@ static void snd_trident_free_synth_channel(struct snd_trident *trident, int chan
/*---------------------------------------------------------------------------
snd_trident_write_voice_regs
-
+
Description: This routine will complete and write the 5 hardware channel
registers to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
Each register field.
-
+
---------------------------------------------------------------------------*/
void snd_trident_write_voice_regs(struct snd_trident * trident,
@@ -509,14 +509,14 @@ EXPORT_SYMBOL(snd_trident_write_voice_regs);
/*---------------------------------------------------------------------------
snd_trident_write_cso_reg
-
+
Description: This routine will write the new CSO offset
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
CSO - new CSO value
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_cso_reg(struct snd_trident * trident,
@@ -535,14 +535,14 @@ static void snd_trident_write_cso_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_eso_reg
-
+
Description: This routine will write the new ESO offset
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
ESO - new ESO value
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_eso_reg(struct snd_trident * trident,
@@ -561,14 +561,14 @@ static void snd_trident_write_eso_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_vol_reg
-
+
Description: This routine will write the new voice volume
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
Vol - new voice volume
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_vol_reg(struct snd_trident * trident,
@@ -583,7 +583,7 @@ static void snd_trident_write_vol_reg(struct snd_trident * trident,
outb(voice->Vol >> 2, TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC + 2));
break;
case TRIDENT_DEVICE_ID_SI7018:
- // printk("voice->Vol = 0x%x\n", voice->Vol);
+ /* printk("voice->Vol = 0x%x\n", voice->Vol); */
outw((voice->CTRL << 12) | voice->Vol,
TRID_REG(trident, CH_GVSEL_PAN_VOL_CTRL_EC));
break;
@@ -592,14 +592,14 @@ static void snd_trident_write_vol_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_pan_reg
-
+
Description: This routine will write the new voice pan
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
Pan - new pan value
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_pan_reg(struct snd_trident * trident,
@@ -614,14 +614,14 @@ static void snd_trident_write_pan_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_rvol_reg
-
+
Description: This routine will write the new reverb volume
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
RVol - new reverb volume
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_rvol_reg(struct snd_trident * trident,
@@ -638,14 +638,14 @@ static void snd_trident_write_rvol_reg(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_write_cvol_reg
-
+
Description: This routine will write the new chorus volume
register to hardware.
-
+
Parameters: trident - pointer to target device class for 4DWave.
voice - synthesizer voice structure
CVol - new chorus volume
-
+
---------------------------------------------------------------------------*/
static void snd_trident_write_cvol_reg(struct snd_trident * trident,
@@ -664,21 +664,21 @@ static void snd_trident_write_cvol_reg(struct snd_trident * trident,
snd_trident_convert_rate
Description: This routine converts rate in HZ to hardware delta value.
-
+
Parameters: trident - pointer to target device class for 4DWave.
rate - Real or Virtual channel number.
-
+
Returns: Delta value.
-
+
---------------------------------------------------------------------------*/
static unsigned int snd_trident_convert_rate(unsigned int rate)
{
unsigned int delta;
- // We special case 44100 and 8000 since rounding with the equation
- // does not give us an accurate enough value. For 11025 and 22050
- // the equation gives us the best answer. All other frequencies will
- // also use the equation. JDW
+ /* We special case 44100 and 8000 since rounding with the equation */
+ /* does not give us an accurate enough value. For 11025 and 22050 */
+ /* the equation gives us the best answer. All other frequencies will */
+ /* also use the equation. JDW */
if (rate == 44100)
delta = 0xeb3;
else if (rate == 8000)
@@ -694,21 +694,21 @@ static unsigned int snd_trident_convert_rate(unsigned int rate)
snd_trident_convert_adc_rate
Description: This routine converts rate in HZ to hardware delta value.
-
+
Parameters: trident - pointer to target device class for 4DWave.
rate - Real or Virtual channel number.
-
+
Returns: Delta value.
-
+
---------------------------------------------------------------------------*/
static unsigned int snd_trident_convert_adc_rate(unsigned int rate)
{
unsigned int delta;
- // We special case 44100 and 8000 since rounding with the equation
- // does not give us an accurate enough value. For 11025 and 22050
- // the equation gives us the best answer. All other frequencies will
- // also use the equation. JDW
+ /* We special case 44100 and 8000 since rounding with the equation */
+ /* does not give us an accurate enough value. For 11025 and 22050 */
+ /* the equation gives us the best answer. All other frequencies will */
+ /* also use the equation. JDW */
if (rate == 44100)
delta = 0x116a;
else if (rate == 8000)
@@ -724,12 +724,12 @@ static unsigned int snd_trident_convert_adc_rate(unsigned int rate)
snd_trident_spurious_threshold
Description: This routine converts rate in HZ to spurious threshold.
-
+
Parameters: trident - pointer to target device class for 4DWave.
rate - Real or Virtual channel number.
-
+
Returns: Delta value.
-
+
---------------------------------------------------------------------------*/
static unsigned int snd_trident_spurious_threshold(unsigned int rate,
unsigned int period_size)
@@ -746,12 +746,12 @@ static unsigned int snd_trident_spurious_threshold(unsigned int rate,
snd_trident_control_mode
Description: This routine returns a control mode for a PCM channel.
-
+
Parameters: trident - pointer to target device class for 4DWave.
substream - PCM substream
-
+
Returns: Control value.
-
+
---------------------------------------------------------------------------*/
static unsigned int snd_trident_control_mode(struct snd_pcm_substream *substream)
{
@@ -763,11 +763,11 @@ static unsigned int snd_trident_control_mode(struct snd_pcm_substream *substream
*/
CTRL = 0x00000001;
if (snd_pcm_format_width(runtime->format) == 16)
- CTRL |= 0x00000008; // 16-bit data
+ CTRL |= 0x00000008; /* 16-bit data */
if (snd_pcm_format_signed(runtime->format))
- CTRL |= 0x00000002; // signed data
+ CTRL |= 0x00000002; /* signed data */
if (runtime->channels > 1)
- CTRL |= 0x00000004; // stereo data
+ CTRL |= 0x00000004; /* stereo data */
return CTRL;
}
@@ -777,15 +777,15 @@ static unsigned int snd_trident_control_mode(struct snd_pcm_substream *substream
/*---------------------------------------------------------------------------
snd_trident_ioctl
-
+
Description: Device I/O control handler for playback/capture parameters.
-
+
Parameters: substream - PCM substream class
cmd - what ioctl message to process
- arg - additional message infoarg
-
+ arg - additional message infoarg
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_ioctl(struct snd_pcm_substream *substream,
@@ -800,14 +800,14 @@ static int snd_trident_ioctl(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_allocate_pcm_mem
-
+
Description: Allocate PCM ring buffer for given substream
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_allocate_pcm_mem(struct snd_pcm_substream *substream,
@@ -834,14 +834,14 @@ static int snd_trident_allocate_pcm_mem(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_allocate_evoice
-
+
Description: Allocate extra voice as interrupt generator
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_allocate_evoice(struct snd_pcm_substream *substream,
@@ -874,14 +874,14 @@ static int snd_trident_allocate_evoice(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_hw_params
-
+
Description: Set the hardware parameters for the playback device.
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_hw_params(struct snd_pcm_substream *substream,
@@ -897,13 +897,13 @@ static int snd_trident_hw_params(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_playback_hw_free
-
+
Description: Release the hardware resources for the playback device.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_hw_free(struct snd_pcm_substream *substream)
@@ -929,13 +929,13 @@ static int snd_trident_hw_free(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_playback_prepare
-
+
Description: Prepare playback device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_playback_prepare(struct snd_pcm_substream *substream)
@@ -946,7 +946,7 @@ static int snd_trident_playback_prepare(struct snd_pcm_substream *substream)
struct snd_trident_voice *evoice = voice->extra;
struct snd_trident_pcm_mixer *mix = &trident->pcm_mixer[substream->number];
- spin_lock_irq(&trident->reg_lock);
+ spin_lock_irq(&trident->reg_lock);
/* set delta (rate) value */
voice->Delta = snd_trident_convert_rate(runtime->rate);
@@ -957,7 +957,7 @@ static int snd_trident_playback_prepare(struct snd_pcm_substream *substream)
voice->LBA = voice->memblk->offset;
else
voice->LBA = runtime->dma_addr;
-
+
voice->CSO = 0;
voice->ESO = runtime->buffer_size - 1; /* in samples */
voice->CTRL = snd_trident_control_mode(substream);
@@ -1014,14 +1014,14 @@ static int snd_trident_playback_prepare(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_capture_hw_params
-
+
Description: Set the hardware parameters for the capture device.
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_capture_hw_params(struct snd_pcm_substream *substream,
@@ -1032,13 +1032,13 @@ static int snd_trident_capture_hw_params(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_capture_prepare
-
+
Description: Prepare capture device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
@@ -1050,29 +1050,29 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
spin_lock_irq(&trident->reg_lock);
- // Initilize the channel and set channel Mode
+ /* Initilize the channel and set channel Mode */
outb(0, TRID_REG(trident, LEGACY_DMAR15));
- // Set DMA channel operation mode register
+ /* Set DMA channel operation mode register */
outb(0x54, TRID_REG(trident, LEGACY_DMAR11));
- // Set channel buffer Address, DMAR0 expects contiguous PCI memory area
+ /* Set channel buffer Address, DMAR0 expects contiguous PCI memory area */
voice->LBA = runtime->dma_addr;
outl(voice->LBA, TRID_REG(trident, LEGACY_DMAR0));
if (voice->memblk)
voice->LBA = voice->memblk->offset;
- // set ESO
+ /* set ESO */
ESO_bytes = snd_pcm_lib_buffer_bytes(substream) - 1;
outb((ESO_bytes & 0x00ff0000) >> 16, TRID_REG(trident, LEGACY_DMAR6));
outw((ESO_bytes & 0x0000ffff), TRID_REG(trident, LEGACY_DMAR4));
ESO_bytes++;
- // Set channel sample rate, 4.12 format
+ /* Set channel sample rate, 4.12 format */
val = (((unsigned int) 48000L << 12) + (runtime->rate/2)) / runtime->rate;
outw(val, TRID_REG(trident, T4D_SBDELTA_DELTA_R));
- // Set channel interrupt blk length
+ /* Set channel interrupt blk length */
if (snd_pcm_format_width(runtime->format) == 16) {
val = (unsigned short) ((ESO_bytes >> 1) - 1);
} else {
@@ -1081,9 +1081,9 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
outl((val << 16) | val, TRID_REG(trident, T4D_SBBL_SBCL));
- // Right now, set format and start to run captureing,
- // continuous run loop enable.
- trident->bDMAStart = 0x19; // 0001 1001b
+ /* Right now, set format and start to run captureing, */
+ /* continuous run loop enable. */
+ trident->bDMAStart = 0x19; /* 0001 1001b */
if (snd_pcm_format_width(runtime->format) == 16)
trident->bDMAStart |= 0x80;
@@ -1092,7 +1092,7 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
if (runtime->channels > 1)
trident->bDMAStart |= 0x40;
- // Prepare capture intr channel
+ /* Prepare capture intr channel */
voice->Delta = snd_trident_convert_rate(runtime->rate);
voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
@@ -1100,7 +1100,7 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
voice->isync_mark = runtime->period_size;
voice->isync_max = runtime->buffer_size;
- // Set voice parameters
+ /* Set voice parameters */
voice->CSO = 0;
voice->ESO = voice->isync_ESO = (runtime->period_size * 2) + 6 - 1;
voice->CTRL = snd_trident_control_mode(substream);
@@ -1123,14 +1123,14 @@ static int snd_trident_capture_prepare(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_si7018_capture_hw_params
-
+
Description: Set the hardware parameters for the capture device.
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_si7018_capture_hw_params(struct snd_pcm_substream *substream,
@@ -1146,13 +1146,13 @@ static int snd_trident_si7018_capture_hw_params(struct snd_pcm_substream *substr
/*---------------------------------------------------------------------------
snd_trident_si7018_capture_hw_free
-
+
Description: Release the hardware resources for the capture device.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_si7018_capture_hw_free(struct snd_pcm_substream *substream)
@@ -1172,13 +1172,13 @@ static int snd_trident_si7018_capture_hw_free(struct snd_pcm_substream *substrea
/*---------------------------------------------------------------------------
snd_trident_si7018_capture_prepare
-
+
Description: Prepare capture device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_si7018_capture_prepare(struct snd_pcm_substream *substream)
@@ -1194,7 +1194,7 @@ static int snd_trident_si7018_capture_prepare(struct snd_pcm_substream *substrea
voice->Delta = snd_trident_convert_adc_rate(runtime->rate);
voice->spurious_threshold = snd_trident_spurious_threshold(runtime->rate, runtime->period_size);
- // Set voice parameters
+ /* Set voice parameters */
voice->CSO = 0;
voice->ESO = runtime->buffer_size - 1; /* in samples */
voice->CTRL = snd_trident_control_mode(substream);
@@ -1236,20 +1236,20 @@ static int snd_trident_si7018_capture_prepare(struct snd_pcm_substream *substrea
evoice->isync_mark = runtime->period_size;
evoice->ESO = (runtime->period_size * 2) - 1;
}
-
+
spin_unlock_irq(&trident->reg_lock);
return 0;
}
/*---------------------------------------------------------------------------
snd_trident_foldback_prepare
-
+
Description: Prepare foldback capture device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_foldback_prepare(struct snd_pcm_substream *substream)
@@ -1320,14 +1320,14 @@ static int snd_trident_foldback_prepare(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_spdif_hw_params
-
+
Description: Set the hardware parameters for the spdif device.
-
+
Parameters: substream - PCM substream class
hw_params - hardware parameters
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_spdif_hw_params(struct snd_pcm_substream *substream,
@@ -1355,21 +1355,21 @@ static int snd_trident_spdif_hw_params(struct snd_pcm_substream *substream,
else
trident->spdif_pcm_bits &= ~(IEC958_AES3_CON_FS << 24);
if (params_rate(hw_params) >= 48000) {
- trident->spdif_pcm_ctrl = 0x3c; // 48000 Hz
+ trident->spdif_pcm_ctrl = 0x3c; /* 48000 Hz */
trident->spdif_pcm_bits |=
trident->spdif_bits & IEC958_AES0_PROFESSIONAL ?
IEC958_AES0_PRO_FS_48000 :
(IEC958_AES3_CON_FS_48000 << 24);
}
else if (params_rate(hw_params) >= 44100) {
- trident->spdif_pcm_ctrl = 0x3e; // 44100 Hz
+ trident->spdif_pcm_ctrl = 0x3e; /* 44100 Hz */
trident->spdif_pcm_bits |=
trident->spdif_bits & IEC958_AES0_PROFESSIONAL ?
IEC958_AES0_PRO_FS_44100 :
(IEC958_AES3_CON_FS_44100 << 24);
}
else {
- trident->spdif_pcm_ctrl = 0x3d; // 32000 Hz
+ trident->spdif_pcm_ctrl = 0x3d; /* 32000 Hz */
trident->spdif_pcm_bits |=
trident->spdif_bits & IEC958_AES0_PROFESSIONAL ?
IEC958_AES0_PRO_FS_32000 :
@@ -1386,13 +1386,13 @@ static int snd_trident_spdif_hw_params(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_spdif_prepare
-
+
Description: Prepare SPDIF device for playback.
-
+
Parameters: substream - PCM substream class
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_spdif_prepare(struct snd_pcm_substream *substream)
@@ -1458,7 +1458,7 @@ static int snd_trident_spdif_prepare(struct snd_pcm_substream *substream)
outl(trident->spdif_pcm_bits, TRID_REG(trident, NX_SPCSTATUS));
} else { /* SiS */
-
+
/* set delta (rate) value */
voice->Delta = 0x800;
voice->spurious_threshold = snd_trident_spurious_threshold(48000, runtime->period_size);
@@ -1524,19 +1524,19 @@ static int snd_trident_spdif_prepare(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_trigger
-
+
Description: Start/stop devices
-
+
Parameters: substream - PCM substream class
cmd - trigger command (STOP, GO)
-
+
Returns: Error status
-
+
---------------------------------------------------------------------------*/
static int snd_trident_trigger(struct snd_pcm_substream *substream,
int cmd)
-
+
{
struct snd_trident *trident = snd_pcm_substream_chip(substream);
struct snd_pcm_substream *s;
@@ -1624,13 +1624,13 @@ static int snd_trident_trigger(struct snd_pcm_substream *substream,
/*---------------------------------------------------------------------------
snd_trident_playback_pointer
-
+
Description: This routine return the playback position
-
+
Parameters: substream - PCM substream class
Returns: position of buffer
-
+
---------------------------------------------------------------------------*/
static snd_pcm_uframes_t snd_trident_playback_pointer(struct snd_pcm_substream *substream)
@@ -1649,7 +1649,7 @@ static snd_pcm_uframes_t snd_trident_playback_pointer(struct snd_pcm_substream *
if (trident->device != TRIDENT_DEVICE_ID_NX) {
cso = inw(TRID_REG(trident, CH_DX_CSO_ALPHA_FMS + 2));
- } else { // ID_4DWAVE_NX
+ } else { /* ID_4DWAVE_NX */
cso = (unsigned int) inl(TRID_REG(trident, CH_NX_DELTA_CSO)) & 0x00ffffff;
}
@@ -1663,13 +1663,13 @@ static snd_pcm_uframes_t snd_trident_playback_pointer(struct snd_pcm_substream *
/*---------------------------------------------------------------------------
snd_trident_capture_pointer
-
+
Description: This routine return the capture position
-
+
Parameters: pcm1 - PCM device class
Returns: position of buffer
-
+
---------------------------------------------------------------------------*/
static snd_pcm_uframes_t snd_trident_capture_pointer(struct snd_pcm_substream *substream)
@@ -1693,13 +1693,13 @@ static snd_pcm_uframes_t snd_trident_capture_pointer(struct snd_pcm_substream *s
/*---------------------------------------------------------------------------
snd_trident_spdif_pointer
-
+
Description: This routine return the SPDIF playback position
-
+
Parameters: substream - PCM substream class
Returns: position of buffer
-
+
---------------------------------------------------------------------------*/
static snd_pcm_uframes_t snd_trident_spdif_pointer(struct snd_pcm_substream *substream)
@@ -1868,10 +1868,10 @@ static int snd_trident_playback_open(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_playback_close
-
- Description: This routine will close the 4DWave playback device. For now
+
+ Description: This routine will close the 4DWave playback device. For now
we will simply free the dma transfer buffer.
-
+
Parameters: substream - PCM substream class
---------------------------------------------------------------------------*/
@@ -1887,13 +1887,13 @@ static int snd_trident_playback_close(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_spdif_open
-
+
Description: This routine will open the 4DWave SPDIF device.
Parameters: substream - PCM substream class
Returns: status - success or failure flag
-
+
---------------------------------------------------------------------------*/
static int snd_trident_spdif_open(struct snd_pcm_substream *substream)
@@ -1901,7 +1901,7 @@ static int snd_trident_spdif_open(struct snd_pcm_substream *substream)
struct snd_trident *trident = snd_pcm_substream_chip(substream);
struct snd_trident_voice *voice;
struct snd_pcm_runtime *runtime = substream->runtime;
-
+
voice = snd_trident_alloc_voice(trident, SNDRV_TRIDENT_VOICE_TYPE_PCM, 0, 0);
if (voice == NULL)
return -EAGAIN;
@@ -1930,9 +1930,9 @@ static int snd_trident_spdif_open(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_spdif_close
-
+
Description: This routine will close the 4DWave SPDIF device.
-
+
Parameters: substream - PCM substream class
---------------------------------------------------------------------------*/
@@ -1943,7 +1943,7 @@ static int snd_trident_spdif_close(struct snd_pcm_substream *substream)
unsigned int temp;
spin_lock_irq(&trident->reg_lock);
- // restore default SPDIF setting
+ /* restore default SPDIF setting */
if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
outb(trident->spdif_ctrl, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
outl(trident->spdif_bits, TRID_REG(trident, NX_SPCSTATUS));
@@ -1966,7 +1966,7 @@ static int snd_trident_spdif_close(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_capture_open
-
+
Description: This routine will open the 4DWave capture device.
Parameters: substream - PCM substream class
@@ -1996,10 +1996,10 @@ static int snd_trident_capture_open(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_capture_close
-
- Description: This routine will close the 4DWave capture device. For now
+
+ Description: This routine will close the 4DWave capture device. For now
we will simply free the dma transfer buffer.
-
+
Parameters: substream - PCM substream class
---------------------------------------------------------------------------*/
@@ -2010,7 +2010,7 @@ static int snd_trident_capture_close(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_foldback_open
-
+
Description: This routine will open the 4DWave foldback capture device.
Parameters: substream - PCM substream class
@@ -2039,10 +2039,10 @@ static int snd_trident_foldback_open(struct snd_pcm_substream *substream)
/*---------------------------------------------------------------------------
snd_trident_foldback_close
-
- Description: This routine will close the 4DWave foldback capture device.
+
+ Description: This routine will close the 4DWave foldback capture device.
For now we will simply free the dma transfer buffer.
-
+
Parameters: substream - PCM substream class
---------------------------------------------------------------------------*/
@@ -2052,7 +2052,7 @@ static int snd_trident_foldback_close(struct snd_pcm_substream *substream)
struct snd_trident_voice *voice;
struct snd_pcm_runtime *runtime = substream->runtime;
voice = runtime->private_data;
-
+
/* stop capture channel */
spin_lock_irq(&trident->reg_lock);
outb(0x00, TRID_REG(trident, T4D_RCI + voice->foldback_chan));
@@ -2156,13 +2156,13 @@ static struct snd_pcm_ops snd_trident_spdif_7018_ops = {
/*---------------------------------------------------------------------------
snd_trident_pcm
-
+
Description: This routine registers the 4DWave device for PCM support.
-
+
Parameters: trident - pointer to target device class for 4DWave.
Returns: None
-
+
---------------------------------------------------------------------------*/
int __devinit snd_trident_pcm(struct snd_trident * trident,
@@ -2214,13 +2214,13 @@ int __devinit snd_trident_pcm(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_foldback_pcm
-
+
Description: This routine registers the 4DWave device for foldback PCM support.
-
+
Parameters: trident - pointer to target device class for 4DWave.
Returns: None
-
+
---------------------------------------------------------------------------*/
int __devinit snd_trident_foldback_pcm(struct snd_trident * trident,
@@ -2271,13 +2271,13 @@ int __devinit snd_trident_foldback_pcm(struct snd_trident * trident,
/*---------------------------------------------------------------------------
snd_trident_spdif
-
+
Description: This routine registers the 4DWave-NX device for SPDIF support.
-
+
Parameters: trident - pointer to target device class for 4DWave-NX.
Returns: None
-
+
---------------------------------------------------------------------------*/
int __devinit snd_trident_spdif_pcm(struct snd_trident * trident,
@@ -2904,7 +2904,7 @@ static void snd_trident_notify_pcm_change1(struct snd_card *card,
{
struct snd_ctl_elem_id id;
- if (! kctl)
+ if (!kctl)
return;
if (activate)
kctl->vd[num].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE;
@@ -2957,13 +2957,13 @@ static int snd_trident_pcm_mixer_free(struct snd_trident *trident, struct snd_tr
/*---------------------------------------------------------------------------
snd_trident_mixer
-
+
Description: This routine registers the 4DWave device for mixer support.
-
+
Parameters: trident - pointer to target device class for 4DWave.
Returns: None
-
+
---------------------------------------------------------------------------*/
static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spdif_device)
@@ -2989,7 +2989,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
_ac97.private_data = trident;
trident->ac97_detect = 1;
- __again:
+__again:
if ((err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97)) < 0) {
if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
if ((err = snd_trident_sis_reset(trident)) < 0)
@@ -3000,7 +3000,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
}
goto __out;
}
-
+
/* secondary codec? */
if (trident->device == TRIDENT_DEVICE_ID_SI7018 &&
(inl(TRID_REG(trident, SI_SERIAL_INTF_CTRL)) & SI_AC97_PRIMARY_READY) != 0) {
@@ -3008,7 +3008,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
err = snd_ac97_mixer(trident->ac97_bus, &_ac97, &trident->ac97_sec);
if (err < 0)
snd_printk(KERN_ERR "SI7018: the secondary codec - invalid access\n");
-#if 0 // only for my testing purpose --jk
+#if 0 /* only for my testing purpose --jk */
{
struct snd_ac97 *mc97;
err = snd_ac97_modem(trident->card, &_ac97, &mc97);
@@ -3017,7 +3017,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
}
#endif
}
-
+
trident->ac97_detect = 0;
if (trident->device != TRIDENT_DEVICE_ID_SI7018) {
@@ -3034,7 +3034,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
for (idx = 0; idx < 32; idx++) {
struct snd_trident_pcm_mixer *tmix;
-
+
tmix = &trident->pcm_mixer[idx];
tmix->voice = NULL;
}
@@ -3042,7 +3042,7 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
goto __nomem;
if ((err = snd_ctl_add(card, trident->ctl_vol)))
goto __out;
-
+
if ((trident->ctl_pan = snd_ctl_new1(&snd_trident_pcm_pan_control, trident)) == NULL)
goto __nomem;
if ((err = snd_ctl_add(card, trident->ctl_pan)))
@@ -3114,10 +3114,10 @@ static int __devinit snd_trident_mixer(struct snd_trident * trident, int pcm_spd
err = 0;
goto __out;
- __nomem:
+__nomem:
err = -ENOMEM;
- __out:
+__out:
kfree(uctl);
return err;
@@ -3161,7 +3161,7 @@ static int snd_trident_gameport_cooked_read(struct gameport *gameport, int *axes
axes[i] = inw(TRID_REG(chip, GAMEPORT_AXES + i * 2));
if (axes[i] == 0xffff) axes[i] = -1;
}
-
+
return 0;
}
@@ -3284,11 +3284,11 @@ static int snd_trident_sis_reset(struct snd_trident *trident)
return 0;
}
-/*
+/*
* /proc interface
*/
-static void snd_trident_proc_read(struct snd_info_entry *entry,
+static void snd_trident_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_trident *trident = entry->private_data;
@@ -3327,10 +3327,10 @@ static void __devinit snd_trident_proc_init(struct snd_trident * trident)
{
struct snd_info_entry *entry;
const char *s = "trident";
-
+
if (trident->device == TRIDENT_DEVICE_ID_SI7018)
s = "sis7018";
- if (! snd_card_proc_new(trident->card, s, &entry))
+ if (!snd_card_proc_new(trident->card, s, &entry))
snd_info_set_text_ops(entry, trident, snd_trident_proc_read);
}
@@ -3342,14 +3342,14 @@ static int snd_trident_dev_free(struct snd_device *device)
/*---------------------------------------------------------------------------
snd_trident_tlb_alloc
-
+
Description: Allocate and set up the TLB page table on 4D NX.
Each entry has 4 bytes (physical PCI address).
-
+
Parameters: trident - pointer to target device class for 4DWave.
Returns: 0 or negative error code
-
+
---------------------------------------------------------------------------*/
static int __devinit snd_trident_tlb_alloc(struct snd_trident *trident)
@@ -3418,7 +3418,7 @@ static int snd_trident_4d_dx_init(struct snd_trident *trident)
udelay(100);
pci_write_config_byte(pci, 0x46, 0); /* release reset */
udelay(100);
-
+
/* warm reset of the AC'97 codec */
outl(0x00000001, TRID_REG(trident, DX_ACR2_AC97_COM_STAT));
udelay(100);
@@ -3436,7 +3436,7 @@ static int snd_trident_4d_dx_init(struct snd_trident *trident)
snd_printk(KERN_ERR "AC'97 codec ready error\n");
return -EIO;
- __dx_ok:
+__dx_ok:
snd_trident_stop_all_voices(trident);
return 0;
@@ -3474,7 +3474,7 @@ static int snd_trident_4d_nx_init(struct snd_trident *trident)
snd_printk(KERN_ERR "AC'97 codec ready error [0x%x]\n", inl(TRID_REG(trident, NX_ACR0_AC97_COM_STAT)));
return -EIO;
- __nx_ok:
+__nx_ok:
/* DAC on */
trident->ac97_ctrl = 0x00000002;
outl(trident->ac97_ctrl, TRID_REG(trident, NX_ACR0_AC97_COM_STAT));
@@ -3519,10 +3519,10 @@ static int snd_trident_sis_init(struct snd_trident *trident)
/*---------------------------------------------------------------------------
snd_trident_create
-
+
Description: This routine will create the device specific class for
the 4DWave card. It will also perform basic initialization.
-
+
Parameters: card - which card to create
pci - interface to PCI bus resource info
dma1ptr - playback dma buffer
@@ -3530,7 +3530,7 @@ static int snd_trident_sis_init(struct snd_trident *trident)
irqptr - interrupt resource info
Returns: 4DWave device class private data
-
+
---------------------------------------------------------------------------*/
int __devinit snd_trident_create(struct snd_card *card,
@@ -3560,7 +3560,7 @@ int __devinit snd_trident_create(struct snd_card *card,
pci_disable_device(pci);
return -ENXIO;
}
-
+
trident = kzalloc(sizeof(*trident), GFP_KERNEL);
if (trident == NULL) {
pci_disable_device(pci);
@@ -3577,7 +3577,7 @@ int __devinit snd_trident_create(struct snd_card *card,
if (pcm_streams > 32)
pcm_streams = 32;
trident->ChanPCM = pcm_streams;
- if (max_wavetable_size < 0 )
+ if (max_wavetable_size < 0)
max_wavetable_size = 0;
trident->synth.max_size = max_wavetable_size * 1024;
trident->irq = -1;
@@ -3639,7 +3639,7 @@ int __devinit snd_trident_create(struct snd_card *card,
if ((err = snd_trident_mixer(trident, pcm_spdif_device)) < 0)
return err;
-
+
/* initialise synth voices */
for (i = 0; i < 64; i++) {
voice = &trident->synth.voices[i];
@@ -3665,21 +3665,21 @@ int __devinit snd_trident_create(struct snd_card *card,
/*---------------------------------------------------------------------------
snd_trident_free
-
+
Description: This routine will free the device specific class for
- the 4DWave card.
-
+ the 4DWave card.
+
Parameters: trident - device specific private data for 4DWave card
Returns: None.
-
+
---------------------------------------------------------------------------*/
static int snd_trident_free(struct snd_trident *trident)
{
snd_trident_free_gameport(trident);
snd_trident_disable_eso(trident);
- // Disable S/PDIF out
+ /* Disable S/PDIF out */
if (trident->device == TRIDENT_DEVICE_ID_NX)
outb(0x00, TRID_REG(trident, NX_SPCTRL_SPCSO + 3));
else if (trident->device == TRIDENT_DEVICE_ID_SI7018) {
@@ -3704,9 +3704,9 @@ static int snd_trident_free(struct snd_trident *trident)
/*---------------------------------------------------------------------------
snd_trident_interrupt
-
+
Description: ISR for Trident 4DWave device
-
+
Parameters: trident - device specific private data for 4DWave card
Problems: It seems that Trident chips generates interrupts more than
@@ -3717,7 +3717,7 @@ static int snd_trident_free(struct snd_trident *trident)
work on all computers. [jaroslav]
Returns: None.
-
+
---------------------------------------------------------------------------*/
static irqreturn_t snd_trident_interrupt(int irq, void *dev_id)
@@ -3731,7 +3731,7 @@ static irqreturn_t snd_trident_interrupt(int irq, void *dev_id)
if ((audio_int & (ADDRESS_IRQ|MPU401_IRQ)) == 0)
return IRQ_NONE;
if (audio_int & ADDRESS_IRQ) {
- // get interrupt status for all channels
+ /* get interrupt status for all channels */
spin_lock(&trident->reg_lock);
stimer = inl(TRID_REG(trident, T4D_STIMER)) & 0x00ffffff;
chn_int = inl(TRID_REG(trident, T4D_AINT_A));
@@ -3813,7 +3813,7 @@ static irqreturn_t snd_trident_interrupt(int irq, void *dev_id)
inb(TRID_REG(trident, T4D_MPUR0));
}
}
- // outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(trident, T4D_MISCINT));
+ /* outl((ST_TARGET_REACHED | MIXER_OVERFLOW | MIXER_UNDERFLOW), TRID_REG(trident, T4D_MISCINT)); */
return IRQ_HANDLED;
}
@@ -3826,7 +3826,7 @@ struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident,
spin_lock_irqsave(&trident->voice_alloc, flags);
if (type == SNDRV_TRIDENT_VOICE_TYPE_PCM) {
idx = snd_trident_allocate_pcm_channel(trident);
- if(idx < 0) {
+ if (idx < 0) {
spin_unlock_irqrestore(&trident->voice_alloc, flags);
return NULL;
}
@@ -3842,7 +3842,7 @@ struct snd_trident_voice *snd_trident_alloc_voice(struct snd_trident * trident,
}
if (type == SNDRV_TRIDENT_VOICE_TYPE_SYNTH) {
idx = snd_trident_allocate_synth_channel(trident);
- if(idx < 0) {
+ if (idx < 0) {
spin_unlock_irqrestore(&trident->voice_alloc, flags);
return NULL;
}
diff --git a/sound/pci/trident/trident_memory.c b/sound/pci/trident/trident_memory.c
index f9779e2..4bf4bbb 100644
--- a/sound/pci/trident/trident_memory.c
+++ b/sound/pci/trident/trident_memory.c
@@ -23,7 +23,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/pci.h>
#include <linux/time.h>
#include <linux/mutex.h>
@@ -203,7 +203,7 @@ snd_trident_alloc_sg_pages(struct snd_trident *trident,
if (snd_BUG_ON(!hdr))
return NULL;
-
+
mutex_lock(&hdr->block_mutex);
blk = search_empty(hdr, runtime->dma_bytes);
@@ -211,7 +211,7 @@ snd_trident_alloc_sg_pages(struct snd_trident *trident,
mutex_unlock(&hdr->block_mutex);
return NULL;
}
-
+
/* set TLB entries */
idx = 0;
for (page = firstpg(blk); page <= lastpg(blk); page++, idx++) {
@@ -219,7 +219,7 @@ snd_trident_alloc_sg_pages(struct snd_trident *trident,
dma_addr_t addr = snd_pcm_sgbuf_get_addr(substream, ofs);
unsigned long ptr = (unsigned long)
snd_pcm_sgbuf_get_ptr(substream, ofs);
- if (! is_valid_page(addr)) {
+ if (!is_valid_page(addr)) {
__snd_util_mem_free(hdr, blk);
mutex_unlock(&hdr->block_mutex);
return NULL;
@@ -258,13 +258,13 @@ snd_trident_alloc_cont_pages(struct snd_trident *trident,
mutex_unlock(&hdr->block_mutex);
return NULL;
}
-
+
/* set TLB entries */
addr = runtime->dma_addr;
ptr = (unsigned long)runtime->dma_area;
for (page = firstpg(blk); page <= lastpg(blk); page++,
ptr += SNDRV_TRIDENT_PAGE_SIZE, addr += SNDRV_TRIDENT_PAGE_SIZE) {
- if (! is_valid_page(addr)) {
+ if (!is_valid_page(addr)) {
__snd_util_mem_free(hdr, blk);
mutex_unlock(&hdr->block_mutex);
return NULL;
1
0

[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