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 06/24] sound/pci: coding style fixes: sound/pci/c*
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/bt87x.c | 4 +-
sound/pci/cmipci.c | 80 +++++++++++++++---------------
sound/pci/cs4281.c | 82 ++++++++++++++++----------------
sound/pci/cs5530.c | 8 ++--
sound/pci/cs5535audio/cs5535audio.c | 8 ++--
sound/pci/cs5535audio/cs5535audio_pm.c | 12 ++--
6 files changed, 97 insertions(+), 97 deletions(-)
diff --git a/sound/pci/bt87x.c b/sound/pci/bt87x.c
index 3aa8d97..e9a4fad 100644
--- a/sound/pci/bt87x.c
+++ b/sound/pci/bt87x.c
@@ -27,7 +27,7 @@
#include <linux/slab.h>
#include <linux/moduleparam.h>
#include <linux/bitops.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/pcm_params.h>
@@ -603,7 +603,7 @@ static int snd_bt87x_capture_boost_get(struct snd_kcontrol *kcontrol,
{
struct snd_bt87x *chip = snd_kcontrol_chip(kcontrol);
- value->value.integer.value[0] = !! (chip->reg_control & CTL_A_G2X);
+ value->value.integer.value[0] = !!(chip->reg_control & CTL_A_G2X);
return 0;
}
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 1a74ca6..411ff65 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -16,11 +16,11 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-
+
/* Does not work. Warning may block system in capture mode */
/* #define USE_VAR48KRATE */
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -125,7 +125,7 @@ MODULE_PARM_DESC(joystick_port, "Joystick port address.");
#define CM_SPD24SEL 0x00020000 /* 24bit spdif: model 037 */
/* #define CM_SPDIF_INVERSE 0x00010000 */ /* ??? */
-#define CM_ADCBITLEN_MASK 0x0000C000
+#define CM_ADCBITLEN_MASK 0x0000C000
#define CM_ADCBITLEN_16 0x00000000
#define CM_ADCBITLEN_15 0x00004000
#define CM_ADCBITLEN_14 0x00008000
@@ -255,7 +255,7 @@ MODULE_PARM_DESC(joystick_port, "Joystick port address.");
#define CM_UPDDMA_2048 0x00000000
#define CM_UPDDMA_1024 0x00000004
#define CM_UPDDMA_512 0x00000008
-#define CM_UPDDMA_256 0x0000000C
+#define CM_UPDDMA_256 0x0000000C
#define CM_TWAIT_MASK 0x00000003 /* model 037 */
#define CM_TWAIT1 0x00000002 /* FM i/o cycle, 0: 48, 1: 64 PCICLKs */
#define CM_TWAIT0 0x00000001 /* i/o cycle, 0: 4, 1: 6 PCICLKs */
@@ -450,7 +450,7 @@ static const struct cmipci_mixer_auto_switches cm_saved_mixer[] = {
{"PCM Playback Switch", 0},
{"IEC958 Output Switch", 1},
{"IEC958 Mix Analog", 0},
- // {"IEC958 Out To DAC", 1}, // no longer used
+ /* {"IEC958 Out To DAC", 1}, // no longer used */
{"IEC958 Loop", 0},
};
#define CM_SAVED_MIXERS ARRAY_SIZE(cm_saved_mixer)
@@ -827,7 +827,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
else
cm->ctrl |= val;
snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
- //snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl);
+ /* snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl); */
/* set sample rate */
freq = 0;
@@ -850,7 +850,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
val |= (freq << CM_ASFC_SHIFT) & CM_ASFC_MASK;
}
snd_cmipci_write(cm, CM_REG_FUNCTRL1, val);
- //snd_printd("cmipci: functrl1 = %08x\n", val);
+ /* snd_printd("cmipci: functrl1 = %08x\n", val); */
/* set format */
val = snd_cmipci_read(cm, CM_REG_CHFORMAT);
@@ -866,7 +866,7 @@ static int snd_cmipci_pcm_prepare(struct cmipci *cm, struct cmipci_pcm *rec,
val |= freq_ext << (rec->ch * 2);
}
snd_cmipci_write(cm, CM_REG_CHFORMAT, val);
- //snd_printd("cmipci: chformat = %08x\n", val);
+ /* snd_printd("cmipci: chformat = %08x\n", val); */
if (!rec->is_dac && cm->chip_version) {
if (runtime->rate > 44100)
@@ -904,7 +904,7 @@ static int snd_cmipci_pcm_trigger(struct cmipci *cm, struct cmipci_pcm *rec,
cm->ctrl |= chen;
/* enable channel */
snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
- //snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl);
+ /* snd_printd("cmipci: functrl0 = %08x\n", cm->ctrl); */
break;
case SNDRV_PCM_TRIGGER_STOP:
rec->running = 0;
@@ -944,7 +944,7 @@ static snd_pcm_uframes_t snd_cmipci_pcm_pointer(struct cmipci *cm, struct cmipci
unsigned int reg;
if (!rec->running)
return 0;
-#if 1 // this seems better..
+#if 1 /* this seems better.. */
reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2;
ptr = rec->dma_size - (snd_cmipci_read_w(cm, reg) + 1);
ptr >>= rec->shift;
@@ -1127,7 +1127,7 @@ static struct snd_kcontrol_new snd_cmipci_spdif_stream __devinitdata =
/* save mixer setting and mute for AC3 playback */
static int save_mixer_state(struct cmipci *cm)
{
- if (! cm->mixer_insensitive) {
+ if (!cm->mixer_insensitive) {
struct snd_ctl_elem_value *val;
unsigned int i;
@@ -1199,7 +1199,7 @@ static void setup_ac3(struct cmipci *cm, struct snd_pcm_substream *subs, int do_
snd_cmipci_set_bit(cm, CM_REG_CHFORMAT, CM_AC3EN1);
/* AC3EN for 039 */
snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_AC3EN2);
-
+
if (cm->can_ac3_hw) {
/* SPD24SEL for 037, 0x02 */
/* SPD24SEL for 039, 0x20, but cannot be set */
@@ -1294,7 +1294,7 @@ static int snd_cmipci_playback_prepare(struct snd_pcm_substream *substream)
do_spdif = (rate >= 44100 && rate <= 96000 &&
substream->runtime->format == SNDRV_PCM_FORMAT_S16_LE &&
substream->runtime->channels == 2);
- if (do_spdif && cm->can_ac3_hw)
+ if (do_spdif && cm->can_ac3_hw)
do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO;
if ((err = setup_spdif_playback(cm, substream, do_spdif, do_ac3)) < 0)
return err;
@@ -1307,7 +1307,7 @@ static int snd_cmipci_playback_spdif_prepare(struct snd_pcm_substream *substream
struct cmipci *cm = snd_pcm_substream_chip(substream);
int err, do_ac3;
- if (cm->can_ac3_hw)
+ if (cm->can_ac3_hw)
do_ac3 = cm->dig_pcm_status & IEC958_AES0_NONAUDIO;
else
do_ac3 = 1; /* doesn't matter */
@@ -1335,7 +1335,7 @@ static void snd_cmipci_silence_hack(struct cmipci *cm, struct cmipci_pcm *rec)
reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2;
val = ((PAGE_SIZE / 4) - 1) | (((PAGE_SIZE / 4) / 2 - 1) << 16);
snd_cmipci_write(cm, reg, val);
-
+
/* configure for 16 bits, 2 channels, 8 kHz */
if (runtime->channels > 2)
set_dac_channels(cm, rec, 2);
@@ -1350,7 +1350,7 @@ static void snd_cmipci_silence_hack(struct cmipci *cm, struct cmipci_pcm *rec)
if (cm->can_96k)
val &= ~(CM_CH0_SRATE_MASK << (rec->ch * 2));
snd_cmipci_write(cm, CM_REG_CHFORMAT, val);
-
+
/* start stream (we don't need interrupts) */
cm->ctrl |= CM_CHEN0 << rec->ch;
snd_cmipci_write(cm, CM_REG_FUNCTRL0, cm->ctrl);
@@ -1436,7 +1436,7 @@ static irqreturn_t snd_cmipci_interrupt(int irq, void *dev_id)
{
struct cmipci *cm = dev_id;
unsigned int status, mask = 0;
-
+
/* fastpath out, to ease interrupt sharing */
status = snd_cmipci_read(cm, CM_REG_INT_STATUS);
if (!(status & CM_INTR))
@@ -1616,7 +1616,7 @@ static int open_device_check(struct cmipci *cm, int mode, struct snd_pcm_substre
}
cm->opened[ch] = mode;
cm->channel[ch].substream = subs;
- if (! (mode & CM_OPEN_DAC)) {
+ if (!(mode & CM_OPEN_DAC)) {
/* disable dual DAC mode */
cm->channel[ch].is_dac = 0;
spin_lock_irq(&cm->reg_lock);
@@ -1639,7 +1639,7 @@ static void close_device_check(struct cmipci *cm, int mode)
cm->channel[ch].substream = NULL;
}
cm->opened[ch] = 0;
- if (! cm->channel[ch].is_dac) {
+ if (!cm->channel[ch].is_dac) {
/* enable dual DAC mode again */
cm->channel[ch].is_dac = 1;
spin_lock_irq(&cm->reg_lock);
@@ -1688,7 +1688,7 @@ static int snd_cmipci_capture_open(struct snd_pcm_substream *substream)
if ((err = open_device_check(cm, CM_OPEN_CAPTURE, substream)) < 0)
return err;
runtime->hw = snd_cmipci_capture;
- if (cm->chip_version == 68) { // 8768 only supports 44k/48k recording
+ if (cm->chip_version == 68) { /* 8768 only supports 44k/48k recording */
runtime->hw.rate_min = 41000;
runtime->hw.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000;
} else if (cm->chip_version == 55) {
@@ -1713,7 +1713,7 @@ static int snd_cmipci_playback2_open(struct snd_pcm_substream *substream)
return err;
runtime->hw = snd_cmipci_playback2;
mutex_lock(&cm->open_mutex);
- if (! cm->opened[CM_CH_PLAY]) {
+ if (!cm->opened[CM_CH_PLAY]) {
if (cm->can_multi_ch) {
runtime->hw.channels_max = cm->max_channels;
if (cm->max_channels == 4)
@@ -2030,7 +2030,7 @@ static int snd_cmipci_info_volume(struct snd_kcontrol *kcontrol,
uinfo->value.integer.max = reg.mask;
return 0;
}
-
+
static int snd_cmipci_get_volume(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -2112,7 +2112,7 @@ static int snd_cmipci_info_input_sw(struct snd_kcontrol *kcontrol,
uinfo->value.integer.max = 1;
return 0;
}
-
+
static int snd_cmipci_get_input_sw(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -2260,7 +2260,7 @@ static int snd_cmipci_put_native_mixer(struct snd_kcontrol *kcontrol,
static int snd_cmipci_get_native_mixer_sensitive(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
- //struct cmipci *cm = snd_kcontrol_chip(kcontrol);
+ /* struct cmipci *cm = snd_kcontrol_chip(kcontrol); */
return snd_cmipci_get_native_mixer(kcontrol, ucontrol);
}
@@ -2280,7 +2280,7 @@ static struct snd_kcontrol_new snd_cmipci_mixers[] __devinitdata = {
CMIPCI_SB_VOL_STEREO("Master Playback Volume", SB_DSP4_MASTER_DEV, 3, 31),
CMIPCI_MIXER_SW_MONO("3D Control - Switch", CM_REG_MIXER1, CM_X3DEN_SHIFT, 0),
CMIPCI_SB_VOL_STEREO("PCM Playback Volume", SB_DSP4_PCM_DEV, 3, 31),
- //CMIPCI_MIXER_SW_MONO("PCM Playback Switch", CM_REG_MIXER1, CM_WSMUTE_SHIFT, 1),
+ /* CMIPCI_MIXER_SW_MONO("PCM Playback Switch", CM_REG_MIXER1, CM_WSMUTE_SHIFT, 1), */
{ /* switch with sensitivity */
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Playback Switch",
@@ -2380,7 +2380,7 @@ static int _snd_cmipci_uswitch_put(struct snd_kcontrol *kcontrol,
val = inb(cm->iobase + args->reg);
else
val = snd_cmipci_read(cm, args->reg);
- change = (val & args->mask) != (ucontrol->value.integer.value[0] ?
+ change = (val & args->mask) != (ucontrol->value.integer.value[0] ?
args->mask_on : (args->mask & ~args->mask_on));
if (change) {
val &= ~args->mask;
@@ -2415,7 +2415,7 @@ static struct cmipci_switch_args cmipci_switch_arg_##sname = { \
.is_byte = xis_byte, \
.ac3_sensitive = xac3, \
}
-
+
#define DEFINE_BIT_SWITCH_ARG(sname, xreg, xmask, xis_byte, xac3) \
DEFINE_SWITCH_ARG(sname, xreg, xmask, xmask, xis_byte, xac3)
@@ -2572,7 +2572,7 @@ static int snd_cmipci_mic_in_mode_get(struct snd_kcontrol *kcontrol,
struct cmipci *cm = snd_kcontrol_chip(kcontrol);
/* same bit as spdi_phase */
spin_lock_irq(&cm->reg_lock);
- ucontrol->value.enumerated.item[0] =
+ ucontrol->value.enumerated.item[0] =
(snd_cmipci_read_b(cm, CM_REG_MISC) & CM_SPDIF_INVERSE) ? 1 : 0;
spin_unlock_irq(&cm->reg_lock);
return 0;
@@ -2616,7 +2616,7 @@ static struct snd_kcontrol_new snd_cmipci_8738_mixer_switches[] __devinitdata =
DEFINE_MIXER_SWITCH("IEC958 Out", spdif_out),
DEFINE_MIXER_SWITCH("IEC958 Out To DAC", spdo2dac),
#endif
- // DEFINE_MIXER_SWITCH("IEC958 Output Switch", spdif_enable),
+ /* DEFINE_MIXER_SWITCH("IEC958 Output Switch", spdif_enable), */
{ .name = "IEC958 Output Switch",
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.info = snd_cmipci_uswitch_info,
@@ -2676,7 +2676,7 @@ static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_devic
spin_unlock_irq(&cm->reg_lock);
for (idx = 0; idx < ARRAY_SIZE(snd_cmipci_mixers); idx++) {
- if (cm->chip_version == 68) { // 8768 has no PCM volume
+ if (cm->chip_version == 68) { /* 8768 has no PCM volume */
if (!strcmp(snd_cmipci_mixers[idx].name,
"PCM Playback Volume"))
continue;
@@ -2692,7 +2692,7 @@ static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_devic
if (err < 0)
return err;
}
- if (! cm->can_multi_ch) {
+ if (!cm->can_multi_ch) {
err = snd_ctl_add(cm->card, snd_ctl_new1(&snd_cmipci_nomulti_switch, cm));
if (err < 0)
return err;
@@ -2766,12 +2766,12 @@ static int __devinit snd_cmipci_mixer_new(struct cmipci *cm, int pcm_spdif_devic
*/
#ifdef CONFIG_PROC_FS
-static void snd_cmipci_proc_read(struct snd_info_entry *entry,
+static void snd_cmipci_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct cmipci *cm = entry->private_data;
int i, v;
-
+
snd_iprintf(buffer, "%s\n", cm->card->longname);
for (i = 0; i < 0x94; i++) {
if (i == 0x28)
@@ -2788,7 +2788,7 @@ static void __devinit snd_cmipci_proc_init(struct cmipci *cm)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(cm->card, "cmipci", &entry))
+ if (!snd_card_proc_new(cm->card, "cmipci", &entry))
snd_info_set_text_ops(entry, cm, snd_cmipci_proc_read);
}
#else /* !CONFIG_PROC_FS */
@@ -2816,7 +2816,7 @@ static void __devinit query_chip(struct cmipci *cm)
/* check reg 0Ch, bit 24-31 */
detect = snd_cmipci_read(cm, CM_REG_INT_HLDCLR) & CM_CHIP_MASK2;
- if (! detect) {
+ if (!detect) {
/* check reg 08h, bit 24-28 */
detect = snd_cmipci_read(cm, CM_REG_CHFORMAT) & CM_CHIP_MASK1;
switch (detect) {
@@ -3115,7 +3115,7 @@ static int __devinit snd_cmipci_create(struct snd_card *card, struct pci_dev *pc
switch (pci->device) {
case PCI_DEVICE_ID_CMEDIA_CM8738:
case PCI_DEVICE_ID_CMEDIA_CM8738B:
- if (!pci_dev_present(intel_82437vx))
+ if (!pci_dev_present(intel_82437vx))
snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_TXVX);
break;
default:
@@ -3267,7 +3267,7 @@ static int __devinit snd_cmipci_probe(struct pci_dev *pci,
if (dev >= SNDRV_CARDS)
return -ENODEV;
- if (! enable[dev]) {
+ if (!enable[dev]) {
dev++;
return -ENOENT;
}
@@ -3275,7 +3275,7 @@ static int __devinit snd_cmipci_probe(struct pci_dev *pci,
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
-
+
switch (pci->device) {
case PCI_DEVICE_ID_CMEDIA_CM8738:
case PCI_DEVICE_ID_CMEDIA_CM8738B:
@@ -3343,7 +3343,7 @@ static int snd_cmipci_suspend(struct pci_dev *pci, pm_message_t state)
int i;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
-
+
snd_pcm_suspend_all(cm->pcm);
snd_pcm_suspend_all(cm->pcm2);
snd_pcm_suspend_all(cm->pcm_spdif);
@@ -3406,7 +3406,7 @@ static struct pci_driver driver = {
.resume = snd_cmipci_resume,
#endif
};
-
+
static int __init alsa_card_cmipci_init(void)
{
return pci_register_driver(&driver);
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index ef9308f..24cc52b 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -19,7 +19,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -573,13 +573,13 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
struct cs4281 *chip = ac97->private_data;
int count;
unsigned short result;
- // FIXME: volatile is necessary in the following due to a bug of
- // some gcc versions
+ /* FIXME: volatile is necessary in the following due to a bug of */
+ /* some gcc versions */
volatile int ac97_num = ((volatile struct snd_ac97 *)ac97)->num;
/*
* 1. Write ACCAD = Command Address Register = 46Ch for AC97 register address
- * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
+ * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
* 3. Write ACCTL = Control Register = 460h for initiating the write
* 4. Read ACCTL = 460h, DCV should be reset by now and 460h = 17h
* 5. if DCV not cleared, break and return error
@@ -627,7 +627,7 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
snd_printk(KERN_ERR "AC'97 read problem (ACCTL_DCV), reg = 0x%x\n", reg);
result = 0xffff;
goto __end;
-
+
__ok1:
/*
* Wait for the valid status bit to go active.
@@ -642,7 +642,7 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
goto __ok2;
udelay(10);
}
-
+
snd_printk(KERN_ERR "AC'97 read problem (ACSTS_VSTS), reg = 0x%x\n", reg);
result = 0xffff;
goto __end;
@@ -654,7 +654,7 @@ static unsigned short snd_cs4281_ac97_read(struct snd_ac97 *ac97,
*/
result = snd_cs4281_peekBA0(chip, ac97_num ? BA0_ACSDA2 : BA0_ACSDA);
- __end:
+__end:
return result;
}
@@ -707,7 +707,7 @@ static int snd_cs4281_trigger(struct snd_pcm_substream *substream, int cmd)
static unsigned int snd_cs4281_rate(unsigned int rate, unsigned int *real_rate)
{
unsigned int val = ~0;
-
+
if (real_rate)
*real_rate = rate;
/* special "hardcoded" rates */
@@ -721,7 +721,7 @@ static unsigned int snd_cs4281_rate(unsigned int rate, unsigned int *real_rate)
default:
goto __variable;
}
- __variable:
+__variable:
val = 1536000 / rate;
if (real_rate)
*real_rate = 1536000 / val;
@@ -776,7 +776,7 @@ static void snd_cs4281_mode(struct cs4281 *chip, struct cs4281_dma *dma,
snd_cs4281_pokeBA0(chip, BA0_ADCSR, val);
}
}
- __skip_src:
+__skip_src:
/* Deactivate wave playback FIFO before changing slot assignments */
if (dma->regFCR == BA0_FCR0)
snd_cs4281_pokeBA0(chip, dma->regFCR, snd_cs4281_peekBA0(chip, dma->regFCR) & ~BA0_FCR_FEN);
@@ -834,7 +834,7 @@ static snd_pcm_uframes_t snd_cs4281_pointer(struct snd_pcm_substream *substream)
struct cs4281_dma *dma = runtime->private_data;
struct cs4281 *chip = snd_pcm_substream_chip(substream);
- // printk("DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n", snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size, jiffies);
+ /* printk("DCC = 0x%x, buffer_size = 0x%x, jiffies = %li\n", snd_cs4281_peekBA0(chip, dma->regDCC), runtime->buffer_size, jiffies); */
return runtime->buffer_size -
snd_cs4281_peekBA0(chip, dma->regDCC) - 1;
}
@@ -965,7 +965,7 @@ static struct snd_pcm_ops snd_cs4281_capture_ops = {
.pointer = snd_cs4281_pointer,
};
-static int __devinit snd_cs4281_pcm(struct cs4281 * chip, int device,
+static int __devinit snd_cs4281_pcm(struct cs4281 *chip, int device,
struct snd_pcm ** rpcm)
{
struct snd_pcm *pcm;
@@ -1008,7 +1008,7 @@ static int snd_cs4281_info_volume(struct snd_kcontrol *kcontrol,
uinfo->value.integer.max = CS_VOL_MASK;
return 0;
}
-
+
static int snd_cs4281_get_volume(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
@@ -1052,24 +1052,24 @@ static int snd_cs4281_put_volume(struct snd_kcontrol *kcontrol,
static const DECLARE_TLV_DB_SCALE(db_scale_dsp, -4650, 150, 0);
-static struct snd_kcontrol_new snd_cs4281_fm_vol =
+static struct snd_kcontrol_new snd_cs4281_fm_vol =
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "Synth Playback Volume",
- .info = snd_cs4281_info_volume,
+ .info = snd_cs4281_info_volume,
.get = snd_cs4281_get_volume,
- .put = snd_cs4281_put_volume,
+ .put = snd_cs4281_put_volume,
.private_value = ((BA0_FMLVC << 16) | BA0_FMRVC),
.tlv = { .p = db_scale_dsp },
};
-static struct snd_kcontrol_new snd_cs4281_pcm_vol =
+static struct snd_kcontrol_new snd_cs4281_pcm_vol =
{
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
.name = "PCM Stream Playback Volume",
- .info = snd_cs4281_info_volume,
+ .info = snd_cs4281_info_volume,
.get = snd_cs4281_get_volume,
- .put = snd_cs4281_put_volume,
+ .put = snd_cs4281_put_volume,
.private_value = ((BA0_PPLVC << 16) | BA0_PPRVC),
.tlv = { .p = db_scale_dsp },
};
@@ -1089,7 +1089,7 @@ static void snd_cs4281_mixer_free_ac97(struct snd_ac97 *ac97)
chip->ac97 = NULL;
}
-static int __devinit snd_cs4281_mixer(struct cs4281 * chip)
+static int __devinit snd_cs4281_mixer(struct cs4281 *chip)
{
struct snd_card *card = chip->card;
struct snd_ac97_template ac97;
@@ -1125,7 +1125,7 @@ static int __devinit snd_cs4281_mixer(struct cs4281 * chip)
* proc interface
*/
-static void snd_cs4281_proc_read(struct snd_info_entry *entry,
+static void snd_cs4281_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct cs4281 *chip = entry->private_data;
@@ -1142,7 +1142,7 @@ static long snd_cs4281_BA0_read(struct snd_info_entry *entry,
{
long size;
struct cs4281 *chip = entry->private_data;
-
+
size = count;
if (pos + size > CS4281_BA0_SIZE)
size = (long)CS4281_BA0_SIZE - pos;
@@ -1160,7 +1160,7 @@ static long snd_cs4281_BA1_read(struct snd_info_entry *entry,
{
long size;
struct cs4281 *chip = entry->private_data;
-
+
size = count;
if (pos + size > CS4281_BA1_SIZE)
size = (long)CS4281_BA1_SIZE - pos;
@@ -1179,19 +1179,19 @@ static struct snd_info_entry_ops snd_cs4281_proc_ops_BA1 = {
.read = snd_cs4281_BA1_read,
};
-static void __devinit snd_cs4281_proc_init(struct cs4281 * chip)
+static void __devinit snd_cs4281_proc_init(struct cs4281 *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "cs4281", &entry))
+ if (!snd_card_proc_new(chip->card, "cs4281", &entry))
snd_info_set_text_ops(entry, chip, snd_cs4281_proc_read);
- if (! snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) {
+ if (!snd_card_proc_new(chip->card, "cs4281_BA0", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip;
entry->c.ops = &snd_cs4281_proc_ops_BA0;
entry->size = CS4281_BA0_SIZE;
}
- if (! snd_card_proc_new(chip->card, "cs4281_BA1", &entry)) {
+ if (!snd_card_proc_new(chip->card, "cs4281_BA1", &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip;
entry->c.ops = &snd_cs4281_proc_ops_BA1;
@@ -1229,16 +1229,16 @@ static int snd_cs4281_gameport_cooked_read(struct gameport *gameport,
{
struct cs4281 *chip = gameport_get_port_data(gameport);
unsigned js1, js2, jst;
-
+
if (snd_BUG_ON(!chip))
return 0;
js1 = snd_cs4281_peekBA0(chip, BA0_JSC1);
js2 = snd_cs4281_peekBA0(chip, BA0_JSC2);
jst = snd_cs4281_peekBA0(chip, BA0_JSPT);
-
- *buttons = (~jst >> 4) & 0x0F;
-
+
+ *buttons = (~jst >> 4) & 0x0F;
+
axes[0] = ((js1 & JSC1_Y1V_MASK) >> JSC1_Y1V_SHIFT) & 0xFFFF;
axes[1] = ((js1 & JSC1_X1V_MASK) >> JSC1_X1V_SHIFT) & 0xFFFF;
axes[2] = ((js2 & JSC2_Y2V_MASK) >> JSC2_Y2V_SHIFT) & 0xFFFF;
@@ -1286,7 +1286,7 @@ static int __devinit snd_cs4281_create_gameport(struct cs4281 *chip)
gp->cooked_read = snd_cs4281_gameport_cooked_read;
gameport_set_port_data(gp, chip);
- snd_cs4281_pokeBA0(chip, BA0_JSIO, 0xFF); // ?
+ snd_cs4281_pokeBA0(chip, BA0_JSIO, 0xFF); /* ? */
snd_cs4281_pokeBA0(chip, BA0_JSCTL, JSCTL_SP_MEDIUM_SLOW);
gameport_register_port(gp);
@@ -1388,7 +1388,7 @@ static int __devinit snd_cs4281_create(struct snd_card *card,
snd_cs4281_free(chip);
return -ENOMEM;
}
-
+
if (request_irq(pci->irq, snd_cs4281_interrupt, IRQF_SHARED,
"CS4281", chip)) {
snd_printk(KERN_ERR "unable to grab IRQ %d\n", pci->irq);
@@ -1427,7 +1427,7 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
if (tmp & BA0_EPPMC_FPDN)
snd_cs4281_pokeBA0(chip, BA0_EPPMC, tmp & ~BA0_EPPMC_FPDN);
- __retry:
+__retry:
tmp = snd_cs4281_peekBA0(chip, BA0_CFLR);
if (tmp != BA0_CFLR_DEFAULT) {
snd_cs4281_pokeBA0(chip, BA0_CFLR, BA0_CFLR_DEFAULT);
@@ -1440,9 +1440,9 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
/* Set the 'Configuration Write Protect' register
* to 4281h. Allows vendor-defined configuration
- * space between 0e4h and 0ffh to be written. */
+ * space between 0e4h and 0ffh to be written. */
snd_cs4281_pokeBA0(chip, BA0_CWPR, 0x4281);
-
+
if ((tmp = snd_cs4281_peekBA0(chip, BA0_SERC1)) != (BA0_SERC1_SO1EN | BA0_SERC1_AC97)) {
snd_printk(KERN_ERR "SERC1 AC'97 check failed (0x%x)\n", tmp);
return -EIO;
@@ -1469,7 +1469,7 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
* the Sync pulse on the AC97 link. */
snd_cs4281_pokeBA0(chip, BA0_ACCTL, 0);
udelay(50);
-
+
/* Drive the ARST# pin low for a minimum of 1uS (as defined in the AC97
* spec) and then drive it high. This is done for non AC97 modes since
* there might be logic external to the CS4281 that uses the ARST# line
@@ -1549,7 +1549,7 @@ static int snd_cs4281_chip_init(struct cs4281 *chip)
} while (time_after_eq(end_time, jiffies));
snd_printk(KERN_INFO "secondary codec doesn't respond. disable it...\n");
chip->dual_codec = 0;
- __codec2_ok: ;
+ __codec2_ok:;
}
/*
@@ -1787,7 +1787,7 @@ static struct snd_rawmidi_ops snd_cs4281_midi_input =
.trigger = snd_cs4281_midi_input_trigger,
};
-static int __devinit snd_cs4281_midi(struct cs4281 * chip, int device,
+static int __devinit snd_cs4281_midi(struct cs4281 *chip, int device,
struct snd_rawmidi **rrawmidi)
{
struct snd_rawmidi *rmidi;
@@ -1855,7 +1855,7 @@ static irqreturn_t snd_cs4281_interrupt(int irq, void *dev_id)
if ((status & BA0_HISR_MIDI) && chip->rmidi) {
unsigned char c;
-
+
spin_lock(&chip->reg_lock);
while ((snd_cs4281_peekBA0(chip, BA0_MIDSR) & BA0_MIDSR_RBE) == 0) {
c = snd_cs4281_peekBA0(chip, BA0_MIDRP);
@@ -2102,7 +2102,7 @@ static struct pci_driver driver = {
.resume = cs4281_resume,
#endif
};
-
+
static int __init alsa_card_cs4281_init(void)
{
return pci_register_driver(&driver);
diff --git a/sound/pci/cs5530.c b/sound/pci/cs5530.c
index 7ff8b68..2e46ac7 100644
--- a/sound/pci/cs5530.c
+++ b/sound/pci/cs5530.c
@@ -10,8 +10,8 @@
* simultaneously play back audio at 16bit 44100kHz, the device actually plays
* back in the same format in which it is capturing. By forcing the chip to
* always play/capture in 16/44100, we can let alsa-lib convert the samples and
- * that way we can hack up some full duplex audio.
- *
+ * that way we can hack up some full duplex audio.
+ *
* XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems.
* The older version (VSA1) provides fairly good soundblaster emulation
* although there are a couple of bugs: large DMA buffers break record,
@@ -126,7 +126,7 @@ static int __devinit snd_cs5530_create(struct snd_card *card,
err = pci_request_regions(pci, "CS5530");
if (err < 0) {
- kfree(chip);
+ kfree(chip);
pci_disable_device(pci);
return err;
}
@@ -207,7 +207,7 @@ static int __devinit snd_cs5530_create(struct snd_card *card,
return -ENODEV;
}
- printk(KERN_INFO "CS5530: IRQ: %d DMA8: %d DMA16: %d\n", irq, dma8,
+ printk(KERN_INFO "CS5530: IRQ: %d DMA8: %d DMA16: %d\n", irq, dma8,
dma16);
err = snd_sbdsp_create(card, sb_base, irq, snd_sb16dsp_interrupt, dma8,
diff --git a/sound/pci/cs5535audio/cs5535audio.c b/sound/pci/cs5535audio/cs5535audio.c
index 1d8b160..07c908c 100644
--- a/sound/pci/cs5535audio/cs5535audio.c
+++ b/sound/pci/cs5535audio/cs5535audio.c
@@ -27,7 +27,7 @@
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/moduleparam.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/control.h>
#include <sound/pcm.h>
@@ -46,9 +46,9 @@ MODULE_PARM_DESC(ac97_quirk, "AC'97 board specific workarounds.");
static struct ac97_quirk ac97_quirks[] __devinitdata = {
#if 0 /* Not yet confirmed if all 5536 boards are HP only */
{
- .subvendor = PCI_VENDOR_ID_AMD,
- .subdevice = PCI_DEVICE_ID_AMD_CS5536_AUDIO,
- .name = "AMD RDK",
+ .subvendor = PCI_VENDOR_ID_AMD,
+ .subdevice = PCI_DEVICE_ID_AMD_CS5536_AUDIO,
+ .name = "AMD RDK",
.type = AC97_TUNE_HP_ONLY
},
#endif
diff --git a/sound/pci/cs5535audio/cs5535audio_pm.c b/sound/pci/cs5535audio/cs5535audio_pm.c
index 564c33b..ea67963 100644
--- a/sound/pci/cs5535audio/cs5535audio_pm.c
+++ b/sound/pci/cs5535audio/cs5535audio_pm.c
@@ -32,18 +32,18 @@
static void snd_cs5535audio_stop_hardware(struct cs5535audio *cs5535au)
{
- /*
+ /*
we depend on snd_ac97_suspend to tell the
AC97 codec to shutdown. the amd spec suggests
that the LNK_SHUTDOWN be done at the same time
that the codec power-down is issued. instead,
- we do it just after rather than at the same
+ we do it just after rather than at the same
time. excluding codec specific build_ops->suspend
ac97 powerdown hits:
- 0x8000 EAPD
- 0x4000 Headphone amplifier
- 0x0300 ADC & DAC
- 0x0400 Analog Mixer powerdown (Vref on)
+ 0x8000 EAPD
+ 0x4000 Headphone amplifier
+ 0x0300 ADC & DAC
+ 0x0400 Analog Mixer powerdown (Vref on)
I am not sure if this is the best that we can do.
The remainder to be investigated are:
- analog mixer (vref off) 0x0800
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/cs46xx/cs46xx.c | 2 +-
sound/pci/cs46xx/cs46xx_lib.c | 316 ++++++++++----------
sound/pci/cs46xx/dsp_spos.c | 428 ++++++++++++++--------------
sound/pci/cs46xx/dsp_spos.h | 8 +-
sound/pci/cs46xx/dsp_spos_scb_lib.c | 546 +++++++++++++++++-----------------
sound/pci/cs46xx/imgs/cwcbinhack.h | 2 +-
6 files changed, 651 insertions(+), 651 deletions(-)
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index e876b32..d766d85 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -21,7 +21,7 @@
/*
NOTES:
- - sometimes the sound is metallic and sibilant, unloading and
+ - sometimes the sound is metallic and sibilant, unloading and
reloading the module may solve this.
*/
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index a10ab82..d8ab1ad 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -7,7 +7,7 @@
* KNOWN BUGS:
* - Sometimes the SPDIF input DSP tasks get's unsynchronized
* and the SPDIF get somewhat "distorcionated", or/and left right channel
- * are swapped. To get around this problem when it happens, mute and unmute
+ * are swapped. To get around this problem when it happens, mute and unmute
* the SPDIF input mixer control.
* - On the Hercules Game Theater XP the amplifier are sometimes turned
* off on inadecuate moments which causes distorcions on sound.
@@ -22,13 +22,13 @@
* is default configuration), no SPDIF, no secondary codec, no
* multi channel PCM. But known to work.
*
- * FINALLY: A credit to the developers Tom and Jordan
+ * FINALLY: A credit to the developers Tom and Jordan
* at Cirrus for have helping me out with the DSP, however we
* still don't have sufficient documentation and technical
* references to be able to implement all fancy feutures
- * supported by the cs46xx DSP's.
+ * supported by the cs46xx DSP's.
* Benny <benny(a)hostmobility.com>
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
@@ -62,7 +62,7 @@
#include <sound/pcm_params.h>
#include <sound/cs46xx.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "cs46xx_lib.h"
#include "dsp_spos.h"
@@ -102,7 +102,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
/*
* 1. Write ACCAD = Command Address Register = 46Ch for AC97 register address
- * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
+ * 2. Write ACCDA = Command Data Register = 470h for data to write to AC97
* 3. Write ACCTL = Control Register = 460h for initiating the write7---55
* 4. Read ACCTL = 460h, DCV should be reset by now and 460h = 17h
* 5. if DCV not cleared, break and return error
@@ -114,10 +114,10 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
tmp = snd_cs46xx_peekBA0(chip, BA0_ACCTL);
if ((tmp & ACCTL_VFRM) == 0) {
snd_printk(KERN_WARNING "cs46xx: ACCTL_VFRM not set 0x%x\n",tmp);
- snd_cs46xx_pokeBA0(chip, BA0_ACCTL, (tmp & (~ACCTL_ESYN)) | ACCTL_VFRM );
+ snd_cs46xx_pokeBA0(chip, BA0_ACCTL, (tmp & (~ACCTL_ESYN)) | ACCTL_VFRM);
msleep(50);
tmp = snd_cs46xx_peekBA0(chip, BA0_ACCTL + offset);
- snd_cs46xx_pokeBA0(chip, BA0_ACCTL, tmp | ACCTL_ESYN | ACCTL_VFRM );
+ snd_cs46xx_pokeBA0(chip, BA0_ACCTL, tmp | ACCTL_ESYN | ACCTL_VFRM);
}
@@ -137,7 +137,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
snd_cs46xx_pokeBA0(chip, BA0_ACCAD, reg);
snd_cs46xx_pokeBA0(chip, BA0_ACCDA, 0);
if (codec_index == CS46XX_PRIMARY_CODEC_INDEX) {
- snd_cs46xx_pokeBA0(chip, BA0_ACCTL,/* clear ACCTL_DCV */ ACCTL_CRW |
+ snd_cs46xx_pokeBA0(chip, BA0_ACCTL,/* clear ACCTL_DCV */ ACCTL_CRW |
ACCTL_VFRM | ACCTL_ESYN |
ACCTL_RSTN);
snd_cs46xx_pokeBA0(chip, BA0_ACCTL, ACCTL_DCV | ACCTL_CRW |
@@ -168,7 +168,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
snd_printk(KERN_ERR "AC'97 read problem (ACCTL_DCV), reg = 0x%x\n", reg);
result = 0xffff;
goto end;
-
+
ok1:
/*
* Wait for the valid status bit to go active.
@@ -183,7 +183,7 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
goto ok2;
udelay(10);
}
-
+
snd_printk(KERN_ERR "AC'97 read problem (ACSTS_VSTS), codec_index %d, reg = 0x%x\n", codec_index, reg);
result = 0xffff;
goto end;
@@ -199,14 +199,14 @@ static unsigned short snd_cs46xx_codec_read(struct snd_cs46xx *chip,
snd_cs46xx_peekBA0(chip, BA0_ACCAD));
#endif
- //snd_cs46xx_peekBA0(chip, BA0_ACCAD);
+ /* snd_cs46xx_peekBA0(chip, BA0_ACCAD); */
result = snd_cs46xx_peekBA0(chip, BA0_ACSDA + offset);
end:
chip->active_ctrl(chip, -1);
return result;
}
-static unsigned short snd_cs46xx_ac97_read(struct snd_ac97 * ac97,
+static unsigned short snd_cs46xx_ac97_read(struct snd_ac97 *ac97,
unsigned short reg)
{
struct snd_cs46xx *chip = ac97->private_data;
@@ -339,7 +339,7 @@ int snd_cs46xx_download(struct snd_cs46xx *chip,
int snd_cs46xx_clear_BA1(struct snd_cs46xx *chip,
unsigned long offset,
- unsigned long len)
+ unsigned long len)
{
void __iomem *dst;
unsigned int bank = offset >> 16;
@@ -374,7 +374,7 @@ int snd_cs46xx_download_image(struct snd_cs46xx *chip)
BA1Struct.memory[idx].size)) < 0)
return err;
offset += BA1Struct.memory[idx].size >> 2;
- }
+ }
return 0;
}
#endif /* CONFIG_SND_CS46XX_NEW_DSP */
@@ -412,23 +412,23 @@ static void snd_cs46xx_reset(struct snd_cs46xx *chip)
snd_cs46xx_poke(chip, BA1_FRMT, 0xadf);
}
-static int cs46xx_wait_for_fifo(struct snd_cs46xx * chip,int retry_timeout)
+static int cs46xx_wait_for_fifo(struct snd_cs46xx *chip, int retry_timeout)
{
u32 i, status = 0;
/*
* Make sure the previous FIFO write operation has completed.
*/
- for(i = 0; i < 50; i++){
+ for (i = 0; i < 50; i++){
status = snd_cs46xx_peekBA0(chip, BA0_SERBST);
-
- if( !(status & SERBST_WBSY) )
+
+ if (!(status & SERBST_WBSY))
break;
mdelay(retry_timeout);
}
-
- if(status & SERBST_WBSY) {
- snd_printk( KERN_ERR "cs46xx: failure waiting for FIFO command to complete\n");
+
+ if (status & SERBST_WBSY) {
+ snd_printk(KERN_ERR "cs46xx: failure waiting for FIFO command to complete\n");
return -EINVAL;
}
@@ -470,7 +470,7 @@ static void snd_cs46xx_clear_serial_FIFOs(struct snd_cs46xx *chip)
if (powerdown)
snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, tmp);
-
+
break;
}
/*
@@ -668,7 +668,7 @@ static void snd_cs46xx_set_capture_sample_rate(struct snd_cs46xx *chip, unsigned
frameGroupLength *= 3;
}
for (cnt = 5; cnt <= 125; cnt *= 5) {
- if (((rate / cnt) * cnt) != rate)
+ if (((rate / cnt) * cnt) != rate)
frameGroupLength *= 5;
}
@@ -778,7 +778,7 @@ static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream,
#ifdef CONFIG_SND_CS46XX_NEW_DSP
struct snd_cs46xx_pcm *cpcm = substream->runtime->private_data;
- if (! cpcm->pcm_channel) {
+ if (!cpcm->pcm_channel) {
return -ENXIO;
}
#endif
@@ -787,7 +787,7 @@ static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_RESUME:
#ifdef CONFIG_SND_CS46XX_NEW_DSP
/* magic value to unmute PCM stream playback volume */
- snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
+ snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
SCBVolumeCtrl) << 2, 0x80008000);
if (cpcm->pcm_channel->unlinked)
@@ -811,7 +811,7 @@ static int snd_cs46xx_playback_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_SUSPEND:
#ifdef CONFIG_SND_CS46XX_NEW_DSP
/* magic mute channel */
- snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
+ snd_cs46xx_poke(chip, (cpcm->pcm_channel->pcm_reader_scb->address +
SCBVolumeCtrl) << 2, 0xffffffff);
if (!cpcm->pcm_channel->unlinked)
@@ -865,13 +865,13 @@ static int snd_cs46xx_capture_trigger(struct snd_pcm_substream *substream,
}
#ifdef CONFIG_SND_CS46XX_NEW_DSP
-static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46xx_pcm *cpcm,
- int sample_rate)
+static int _cs46xx_adjust_sample_rate(struct snd_cs46xx *chip, struct snd_cs46xx_pcm *cpcm,
+ int sample_rate)
{
/* If PCMReaderSCB and SrcTaskSCB not created yet ... */
- if ( cpcm->pcm_channel == NULL) {
- cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate,
+ if (cpcm->pcm_channel == NULL) {
+ cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel(chip, sample_rate,
cpcm, cpcm->hw_buf.addr,cpcm->pcm_channel_id);
if (cpcm->pcm_channel == NULL) {
snd_printk(KERN_ERR "cs46xx: failed to create virtual PCM channel\n");
@@ -882,9 +882,9 @@ static int _cs46xx_adjust_sample_rate (struct snd_cs46xx *chip, struct snd_cs46x
/* if sample rate is changed */
if ((int)cpcm->pcm_channel->sample_rate != sample_rate) {
int unlinked = cpcm->pcm_channel->unlinked;
- cs46xx_dsp_destroy_pcm_channel (chip,cpcm->pcm_channel);
+ cs46xx_dsp_destroy_pcm_channel(chip,cpcm->pcm_channel);
- if ( (cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel (chip, sample_rate, cpcm,
+ if ((cpcm->pcm_channel = cs46xx_dsp_create_pcm_channel(chip, sample_rate, cpcm,
cpcm->hw_buf.addr,
cpcm->pcm_channel_id)) == NULL) {
snd_printk(KERN_ERR "cs46xx: failed to re-create virtual PCM channel\n");
@@ -1017,7 +1017,7 @@ static int snd_cs46xx_playback_hw_free(struct snd_pcm_substream *substream)
if (runtime->dma_area != cpcm->hw_buf.area)
snd_pcm_lib_free_pages(substream);
-
+
runtime->dma_area = NULL;
runtime->dma_addr = 0;
runtime->dma_bytes = 0;
@@ -1039,7 +1039,7 @@ static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream)
if (snd_BUG_ON(!cpcm->pcm_channel))
return -ENXIO;
- pfie = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 1) << 2 );
+ pfie = snd_cs46xx_peek(chip, (cpcm->pcm_channel->pcm_reader_scb->address + 1) << 2);
pfie &= ~0x0000f03f;
#else
/* old dsp */
@@ -1068,7 +1068,7 @@ static int snd_cs46xx_playback_prepare(struct snd_pcm_substream *substream)
if (snd_pcm_format_big_endian(runtime->format))
pfie |= 0x00004000;
}
-
+
memset(&cpcm->pcm_rec, 0, sizeof(cpcm->pcm_rec));
cpcm->pcm_rec.sw_buffer_size = snd_pcm_lib_buffer_bytes(substream);
cpcm->pcm_rec.hw_buffer_size = runtime->period_size * CS46XX_FRAGS << cpcm->shift;
@@ -1161,7 +1161,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
struct snd_cs46xx *chip = dev_id;
u32 status1;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
u32 status2;
int i;
struct snd_cs46xx_pcm *cpcm = NULL;
@@ -1181,7 +1181,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
for (i = 0; i < DSP_MAX_PCM_CHANNELS; ++i) {
if (i <= 15) {
- if ( status1 & (1 << i) ) {
+ if (status1 & (1 << i)) {
if (i == CS46XX_DSP_CAPTURE_CHANNEL) {
if (chip->capt.substream)
snd_pcm_period_elapsed(chip->capt.substream);
@@ -1195,8 +1195,8 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
}
}
} else {
- if ( status2 & (1 << (i - 16))) {
- if (ins->pcm_channels[i].active &&
+ if (status2 & (1 << (i - 16))) {
+ if (ins->pcm_channels[i].active &&
ins->pcm_channels[i].private_data &&
!ins->pcm_channels[i].unlinked) {
cpcm = ins->pcm_channels[i].private_data;
@@ -1220,7 +1220,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
if ((status1 & HISR_MIDI) && chip->rmidi) {
unsigned char c;
-
+
spin_lock(&chip->reg_lock);
while ((snd_cs46xx_peekBA0(chip, BA0_MIDSR) & MIDSR_RBE) == 0) {
c = snd_cs46xx_peekBA0(chip, BA0_MIDRP);
@@ -1251,7 +1251,7 @@ static irqreturn_t snd_cs46xx_interrupt(int irq, void *dev_id)
static struct snd_pcm_hardware snd_cs46xx_playback =
{
.info = (SNDRV_PCM_INFO_MMAP |
- SNDRV_PCM_INFO_INTERLEAVED |
+ SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER /*|*/
/*SNDRV_PCM_INFO_RESUME*/),
.formats = (SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_U8 |
@@ -1307,7 +1307,7 @@ static void snd_cs46xx_pcm_free_substream(struct snd_pcm_runtime *runtime)
kfree(runtime->private_data);
}
-static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,int pcm_channel_id)
+static int _cs46xx_playback_open_channel(struct snd_pcm_substream *substream, int pcm_channel_id)
{
struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
struct snd_cs46xx_pcm * cpcm;
@@ -1329,12 +1329,12 @@ static int _cs46xx_playback_open_channel (struct snd_pcm_substream *substream,in
cpcm->substream = substream;
#ifdef CONFIG_SND_CS46XX_NEW_DSP
mutex_lock(&chip->spos_mutex);
- cpcm->pcm_channel = NULL;
+ cpcm->pcm_channel = NULL;
cpcm->pcm_channel_id = pcm_channel_id;
snd_pcm_hw_constraint_list(runtime, 0,
- SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
&hw_constraints_period_sizes);
mutex_unlock(&chip->spos_mutex);
@@ -1389,7 +1389,7 @@ static int snd_cs46xx_playback_close_iec958(struct snd_pcm_substream *substream)
{
int err;
struct snd_cs46xx *chip = snd_pcm_substream_chip(substream);
-
+
snd_printdd("close raw iec958 channel\n");
err = snd_cs46xx_playback_close(substream);
@@ -1419,7 +1419,7 @@ static int snd_cs46xx_capture_open(struct snd_pcm_substream *substream)
#ifdef CONFIG_SND_CS46XX_NEW_DSP
snd_pcm_hw_constraint_list(substream->runtime, 0,
- SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
+ SNDRV_PCM_HW_PARAM_PERIOD_BYTES,
&hw_constraints_period_sizes);
#endif
return 0;
@@ -1734,7 +1734,7 @@ static void snd_cs46xx_mixer_free_ac97(struct snd_ac97 *ac97)
chip->ac97[CS46XX_SECONDARY_CODEC_INDEX] = NULL;
}
-static int snd_cs46xx_vol_info(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_vol_info(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_info *uinfo)
{
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
@@ -1758,7 +1758,7 @@ static int snd_cs46xx_vol_put(struct snd_kcontrol *kcontrol, struct snd_ctl_elem
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
int reg = kcontrol->private_value;
- unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 |
+ unsigned int val = ((0xffff - ucontrol->value.integer.value[0]) << 16 |
(0xffff - ucontrol->value.integer.value[1]));
unsigned int old = snd_cs46xx_peek(chip, reg);
int change = (old != val);
@@ -1827,7 +1827,7 @@ static int snd_cs46xx_vol_iec958_put(struct snd_kcontrol *kcontrol, struct snd_c
#define snd_mixer_boolean_info snd_ctl_boolean_mono_info
-static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -1841,7 +1841,7 @@ static int snd_cs46xx_iec958_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -1851,7 +1851,7 @@ static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
case CS46XX_MIXER_SPDIF_OUTPUT_ELEMENT:
mutex_lock(&chip->spos_mutex);
change = (chip->dsp_spos_instance->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED);
- if (ucontrol->value.integer.value[0] && !change)
+ if (ucontrol->value.integer.value[0] && !change)
cs46xx_dsp_enable_spdif_out(chip);
else if (change && !ucontrol->value.integer.value[0])
cs46xx_dsp_disable_spdif_out(chip);
@@ -1867,7 +1867,7 @@ static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
}
else if (change && !ucontrol->value.integer.value[0])
cs46xx_dsp_disable_spdif_in(chip);
-
+
res = (change != chip->dsp_spos_instance->spdif_status_in);
break;
default:
@@ -1878,25 +1878,25 @@ static int snd_cs46xx_iec958_put(struct snd_kcontrol *kcontrol,
return res;
}
-static int snd_cs46xx_adc_capture_get(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_adc_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- if (ins->adc_input != NULL)
+ if (ins->adc_input != NULL)
ucontrol->value.integer.value[0] = 1;
- else
+ else
ucontrol->value.integer.value[0] = 0;
-
+
return 0;
}
-static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int change = 0;
if (ucontrol->value.integer.value[0] && !ins->adc_input) {
@@ -1909,26 +1909,26 @@ static int snd_cs46xx_adc_capture_put(struct snd_kcontrol *kcontrol,
return change;
}
-static int snd_cs46xx_pcm_capture_get(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_pcm_capture_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- if (ins->pcm_input != NULL)
+ if (ins->pcm_input != NULL)
ucontrol->value.integer.value[0] = 1;
- else
+ else
ucontrol->value.integer.value[0] = 0;
return 0;
}
-static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int change = 0;
if (ucontrol->value.integer.value[0] && !ins->pcm_input) {
@@ -1942,7 +1942,7 @@ static int snd_cs46xx_pcm_capture_put(struct snd_kcontrol *kcontrol,
return change;
}
-static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol,
+static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -1959,8 +1959,8 @@ static int snd_herc_spdif_select_get(struct snd_kcontrol *kcontrol,
/*
* Game Theatre XP card - EGPIO[0] is used to select SPDIF input optical or coaxial.
- */
-static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
+ */
+static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -1969,9 +1969,9 @@ static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
if (ucontrol->value.integer.value[0]) {
/* optical is default */
- snd_cs46xx_pokeBA0(chip, BA0_EGPIODR,
+ snd_cs46xx_pokeBA0(chip, BA0_EGPIODR,
EGPIODR_GPOE0 | val1); /* enable EGPIO0 output */
- snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR,
+ snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR,
EGPIOPTR_GPPT0 | val2); /* open-drain on output */
} else {
/* coaxial */
@@ -1979,7 +1979,7 @@ static int snd_herc_spdif_select_put(struct snd_kcontrol *kcontrol,
snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, val2 & ~EGPIOPTR_GPPT0); /* disable */
}
- /* checking diff from the EGPIO direction register
+ /* checking diff from the EGPIO direction register
should be enough */
return (val1 != (int)snd_cs46xx_peekBA0(chip, BA0_EGPIODR));
}
@@ -1996,7 +1996,7 @@ static int snd_cs46xx_spdif_default_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
mutex_lock(&chip->spos_mutex);
ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_default >> 24) & 0xff);
@@ -2012,7 +2012,7 @@ static int snd_cs46xx_spdif_default_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned int val;
int change;
@@ -2027,7 +2027,7 @@ static int snd_cs46xx_spdif_default_put(struct snd_kcontrol *kcontrol,
change = (unsigned int)ins->spdif_csuv_default != val;
ins->spdif_csuv_default = val;
- if ( !(ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) )
+ if (!(ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN))
cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV,val);
mutex_unlock(&chip->spos_mutex);
@@ -2049,7 +2049,7 @@ static int snd_cs46xx_spdif_stream_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
mutex_lock(&chip->spos_mutex);
ucontrol->value.iec958.status[0] = _wrap_all_bits((ins->spdif_csuv_stream >> 24) & 0xff);
@@ -2065,7 +2065,7 @@ static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx * chip = snd_kcontrol_chip(kcontrol);
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned int val;
int change;
@@ -2080,7 +2080,7 @@ static int snd_cs46xx_spdif_stream_put(struct snd_kcontrol *kcontrol,
change = ins->spdif_csuv_stream != val;
ins->spdif_csuv_stream = val;
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN )
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN)
cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV,val);
mutex_unlock(&chip->spos_mutex);
@@ -2187,7 +2187,7 @@ static struct snd_kcontrol_new snd_cs46xx_controls[] __devinitdata = {
#ifdef CONFIG_SND_CS46XX_NEW_DSP
/* set primary cs4294 codec into Extended Audio Mode */
-static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -2197,7 +2197,7 @@ static int snd_cs46xx_front_dup_get(struct snd_kcontrol *kcontrol,
return 0;
}
-static int snd_cs46xx_front_dup_put(struct snd_kcontrol *kcontrol,
+static int snd_cs46xx_front_dup_put(struct snd_kcontrol *kcontrol,
struct snd_ctl_elem_value *ucontrol)
{
struct snd_cs46xx *chip = snd_kcontrol_chip(kcontrol);
@@ -2228,13 +2228,13 @@ static struct snd_kcontrol_new snd_hercules_controls[] = {
};
-static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97)
+static void snd_cs46xx_codec_reset(struct snd_ac97 *ac97)
{
unsigned long end_time;
int err;
/* reset to defaults */
- snd_ac97_write(ac97, AC97_RESET, 0);
+ snd_ac97_write(ac97, AC97_RESET, 0);
/* set the desired CODEC mode */
if (ac97->num == CS46XX_PRIMARY_CODEC_INDEX) {
@@ -2255,7 +2255,7 @@ static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97)
end_time = jiffies + HZ;
do {
unsigned short ext_mid;
-
+
/* use preliminary reads to settle the communication */
snd_ac97_read(ac97, AC97_RESET);
snd_ac97_read(ac97, AC97_VENDOR_ID1);
@@ -2273,7 +2273,7 @@ static void snd_cs46xx_codec_reset (struct snd_ac97 * ac97)
msleep(10);
} while (time_after_eq(end_time, jiffies));
- snd_printk(KERN_ERR "CS46xx secondary codec doesn't respond!\n");
+ snd_printk(KERN_ERR "CS46xx secondary codec doesn't respond!\n");
}
#endif
@@ -2338,7 +2338,7 @@ int __devinit snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device)
#ifdef CONFIG_SND_CS46XX_NEW_DSP
snd_printdd("snd_cs46xx: detecting seconadry codec\n");
/* try detect a secondary codec */
- if (! cs46xx_detect_codec(chip, CS46XX_SECONDARY_CODEC_INDEX))
+ if (!cs46xx_detect_codec(chip, CS46XX_SECONDARY_CODEC_INDEX))
chip->nr_ac97_codecs = 2;
#endif /* CONFIG_SND_CS46XX_NEW_DSP */
@@ -2357,7 +2357,7 @@ int __devinit snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device)
id.iface = SNDRV_CTL_ELEM_IFACE_MIXER;
strcpy(id.name, "External Amplifier");
chip->eapd_switch = snd_ctl_find_id(chip->card, &id);
-
+
#ifdef CONFIG_SND_CS46XX_NEW_DSP
if (chip->nr_ac97_codecs == 1) {
unsigned int id2 = chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]->id & 0xffff;
@@ -2378,7 +2378,7 @@ int __devinit snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device)
/* turn on amplifier */
chip->amplifier_ctrl(chip, 1);
-
+
return 0;
}
@@ -2563,7 +2563,7 @@ static void snd_cs46xx_gameport_trigger(struct gameport *gameport)
if (snd_BUG_ON(!chip))
return;
- snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); //outb(gameport->io, 0xFF);
+ snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF); /* outb(gameport->io, 0xFF); */
}
static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport)
@@ -2572,7 +2572,7 @@ static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport)
if (snd_BUG_ON(!chip))
return 0;
- return snd_cs46xx_peekBA0(chip, BA0_JSPT); //inb(gameport->io);
+ return snd_cs46xx_peekBA0(chip, BA0_JSPT); /* inb(gameport->io); */
}
static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
@@ -2586,16 +2586,16 @@ static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes,
js1 = snd_cs46xx_peekBA0(chip, BA0_JSC1);
js2 = snd_cs46xx_peekBA0(chip, BA0_JSC2);
jst = snd_cs46xx_peekBA0(chip, BA0_JSPT);
-
- *buttons = (~jst >> 4) & 0x0F;
-
+
+ *buttons = (~jst >> 4) & 0x0F;
+
axes[0] = ((js1 & JSC1_Y1V_MASK) >> JSC1_Y1V_SHIFT) & 0xFFFF;
axes[1] = ((js1 & JSC1_X1V_MASK) >> JSC1_X1V_SHIFT) & 0xFFFF;
axes[2] = ((js2 & JSC2_Y2V_MASK) >> JSC2_Y2V_SHIFT) & 0xFFFF;
axes[3] = ((js2 & JSC2_X2V_MASK) >> JSC2_X2V_SHIFT) & 0xFFFF;
- for(jst=0;jst<4;++jst)
- if(axes[jst]==0xFFFF) axes[jst] = -1;
+ for (jst=0; jst<4; ++jst)
+ if (axes[jst]==0xFFFF) axes[jst] = -1;
return 0;
}
@@ -2632,7 +2632,7 @@ int __devinit snd_cs46xx_gameport(struct snd_cs46xx *chip)
gp->trigger = snd_cs46xx_gameport_trigger;
gp->cooked_read = snd_cs46xx_gameport_cooked_read;
- snd_cs46xx_pokeBA0(chip, BA0_JSIO, 0xFF); // ?
+ snd_cs46xx_pokeBA0(chip, BA0_JSIO, 0xFF); /* ? */
snd_cs46xx_pokeBA0(chip, BA0_JSCTL, JSCTL_SP_MEDIUM_SLOW);
gameport_register_port(gp);
@@ -2663,7 +2663,7 @@ static long snd_cs46xx_io_read(struct snd_info_entry *entry, void *file_private_
{
long size;
struct snd_cs46xx_region *region = entry->private_data;
-
+
size = count;
if (pos + (size_t)size > region->size)
size = region->size - pos;
@@ -2682,10 +2682,10 @@ static int __devinit snd_cs46xx_proc_init(struct snd_card *card, struct snd_cs46
{
struct snd_info_entry *entry;
int idx;
-
+
for (idx = 0; idx < 5; idx++) {
struct snd_cs46xx_region *region = &chip->region.idx[idx];
- if (! snd_card_proc_new(card, region->name, &entry)) {
+ if (!snd_card_proc_new(card, region->name, &entry)) {
entry->content = SNDRV_INFO_CONTENT_DATA;
entry->private_data = chip;
entry->c.ops = &snd_cs46xx_proc_io_ops;
@@ -2753,7 +2753,7 @@ static void snd_cs46xx_hw_stop(struct snd_cs46xx *chip)
snd_cs46xx_pokeBA0(chip, BA0_CLKCR1, 0);
/*
- * Turn off the Processor by turning off the software clock enable flag in
+ * Turn off the Processor by turning off the software clock enable flag in
* the clock control register.
*/
tmp = snd_cs46xx_peekBA0(chip, BA0_CLKCR1) & ~CLKCR1_SWCE;
@@ -2775,7 +2775,7 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip)
if (chip->amplifier_ctrl)
chip->amplifier_ctrl(chip, -chip->amplifier); /* force to off */
-
+
snd_cs46xx_proc_done(chip);
if (chip->region.idx[0].resource)
@@ -2800,7 +2800,7 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip)
chip->dsp_spos_instance = NULL;
}
#endif
-
+
#ifdef CONFIG_PM
kfree(chip->saved_regs);
#endif
@@ -2823,7 +2823,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
{
int timeout;
- /*
+ /*
* First, blast the clock control register to zero so that the PLL starts
* out in a known state, and blast the master serial port control register
* to zero so that the serial ports also start out in a known state.
@@ -2834,9 +2834,9 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
/*
* If we are in AC97 mode, then we must set the part to a host controlled
* AC-link. Otherwise, we won't be able to bring up the link.
- */
+ */
#ifdef CONFIG_SND_CS46XX_NEW_DSP
- snd_cs46xx_pokeBA0(chip, BA0_SERACC, SERACC_HSP | SERACC_CHIP_TYPE_2_0 |
+ snd_cs46xx_pokeBA0(chip, BA0_SERACC, SERACC_HSP | SERACC_CHIP_TYPE_2_0 |
SERACC_TWO_CODECS); /* 2.00 dual codecs */
/* snd_cs46xx_pokeBA0(chip, BA0_SERACC, SERACC_HSP | SERACC_CHIP_TYPE_2_0); */ /* 2.00 codec */
#else
@@ -2858,7 +2858,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
#ifdef CONFIG_SND_CS46XX_NEW_DSP
snd_cs46xx_pokeBA0(chip, BA0_ACCTL2, ACCTL_RSTN);
#endif
-
+
/*
* The first thing we do here is to enable sync generation. As soon
* as we start receiving bit clock, we'll start producing the SYNC
@@ -2966,7 +2966,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
for (count = 0; count < 150; count++) {
/* First, we want to wait for a short time. */
udelay(25);
-
+
if (snd_cs46xx_peekBA0(chip, BA0_ACSTS2) & ACSTS_CRDY)
break;
}
@@ -3009,7 +3009,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
return -EIO;
#else
/* This may happen on a cold boot with a Terratec SiXPack 5.1.
- Reloading the driver may help, if there's other soundcards
+ Reloading the driver may help, if there's other soundcards
with the same problem I would like to know. (Benny) */
snd_printk(KERN_ERR "ERROR: snd-cs46xx: never read ISV3 & ISV4 from AC'97\n");
@@ -3036,7 +3036,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
/* snd_cs46xx_pokeBA0(chip, BA0_AC97_POWERDOWN, 0x300); */
/*
- * Turn off the Processor by turning off the software clock enable flag in
+ * Turn off the Processor by turning off the software clock enable flag in
* the clock control register.
*/
/* tmp = snd_cs46xx_peekBA0(chip, BA0_CLKCR1) & ~CLKCR1_SWCE; */
@@ -3046,7 +3046,7 @@ static int snd_cs46xx_chip_init(struct snd_cs46xx *chip)
}
/*
- * start and load DSP
+ * start and load DSP
*/
static void cs46xx_enable_stream_irqs(struct snd_cs46xx *chip)
@@ -3054,7 +3054,7 @@ static void cs46xx_enable_stream_irqs(struct snd_cs46xx *chip)
unsigned int tmp;
snd_cs46xx_pokeBA0(chip, BA0_HICR, HICR_IEV | HICR_CHGM);
-
+
tmp = snd_cs46xx_peek(chip, BA1_PFIE);
tmp &= ~0x0000f03f;
snd_cs46xx_poke(chip, BA1_PFIE, tmp); /* playback interrupt enable */
@@ -3066,7 +3066,7 @@ static void cs46xx_enable_stream_irqs(struct snd_cs46xx *chip)
}
int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip)
-{
+{
unsigned int tmp;
/*
* Reset the processor.
@@ -3140,9 +3140,9 @@ int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip)
snd_cs46xx_proc_start(chip);
cs46xx_enable_stream_irqs(chip);
-
+
#ifndef CONFIG_SND_CS46XX_NEW_DSP
- /* set the attenuation to 0dB */
+ /* set the attenuation to 0dB */
snd_cs46xx_poke(chip, BA1_PVOL, 0x80008000);
snd_cs46xx_poke(chip, BA1_CVOL, 0x80008000);
#endif
@@ -3154,15 +3154,15 @@ int __devinit snd_cs46xx_start_dsp(struct snd_cs46xx *chip)
/*
* AMP control - null AMP
*/
-
+
static void amp_none(struct snd_cs46xx *chip, int change)
-{
+{
}
#ifdef CONFIG_SND_CS46XX_NEW_DSP
static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
{
-
+
u32 idx, valid_slots,tmp,powerdown = 0;
u16 modem_power,pin_config,logic_type;
@@ -3183,39 +3183,39 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
* Clear PRA. The Bonzo chip will be used for GPIO not for modem
* stuff.
*/
- if(chip->nr_ac97_codecs != 2) {
+ if (chip->nr_ac97_codecs != 2) {
snd_printk (KERN_ERR "cs46xx: cs46xx_setup_eapd_slot() - no secondary codec configured\n");
return -EINVAL;
}
- modem_power = snd_cs46xx_codec_read (chip,
+ modem_power = snd_cs46xx_codec_read (chip,
AC97_EXTENDED_MSTATUS,
CS46XX_SECONDARY_CODEC_INDEX);
modem_power &=0xFEFF;
- snd_cs46xx_codec_write(chip,
+ snd_cs46xx_codec_write(chip,
AC97_EXTENDED_MSTATUS, modem_power,
CS46XX_SECONDARY_CODEC_INDEX);
/*
* Set GPIO pin's 7 and 8 so that they are configured for output.
*/
- pin_config = snd_cs46xx_codec_read (chip,
+ pin_config = snd_cs46xx_codec_read (chip,
AC97_GPIO_CFG,
CS46XX_SECONDARY_CODEC_INDEX);
pin_config &=0x27F;
- snd_cs46xx_codec_write(chip,
+ snd_cs46xx_codec_write(chip,
AC97_GPIO_CFG, pin_config,
CS46XX_SECONDARY_CODEC_INDEX);
-
+
/*
* Set GPIO pin's 7 and 8 so that they are compatible with CMOS logic.
*/
logic_type = snd_cs46xx_codec_read(chip, AC97_GPIO_POLARITY,
CS46XX_SECONDARY_CODEC_INDEX);
- logic_type &=0x27F;
+ logic_type &=0x27F;
snd_cs46xx_codec_write (chip, AC97_GPIO_POLARITY, logic_type,
CS46XX_SECONDARY_CODEC_INDEX);
@@ -3224,16 +3224,16 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
valid_slots |= 0x200;
snd_cs46xx_pokeBA0(chip, BA0_ACOSV, valid_slots);
- if ( cs46xx_wait_for_fifo(chip,1) ) {
+ if (cs46xx_wait_for_fifo(chip,1)) {
snd_printdd("FIFO is busy\n");
-
+
return -EINVAL;
}
/*
- * Fill slots 12 with the correct value for the GPIO pins.
+ * Fill slots 12 with the correct value for the GPIO pins.
*/
- for(idx = 0x90; idx <= 0x9F; idx++) {
+ for (idx = 0x90; idx <= 0x9F; idx++) {
/*
* Initialize the fifo so that bits 7 and 8 are on.
*
@@ -3245,17 +3245,17 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
/*
* Wait for command to complete
*/
- if ( cs46xx_wait_for_fifo(chip,200) ) {
+ if (cs46xx_wait_for_fifo(chip,200)) {
snd_printdd("failed waiting for FIFO at addr (%02X)\n",idx);
return -EINVAL;
}
-
+
/*
* Write the serial port FIFO index.
*/
snd_cs46xx_pokeBA0(chip, BA0_SERBAD, idx);
-
+
/*
* Tell the serial port to load the new value into the FIFO location.
*/
@@ -3279,17 +3279,17 @@ static int voyetra_setup_eapd_slot(struct snd_cs46xx *chip)
/*
* Crystal EAPD mode
*/
-
+
static void amp_voyetra(struct snd_cs46xx *chip, int change)
{
- /* Manage the EAPD bit on the Crystal 4297
+ /* Manage the EAPD bit on the Crystal 4297
and the Analog AD1885 */
-
+
#ifdef CONFIG_SND_CS46XX_NEW_DSP
int old = chip->amplifier;
#endif
int oval, val;
-
+
chip->amplifier += change;
oval = snd_cs46xx_codec_read(chip, AC97_POWERDOWN,
CS46XX_PRIMARY_CODEC_INDEX);
@@ -3316,7 +3316,7 @@ static void amp_voyetra(struct snd_cs46xx *chip, int change)
#endif
}
-static void hercules_init(struct snd_cs46xx *chip)
+static void hercules_init(struct snd_cs46xx *chip)
{
/* default: AMP off, and SPDIF input optical */
snd_cs46xx_pokeBA0(chip, BA0_EGPIODR, EGPIODR_GPOE0);
@@ -3326,7 +3326,7 @@ static void hercules_init(struct snd_cs46xx *chip)
/*
* Game Theatre XP card - EGPIO[2] is used to enable the external amp.
- */
+ */
static void amp_hercules(struct snd_cs46xx *chip, int change)
{
int old = chip->amplifier;
@@ -3337,9 +3337,9 @@ static void amp_hercules(struct snd_cs46xx *chip, int change)
if (chip->amplifier && !old) {
snd_printdd ("Hercules amplifier ON\n");
- snd_cs46xx_pokeBA0(chip, BA0_EGPIODR,
+ snd_cs46xx_pokeBA0(chip, BA0_EGPIODR,
EGPIODR_GPOE2 | val1); /* enable EGPIO2 output */
- snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR,
+ snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR,
EGPIOPTR_GPPT2 | val2); /* open-drain on output */
} else if (old && !chip->amplifier) {
snd_printdd ("Hercules amplifier OFF\n");
@@ -3348,7 +3348,7 @@ static void amp_hercules(struct snd_cs46xx *chip, int change)
}
}
-static void voyetra_mixer_init (struct snd_cs46xx *chip)
+static void voyetra_mixer_init(struct snd_cs46xx *chip)
{
snd_printdd ("initializing Voyetra mixer\n");
@@ -3357,7 +3357,7 @@ static void voyetra_mixer_init (struct snd_cs46xx *chip)
snd_cs46xx_pokeBA0(chip, BA0_EGPIOPTR, EGPIODR_GPOE0);
}
-static void hercules_mixer_init (struct snd_cs46xx *chip)
+static void hercules_mixer_init(struct snd_cs46xx *chip)
{
#ifdef CONFIG_SND_CS46XX_NEW_DSP
unsigned int idx;
@@ -3374,7 +3374,7 @@ static void hercules_mixer_init (struct snd_cs46xx *chip)
if (chip->in_suspend)
return;
- for (idx = 0 ; idx < ARRAY_SIZE(snd_hercules_controls); idx++) {
+ for (idx = 0; idx < ARRAY_SIZE(snd_hercules_controls); idx++) {
struct snd_kcontrol *kctl;
kctl = snd_ctl_new1(&snd_hercules_controls[idx], chip);
@@ -3391,7 +3391,7 @@ static void hercules_mixer_init (struct snd_cs46xx *chip)
/*
* Untested
*/
-
+
static void amp_voyetra_4294(struct snd_cs46xx *chip, int change)
{
chip->amplifier += change;
@@ -3421,21 +3421,21 @@ static void amp_voyetra_4294(struct snd_cs46xx *chip, int change)
* Linuxcare. Perhaps one day Crystal will document their chips well
* enough to make them useful.
*/
-
+
static void clkrun_hack(struct snd_cs46xx *chip, int change)
{
u16 control, nval;
-
+
if (!chip->acpi_port)
return;
chip->amplifier += change;
-
- /* Read ACPI port */
+
+ /* Read ACPI port */
nval = control = inw(chip->acpi_port + 0x10);
/* Flip CLKRUN off while running */
- if (! chip->amplifier)
+ if (!chip->amplifier)
nval |= 0x2000;
else
nval &= ~0x2000;
@@ -3443,7 +3443,7 @@ static void clkrun_hack(struct snd_cs46xx *chip, int change)
outw(nval, chip->acpi_port + 0x10);
}
-
+
/*
* detect intel piix4
*/
@@ -3453,13 +3453,13 @@ static void clkrun_init(struct snd_cs46xx *chip)
u8 pp;
chip->acpi_port = 0;
-
+
pdev = pci_get_device(PCI_VENDOR_ID_INTEL,
PCI_DEVICE_ID_INTEL_82371AB_3, NULL);
if (pdev == NULL)
return; /* Not a thinkpad thats for sure */
- /* Find the control port */
+ /* Find the control port */
pci_read_config_byte(pdev, 0x41, &pp);
chip->acpi_port = pp << 8;
pci_dev_put(pdev);
@@ -3469,7 +3469,7 @@ static void clkrun_init(struct snd_cs46xx *chip)
/*
* Card subid table
*/
-
+
struct cs_card_type
{
u16 vendor;
@@ -3595,8 +3595,8 @@ int snd_cs46xx_suspend(struct pci_dev *pci, pm_message_t state)
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
chip->in_suspend = 1;
snd_pcm_suspend_all(chip->pcm);
- // chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL);
- // chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE);
+ /* chip->ac97_powerdown = snd_cs46xx_codec_read(chip, AC97_POWER_CONTROL); */
+ /* chip->ac97_general_purpose = snd_cs46xx_codec_read(chip, BA0_AC97_GENERAL_PURPOSE); */
snd_ac97_suspend(chip->ac97[CS46XX_PRIMARY_CODEC_INDEX]);
snd_ac97_suspend(chip->ac97[CS46XX_SECONDARY_CODEC_INDEX]);
@@ -3652,9 +3652,9 @@ int snd_cs46xx_resume(struct pci_dev *pci)
#endif
#if 0
- snd_cs46xx_codec_write(chip, BA0_AC97_GENERAL_PURPOSE,
+ snd_cs46xx_codec_write(chip, BA0_AC97_GENERAL_PURPOSE,
chip->ac97_general_purpose);
- snd_cs46xx_codec_write(chip, AC97_POWER_CONTROL,
+ snd_cs46xx_codec_write(chip, AC97_POWER_CONTROL,
chip->ac97_powerdown);
mdelay(10);
snd_cs46xx_codec_write(chip, BA0_AC97_POWERDOWN,
@@ -3700,7 +3700,7 @@ int __devinit snd_cs46xx_create(struct snd_card *card,
static struct snd_device_ops ops = {
.dev_free = snd_cs46xx_dev_free,
};
-
+
*rchip = NULL;
/* enable PCI device */
@@ -3782,7 +3782,7 @@ int __devinit snd_cs46xx_create(struct snd_card *card,
chip->active_ctrl = clkrun_hack;
clkrun_init(chip);
}
-
+
if (chip->amplifier_ctrl == NULL)
chip->amplifier_ctrl = amp_none;
if (chip->active_ctrl == NULL)
@@ -3835,7 +3835,7 @@ int __devinit snd_cs46xx_create(struct snd_card *card,
snd_cs46xx_free(chip);
return err;
}
-
+
snd_cs46xx_proc_init(card, chip);
#ifdef CONFIG_PM
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c
index f4f0c8f..ad6e433 100644
--- a/sound/pci/cs46xx/dsp_spos.c
+++ b/sound/pci/cs46xx/dsp_spos.c
@@ -20,7 +20,7 @@
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/init.h>
@@ -37,10 +37,10 @@
#include "cs46xx_lib.h"
#include "dsp_spos.h"
-static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
- struct dsp_scb_descriptor * fg_entry);
+static int cs46xx_dsp_async_init(struct snd_cs46xx *chip,
+ struct dsp_scb_descriptor *fg_entry);
-static enum wide_opcode wide_opcodes[] = {
+static enum wide_opcode wide_opcodes[] = {
WIDE_FOR_BEGIN_LOOP,
WIDE_FOR_BEGIN_LOOP2,
WIDE_COND_GOTO_ADDR,
@@ -55,17 +55,17 @@ static enum wide_opcode wide_opcodes[] = {
WIDE_TBEQ_NCOND_CALL1_ADDR
};
-static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32 size,
+static int shadow_and_reallocate_code(struct snd_cs46xx *chip, u32 *data, u32 size,
u32 overlay_begin_address)
{
unsigned int i = 0, j, nreallocated = 0;
u32 hival,loval,address;
u32 mop_operands,mop_type,wide_op;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(size %2))
return -EINVAL;
-
+
while (i < size) {
loval = data[i++];
hival = data[i++];
@@ -73,37 +73,37 @@ static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32
if (ins->code.offset > 0) {
mop_operands = (hival >> 6) & 0x03fff;
mop_type = mop_operands >> 10;
-
+
/* check for wide type instruction */
if (mop_type == 0 &&
(mop_operands & WIDE_LADD_INSTR_MASK) == 0 &&
(mop_operands & WIDE_INSTR_MASK) != 0) {
wide_op = loval & 0x7f;
- for (j = 0;j < ARRAY_SIZE(wide_opcodes); ++j) {
+ for (j = 0; j < ARRAY_SIZE(wide_opcodes); ++j) {
if (wide_opcodes[j] == wide_op) {
/* need to reallocate instruction */
address = (hival & 0x00FFF) << 5;
address |= loval >> 15;
-
+
snd_printdd("handle_wideop[1]: %05x:%05x addr %04x\n",hival,loval,address);
-
- if ( !(address & 0x8000) ) {
+
+ if (!(address & 0x8000)) {
address += (ins->code.offset / 2) - overlay_begin_address;
} else {
snd_printdd("handle_wideop[1]: ROM symbol not reallocated\n");
}
-
+
hival &= 0xFF000;
loval &= 0x07FFF;
-
+
hival |= ( (address >> 5) & 0x00FFF);
loval |= ( (address << 15) & 0xF8000);
-
+
address = (hival & 0x00FFF) << 5;
address |= loval >> 15;
-
- snd_printdd("handle_wideop:[2] %05x:%05x addr %04x\n",hival,loval,address);
- nreallocated ++;
+
+ snd_printdd("handle_wideop:[2] %05x:%05x addr %04x\n",hival,loval,address);
+ nreallocated++;
} /* wide_opcodes[j] == wide_op */
} /* for */
} /* mod_type == 0 ... */
@@ -117,10 +117,10 @@ static int shadow_and_reallocate_code (struct snd_cs46xx * chip, u32 * data, u32
return nreallocated;
}
-static struct dsp_segment_desc * get_segment_desc (struct dsp_module_desc * module, int seg_type)
+static struct dsp_segment_desc *get_segment_desc(struct dsp_module_desc *module, int seg_type)
{
int i;
- for (i = 0;i < module->nsegments; ++i) {
+ for (i = 0; i < module->nsegments; ++i) {
if (module->segments[i].segment_type == seg_type) {
return (module->segments + i);
}
@@ -129,7 +129,7 @@ static struct dsp_segment_desc * get_segment_desc (struct dsp_module_desc * modu
return NULL;
};
-static int find_free_symbol_index (struct dsp_spos_instance * ins)
+static int find_free_symbol_index(struct dsp_spos_instance *ins)
{
int index = ins->symbol_table.nsymbols,i;
@@ -143,19 +143,19 @@ static int find_free_symbol_index (struct dsp_spos_instance * ins)
return index;
}
-static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * module)
+static int add_symbols(struct snd_cs46xx *chip, struct dsp_module_desc *module)
{
int i;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (module->symbol_table.nsymbols > 0) {
if (!strcmp(module->symbol_table.symbols[0].symbol_name, "OVERLAYBEGINADDRESS") &&
- module->symbol_table.symbols[0].symbol_type == SYMBOL_CONSTANT ) {
+ module->symbol_table.symbols[0].symbol_type == SYMBOL_CONSTANT) {
module->overlay_begin_address = module->symbol_table.symbols[0].address;
}
}
- for (i = 0;i < module->symbol_table.nsymbols; ++i) {
+ for (i = 0; i < module->symbol_table.nsymbols; ++i) {
if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) {
snd_printk(KERN_ERR "dsp_spos: symbol table is full\n");
return -ENOMEM;
@@ -171,7 +171,7 @@ static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * modul
ins->symbol_table.symbols[ins->symbol_table.nsymbols].module = module;
ins->symbol_table.symbols[ins->symbol_table.nsymbols].deleted = 0;
- if (ins->symbol_table.nsymbols > ins->symbol_table.highest_frag_index)
+ if (ins->symbol_table.nsymbols > ins->symbol_table.highest_frag_index)
ins->symbol_table.highest_frag_index = ins->symbol_table.nsymbols;
ins->symbol_table.nsymbols++;
@@ -185,17 +185,17 @@ static int add_symbols (struct snd_cs46xx * chip, struct dsp_module_desc * modul
}
static struct dsp_symbol_entry *
-add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type)
+add_symbol(struct snd_cs46xx *chip, char *symbol_name, u32 address, int type)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_symbol_entry * symbol = NULL;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_symbol_entry *symbol = NULL;
int index;
if (ins->symbol_table.nsymbols == (DSP_MAX_SYMBOLS - 1)) {
snd_printk(KERN_ERR "dsp_spos: symbol table is full\n");
return NULL;
}
-
+
if (cs46xx_dsp_lookup_symbol(chip,
symbol_name,
type) != NULL) {
@@ -212,7 +212,7 @@ add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type)
ins->symbol_table.symbols[index].deleted = 0;
symbol = (ins->symbol_table.symbols + index);
- if (index > ins->symbol_table.highest_frag_index)
+ if (index > ins->symbol_table.highest_frag_index)
ins->symbol_table.highest_frag_index = index;
if (index == ins->symbol_table.nsymbols)
@@ -221,11 +221,11 @@ add_symbol (struct snd_cs46xx * chip, char * symbol_name, u32 address, int type)
return symbol;
}
-struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
+struct dsp_spos_instance *cs46xx_dsp_spos_create(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = kzalloc(sizeof(struct dsp_spos_instance), GFP_KERNEL);
+ struct dsp_spos_instance *ins = kzalloc(sizeof(struct dsp_spos_instance), GFP_KERNEL);
- if (ins == NULL)
+ if (ins == NULL)
return NULL;
/* better to use vmalloc for this big table */
@@ -271,8 +271,8 @@ struct dsp_spos_instance *cs46xx_dsp_spos_create (struct snd_cs46xx * chip)
/* set left and right validity bits and
default channel status */
- ins->spdif_csuv_default =
- ins->spdif_csuv_stream =
+ ins->spdif_csuv_default =
+ ins->spdif_csuv_stream =
/* byte 0 */ ((unsigned int)_wrap_all_bits( (SNDRV_PCM_DEFAULT_CON_SPDIF & 0xff)) << 24) |
/* byte 1 */ ((unsigned int)_wrap_all_bits( ((SNDRV_PCM_DEFAULT_CON_SPDIF >> 8) & 0xff)) << 16) |
/* byte 3 */ (unsigned int)_wrap_all_bits( (SNDRV_PCM_DEFAULT_CON_SPDIF >> 24) & 0xff) |
@@ -285,10 +285,10 @@ error:
return NULL;
}
-void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)
+void cs46xx_dsp_spos_destroy(struct snd_cs46xx *chip)
{
int i;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins))
return;
@@ -297,7 +297,7 @@ void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip)
for (i = 0; i < ins->nscb; ++i) {
if (ins->scbs[i].deleted) continue;
- cs46xx_dsp_proc_free_scb_desc ( (ins->scbs + i) );
+ cs46xx_dsp_proc_free_scb_desc ( (ins->scbs + i));
}
kfree(ins->code.data);
@@ -354,10 +354,10 @@ static int dsp_load_sample(struct snd_cs46xx *chip,
return 0;
}
-int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module)
+int cs46xx_dsp_load_module(struct snd_cs46xx *chip, struct dsp_module_desc *module)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_segment_desc * code = get_segment_desc (module,SEGTYPE_SP_PROGRAM);
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_segment_desc *code = get_segment_desc (module,SEGTYPE_SP_PROGRAM);
u32 doffset, dsize;
int err;
@@ -367,12 +367,12 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m
}
snd_printdd("dsp_spos: loading module %s into DSP\n", module->module_name);
-
+
if (ins->nmodules == 0) {
snd_printdd("dsp_spos: clearing parameter area\n");
snd_cs46xx_clear_BA1(chip, DSP_PARAMETER_BYTE_OFFSET, DSP_PARAMETER_BYTE_SIZE);
}
-
+
err = dsp_load_parameter(chip, get_segment_desc(module,
SEGTYPE_SP_PARAMETER));
if (err < 0)
@@ -412,11 +412,11 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m
snd_printk(KERN_ERR "dsp_spos: failed to load symbol table\n");
return -ENOMEM;
}
-
+
doffset = (code->offset * 4 + ins->code.offset * 4 + DSP_CODE_BYTE_OFFSET);
dsize = code->size * 4;
snd_printdd("dsp_spos: downloading code to chip (%08x-%08x)\n",
- doffset,doffset + dsize);
+ doffset,doffset + dsize);
module->nfixups = shadow_and_reallocate_code(chip,code->data,code->size,module->overlay_begin_address);
@@ -438,12 +438,12 @@ int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * m
}
struct dsp_symbol_entry *
-cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symbol_type)
+cs46xx_dsp_lookup_symbol(struct snd_cs46xx *chip, char *symbol_name, int symbol_type)
{
int i;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
+ for (i = 0; i < ins->symbol_table.nsymbols; ++i) {
if (ins->symbol_table.symbols[i].deleted)
continue;
@@ -465,12 +465,12 @@ cs46xx_dsp_lookup_symbol (struct snd_cs46xx * chip, char * symbol_name, int symb
#ifdef CONFIG_PROC_FS
static struct dsp_symbol_entry *
-cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol_type)
+cs46xx_dsp_lookup_symbol_addr(struct snd_cs46xx *chip, u32 address, int symbol_type)
{
int i;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
+ for (i = 0; i < ins->symbol_table.nsymbols; ++i) {
if (ins->symbol_table.symbols[i].deleted)
continue;
@@ -486,15 +486,15 @@ cs46xx_dsp_lookup_symbol_addr (struct snd_cs46xx * chip, u32 address, int symbol
}
-static void cs46xx_dsp_proc_symbol_table_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_symbol_table_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i;
snd_iprintf(buffer, "SYMBOLS:\n");
- for ( i = 0; i < ins->symbol_table.nsymbols; ++i ) {
+ for (i = 0; i < ins->symbol_table.nsymbols; ++i) {
char *module_str = "system";
if (ins->symbol_table.symbols[i].deleted)
@@ -504,32 +504,32 @@ static void cs46xx_dsp_proc_symbol_table_read (struct snd_info_entry *entry,
module_str = ins->symbol_table.symbols[i].module->module_name;
}
-
+
snd_iprintf(buffer, "%04X <%02X> %s [%s]\n",
ins->symbol_table.symbols[i].address,
ins->symbol_table.symbols[i].symbol_type,
ins->symbol_table.symbols[i].symbol_name,
- module_str);
+ module_str);
}
}
-static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_modules_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i,j;
mutex_lock(&chip->spos_mutex);
snd_iprintf(buffer, "MODULES:\n");
- for ( i = 0; i < ins->nmodules; ++i ) {
+ for (i = 0; i < ins->nmodules; ++i) {
snd_iprintf(buffer, "\n%s:\n", ins->modules[i].module_name);
snd_iprintf(buffer, " %d symbols\n", ins->modules[i].symbol_table.nsymbols);
snd_iprintf(buffer, " %d fixups\n", ins->modules[i].nfixups);
for (j = 0; j < ins->modules[i].nsegments; ++ j) {
- struct dsp_segment_desc * desc = (ins->modules[i].segments + j);
+ struct dsp_segment_desc *desc = (ins->modules[i].segments + j);
snd_iprintf(buffer, " segment %02x offset %08x size %08x\n",
desc->segment_type,desc->offset, desc->size);
}
@@ -537,20 +537,20 @@ static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry,
mutex_unlock(&chip->spos_mutex);
}
-static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_task_tree_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i, j, col;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
mutex_lock(&chip->spos_mutex);
snd_iprintf(buffer, "TASK TREES:\n");
- for ( i = 0; i < ins->ntask; ++i) {
+ for (i = 0; i < ins->ntask; ++i) {
snd_iprintf(buffer,"\n%04x %s:\n",ins->tasks[i].address,ins->tasks[i].task_name);
- for (col = 0,j = 0;j < ins->tasks[i].size; j++,col++) {
+ for (col = 0,j = 0; j < ins->tasks[i].size; j++, col++) {
u32 val;
if (col == 4) {
snd_iprintf(buffer,"\n");
@@ -561,26 +561,26 @@ static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry,
}
}
- snd_iprintf(buffer,"\n");
+ snd_iprintf(buffer,"\n");
mutex_unlock(&chip->spos_mutex);
}
-static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_scb_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i;
mutex_lock(&chip->spos_mutex);
snd_iprintf(buffer, "SCB's:\n");
- for ( i = 0; i < ins->nscb; ++i) {
+ for (i = 0; i < ins->nscb; ++i) {
if (ins->scbs[i].deleted)
continue;
snd_iprintf(buffer,"\n%04x %s:\n\n",ins->scbs[i].address,ins->scbs[i].scb_name);
if (ins->scbs[i].parent_scb_ptr != NULL) {
- snd_iprintf(buffer,"parent [%s:%04x] ",
+ snd_iprintf(buffer,"parent [%s:%04x] ",
ins->scbs[i].parent_scb_ptr->scb_name,
ins->scbs[i].parent_scb_ptr->address);
} else snd_iprintf(buffer,"parent [none] ");
@@ -598,22 +598,22 @@ static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry,
mutex_unlock(&chip->spos_mutex);
}
-static void cs46xx_dsp_proc_parameter_dump_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_parameter_dump_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- /*struct dsp_spos_instance * ins = chip->dsp_spos_instance; */
+ /*struct dsp_spos_instance *ins = chip->dsp_spos_instance; */
unsigned int i, col = 0;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
- struct dsp_symbol_entry * symbol;
+ struct dsp_symbol_entry *symbol;
- for (i = 0;i < DSP_PARAMETER_BYTE_SIZE; i += sizeof(u32),col ++) {
+ for (i = 0; i < DSP_PARAMETER_BYTE_SIZE; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
}
- if ( (symbol = cs46xx_dsp_lookup_symbol_addr (chip,i / sizeof(u32), SYMBOL_PARAMETER)) != NULL) {
+ if ((symbol = cs46xx_dsp_lookup_symbol_addr (chip,i / sizeof(u32), SYMBOL_PARAMETER)) != NULL) {
col = 0;
snd_iprintf (buffer,"\n%s:\n",symbol->symbol_name);
}
@@ -626,15 +626,15 @@ static void cs46xx_dsp_proc_parameter_dump_read (struct snd_info_entry *entry,
}
}
-static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_sample_dump_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_cs46xx *chip = entry->private_data;
- int i,col = 0;
+ int i, col = 0;
void __iomem *dst = chip->region.idx[2].remap_addr;
snd_iprintf(buffer,"PCMREADER:\n");
- for (i = PCM_READER_BUF1;i < PCM_READER_BUF1 + 0x30; i += sizeof(u32),col ++) {
+ for (i = PCM_READER_BUF1; i < PCM_READER_BUF1 + 0x30; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -650,7 +650,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nMIX_SAMPLE_BUF1:\n");
col = 0;
- for (i = MIX_SAMPLE_BUF1;i < MIX_SAMPLE_BUF1 + 0x40; i += sizeof(u32),col ++) {
+ for (i = MIX_SAMPLE_BUF1; i < MIX_SAMPLE_BUF1 + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -665,12 +665,12 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nSRC_TASK_SCB1:\n");
col = 0;
- for (i = 0x2480 ; i < 0x2480 + 0x40 ; i += sizeof(u32),col ++) {
+ for (i = 0x2480; i < 0x2480 + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
}
-
+
if (col == 0) {
snd_iprintf(buffer, "%04X ",i);
}
@@ -681,7 +681,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nSPDIFO_BUFFER:\n");
col = 0;
- for (i = SPDIFO_IP_OUTPUT_BUFFER1;i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x30; i += sizeof(u32),col ++) {
+ for (i = SPDIFO_IP_OUTPUT_BUFFER1; i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x30; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -697,7 +697,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\n...\n");
col = 0;
- for (i = SPDIFO_IP_OUTPUT_BUFFER1+0xD0;i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x110; i += sizeof(u32),col ++) {
+ for (i = SPDIFO_IP_OUTPUT_BUFFER1+0xD0; i < SPDIFO_IP_OUTPUT_BUFFER1 + 0x110; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -713,7 +713,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nOUTPUT_SNOOP:\n");
col = 0;
- for (i = OUTPUT_SNOOP_BUFFER;i < OUTPUT_SNOOP_BUFFER + 0x40; i += sizeof(u32),col ++) {
+ for (i = OUTPUT_SNOOP_BUFFER; i < OUTPUT_SNOOP_BUFFER + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -728,7 +728,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nCODEC_INPUT_BUF1: \n");
col = 0;
- for (i = CODEC_INPUT_BUF1;i < CODEC_INPUT_BUF1 + 0x40; i += sizeof(u32),col ++) {
+ for (i = CODEC_INPUT_BUF1; i < CODEC_INPUT_BUF1 + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -743,7 +743,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
#if 0
snd_iprintf(buffer,"\nWRITE_BACK_BUF1: \n");
col = 0;
- for (i = WRITE_BACK_BUF1;i < WRITE_BACK_BUF1 + 0x40; i += sizeof(u32),col ++) {
+ for (i = WRITE_BACK_BUF1; i < WRITE_BACK_BUF1 + 0x40; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -759,7 +759,7 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
snd_iprintf(buffer,"\nSPDIFI_IP_OUTPUT_BUFFER1: \n");
col = 0;
- for (i = SPDIFI_IP_OUTPUT_BUFFER1;i < SPDIFI_IP_OUTPUT_BUFFER1 + 0x80; i += sizeof(u32),col ++) {
+ for (i = SPDIFI_IP_OUTPUT_BUFFER1; i < SPDIFI_IP_OUTPUT_BUFFER1 + 0x80; i += sizeof(u32), col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
@@ -768,16 +768,16 @@ static void cs46xx_dsp_proc_sample_dump_read (struct snd_info_entry *entry,
if (col == 0) {
snd_iprintf(buffer, "%04X ",i);
}
-
+
snd_iprintf(buffer,"%08X ",readl(dst + i));
}
snd_iprintf(buffer,"\n");
}
-int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
+int cs46xx_dsp_proc_init(struct snd_card *card, struct snd_cs46xx *chip)
{
struct snd_info_entry *entry;
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i;
ins->snd_card = card;
@@ -785,7 +785,7 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
if ((entry = snd_info_create_card_entry(card, "dsp", card->proc_root)) != NULL) {
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->mode = S_IFDIR | S_IRUGO | S_IXUGO;
-
+
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
entry = NULL;
@@ -808,7 +808,7 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
}
}
ins->proc_sym_info_entry = entry;
-
+
if ((entry = snd_info_create_card_entry(card, "spos_modules", ins->proc_dsp_dir)) != NULL) {
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->private_data = chip;
@@ -881,9 +881,9 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_proc_done (struct snd_cs46xx *chip)
+int cs46xx_dsp_proc_done(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i;
snd_info_free_entry(ins->proc_sym_info_entry);
@@ -907,7 +907,7 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip)
mutex_lock(&chip->spos_mutex);
for (i = 0; i < ins->nscb; ++i) {
if (ins->scbs[i].deleted) continue;
- cs46xx_dsp_proc_free_scb_desc ( (ins->scbs + i) );
+ cs46xx_dsp_proc_free_scb_desc ( (ins->scbs + i));
}
mutex_unlock(&chip->spos_mutex);
@@ -919,10 +919,10 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip)
#endif /* CONFIG_PROC_FS */
static int debug_tree;
-static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data,
+static void _dsp_create_task_tree(struct snd_cs46xx *chip, u32 *task_data,
u32 dest, int size)
{
- void __iomem *spdst = chip->region.idx[1].remap_addr +
+ void __iomem *spdst = chip->region.idx[1].remap_addr +
DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
int i;
@@ -934,9 +934,9 @@ static void _dsp_create_task_tree (struct snd_cs46xx *chip, u32 * task_data,
}
static int debug_scb;
-static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest)
+static void _dsp_create_scb(struct snd_cs46xx *chip, u32 *scb_data, u32 dest)
{
- void __iomem *spdst = chip->region.idx[1].remap_addr +
+ void __iomem *spdst = chip->region.idx[1].remap_addr +
DSP_PARAMETER_BYTE_OFFSET + dest * sizeof(u32);
int i;
@@ -947,7 +947,7 @@ static void _dsp_create_scb (struct snd_cs46xx *chip, u32 * scb_data, u32 dest)
}
}
-static int find_free_scb_index (struct dsp_spos_instance * ins)
+static int find_free_scb_index(struct dsp_spos_instance *ins)
{
int index = ins->nscb, i;
@@ -961,10 +961,10 @@ static int find_free_scb_index (struct dsp_spos_instance * ins)
return index;
}
-static struct dsp_scb_descriptor * _map_scb (struct snd_cs46xx *chip, char * name, u32 dest)
+static struct dsp_scb_descriptor *_map_scb(struct snd_cs46xx *chip, char *name, u32 dest)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * desc = NULL;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *desc = NULL;
int index;
if (ins->nscb == DSP_MAX_SCB_DESC - 1) {
@@ -995,10 +995,10 @@ static struct dsp_scb_descriptor * _map_scb (struct snd_cs46xx *chip, char * nam
}
static struct dsp_task_descriptor *
-_map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size)
+_map_task_tree(struct snd_cs46xx *chip, char *name, u32 dest, u32 size)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_task_descriptor * desc = NULL;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_task_descriptor *desc = NULL;
if (ins->ntask == DSP_MAX_TASK_DESC - 1) {
snd_printk(KERN_ERR "dsp_spos: got no place for other TASK\n");
@@ -1023,9 +1023,9 @@ _map_task_tree (struct snd_cs46xx *chip, char * name, u32 dest, u32 size)
}
struct dsp_scb_descriptor *
-cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest)
+cs46xx_dsp_create_scb(struct snd_cs46xx *chip, char *name, u32 *scb_data, u32 dest)
{
- struct dsp_scb_descriptor * desc;
+ struct dsp_scb_descriptor *desc;
desc = _map_scb (chip,name,dest);
if (desc) {
@@ -1040,10 +1040,10 @@ cs46xx_dsp_create_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32
static struct dsp_task_descriptor *
-cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_data,
+cs46xx_dsp_create_task_tree(struct snd_cs46xx *chip, char *name, u32 *task_data,
u32 dest, int size)
{
- struct dsp_task_descriptor * desc;
+ struct dsp_task_descriptor *desc;
desc = _map_task_tree (chip,name,dest,size);
if (desc) {
@@ -1056,28 +1056,28 @@ cs46xx_dsp_create_task_tree (struct snd_cs46xx *chip, char * name, u32 * task_da
return desc;
}
-int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
+int cs46xx_dsp_scb_and_task_init(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_symbol_entry * fg_task_tree_header_code;
- struct dsp_symbol_entry * task_tree_header_code;
- struct dsp_symbol_entry * task_tree_thread;
- struct dsp_symbol_entry * null_algorithm;
- struct dsp_symbol_entry * magic_snoop_task;
-
- struct dsp_scb_descriptor * timing_master_scb;
- struct dsp_scb_descriptor * codec_out_scb;
- struct dsp_scb_descriptor * codec_in_scb;
- struct dsp_scb_descriptor * src_task_scb;
- struct dsp_scb_descriptor * master_mix_scb;
- struct dsp_scb_descriptor * rear_mix_scb;
- struct dsp_scb_descriptor * record_mix_scb;
- struct dsp_scb_descriptor * write_back_scb;
- struct dsp_scb_descriptor * vari_decimate_scb;
- struct dsp_scb_descriptor * rear_codec_out_scb;
- struct dsp_scb_descriptor * clfe_codec_out_scb;
- struct dsp_scb_descriptor * magic_snoop_scb;
-
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_symbol_entry *fg_task_tree_header_code;
+ struct dsp_symbol_entry *task_tree_header_code;
+ struct dsp_symbol_entry *task_tree_thread;
+ struct dsp_symbol_entry *null_algorithm;
+ struct dsp_symbol_entry *magic_snoop_task;
+
+ struct dsp_scb_descriptor *timing_master_scb;
+ struct dsp_scb_descriptor *codec_out_scb;
+ struct dsp_scb_descriptor *codec_in_scb;
+ struct dsp_scb_descriptor *src_task_scb;
+ struct dsp_scb_descriptor *master_mix_scb;
+ struct dsp_scb_descriptor *rear_mix_scb;
+ struct dsp_scb_descriptor *record_mix_scb;
+ struct dsp_scb_descriptor *write_back_scb;
+ struct dsp_scb_descriptor *vari_decimate_scb;
+ struct dsp_scb_descriptor *rear_codec_out_scb;
+ struct dsp_scb_descriptor *clfe_codec_out_scb;
+ struct dsp_scb_descriptor *magic_snoop_scb;
+
int fifo_addr, fifo_span, valid_slots;
static struct dsp_spos_control_block sposcb = {
@@ -1107,18 +1107,18 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
return -EIO;
}
- fg_task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "FGTASKTREEHEADERCODE", SYMBOL_CODE);
+ fg_task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "FGTASKTREEHEADERCODE", SYMBOL_CODE);
if (fg_task_tree_header_code == NULL) {
snd_printk(KERN_ERR "dsp_spos: symbol FGTASKTREEHEADERCODE not found\n");
return -EIO;
}
- task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "TASKTREEHEADERCODE", SYMBOL_CODE);
+ task_tree_header_code = cs46xx_dsp_lookup_symbol(chip, "TASKTREEHEADERCODE", SYMBOL_CODE);
if (task_tree_header_code == NULL) {
snd_printk(KERN_ERR "dsp_spos: symbol TASKTREEHEADERCODE not found\n");
return -EIO;
}
-
+
task_tree_thread = cs46xx_dsp_lookup_symbol(chip, "TASKTREETHREAD", SYMBOL_CODE);
if (task_tree_thread == NULL) {
snd_printk(KERN_ERR "dsp_spos: symbol TASKTREETHREAD not found\n");
@@ -1130,7 +1130,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
snd_printk(KERN_ERR "dsp_spos: symbol MAGICSNOOPTASK not found\n");
return -EIO;
}
-
+
{
/* create the null SCB */
static struct dsp_generic_scb null_scb = {
@@ -1165,14 +1165,14 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
DSP_SPOS_DC_DC,
DSP_SPOS_DC_DC,
DSP_SPOS_DC,DSP_SPOS_DC },
-
+
{
- BG_TREE_SCB_ADDR,TIMINGMASTER_SCB_ADDR,
+ BG_TREE_SCB_ADDR,TIMINGMASTER_SCB_ADDR,
0,
- FG_TASK_HEADER_ADDR + TCBData,
+ FG_TASK_HEADER_ADDR + TCBData,
},
- {
+ {
4,0,
1,0,
2,SPOSCB_ADDR + HFGFlags,
@@ -1215,9 +1215,9 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
DSP_SPOS_DCDC,
DSP_SPOS_DCDC,
DSP_SPOS_DCDC,
- DSP_SPOS_DCDC
- },
- {
+ DSP_SPOS_DCDC
+ },
+ {
FG_INTERVAL_TIMER_PERIOD,DSP_SPOS_UU,
0,0
}
@@ -1241,14 +1241,14 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
DSP_SPOS_DC_DC,
DSP_SPOS_DC_DC,
DSP_SPOS_DC,DSP_SPOS_DC },
-
+
{
NULL_SCB_ADDR,NULL_SCB_ADDR, /* Set up the background to do nothing */
0,
BG_TREE_SCB_ADDR + TCBData,
},
- {
+ {
9999,0,
0,1,
0,SPOSCB_ADDR + HFGFlags,
@@ -1291,9 +1291,9 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
DSP_SPOS_DCDC,
DSP_SPOS_DCDC,
DSP_SPOS_DCDC,
- DSP_SPOS_DCDC
- },
- {
+ DSP_SPOS_DCDC
+ },
+ {
BG_INTERVAL_TIMER_PERIOD,DSP_SPOS_UU,
0,0
}
@@ -1344,7 +1344,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
0x00020000,
0x0000ffff
};
-
+
if (!cs46xx_dsp_create_task_tree(chip, NULL,
(u32 *)&mix2_ostream_spb,
WRITE_BACK_SPB, 2))
@@ -1376,7 +1376,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
goto _fail_end;
if (chip->nr_ac97_codecs == 1) {
- /* output on slot 5 and 11
+ /* output on slot 5 and 11
on primary CODEC */
fifo_addr = 0x20;
fifo_span = 0x60;
@@ -1384,7 +1384,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
/* enable slot 5 and 11 */
valid_slots |= ACOSV_SLV5 | ACOSV_SLV11;
} else {
- /* output on slot 7 and 8
+ /* output on slot 7 and 8
on secondary CODEC */
fifo_addr = 0x40;
fifo_span = 0x10;
@@ -1398,8 +1398,8 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
REAR_CODECOUT_SCB_ADDR,codec_in_scb,
SCB_ON_PARENT_NEXT_SCB);
if (!rear_codec_out_scb) goto _fail_end;
-
-
+
+
/* create the rear PCM channel mixer SCB */
rear_mix_scb = cs46xx_dsp_create_mix_only_scb(chip,"RearMixerSCB",
MIX_SAMPLE_BUF3,
@@ -1408,9 +1408,9 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
SCB_ON_PARENT_SUBLIST_SCB);
ins->rear_mix_scb = rear_mix_scb;
if (!rear_mix_scb) goto _fail_end;
-
+
if (chip->nr_ac97_codecs == 2) {
- /* create CODEC tasklet for rear Center/LFE output
+ /* create CODEC tasklet for rear Center/LFE output
slot 6 and 9 on seconadry CODEC */
clfe_codec_out_scb = cs46xx_dsp_create_codec_out_scb(chip,"CodecOutSCB_CLFE",0x0030,0x0030,
CLFE_MIXER_SCB_ADDR,
@@ -1418,8 +1418,8 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
rear_codec_out_scb,
SCB_ON_PARENT_NEXT_SCB);
if (!clfe_codec_out_scb) goto _fail_end;
-
-
+
+
/* create the rear PCM channel mixer SCB */
ins->center_lfe_mix_scb = cs46xx_dsp_create_mix_only_scb(chip,"CLFEMixerSCB",
MIX_SAMPLE_BUF4,
@@ -1445,7 +1445,7 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
clfe_codec_out_scb,
SCB_ON_PARENT_NEXT_SCB);
-
+
if (!magic_snoop_scb) goto _fail_end;
ins->ref_snoop_scb = magic_snoop_scb;
@@ -1473,19 +1473,19 @@ int cs46xx_dsp_scb_and_task_init (struct snd_cs46xx *chip)
cs46xx_dsp_async_init(chip,timing_master_scb);
return 0;
- _fail_end:
+_fail_end:
snd_printk(KERN_ERR "dsp_spos: failed to setup SCB's in DSP\n");
return -EINVAL;
}
-static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
- struct dsp_scb_descriptor * fg_entry)
+static int cs46xx_dsp_async_init(struct snd_cs46xx *chip,
+ struct dsp_scb_descriptor *fg_entry)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_symbol_entry * s16_async_codec_input_task;
- struct dsp_symbol_entry * spdifo_task;
- struct dsp_symbol_entry * spdifi_task;
- struct dsp_scb_descriptor * spdifi_scb_desc, * spdifo_scb_desc, * async_codec_scb_desc;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_symbol_entry *s16_async_codec_input_task;
+ struct dsp_symbol_entry *spdifo_task;
+ struct dsp_symbol_entry *spdifi_task;
+ struct dsp_scb_descriptor *spdifi_scb_desc, *spdifo_scb_desc, *async_codec_scb_desc;
s16_async_codec_input_task = cs46xx_dsp_lookup_symbol(chip, "S16_ASYNCCODECINPUTTASK", SYMBOL_CODE);
if (s16_async_codec_input_task == NULL) {
@@ -1509,10 +1509,10 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
struct dsp_spdifoscb spdifo_scb = {
/* 0 */ DSP_SPOS_UUUU,
{
- /* 1 */ 0xb0,
- /* 2 */ 0,
- /* 3 */ 0,
- /* 4 */ 0,
+ /* 1 */ 0xb0,
+ /* 2 */ 0,
+ /* 3 */ 0,
+ /* 4 */ 0,
},
/* NOTE: the SPDIF output task read samples in mono
format, the AsynchFGTxSCB task writes to buffer
@@ -1520,9 +1520,9 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
*/
/* 5 */ RSCONFIG_SAMPLE_16MONO + RSCONFIG_MODULO_256,
/* 6 */ ( SPDIFO_IP_OUTPUT_BUFFER1 << 0x10 ) | 0xFFFC,
- /* 7 */ 0,0,
- /* 8 */ 0,
- /* 9 */ FG_TASK_HEADER_ADDR, NULL_SCB_ADDR,
+ /* 7 */ 0,0,
+ /* 8 */ 0,
+ /* 9 */ FG_TASK_HEADER_ADDR, NULL_SCB_ADDR,
/* A */ spdifo_task->address,
SPDIFO_SCB_INST + SPDIFOFIFOPointer,
{
@@ -1539,7 +1539,7 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
/* 0 */ DSP_SPOS_UULO,DSP_SPOS_UUHI,
/* 1 */ 0,
/* 2 */ 0,
- /* 3 */ 1,4000, /* SPDIFICountLimit SPDIFICount */
+ /* 3 */ 1,4000, /* SPDIFICountLimit SPDIFICount */
/* 4 */ DSP_SPOS_UUUU, /* SPDIFIStatusData */
/* 5 */ 0,DSP_SPOS_UUHI, /* StatusData, Free4 */
/* 6 */ DSP_SPOS_UUUU, /* Free3 */
@@ -1549,8 +1549,8 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
/* A */ spdifi_task->address,
SPDIFI_SCB_INST + SPDIFIFIFOPointer,
/* NOTE: The SPDIF input task write the sample in mono
- format from the HW FIFO, the AsynchFGRxSCB task reads
- them in stereo
+ format from the HW FIFO, the AsynchFGRxSCB task reads
+ them in stereo
*/
/* B */ RSCONFIG_SAMPLE_16MONO + RSCONFIG_MODULO_128,
/* C */ (SPDIFI_IP_OUTPUT_BUFFER1 << 0x10) | 0xFFFC,
@@ -1573,40 +1573,40 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
/* 9 */ SPDIFI_SCB_INST,NULL_SCB_ADDR,
/* A */ s16_async_codec_input_task->address,
HFG_TREE_SCB + AsyncCIOFIFOPointer,
-
+
/* B */ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_64,
/* C */ (ASYNC_IP_OUTPUT_BUFFER1 << 0x10), /*(ASYNC_IP_OUTPUT_BUFFER1 << 0x10) | 0xFFFC,*/
-
+
#ifdef UseASER1Input
- /* short AsyncCIFIFOPointer:AsyncCIStatRegAddr;
+ /* short AsyncCIFIFOPointer:AsyncCIStatRegAddr;
Init. 0000:8042: for ASER1
0000:8044: for ASER2 */
/* D */ 0x8042,0,
-
+
/* short AsyncCIStMoFormat:AsyncCIFIFOBaseAddr;
Init 1 stero:8050 ASER1
Init 0 mono:8070 ASER2
Init 1 Stereo : 0100 ASER1 (Set by script) */
/* E */ 0x0100,0x0001,
-
+
#endif
-
+
#ifdef UseASER2Input
/* short AsyncCIFIFOPointer:AsyncCIStatRegAddr;
Init. 0000:8042: for ASER1
0000:8044: for ASER2 */
/* D */ 0x8044,0,
-
+
/* short AsyncCIStMoFormat:AsyncCIFIFOBaseAddr;
Init 1 stero:8050 ASER1
Init 0 mono:8070 ASER2
Init 1 Stereo : 0100 ASER1 (Set by script) */
/* E */ 0x0110,0x0001,
-
+
#endif
-
+
/* short AsyncCIOutputBufModulo:AsyncCIFree;
- AsyncCIOutputBufModulo: The modulo size for
+ AsyncCIOutputBufModulo: The modulo size for
the output buffer of this task */
/* F */ 0, /* DSP_SPOS_UUUU */
};
@@ -1647,15 +1647,15 @@ static int cs46xx_dsp_async_init (struct snd_cs46xx *chip,
cs46xx_dsp_proc_register_scb_desc (chip,async_codec_scb_desc);
/* Async MASTER ENABLE, affects both SPDIF input and output */
- snd_cs46xx_pokeBA0(chip, BA0_ASER_MASTER, 0x1 );
+ snd_cs46xx_pokeBA0(chip, BA0_ASER_MASTER, 0x1);
}
return 0;
}
-static void cs46xx_dsp_disable_spdif_hw (struct snd_cs46xx *chip)
+static void cs46xx_dsp_disable_spdif_hw(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
/* set SPDIF output FIFO slot */
snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, 0);
@@ -1674,16 +1674,16 @@ static void cs46xx_dsp_disable_spdif_hw (struct snd_cs46xx *chip)
ins->spdif_status_out &= ~DSP_SPDIF_STATUS_HW_ENABLED;
}
-int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip)
+int cs46xx_dsp_enable_spdif_hw(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
/* if hw-ctrl already enabled, turn off to reset logic ... */
cs46xx_dsp_disable_spdif_hw (chip);
udelay(50);
/* set SPDIF output FIFO slot */
- snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, ( 0x8000 | ((SP_SPDOUT_FIFO >> 4) << 4) ));
+ snd_cs46xx_pokeBA0(chip, BA0_ASER_FADDR, ( 0x8000 | ((SP_SPDOUT_FIFO >> 4) << 4)));
/* SPDIF output MASTER ENABLE */
cs46xx_poke_via_dsp (chip,SP_SPDOUT_CONTROL, 0x80000000);
@@ -1699,7 +1699,7 @@ int cs46xx_dsp_enable_spdif_hw (struct snd_cs46xx *chip)
int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
/* turn on amplifier */
chip->active_ctrl(chip, 1);
@@ -1712,7 +1712,7 @@ int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip)
mutex_lock(&chip->spos_mutex);
- if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED) ) {
+ if (!(ins->spdif_status_out & DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED)) {
/* time countdown enable */
cs46xx_poke_via_dsp (chip,SP_ASER_COUNTDOWN, 0x80000005);
/* NOTE: 80000005 value is just magic. With all values
@@ -1761,7 +1761,7 @@ int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip)
int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins->asynch_rx_scb))
return -EINVAL;
@@ -1787,9 +1787,9 @@ int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip)
+int cs46xx_dsp_enable_pcm_capture(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(ins->pcm_input))
return -EINVAL;
@@ -1804,9 +1804,9 @@ int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip)
+int cs46xx_dsp_disable_pcm_capture(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins->pcm_input))
return -EINVAL;
@@ -1819,9 +1819,9 @@ int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip)
+int cs46xx_dsp_enable_adc_capture(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(ins->adc_input))
return -EINVAL;
@@ -1836,9 +1836,9 @@ int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip)
+int cs46xx_dsp_disable_adc_capture(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins->adc_input))
return -EINVAL;
@@ -1851,7 +1851,7 @@ int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data)
+int cs46xx_poke_via_dsp(struct snd_cs46xx *chip, u32 address, u32 data)
{
u32 temp;
int i;
@@ -1860,19 +1860,19 @@ int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data)
a rough guess from looking at the controller spec.) */
if (address < 0x8000 || address >= 0x9000)
return -EINVAL;
-
+
/* initialize the SP_IO_WRITE SCB with the data. */
temp = ( address << 16 ) | ( address & 0x0000FFFF); /* offset 0 <-- address2 : address1 */
snd_cs46xx_poke(chip,( SPIOWRITE_SCB_ADDR << 2), temp);
snd_cs46xx_poke(chip,((SPIOWRITE_SCB_ADDR + 1) << 2), data); /* offset 1 <-- data1 */
snd_cs46xx_poke(chip,((SPIOWRITE_SCB_ADDR + 2) << 2), data); /* offset 1 <-- data2 */
-
+
/* Poke this location to tell the task to start */
snd_cs46xx_poke(chip,((SPIOWRITE_SCB_ADDR + 6) << 2), SPIOWRITE_SCB_ADDR << 0x10);
/* Verify that the task ran */
- for (i=0; i<25; i++) {
+ for (i = 0; i < 25; i++) {
udelay(125);
temp = snd_cs46xx_peek(chip,((SPIOWRITE_SCB_ADDR + 6) << 2));
@@ -1888,13 +1888,13 @@ int cs46xx_poke_via_dsp (struct snd_cs46xx *chip, u32 address, u32 data)
return 0;
}
-int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right)
+int cs46xx_dsp_set_dac_volume(struct snd_cs46xx *chip, u16 left, u16 right)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
mutex_lock(&chip->spos_mutex);
-
+
/* main output */
scb = ins->master_mix_scb->sub_list_ptr;
while (scb != ins->the_null_scb) {
@@ -1917,9 +1917,9 @@ int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right)
return 0;
}
-int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right)
+int cs46xx_dsp_set_iec958_volume(struct snd_cs46xx *chip, u16 left, u16 right)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
mutex_lock(&chip->spos_mutex);
@@ -1936,9 +1936,9 @@ int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right)
}
#ifdef CONFIG_PM
-int cs46xx_dsp_resume(struct snd_cs46xx * chip)
+int cs46xx_dsp_resume(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int i, err;
/* clear parameter, sample and code areas */
diff --git a/sound/pci/cs46xx/dsp_spos.h b/sound/pci/cs46xx/dsp_spos.h
index f9e169d..a005f85 100644
--- a/sound/pci/cs46xx/dsp_spos.h
+++ b/sound/pci/cs46xx/dsp_spos.h
@@ -189,9 +189,9 @@ enum wide_opcode {
static inline u8 _wrap_all_bits (u8 val)
{
u8 wrapped;
-
+
/* wrap all 8 bits */
- wrapped =
+ wrapped =
((val & 0x1 ) << 7) |
((val & 0x2 ) << 5) |
((val & 0x4 ) << 3) |
@@ -205,13 +205,13 @@ static inline u8 _wrap_all_bits (u8 val)
}
static inline void cs46xx_dsp_spos_update_scb (struct snd_cs46xx * chip,
- struct dsp_scb_descriptor * scb)
+ struct dsp_scb_descriptor * scb)
{
/* update nextSCB and subListPtr in SCB */
snd_cs46xx_poke(chip,
(scb->address + SCBsubListPtr) << 2,
(scb->sub_list_ptr->address << 0x10) |
- (scb->next_scb_ptr->address));
+ (scb->next_scb_ptr->address));
}
static inline void cs46xx_dsp_scb_set_volume (struct snd_cs46xx * chip,
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c
index dd7c41b..ac14c46 100644
--- a/sound/pci/cs46xx/dsp_spos_scb_lib.c
+++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c
@@ -21,7 +21,7 @@
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/pm.h>
#include <linux/init.h>
@@ -37,13 +37,13 @@
#include "dsp_spos.h"
struct proc_scb_info {
- struct dsp_scb_descriptor * scb_desc;
+ struct dsp_scb_descriptor *scb_desc;
struct snd_cs46xx *chip;
};
-static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * symbol)
+static void remove_symbol(struct snd_cs46xx *chip, struct dsp_symbol_entry *symbol)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
int symbol_index = (int)(symbol - ins->symbol_table.symbols);
if (snd_BUG_ON(ins->symbol_table.nsymbols <= 0))
@@ -57,7 +57,7 @@ static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * s
if (symbol_index < ins->symbol_table.highest_frag_index) {
ins->symbol_table.highest_frag_index = symbol_index;
}
-
+
if (symbol_index == ins->symbol_table.nsymbols - 1)
ins->symbol_table.nsymbols --;
@@ -68,14 +68,14 @@ static void remove_symbol (struct snd_cs46xx * chip, struct dsp_symbol_entry * s
}
#ifdef CONFIG_PROC_FS
-static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
+static void cs46xx_dsp_proc_scb_info_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
- struct proc_scb_info * scb_info = entry->private_data;
- struct dsp_scb_descriptor * scb = scb_info->scb_desc;
- struct dsp_spos_instance * ins;
+ struct proc_scb_info *scb_info = entry->private_data;
+ struct dsp_scb_descriptor *scb = scb_info->scb_desc;
+ struct dsp_spos_instance *ins;
struct snd_cs46xx *chip = scb_info->chip;
- int j,col;
+ int j, col;
void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET;
ins = chip->dsp_spos_instance;
@@ -83,22 +83,22 @@ static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
mutex_lock(&chip->spos_mutex);
snd_iprintf(buffer,"%04x %s:\n",scb->address,scb->scb_name);
- for (col = 0,j = 0;j < 0x10; j++,col++) {
+ for (col = 0,j = 0; j < 0x10; j++, col++) {
if (col == 4) {
snd_iprintf(buffer,"\n");
col = 0;
}
snd_iprintf(buffer,"%08x ",readl(dst + (scb->address + j) * sizeof(u32)));
}
-
+
snd_iprintf(buffer,"\n");
if (scb->parent_scb_ptr != NULL) {
- snd_iprintf(buffer,"parent [%s:%04x] ",
+ snd_iprintf(buffer,"parent [%s:%04x] ",
scb->parent_scb_ptr->scb_name,
scb->parent_scb_ptr->address);
} else snd_iprintf(buffer,"parent [none] ");
-
+
snd_iprintf(buffer,"sub_list_ptr [%s:%04x]\nnext_scb_ptr [%s:%04x] task_entry [%s:%04x]\n",
scb->sub_list_ptr->scb_name,
scb->sub_list_ptr->address,
@@ -107,22 +107,22 @@ static void cs46xx_dsp_proc_scb_info_read (struct snd_info_entry *entry,
scb->task_entry->symbol_name,
scb->task_entry->address);
- snd_iprintf(buffer,"index [%d] ref_count [%d]\n",scb->index,scb->ref_count);
+ snd_iprintf(buffer,"index [%d] ref_count [%d]\n",scb->index,scb->ref_count);
mutex_unlock(&chip->spos_mutex);
}
#endif
-static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
+static void _dsp_unlink_scb(struct snd_cs46xx *chip, struct dsp_scb_descriptor *scb)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned long flags;
- if ( scb->parent_scb_ptr ) {
+ if (scb->parent_scb_ptr) {
/* unlink parent SCB */
if (snd_BUG_ON(scb->parent_scb_ptr->sub_list_ptr != scb &&
scb->parent_scb_ptr->next_scb_ptr != scb))
return;
-
+
if (scb->parent_scb_ptr->sub_list_ptr == scb) {
if (scb->next_scb_ptr == ins->the_null_scb) {
@@ -153,7 +153,7 @@ static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor
scb->next_scb_ptr = ins->the_null_scb;
}
- spin_lock_irqsave(&chip->reg_lock, flags);
+ spin_lock_irqsave(&chip->reg_lock, flags);
/* update parent first entry in DSP RAM */
cs46xx_dsp_spos_update_scb(chip,scb->parent_scb_ptr);
@@ -166,21 +166,21 @@ static void _dsp_unlink_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor
}
}
-static void _dsp_clear_sample_buffer (struct snd_cs46xx *chip, u32 sample_buffer_addr,
- int dword_count)
+static void _dsp_clear_sample_buffer(struct snd_cs46xx *chip, u32 sample_buffer_addr,
+ int dword_count)
{
void __iomem *dst = chip->region.idx[2].remap_addr + sample_buffer_addr;
int i;
-
- for (i = 0; i < dword_count ; ++i ) {
+
+ for (i = 0; i < dword_count; ++i) {
writel(0, dst);
dst += 4;
- }
+ }
}
-void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor * scb)
+void cs46xx_dsp_remove_scb(struct snd_cs46xx *chip, struct dsp_scb_descriptor *scb)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned long flags;
/* check integrety */
@@ -190,7 +190,7 @@ void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor *
return;
#if 0
- /* can't remove a SCB with childs before
+ /* can't remove a SCB with childs before
removing childs first */
if (snd_BUG_ON(scb->sub_list_ptr != ins->the_null_scb ||
scb->next_scb_ptr != ins->the_null_scb))
@@ -221,7 +221,7 @@ void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor *
#if 0
/* !!!! THIS IS A PIECE OF SHIT MADE BY ME !!! */
- for(i = scb->index + 1;i < ins->nscb; ++i) {
+ for (i = scb->index + 1; i < ins->nscb; ++i) {
ins->scbs[i - 1].index = i - 1;
}
#endif
@@ -229,10 +229,10 @@ void cs46xx_dsp_remove_scb (struct snd_cs46xx *chip, struct dsp_scb_descriptor *
#ifdef CONFIG_PROC_FS
-void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb)
+void cs46xx_dsp_proc_free_scb_desc(struct dsp_scb_descriptor *scb)
{
if (scb->proc_info) {
- struct proc_scb_info * scb_info = scb->proc_info->private_data;
+ struct proc_scb_info *scb_info = scb->proc_info->private_data;
snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name);
@@ -243,18 +243,18 @@ void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb)
}
}
-void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
- struct dsp_scb_descriptor * scb)
+void cs46xx_dsp_proc_register_scb_desc(struct snd_cs46xx *chip,
+ struct dsp_scb_descriptor *scb)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
struct snd_info_entry * entry;
- struct proc_scb_info * scb_info;
+ struct proc_scb_info *scb_info;
/* register to proc */
if (ins->snd_card != NULL && ins->proc_dsp_dir != NULL &&
scb->proc_info == NULL) {
-
- if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name,
+
+ if ((entry = snd_info_create_card_entry(ins->snd_card, scb->scb_name,
ins->proc_dsp_dir)) != NULL) {
scb_info = kmalloc(sizeof(struct proc_scb_info), GFP_KERNEL);
if (!scb_info) {
@@ -265,13 +265,13 @@ void cs46xx_dsp_proc_register_scb_desc (struct snd_cs46xx *chip,
scb_info->chip = chip;
scb_info->scb_desc = scb;
-
+
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->private_data = scb_info;
entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
-
+
entry->c.text.read = cs46xx_dsp_proc_scb_info_read;
-
+
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
kfree (scb_info);
@@ -284,22 +284,22 @@ out:
}
#endif /* CONFIG_PROC_FS */
-static struct dsp_scb_descriptor *
-_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u32 dest,
- struct dsp_symbol_entry * task_entry,
- struct dsp_scb_descriptor * parent_scb,
+static struct dsp_scb_descriptor *
+_dsp_create_generic_scb(struct snd_cs46xx *chip, char *name, u32 *scb_data, u32 dest,
+ struct dsp_symbol_entry *task_entry,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
+
unsigned long flags;
if (snd_BUG_ON(!ins->the_null_scb))
return NULL;
/* fill the data that will be wroten to DSP */
- scb_data[SCBsubListPtr] =
+ scb_data[SCBsubListPtr] =
(ins->the_null_scb->address << 0x10) | ins->the_null_scb->address;
scb_data[SCBfuncEntryPtr] &= 0xFFFF0000;
@@ -316,7 +316,7 @@ _dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u
scb->parent_scb_ptr = parent_scb;
scb->task_entry = task_entry;
-
+
/* update parent SCB */
if (scb->parent_scb_ptr) {
#if 0
@@ -356,31 +356,31 @@ _dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data, u
return scb;
}
-static struct dsp_scb_descriptor *
-cs46xx_dsp_create_generic_scb (struct snd_cs46xx *chip, char * name, u32 * scb_data,
- u32 dest, char * task_entry_name,
- struct dsp_scb_descriptor * parent_scb,
+static struct dsp_scb_descriptor *
+cs46xx_dsp_create_generic_scb(struct snd_cs46xx *chip, char *name, u32 *scb_data,
+ u32 dest, char *task_entry_name,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_symbol_entry * task_entry;
+ struct dsp_symbol_entry *task_entry;
task_entry = cs46xx_dsp_lookup_symbol (chip,task_entry_name,
SYMBOL_CODE);
-
+
if (task_entry == NULL) {
snd_printk (KERN_ERR "dsp_spos: symbol %s not found\n",task_entry_name);
return NULL;
}
-
+
return _dsp_create_generic_scb (chip,name,scb_data,dest,task_entry,
parent_scb,scb_child_type);
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip)
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_timing_master_scb(struct snd_cs46xx *chip)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_timing_master_scb timing_master_scb = {
{ 0,
0,
@@ -400,8 +400,8 @@ cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip)
0x0001,0x8000, /* fracSampAccumQm1:TMfrmsLeftInGroup */
0x0001,0x0000, /* fracSampCorrectionQm1:TMfrmGroupLength */
0x00060000 /* nSampPerFrmQ15 */
- };
-
+ };
+
scb = cs46xx_dsp_create_generic_scb(chip,"TimingMasterSCBInst",(u32 *)&timing_master_scb,
TIMINGMASTER_SCB_ADDR,
"TIMINGMASTER",NULL,SCB_NO_PARENT);
@@ -410,14 +410,14 @@ cs46xx_dsp_create_timing_master_scb (struct snd_cs46xx *chip)
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, char * codec_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx *chip, char *codec_name,
u16 channel_disp, u16 fifo_addr, u16 child_scb_addr,
- u32 dest, struct dsp_scb_descriptor * parent_scb,
+ u32 dest, struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_codec_output_scb codec_out_scb = {
{ 0,
0,
@@ -439,23 +439,23 @@ cs46xx_dsp_create_codec_out_scb(struct snd_cs46xx * chip, char * codec_name,
0x0000,0x0080, /* (!AC97!) COexpVolChangeRate:COscaleShiftCount */
0,child_scb_addr /* COreserved - need child scb to work with rom code */
};
-
-
+
+
scb = cs46xx_dsp_create_generic_scb(chip,codec_name,(u32 *)&codec_out_scb,
dest,"S16_CODECOUTPUTTASK",parent_scb,
scb_child_type);
-
+
return scb;
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx *chip, char *codec_name,
u16 channel_disp, u16 fifo_addr, u16 sample_buffer_addr,
- u32 dest, struct dsp_scb_descriptor * parent_scb,
+ u32 dest, struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
+ struct dsp_scb_descriptor *scb;
struct dsp_codec_input_scb codec_input_scb = {
{ 0,
0,
@@ -469,7 +469,7 @@ cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
0,
0
},
-
+
#if 0 /* cs4620 */
SyncIOSCB,NULL_SCB_ADDR
#else
@@ -479,13 +479,13 @@ cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_64, /* strmRsConfig */
sample_buffer_addr << 0x10, /* strmBufPtr; defined as a dword ptr, used as a byte ptr */
- channel_disp,fifo_addr, /* (!AC97!) leftChanBaseINaddr=AC97primary
+ channel_disp,fifo_addr, /* (!AC97!) leftChanBaseINaddr=AC97primary
link input slot 3 :rightChanINdisp=""slot 4 */
- 0x0000,0x0000, /* (!AC97!) ????:scaleShiftCount; no shift needed
+ 0x0000,0x0000, /* (!AC97!) ????:scaleShiftCount; no shift needed
because AC97 is already 20 bits */
0x80008000 /* ??clw cwcgame.scb has 0 */
};
-
+
scb = cs46xx_dsp_create_generic_scb(chip,codec_name,(u32 *)&codec_input_scb,
dest,"S16_CODECINPUTTASK",parent_scb,
scb_child_type);
@@ -493,18 +493,18 @@ cs46xx_dsp_create_codec_in_scb(struct snd_cs46xx * chip, char * codec_name,
}
-static struct dsp_scb_descriptor *
-cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
+static struct dsp_scb_descriptor *
+cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx *chip, char *scb_name,
u16 sample_buffer_addr, u32 dest,
int virtual_channel, u32 playback_hw_addr,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
+
struct dsp_generic_scb pcm_reader_scb = {
-
+
/*
Play DMA Task xfers data from host buffer to SP buffer
init/runtime variables:
@@ -524,7 +524,7 @@ cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
DMA_RQ_C2_AC_MONO_TO_STEREO 0x00002000L
DMA_RQ_C2_AC_ENDIAN_CONVERT 0x00004000L
DMA_RQ_C2_AC_SIGNED_CONVERT 0x00008000L
-
+
HostBuffAddr: Host Buffer Physical Byte Address - SCB loc:3rd dword, Mask: 0xFFFFFFFFL
aligned to dword boundary
*/
@@ -551,7 +551,7 @@ cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
0,
0,
0,
- 0
+ 0
},
/* Sublist pointer & next stream control block (SCB) link. */
NULL_SCB_ADDR,NULL_SCB_ADDR,
@@ -568,7 +568,7 @@ cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
/* Stream sample pointer & MAC-unit mode for this stream */
(sample_buffer_addr << 0x10),
/* Fractional increment per output sample in the input sample buffer */
- 0,
+ 0,
{
/* Standard stereo volume control
default muted */
@@ -580,34 +580,34 @@ cs46xx_dsp_create_pcm_reader_scb(struct snd_cs46xx * chip, char * scb_name,
if (ins->null_algorithm == NULL) {
ins->null_algorithm = cs46xx_dsp_lookup_symbol (chip,"NULLALGORITHM",
SYMBOL_CODE);
-
+
if (ins->null_algorithm == NULL) {
snd_printk (KERN_ERR "dsp_spos: symbol NULLALGORITHM not found\n");
return NULL;
- }
+ }
}
scb = _dsp_create_generic_scb(chip,scb_name,(u32 *)&pcm_reader_scb,
dest,ins->null_algorithm,parent_scb,
scb_child_type);
-
+
return scb;
}
#define GOF_PER_SEC 200
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_src_task_scb(struct snd_cs46xx *chip, char *scb_name,
int rate,
u16 src_buffer_addr,
u16 src_delay_buffer_addr, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type,
int pass_through)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
unsigned int tmp1, tmp2;
unsigned int phiIncr;
unsigned int correctionPerGOF, correctionPerSec;
@@ -650,35 +650,35 @@ cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
0x0000,0x0000,
src_buffer_addr,1,
correctionPerGOF,correctionPerSec,
- RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_32,
- 0x0000,src_delay_buffer_addr,
- 0x0,
+ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_32,
+ 0x0000,src_delay_buffer_addr,
+ 0x0,
0x080,(src_delay_buffer_addr + (24 * 4)),
0,0, /* next_scb, sub_list_ptr */
0,0, /* entry, this_spb */
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_8,
src_buffer_addr << 0x10,
phiIncr,
- {
+ {
0xffff - ins->dac_volume_right,0xffff - ins->dac_volume_left,
0xffff - ins->dac_volume_right,0xffff - ins->dac_volume_left
}
};
-
+
if (ins->s16_up == NULL) {
ins->s16_up = cs46xx_dsp_lookup_symbol (chip,"S16_UPSRC",
SYMBOL_CODE);
-
+
if (ins->s16_up == NULL) {
snd_printk (KERN_ERR "dsp_spos: symbol S16_UPSRC not found\n");
return NULL;
- }
+ }
}
-
+
/* clear buffers */
_dsp_clear_sample_buffer (chip,src_buffer_addr,8);
_dsp_clear_sample_buffer (chip,src_delay_buffer_addr,32);
-
+
if (pass_through) {
/* wont work with any other rate than
the native DSP rate */
@@ -700,13 +700,13 @@ cs46xx_dsp_create_src_task_scb(struct snd_cs46xx * chip, char * scb_name,
}
#if 0 /* not used */
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_filter_scb(struct snd_cs46xx *chip, char *scb_name,
u16 buffer_addr, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type) {
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_filter_scb filter_scb = {
.a0_right = 0x41a9,
.a0_left = 0x41a9,
@@ -714,7 +714,7 @@ cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name,
.a1_left = 0xb8e4,
.a2_right = 0x3e55,
.a2_left = 0x3e55,
-
+
.filter_unused3 = 0x0000,
.filter_unused2 = 0x0000,
@@ -750,14 +750,14 @@ cs46xx_dsp_create_filter_scb(struct snd_cs46xx * chip, char * scb_name,
}
#endif /* not used */
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx *chip, char *scb_name,
u16 mix_buffer_addr, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_mix_only_scb master_mix_scb = {
/* 0 */ { 0,
/* 1 */ 0,
@@ -774,7 +774,7 @@ cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
/* 9 */ 0,0,
/* A */ 0,0,
/* B */ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_32,
- /* C */ (mix_buffer_addr + (16 * 4)) << 0x10,
+ /* C */ (mix_buffer_addr + (16 * 4)) << 0x10,
/* D */ 0,
{
/* E */ 0x8000,0x8000,
@@ -790,92 +790,92 @@ cs46xx_dsp_create_mix_only_scb(struct snd_cs46xx * chip, char * scb_name,
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx * chip, char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_mix_to_ostream_scb(struct snd_cs46xx *chip, char *scb_name,
u16 mix_buffer_addr, u16 writeback_spb, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
+ struct dsp_scb_descriptor *scb;
struct dsp_mix2_ostream_scb mix2_ostream_scb = {
/* Basic (non scatter/gather) DMA requestor (4 ints) */
- {
+ {
DMA_RQ_C1_SOURCE_MOD64 +
DMA_RQ_C1_DEST_ON_HOST +
DMA_RQ_C1_DEST_MOD1024 +
- DMA_RQ_C1_WRITEBACK_SRC_FLAG +
+ DMA_RQ_C1_WRITEBACK_SRC_FLAG +
DMA_RQ_C1_WRITEBACK_DEST_FLAG +
- 15,
-
+ 15,
+
DMA_RQ_C2_AC_NONE +
- DMA_RQ_C2_SIGNAL_DEST_PINGPONG +
-
- CS46XX_DSP_CAPTURE_CHANNEL,
- DMA_RQ_SD_SP_SAMPLE_ADDR +
- mix_buffer_addr,
- 0x0
+ DMA_RQ_C2_SIGNAL_DEST_PINGPONG +
+
+ CS46XX_DSP_CAPTURE_CHANNEL,
+ DMA_RQ_SD_SP_SAMPLE_ADDR +
+ mix_buffer_addr,
+ 0x0
},
-
+
{ 0, 0, 0, 0, 0, },
0,0,
0,writeback_spb,
-
- RSCONFIG_DMA_ENABLE +
- (19 << RSCONFIG_MAX_DMA_SIZE_SHIFT) +
-
+
+ RSCONFIG_DMA_ENABLE +
+ (19 << RSCONFIG_MAX_DMA_SIZE_SHIFT) +
+
((dest >> 4) << RSCONFIG_STREAM_NUM_SHIFT) +
- RSCONFIG_DMA_TO_HOST +
+ RSCONFIG_DMA_TO_HOST +
RSCONFIG_SAMPLE_16STEREO +
- RSCONFIG_MODULO_64,
+ RSCONFIG_MODULO_64,
(mix_buffer_addr + (32 * 4)) << 0x10,
- 1,0,
+ 1,0,
0x0001,0x0080,
0xFFFF,0
};
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&mix2_ostream_scb,
-
+
dest,"S16_MIX_TO_OSTREAM",parent_scb,
scb_child_type);
-
+
return scb;
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip,char * scb_name,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx *chip,char *scb_name,
u16 vari_buffer_addr0,
u16 vari_buffer_addr1,
u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_vari_decimate_scb vari_decimate_scb = {
0x0028,0x00c8,
0x5555,0x0000,
0x0000,0x0000,
vari_buffer_addr0,vari_buffer_addr1,
-
+
0x0028,0x00c8,
- RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_256,
-
- 0xFF800000,
+ RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_256,
+
+ 0xFF800000,
0,
- 0x0080,vari_buffer_addr1 + (25 * 4),
-
- 0,0,
+ 0x0080,vari_buffer_addr1 + (25 * 4),
+
+ 0,0,
0,0,
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_8,
- vari_buffer_addr0 << 0x10,
- 0x04000000,
+ vari_buffer_addr0 << 0x10,
+ 0x04000000,
{
- 0x8000,0x8000,
+ 0x8000,0x8000,
0xFFFF,0xFFFF
}
};
@@ -883,19 +883,19 @@ cs46xx_dsp_create_vari_decimate_scb(struct snd_cs46xx * chip,char * scb_name,
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&vari_decimate_scb,
dest,"VARIDECIMATE",parent_scb,
scb_child_type);
-
+
return scb;
}
-static struct dsp_scb_descriptor *
-cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+static struct dsp_scb_descriptor *
+cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
struct dsp_scb_descriptor * input_scb,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
+ struct dsp_scb_descriptor *scb;
struct dsp_pcm_serial_input_scb pcm_serial_input_scb = {
@@ -931,15 +931,15 @@ cs46xx_dsp_create_pcm_serial_input_scb(struct snd_cs46xx * chip, char * scb_name
}
-static struct dsp_scb_descriptor *
-cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+static struct dsp_scb_descriptor *
+cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
u16 hfg_scb_address,
u16 asynch_buffer_address,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
+ struct dsp_scb_descriptor *scb;
struct dsp_asynch_fg_tx_scb asynch_fg_tx_scb = {
0xfc00,0x03ff, /* Prototype sample buffer size of 256 dwords */
@@ -949,27 +949,27 @@ cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u3
0,0, /* Initialize current Delta and Consumer ptr adjustment count */
0, /* Initialize accumulated Phi to 0 */
0,0x2aab, /* Const 1/3 */
-
+
{
0, /* Define the unused elements */
0,
0
},
-
+
0,0,
0,dest + AFGTxAccumPhi,
-
+
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_256, /* Stereo, 256 dword */
(asynch_buffer_address) << 0x10, /* This should be automagically synchronized
to the producer pointer */
-
+
/* There is no correct initial value, it will depend upon the detected
rate etc */
0x18000000, /* Phi increment for approx 32k operation */
0x8000,0x8000, /* Volume controls are unused at this time */
0x8000,0x8000
};
-
+
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&asynch_fg_tx_scb,
dest,"ASYNCHFGTXCODE",parent_scb,
scb_child_type);
@@ -978,15 +978,15 @@ cs46xx_dsp_create_asynch_fg_tx_scb(struct snd_cs46xx * chip, char * scb_name, u3
}
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
u16 hfg_scb_address,
u16 asynch_buffer_address,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb;
struct dsp_asynch_fg_rx_scb asynch_fg_rx_scb = {
0xfe00,0x01ff, /* Prototype sample buffer size of 128 dwords */
@@ -1001,18 +1001,18 @@ cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u3
0,
0
},
-
+
0,0,
0,dest,
-
+
RSCONFIG_MODULO_128 |
RSCONFIG_SAMPLE_16STEREO, /* Stereo, 128 dword */
- ( (asynch_buffer_address + (16 * 4)) << 0x10), /* This should be automagically
+ ( (asynch_buffer_address + (16 * 4)) << 0x10), /* This should be automagically
synchrinized to the producer pointer */
-
+
/* There is no correct initial value, it will depend upon the detected
rate etc */
- 0x18000000,
+ 0x18000000,
/* Set IEC958 input volume */
0xffff - ins->spdif_input_volume_right,0xffff - ins->spdif_input_volume_left,
@@ -1028,16 +1028,16 @@ cs46xx_dsp_create_asynch_fg_rx_scb(struct snd_cs46xx * chip, char * scb_name, u3
#if 0 /* not used */
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
u16 snoop_buffer_address,
struct dsp_scb_descriptor * snoop_scb,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_output_snoop_scb output_snoop_scb = {
{ 0, /* not used. Zero */
0,
@@ -1051,17 +1051,17 @@ cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u3
0,
0
},
-
+
0,0,
0,0,
-
+
RSCONFIG_SAMPLE_16STEREO + RSCONFIG_MODULO_64,
- snoop_buffer_address << 0x10,
+ snoop_buffer_address << 0x10,
0,0,
0,
0,snoop_scb->address
};
-
+
scb = cs46xx_dsp_create_generic_scb(chip,scb_name,(u32 *)&output_snoop_scb,
dest,"OUTPUTSNOOP",parent_scb,
scb_child_type);
@@ -1070,13 +1070,13 @@ cs46xx_dsp_create_output_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u3
#endif /* not used */
-struct dsp_scb_descriptor *
-cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
- struct dsp_scb_descriptor * parent_scb,
+struct dsp_scb_descriptor *
+cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_spio_write_scb spio_write_scb = {
0,0, /* SPIOWAddress2:SPIOWAddress1; */
0, /* SPIOWData1; */
@@ -1086,11 +1086,11 @@ cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32
0, /* SPIOWData4; */
0,0, /* SPIOWDataPtr:Unused1; */
{ 0,0 }, /* Unused2[2]; */
-
+
0,0, /* SPIOWChildPtr:SPIOWSiblingPtr; */
0,0, /* SPIOWThisPtr:SPIOWEntryPoint; */
-
- {
+
+ {
0,
0,
0,
@@ -1107,14 +1107,14 @@ cs46xx_dsp_create_spio_write_scb(struct snd_cs46xx * chip, char * scb_name, u32
}
struct dsp_scb_descriptor *
-cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32 dest,
+cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx *chip, char *scb_name, u32 dest,
u16 snoop_buffer_address,
struct dsp_scb_descriptor * snoop_scb,
- struct dsp_scb_descriptor * parent_scb,
+ struct dsp_scb_descriptor *parent_scb,
int scb_child_type)
{
- struct dsp_scb_descriptor * scb;
-
+ struct dsp_scb_descriptor *scb;
+
struct dsp_magic_snoop_task magic_snoop_scb = {
/* 0 */ 0, /* i0 */
/* 1 */ 0, /* i1 */
@@ -1143,10 +1143,10 @@ cs46xx_dsp_create_magic_snoop_scb(struct snd_cs46xx * chip, char * scb_name, u32
}
static struct dsp_scb_descriptor *
-find_next_free_scb (struct snd_cs46xx * chip, struct dsp_scb_descriptor * from)
+find_next_free_scb(struct snd_cs46xx *chip, struct dsp_scb_descriptor *from)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * scb = from;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *scb = from;
while (scb->next_scb_ptr != ins->the_null_scb) {
if (snd_BUG_ON(!scb->next_scb_ptr))
@@ -1198,9 +1198,9 @@ static u32 src_output_buffer_addr[DSP_MAX_SRC_NR] = {
0x2BA0,
0x2BC0,
0x2BE0,
- 0x2D00,
- 0x2D20,
- 0x2D40,
+ 0x2D00,
+ 0x2D20,
+ 0x2D40,
0x2D60,
0x2D80,
0x2DA0,
@@ -1228,16 +1228,16 @@ static u32 src_delay_buffer_addr[DSP_MAX_SRC_NR] = {
};
struct dsp_pcm_channel_descriptor *
-cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
- u32 sample_rate, void * private_data,
+cs46xx_dsp_create_pcm_channel(struct snd_cs46xx *chip,
+ u32 sample_rate, void * private_data,
u32 hw_dma_addr,
int pcm_channel_id)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * src_scb = NULL, * pcm_scb, * mixer_scb = NULL;
- struct dsp_scb_descriptor * src_parent_scb = NULL;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *src_scb = NULL, *pcm_scb, *mixer_scb = NULL;
+ struct dsp_scb_descriptor *src_parent_scb = NULL;
- /* struct dsp_scb_descriptor * pcm_parent_scb; */
+ /* struct dsp_scb_descriptor *pcm_parent_scb; */
char scb_name[DSP_MAX_SCB_NAME];
int i, pcm_index = -1, insert_point, src_index = -1, pass_through = 0;
unsigned long flags;
@@ -1278,19 +1278,19 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
if (!sample_rate) sample_rate = 44100;
/* search for a already created SRC SCB with the same sample rate */
- for (i = 0; i < DSP_MAX_PCM_CHANNELS &&
+ for (i = 0; i < DSP_MAX_PCM_CHANNELS &&
(pcm_index == -1 || src_scb == NULL); ++i) {
- /* virtual channel reserved
+ /* virtual channel reserved
for capture */
if (i == CS46XX_DSP_CAPTURE_CHANNEL) continue;
if (ins->pcm_channels[i].active) {
- if (!src_scb &&
+ if (!src_scb &&
ins->pcm_channels[i].sample_rate == sample_rate &&
ins->pcm_channels[i].mixer_scb == mixer_scb) {
src_scb = ins->pcm_channels[i].src_scb;
- ins->pcm_channels[i].src_scb->ref_count ++;
+ ins->pcm_channels[i].src_scb->ref_count++;
src_index = ins->pcm_channels[i].src_slot;
}
} else if (pcm_index == -1) {
@@ -1330,7 +1330,7 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
}
snprintf (scb_name,DSP_MAX_SCB_NAME,"SrcTask_SCB%d",src_index);
-
+
snd_printdd( "dsp_spos: creating SRC \"%s\"\n",scb_name);
src_scb = cs46xx_dsp_create_src_task_scb(chip,scb_name,
sample_rate,
@@ -1349,10 +1349,10 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
/* cs46xx_dsp_set_src_sample_rate(chip,src_scb,sample_rate); */
- ins->nsrc_scb ++;
- }
-
-
+ ins->nsrc_scb++;
+ }
+
+
snprintf (scb_name,DSP_MAX_SCB_NAME,"PCMReader_SCB%d",pcm_index);
snd_printdd( "dsp_spos: creating PCM \"%s\" (%d)\n",scb_name,
@@ -1365,14 +1365,14 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
pcm_index, /* virtual channel 0-31 */
hw_dma_addr, /* pcm hw addr */
NULL, /* parent SCB ptr */
- 0 /* insert point */
- );
+ 0 /* insert point */
+ );
if (!pcm_scb) {
snd_printk (KERN_ERR "dsp_spos: failed to create PCMreaderSCB\n");
return NULL;
}
-
+
spin_lock_irqsave(&chip->reg_lock, flags);
ins->pcm_channels[pcm_index].sample_rate = sample_rate;
ins->pcm_channels[pcm_index].pcm_reader_scb = pcm_scb;
@@ -1383,14 +1383,14 @@ cs46xx_dsp_create_pcm_channel (struct snd_cs46xx * chip,
ins->pcm_channels[pcm_index].active = 1;
ins->pcm_channels[pcm_index].pcm_slot = pcm_index;
ins->pcm_channels[pcm_index].mixer_scb = mixer_scb;
- ins->npcm_channels ++;
+ ins->npcm_channels++;
spin_unlock_irqrestore(&chip->reg_lock, flags);
return (ins->pcm_channels + pcm_index);
}
-int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
- struct dsp_pcm_channel_descriptor * pcm_channel,
+int cs46xx_dsp_pcm_channel_set_period(struct snd_cs46xx *chip,
+ struct dsp_pcm_channel_descriptor *pcm_channel,
int period_size)
{
u32 temp = snd_cs46xx_peek (chip,pcm_channel->pcm_reader_scb->address << 2);
@@ -1414,10 +1414,10 @@ int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
break;
case 64:
temp |= DMA_RQ_C1_SOURCE_MOD32;
- break;
+ break;
case 32:
temp |= DMA_RQ_C1_SOURCE_MOD16;
- break;
+ break;
default:
snd_printdd ("period size (%d) not supported by HW\n", period_size);
return -EINVAL;
@@ -1428,7 +1428,7 @@ int cs46xx_dsp_pcm_channel_set_period (struct snd_cs46xx * chip,
return 0;
}
-int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip,
+int cs46xx_dsp_pcm_ostream_set_period(struct snd_cs46xx *chip,
int period_size)
{
u32 temp = snd_cs46xx_peek (chip,WRITEBACK_SCB_ADDR << 2);
@@ -1452,10 +1452,10 @@ int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip,
break;
case 64:
temp |= DMA_RQ_C1_DEST_MOD32;
- break;
+ break;
case 32:
temp |= DMA_RQ_C1_DEST_MOD16;
- break;
+ break;
default:
snd_printdd ("period size (%d) not supported by HW\n", period_size);
return -EINVAL;
@@ -1466,10 +1466,10 @@ int cs46xx_dsp_pcm_ostream_set_period (struct snd_cs46xx * chip,
return 0;
}
-void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip,
- struct dsp_pcm_channel_descriptor * pcm_channel)
+void cs46xx_dsp_destroy_pcm_channel(struct snd_cs46xx *chip,
+ struct dsp_pcm_channel_descriptor *pcm_channel)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
unsigned long flags;
if (snd_BUG_ON(!pcm_channel->active ||
@@ -1499,8 +1499,8 @@ void cs46xx_dsp_destroy_pcm_channel (struct snd_cs46xx * chip,
}
}
-int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
- struct dsp_pcm_channel_descriptor * pcm_channel)
+int cs46xx_dsp_pcm_unlink(struct snd_cs46xx *chip,
+ struct dsp_pcm_channel_descriptor *pcm_channel)
{
unsigned long flags;
@@ -1525,12 +1525,12 @@ int cs46xx_dsp_pcm_unlink (struct snd_cs46xx * chip,
return 0;
}
-int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip,
- struct dsp_pcm_channel_descriptor * pcm_channel)
+int cs46xx_dsp_pcm_link(struct snd_cs46xx *chip,
+ struct dsp_pcm_channel_descriptor *pcm_channel)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * parent_scb;
- struct dsp_scb_descriptor * src_scb = pcm_channel->src_scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *parent_scb;
+ struct dsp_scb_descriptor *src_scb = pcm_channel->src_scb;
unsigned long flags;
spin_lock(&pcm_channel->src_scb->lock);
@@ -1568,12 +1568,12 @@ int cs46xx_dsp_pcm_link (struct snd_cs46xx * chip,
}
struct dsp_scb_descriptor *
-cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * source,
- u16 addr, char * scb_name)
+cs46xx_add_record_source(struct snd_cs46xx *chip, struct dsp_scb_descriptor * source,
+ u16 addr, char *scb_name)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * parent;
- struct dsp_scb_descriptor * pcm_input;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *parent;
+ struct dsp_scb_descriptor *pcm_input;
int insert_point;
if (snd_BUG_ON(!ins->record_mixer_scb))
@@ -1594,7 +1594,7 @@ cs46xx_add_record_source (struct snd_cs46xx *chip, struct dsp_scb_descriptor * s
return pcm_input;
}
-int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
+int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor *src)
{
if (snd_BUG_ON(!src->parent_scb_ptr))
return -EINVAL;
@@ -1607,10 +1607,10 @@ int cs46xx_src_unlink(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
return 0;
}
-int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
+int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor *src)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
- struct dsp_scb_descriptor * parent_scb;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
+ struct dsp_scb_descriptor *parent_scb;
if (snd_BUG_ON(src->parent_scb_ptr))
return -EINVAL;
@@ -1629,20 +1629,20 @@ int cs46xx_src_link(struct snd_cs46xx *chip, struct dsp_scb_descriptor * src)
/* update entry in DSP RAM */
cs46xx_dsp_spos_update_scb(chip,parent_scb);
-
+
return 0;
}
-int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
+int cs46xx_dsp_enable_spdif_out(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED) ) {
+ if (!(ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED)) {
cs46xx_dsp_enable_spdif_hw (chip);
}
/* dont touch anything if SPDIF is open */
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
/* when cs46xx_iec958_post_close(...) is called it
will call this function if necessary depending on
this bit */
@@ -1659,8 +1659,8 @@ int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
/* reset output snooper sample buffer pointer */
snd_cs46xx_poke (chip, (ins->ref_snoop_scb->address + 2) << 2,
- (OUTPUT_SNOOP_BUFFER + 0x10) << 0x10 );
-
+ (OUTPUT_SNOOP_BUFFER + 0x10) << 0x10);
+
/* The asynch. transfer task */
ins->asynch_tx_scb = cs46xx_dsp_create_asynch_fg_tx_scb(chip,"AsynchFGTxSCB",ASYNCTX_SCB_ADDR,
SPDIFO_SCB_INST,
@@ -1674,8 +1674,8 @@ int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
ins->ref_snoop_scb,
ins->asynch_tx_scb,
SCB_ON_PARENT_SUBLIST_SCB);
-
-
+
+
if (!ins->spdif_pcm_input_scb) return -ENOMEM;
/* monitor state */
@@ -1684,12 +1684,12 @@ int cs46xx_dsp_enable_spdif_out (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip)
+int cs46xx_dsp_disable_spdif_out(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
/* dont touch anything if SPDIF is open */
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_PLAYBACK_OPEN) {
ins->spdif_status_out &= ~DSP_SPDIF_STATUS_OUTPUT_ENABLED;
return -EBUSY;
}
@@ -1723,18 +1723,18 @@ int cs46xx_dsp_disable_spdif_out (struct snd_cs46xx *chip)
int cs46xx_iec958_pre_open (struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) {
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED) {
/* remove AsynchFGTxSCB and and PCMSerialInput_II */
cs46xx_dsp_disable_spdif_out (chip);
/* save state */
ins->spdif_status_out |= DSP_SPDIF_STATUS_OUTPUT_ENABLED;
}
-
+
/* if not enabled already */
- if ( !(ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED) ) {
+ if (!(ins->spdif_status_out & DSP_SPDIF_STATUS_HW_ENABLED)) {
cs46xx_dsp_enable_spdif_hw (chip);
}
@@ -1754,9 +1754,9 @@ int cs46xx_iec958_pre_open (struct snd_cs46xx *chip)
return 0;
}
-int cs46xx_iec958_post_close (struct snd_cs46xx *chip)
+int cs46xx_iec958_post_close(struct snd_cs46xx *chip)
{
- struct dsp_spos_instance * ins = chip->dsp_spos_instance;
+ struct dsp_spos_instance *ins = chip->dsp_spos_instance;
if (snd_BUG_ON(!ins->asynch_tx_scb))
return -EINVAL;
@@ -1765,7 +1765,7 @@ int cs46xx_iec958_post_close (struct snd_cs46xx *chip)
/* restore settings */
cs46xx_poke_via_dsp (chip,SP_SPDOUT_CSUV, ins->spdif_csuv_default);
-
+
/* deallocate stuff */
if (ins->spdif_pcm_input_scb != NULL) {
cs46xx_dsp_remove_scb (chip,ins->spdif_pcm_input_scb);
@@ -1779,9 +1779,9 @@ int cs46xx_iec958_post_close (struct snd_cs46xx *chip)
_dsp_clear_sample_buffer(chip,SPDIFO_IP_OUTPUT_BUFFER1,256);
/* restore state */
- if ( ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED ) {
+ if (ins->spdif_status_out & DSP_SPDIF_STATUS_OUTPUT_ENABLED) {
cs46xx_dsp_enable_spdif_out (chip);
}
-
+
return 0;
}
diff --git a/sound/pci/cs46xx/imgs/cwcbinhack.h b/sound/pci/cs46xx/imgs/cwcbinhack.h
index f4d9368..0587ab3 100644
--- a/sound/pci/cs46xx/imgs/cwcbinhack.h
+++ b/sound/pci/cs46xx/imgs/cwcbinhack.h
@@ -1,4 +1,4 @@
-/* generated by Benny
+/* generated by Benny
MODIFY ON YOUR OWN RISK */
#ifndef __HEADER_cwcbinhack_H__
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/ca0106/ca0106.h | 32 +++---
sound/pci/ca0106/ca0106_main.c | 262 +++++++++++++++++++-------------------
sound/pci/ca0106/ca0106_mixer.c | 22 ++--
sound/pci/ca0106/ca0106_proc.c | 66 +++++-----
sound/pci/ca0106/ca_midi.c | 14 +-
sound/pci/ca0106/ca_midi.h | 6 +-
6 files changed, 201 insertions(+), 201 deletions(-)
diff --git a/sound/pci/ca0106/ca0106.h b/sound/pci/ca0106/ca0106.h
index 74175fc..645980f 100644
--- a/sound/pci/ca0106/ca0106.h
+++ b/sound/pci/ca0106/ca0106.h
@@ -5,7 +5,7 @@
*
* FEATURES currently supported:
* See ca0106_main.c for features.
- *
+ *
* Changelog:
* Support interrupts per period.
* Removed noise from Center/LFE channel when in Analog mode.
@@ -174,10 +174,10 @@
/********************************************************************************************************/
/* CA0106 pointer-offset register set, accessed through the PTR and DATA registers */
/********************************************************************************************************/
-
+
/* Initally all registers from 0x00 to 0x3f have zero contents. */
#define PLAYBACK_LIST_ADDR 0x00 /* Base DMA address of a list of pointers to each period/size */
- /* One list entry: 4 bytes for DMA address,
+ /* One list entry: 4 bytes for DMA address,
* 4 bytes for period_size << 16.
* One list entry is 8 bytes long.
* One list entry for each period in the buffer.
@@ -219,7 +219,7 @@
* Playback mixer in enable [27:24] (one bit per channel)
* Playback mixer out enable [31:28] (one bit per channel)
*/
-/* The Digital out jack is shared with the Center/LFE Analogue output.
+/* The Digital out jack is shared with the Center/LFE Analogue output.
* The jack has 4 poles. I will call 1 - Tip, 2 - Next to 1, 3 - Next to 2, 4 - Next to 3
* For Analogue: 1 -> Center Speaker, 2 -> Sub Woofer, 3 -> Ground, 4 -> Ground
* For Digital: 1 -> Front SPDIF, 2 -> Rear SPDIF, 3 -> Center/Subwoofer SPDIF, 4 -> Ground.
@@ -232,7 +232,7 @@
* Summary: For ALSA we use the Rear channel for SPDIF Digital AC3/DTS output
*/
/* A standard 2 pole mono mini-jack to RCA plug can be used for SPDIF Stereo PCM output from the Front channel.
- * A standard 3 pole stereo mini-jack to 2 RCA plugs can be used for SPDIF AC3/DTS and Stereo PCM output utilising the Rear channel and just one of the RCA plugs.
+ * A standard 3 pole stereo mini-jack to 2 RCA plugs can be used for SPDIF AC3/DTS and Stereo PCM output utilising the Rear channel and just one of the RCA plugs.
*/
#define SPCS0 0x41 /* SPDIF output Channel Status 0 register. For Rear. default=0x02108004, non-audio=0x02108006 */
#define SPCS1 0x42 /* SPDIF output Channel Status 1 register. For Front */
@@ -331,7 +331,7 @@
#define CAPTURE_SOURCE_CHANNEL2 0x00f00000 /* 1 - What you hear or . 2 - ?? */
#define CAPTURE_SOURCE_CHANNEL3 0x000f0000 /* 3 - Mic in, Line in, TAD in, Aux in. */
#define CAPTURE_SOURCE_RECORD_MAP 0x0000ffff /* Default 0x00e4 */
- /* Record Map [7:0] (2 bits per channel) 0=mapped to channel 0, 1=mapped to channel 1, 2=mapped to channel2, 3=mapped to channel3
+ /* Record Map [7:0] (2 bits per channel) 0=mapped to channel 0, 1=mapped to channel 1, 2=mapped to channel2, 3=mapped to channel3
* Record source select for channel 0 [18:16]
* Record source select for channel 1 [22:20]
* Record source select for channel 2 [26:24]
@@ -432,7 +432,7 @@
* Sample input rate [3:2] (0=48kHz, 1=Not available, 2=96kHz, 3=192Khz)
* SRC input source select [4] 0=Audio from digital mixer, 1=Audio from analog source.
* Record rate [9:8] (0=48kHz, 1=Not available, 2=96kHz, 3=192Khz)
- * Record mixer output enable [12:10]
+ * Record mixer output enable [12:10]
* I2S input rate master mode [15:14] (0=48kHz, 1=44.1kHz, 2=96kHz, 3=192Khz)
* I2S output rate [17:16] (0=48kHz, 1=44.1kHz, 2=96kHz, 3=192Khz)
* I2S output source select [18] (0=Audio from host, 1=Audio from SRC)
@@ -445,7 +445,7 @@
* Not used [27]
* Record Source 0 input [29:28] (0=SPDIF in, 1=I2S in, 2=AC97 Mic, 3=AC97 PCM)
* Record Source 1 input [31:30] (0=SPDIF in, 1=I2S in, 2=AC97 Mic, 3=AC97 PCM)
- */
+ */
/* Sample rate output control register Channel=1
* I2S Input 0 volume Right [7:0]
* I2S Input 0 volume Left [15:8]
@@ -467,7 +467,7 @@
* AC97 output enable [5:0]
* I2S output enable [19:16]
* SPDIF output enable [27:24]
- */
+ */
#define UNKNOWN73 0x73 /* Unknown. Readonly. Default 0x0 */
#define CHIP_VERSION 0x74 /* P17 Chip version. Channel_id 0 only. Default 00000071 */
#define EXTENDED_INT_MASK 0x75 /* Used by both playback and capture interrupt handler */
@@ -502,14 +502,14 @@
#define I2C_A_ADC_LAST_MASK 0x00000040 //Bit mask for Last word transaction
#define I2C_A_ADC_BYTE_MASK 0x00000080 //Bit mask for Byte Mode
-#define I2C_A_ADC_ADD 0x00000034 //This is the Device address for ADC
+#define I2C_A_ADC_ADD 0x00000034 //This is the Device address for ADC
#define I2C_A_ADC_READ 0x00000001 //To perform a read operation
#define I2C_A_ADC_START 0x00000100 //Start I2C transaction
#define I2C_A_ADC_ABORT 0x00000200 //I2C transaction abort
#define I2C_A_ADC_LAST 0x00000400 //I2C last transaction
#define I2C_A_ADC_BYTE 0x00000800 //I2C one byte mode
-#define I2C_D_ADC_REG_MASK 0xfe000000 //ADC address register
+#define I2C_D_ADC_REG_MASK 0xfe000000 //ADC address register
#define I2C_D_ADC_DAT_MASK 0x01ff0000 //ADC data register
#define ADC_TIMEOUT 0x00000007 //ADC Timeout Clock Disable
@@ -708,13 +708,13 @@ struct snd_ca0106 {
int snd_ca0106_mixer(struct snd_ca0106 *emu);
int snd_ca0106_proc_init(struct snd_ca0106 * emu);
-unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu,
- unsigned int reg,
+unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu,
+ unsigned int reg,
unsigned int chn);
-void snd_ca0106_ptr_write(struct snd_ca0106 *emu,
- unsigned int reg,
- unsigned int chn,
+void snd_ca0106_ptr_write(struct snd_ca0106 *emu,
+ unsigned int reg,
+ unsigned int chn,
unsigned int data);
int snd_ca0106_i2c_write(struct snd_ca0106 *emu, u32 reg, u32 value);
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
index 6abe8a3..6d4534a 100644
--- a/sound/pci/ca0106/ca0106_main.c
+++ b/sound/pci/ca0106/ca0106_main.c
@@ -18,7 +18,7 @@
* So, to record from the MIC, set the MIC Playback volume to max,
* unmute the MIC and turn up the MASTER Playback volume.
* So, to prevent feedback when capturing, minimise the "Capture feedback into Playback" volume.
- *
+ *
* The only playback controls that currently do anything are: -
* Analog Front
* Analog Rear
@@ -26,12 +26,12 @@
* SPDIF Front
* SPDIF Rear
* SPDIF Center/LFE
- *
+ *
* For capture from Mic in or Line in.
* Digital/Analog ( switch must be in Analog mode for CAPTURE. )
- *
+ *
* CAPTURE feedback into PLAYBACK
- *
+ *
* Changelog:
* Support interrupts per period.
* Removed noise from Center/LFE channel when in Analog mode.
@@ -108,7 +108,7 @@
* DAC: CS4382 (114 dB, 24-Bit, 192 kHz, 8-Channel D/A Converter with DSD Support)
* SPDIF Out control switches between Mic in and SPDIF out.
* No sound out or mic input working yet.
- *
+ *
* GENERAL INFO:
* Model: SB0413
* P17 Chip: CA0106-DAT
@@ -202,7 +202,7 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
/* AudigyLS[SB0310] */
{ .serial = 0x10021102,
.name = "AudigyLS [SB0310]",
- .ac97 = 1 } ,
+ .ac97 = 1 } ,
/* Unknown AudigyLS that also says SB0310 on it */
{ .serial = 0x10051102,
.name = "AudigyLS [SB0310b]",
@@ -279,7 +279,7 @@ static struct snd_ca0106_details ca0106_chip_details[] = {
/* hardware definition */
static struct snd_pcm_hardware snd_ca0106_playback_hw = {
- .info = SNDRV_PCM_INFO_MMAP |
+ .info = SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID |
@@ -289,8 +289,8 @@ static struct snd_pcm_hardware snd_ca0106_playback_hw = {
SNDRV_PCM_RATE_192000),
.rate_min = 48000,
.rate_max = 192000,
- .channels_min = 2, //1,
- .channels_max = 2, //6,
+ .channels_min = 2, /* 1, */
+ .channels_max = 2, /* 6, */
.buffer_bytes_max = ((65536 - 64) * 8),
.period_bytes_min = 64,
.period_bytes_max = (65536 - 64),
@@ -300,7 +300,7 @@ static struct snd_pcm_hardware snd_ca0106_playback_hw = {
};
static struct snd_pcm_hardware snd_ca0106_capture_hw = {
- .info = (SNDRV_PCM_INFO_MMAP |
+ .info = (SNDRV_PCM_INFO_MMAP |
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER |
SNDRV_PCM_INFO_MMAP_VALID),
@@ -319,13 +319,13 @@ static struct snd_pcm_hardware snd_ca0106_capture_hw = {
.fifo_size = 0,
};
-unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu,
- unsigned int reg,
+unsigned int snd_ca0106_ptr_read(struct snd_ca0106 *emu,
+ unsigned int reg,
unsigned int chn)
{
unsigned long flags;
unsigned int regptr, val;
-
+
regptr = (reg << 16) | chn;
spin_lock_irqsave(&emu->emu_lock, flags);
@@ -335,9 +335,9 @@ unsigned int snd_ca0106_ptr_read(struct snd_ca0106 * emu,
return val;
}
-void snd_ca0106_ptr_write(struct snd_ca0106 *emu,
- unsigned int reg,
- unsigned int chn,
+void snd_ca0106_ptr_write(struct snd_ca0106 *emu,
+ unsigned int reg,
+ unsigned int chn,
unsigned int data)
{
unsigned int regptr;
@@ -351,7 +351,7 @@ void snd_ca0106_ptr_write(struct snd_ca0106 *emu,
spin_unlock_irqrestore(&emu->emu_lock, flags);
}
-int snd_ca0106_spi_write(struct snd_ca0106 * emu,
+int snd_ca0106_spi_write(struct snd_ca0106 *emu,
unsigned int data)
{
unsigned int reset, set;
@@ -398,7 +398,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
}
tmp = reg << 25 | value << 16;
- // snd_printk("I2C-write:reg=0x%x, value=0x%x\n", reg, value);
+ /* snd_printk("I2C-write:reg=0x%x, value=0x%x\n", reg, value); */
/* Not sure what this I2C channel controls. */
/* snd_ca0106_ptr_write(emu, I2C_D0, 0, tmp); */
@@ -407,8 +407,8 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
for (retry = 0; retry < 10; retry++) {
/* Send the data to i2c */
- //tmp = snd_ca0106_ptr_read(emu, I2C_A, 0);
- //tmp = tmp & ~(I2C_A_ADC_READ|I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD_MASK);
+ /* tmp = snd_ca0106_ptr_read(emu, I2C_A, 0); */
+ /* tmp = tmp & ~(I2C_A_ADC_READ|I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD_MASK); */
tmp = 0;
tmp = tmp | (I2C_A_ADC_LAST|I2C_A_ADC_START|I2C_A_ADC_ADD);
snd_ca0106_ptr_write(emu, I2C_A, 0, tmp);
@@ -416,7 +416,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
/* Wait till the transaction ends */
while (1) {
status = snd_ca0106_ptr_read(emu, I2C_A, 0);
- //snd_printk("I2C:status=0x%x\n", status);
+ /* snd_printk("I2C:status=0x%x\n", status); */
timeout++;
if ((status & I2C_A_ADC_START) == 0)
break;
@@ -424,7 +424,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
if (timeout > 1000)
break;
}
- //Read back and see if the transaction is successful
+ /* Read back and see if the transaction is successful */
if ((status & I2C_A_ADC_ABORT) == 0)
break;
}
@@ -433,7 +433,7 @@ int snd_ca0106_i2c_write(struct snd_ca0106 *emu,
snd_printk(KERN_ERR "Writing to ADC failed!\n");
return -EINVAL;
}
-
+
return 0;
}
@@ -496,18 +496,18 @@ static int snd_ca0106_pcm_open_playback_channel(struct snd_pcm_substream *substr
epcm->emu = chip;
epcm->substream = substream;
epcm->channel_id=channel_id;
-
+
runtime->private_data = epcm;
runtime->private_free = snd_ca0106_pcm_free_substream;
-
+
runtime->hw = snd_ca0106_playback_hw;
channel->emu = chip;
channel->number = channel_id;
channel->use = 1;
- //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
- //channel->interrupt = snd_ca0106_pcm_channel_interrupt;
+ /* printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); */
+ /* channel->interrupt = snd_ca0106_pcm_channel_interrupt; */
channel->epcm = epcm;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
@@ -584,22 +584,22 @@ static int snd_ca0106_pcm_open_capture_channel(struct snd_pcm_substream *substre
epcm->emu = chip;
epcm->substream = substream;
epcm->channel_id=channel_id;
-
+
runtime->private_data = epcm;
runtime->private_free = snd_ca0106_pcm_free_substream;
-
+
runtime->hw = snd_ca0106_capture_hw;
channel->emu = chip;
channel->number = channel_id;
channel->use = 1;
- //printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel);
- //channel->interrupt = snd_ca0106_pcm_channel_interrupt;
+ /* printk("open:channel_id=%d, chip=%p, channel=%p\n",channel_id, chip, channel); */
+ /* channel->interrupt = snd_ca0106_pcm_channel_interrupt; */
channel->epcm = epcm;
if ((err = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS)) < 0)
return err;
- //snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes);
+ /* snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_SIZE, &hw_constraints_capture_period_sizes); */
if ((err = snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, 64)) < 0)
return err;
return 0;
@@ -680,37 +680,37 @@ static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
u32 reg40_set = 0;
u32 reg40;
/* FIXME: Depending on mixer selection of SPDIF out or not, select the spdif rate or the DAC rate. */
- u32 reg71_mask = 0x03030000 ; /* Global. Set SPDIF rate. We only support 44100 to spdif, not to DAC. */
+ u32 reg71_mask = 0x03030000; /* Global. Set SPDIF rate. We only support 44100 to spdif, not to DAC. */
u32 reg71_set = 0;
u32 reg71;
int i;
-
- //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
- //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
- //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
+
+ /* snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); */
/* Rate can be set per channel. */
/* reg40 control host to fifo */
/* reg71 controls DAC rate. */
switch (runtime->rate) {
case 44100:
reg40_set = 0x10000 << (channel<<1);
- reg71_set = 0x01010000;
+ reg71_set = 0x01010000;
break;
case 48000:
reg40_set = 0;
- reg71_set = 0;
+ reg71_set = 0;
break;
case 96000:
reg40_set = 0x20000 << (channel<<1);
- reg71_set = 0x02020000;
+ reg71_set = 0x02020000;
break;
case 192000:
reg40_set = 0x30000 << (channel<<1);
- reg71_set = 0x03030000;
+ reg71_set = 0x03030000;
break;
default:
reg40_set = 0;
- reg71_set = 0;
+ reg71_set = 0;
break;
}
/* Format is a global setting */
@@ -726,7 +726,7 @@ static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
hcfg_set = 0;
break;
}
- hcfg = inl(emu->port + HCFG) ;
+ hcfg = inl(emu->port + HCFG);
hcfg = (hcfg & ~hcfg_mask) | hcfg_set;
outl(hcfg, emu->port + HCFG);
reg40 = snd_ca0106_ptr_read(emu, 0x40, 0);
@@ -737,18 +737,18 @@ static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
snd_ca0106_ptr_write(emu, 0x71, 0, reg71);
/* FIXME: Check emu->buffer.size before actually writing to it. */
- for(i=0; i < runtime->periods; i++) {
+ for (i = 0; i < runtime->periods; i++) {
table_base[i*2] = runtime->dma_addr + (i * period_size_bytes);
table_base[i*2+1] = period_size_bytes << 16;
}
-
+
snd_ca0106_ptr_write(emu, PLAYBACK_LIST_ADDR, channel, emu->buffer.addr+(8*16*channel));
snd_ca0106_ptr_write(emu, PLAYBACK_LIST_SIZE, channel, (runtime->periods - 1) << 19);
snd_ca0106_ptr_write(emu, PLAYBACK_LIST_PTR, channel, 0);
snd_ca0106_ptr_write(emu, PLAYBACK_DMA_ADDR, channel, runtime->dma_addr);
- snd_ca0106_ptr_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); // buffer size in bytes
+ snd_ca0106_ptr_write(emu, PLAYBACK_PERIOD_SIZE, channel, frames_to_bytes(runtime, runtime->period_size)<<16); /* buffer size in bytes */
/* FIXME test what 0 bytes does. */
- snd_ca0106_ptr_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); // buffer size in bytes
+ snd_ca0106_ptr_write(emu, PLAYBACK_PERIOD_SIZE, channel, 0); /* buffer size in bytes */
snd_ca0106_ptr_write(emu, PLAYBACK_POINTER, channel, 0);
snd_ca0106_ptr_write(emu, 0x07, channel, 0x0);
snd_ca0106_ptr_write(emu, 0x08, channel, 0);
@@ -758,7 +758,7 @@ static int snd_ca0106_pcm_prepare_playback(struct snd_pcm_substream *substream)
SPCS_CLKACCY_1000PPM | SPCS_SAMPLERATE_48 |
SPCS_CHANNELNUM_LEFT | SPCS_SOURCENUM_UNSPEC |
SPCS_GENERATIONSTATUS | 0x00001200 |
- 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT );
+ 0x00000000 | SPCS_EMPHASIS_NONE | SPCS_COPYRIGHT);
}
#endif
@@ -776,31 +776,31 @@ static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream)
u32 hcfg_set = 0x00000000;
u32 hcfg;
u32 over_sampling=0x2;
- u32 reg71_mask = 0x0000c000 ; /* Global. Set ADC rate. */
+ u32 reg71_mask = 0x0000c000; /* Global. Set ADC rate. */
u32 reg71_set = 0;
u32 reg71;
-
- //snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1));
- //snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base);
- //snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes);
+
+ /* snd_printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, periods=%u, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, runtime->periods, frames_to_bytes(runtime, 1)); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, table_base=%p\n",runtime->dma_addr, runtime->dma_area, table_base); */
+ /* snd_printk("dma_addr=%x, dma_area=%p, dma_bytes(size)=%x\n",emu->buffer.addr, emu->buffer.area, emu->buffer.bytes); */
/* reg71 controls ADC rate. */
switch (runtime->rate) {
case 44100:
reg71_set = 0x00004000;
break;
case 48000:
- reg71_set = 0;
+ reg71_set = 0;
break;
case 96000:
reg71_set = 0x00008000;
over_sampling=0xa;
break;
case 192000:
- reg71_set = 0x0000c000;
+ reg71_set = 0x0000c000;
over_sampling=0xa;
break;
default:
- reg71_set = 0;
+ reg71_set = 0;
break;
}
/* Format is a global setting */
@@ -816,7 +816,7 @@ static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream)
hcfg_set = 0;
break;
}
- hcfg = inl(emu->port + HCFG) ;
+ hcfg = inl(emu->port + HCFG);
hcfg = (hcfg & ~hcfg_mask) | hcfg_set;
outl(hcfg, emu->port + HCFG);
reg71 = snd_ca0106_ptr_read(emu, 0x71, 0);
@@ -827,10 +827,10 @@ static int snd_ca0106_pcm_prepare_capture(struct snd_pcm_substream *substream)
}
- //printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1));
+ /* printk("prepare:channel_number=%d, rate=%d, format=0x%x, channels=%d, buffer_size=%ld, period_size=%ld, frames_to_bytes=%d\n",channel, runtime->rate, runtime->format, runtime->channels, runtime->buffer_size, runtime->period_size, frames_to_bytes(runtime, 1)); */
snd_ca0106_ptr_write(emu, 0x13, channel, 0);
snd_ca0106_ptr_write(emu, CAPTURE_DMA_ADDR, channel, runtime->dma_addr);
- snd_ca0106_ptr_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size)<<16); // buffer size in bytes
+ snd_ca0106_ptr_write(emu, CAPTURE_BUFFER_SIZE, channel, frames_to_bytes(runtime, runtime->buffer_size)<<16); /* buffer size in bytes */
snd_ca0106_ptr_write(emu, CAPTURE_POINTER, channel, 0);
return 0;
@@ -866,13 +866,13 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream,
runtime = s->runtime;
epcm = runtime->private_data;
channel = epcm->channel_id;
- //snd_printk("channel=%d\n",channel);
+ /* snd_printk("channel=%d\n",channel); */
epcm->running = running;
basic |= (0x1<<channel);
extended |= (0x10<<channel);
snd_pcm_trigger_done(s, substream);
}
- //snd_printk("basic=0x%x, extended=0x%x\n",basic, extended);
+ /* snd_printk("basic=0x%x, extended=0x%x\n",basic, extended); */
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
@@ -940,7 +940,7 @@ snd_ca0106_pcm_pointer_playback(struct snd_pcm_substream *substream)
ptr=ptr2;
if (ptr >= runtime->buffer_size)
ptr -= runtime->buffer_size;
- //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate);
+ /* printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); */
return ptr;
}
@@ -963,7 +963,7 @@ snd_ca0106_pcm_pointer_capture(struct snd_pcm_substream *substream)
ptr=ptr2;
if (ptr >= runtime->buffer_size)
ptr -= runtime->buffer_size;
- //printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate);
+ /* printk("ptr1 = 0x%lx, ptr2=0x%lx, ptr=0x%lx, buffer_size = 0x%x, period_size = 0x%x, bits=%d, rate=%d\n", ptr1, ptr2, ptr, (int)runtime->buffer_size, (int)runtime->period_size, (int)runtime->frame_bits, (int)runtime->rate); */
return ptr;
}
@@ -1030,9 +1030,9 @@ static struct snd_pcm_ops snd_ca0106_playback_center_lfe_ops = {
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_ca0106_pcm_hw_params_playback,
.hw_free = snd_ca0106_pcm_hw_free_playback,
- .prepare = snd_ca0106_pcm_prepare_playback,
- .trigger = snd_ca0106_pcm_trigger_playback,
- .pointer = snd_ca0106_pcm_pointer_playback,
+ .prepare = snd_ca0106_pcm_prepare_playback,
+ .trigger = snd_ca0106_pcm_trigger_playback,
+ .pointer = snd_ca0106_pcm_pointer_playback,
};
static struct snd_pcm_ops snd_ca0106_playback_unknown_ops = {
@@ -1041,9 +1041,9 @@ static struct snd_pcm_ops snd_ca0106_playback_unknown_ops = {
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_ca0106_pcm_hw_params_playback,
.hw_free = snd_ca0106_pcm_hw_free_playback,
- .prepare = snd_ca0106_pcm_prepare_playback,
- .trigger = snd_ca0106_pcm_trigger_playback,
- .pointer = snd_ca0106_pcm_pointer_playback,
+ .prepare = snd_ca0106_pcm_prepare_playback,
+ .trigger = snd_ca0106_pcm_trigger_playback,
+ .pointer = snd_ca0106_pcm_pointer_playback,
};
static struct snd_pcm_ops snd_ca0106_playback_rear_ops = {
@@ -1052,9 +1052,9 @@ static struct snd_pcm_ops snd_ca0106_playback_rear_ops = {
.ioctl = snd_pcm_lib_ioctl,
.hw_params = snd_ca0106_pcm_hw_params_playback,
.hw_free = snd_ca0106_pcm_hw_free_playback,
- .prepare = snd_ca0106_pcm_prepare_playback,
- .trigger = snd_ca0106_pcm_trigger_playback,
- .pointer = snd_ca0106_pcm_pointer_playback,
+ .prepare = snd_ca0106_pcm_prepare_playback,
+ .trigger = snd_ca0106_pcm_trigger_playback,
+ .pointer = snd_ca0106_pcm_pointer_playback,
};
@@ -1077,7 +1077,7 @@ static void snd_ca0106_ac97_write(struct snd_ac97 *ac97,
{
struct snd_ca0106 *emu = ac97->private_data;
unsigned long flags;
-
+
spin_lock_irqsave(&emu->emu_lock, flags);
outb(reg, emu->port + AC97ADDRESS);
outw(val, emu->port + AC97DATA);
@@ -1093,7 +1093,7 @@ static int snd_ca0106_ac97(struct snd_ca0106 *chip)
.write = snd_ca0106_ac97_write,
.read = snd_ca0106_ac97_read,
};
-
+
if ((err = snd_ac97_bus(chip->card, 0, &ops, NULL, &pbus)) < 0)
return err;
pbus->no_vra = 1; /* we don't need VRA */
@@ -1107,13 +1107,13 @@ static int snd_ca0106_ac97(struct snd_ca0106 *chip)
static int snd_ca0106_free(struct snd_ca0106 *chip)
{
if (chip->res_port != NULL) { /* avoid access to already used hardware */
- // disable interrupts
+ /* disable interrupts */
snd_ca0106_ptr_write(chip, BASIC_INTERRUPT, 0, 0);
outl(0, chip->port + INTE);
snd_ca0106_ptr_write(chip, EXTENDED_INT_MASK, 0, 0);
udelay(1000);
- // disable audio
- //outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG);
+ /* disable audio */
+ /* outl(HCFG_LOCKSOUNDCACHE, chip->port + HCFG); */
outl(0, chip->port + HCFG);
/* FIXME: We need to stop and DMA transfers here.
* But as I am not sure how yet, we cannot from the dma pages.
@@ -1122,13 +1122,13 @@ static int snd_ca0106_free(struct snd_ca0106 *chip)
}
if (chip->irq >= 0)
free_irq(chip->irq, chip);
- // release the data
+ /* release the data */
#if 1
if (chip->buffer.area)
snd_dma_free_pages(&chip->buffer);
#endif
- // release the i/o port
+ /* release the i/o port */
release_and_free_resource(chip->res_port);
pci_disable_device(chip->pci);
@@ -1153,38 +1153,38 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id)
struct snd_ca0106_channel *pchannel;
status = inl(chip->port + IPR);
- if (! status)
+ if (!status)
return IRQ_NONE;
stat76 = snd_ca0106_ptr_read(chip, EXTENDED_INT, 0);
- //snd_printk("interrupt status = 0x%08x, stat76=0x%08x\n", status, stat76);
- //snd_printk("ptr=0x%08x\n",snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0));
+ /* snd_printk("interrupt status = 0x%08x, stat76=0x%08x\n", status, stat76); */
+ /* snd_printk("ptr=0x%08x\n",snd_ca0106_ptr_read(chip, PLAYBACK_POINTER, 0)); */
mask = 0x11; /* 0x1 for one half, 0x10 for the other half period. */
- for(i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
pchannel = &(chip->playback_channels[i]);
if (stat76 & mask) {
/* FIXME: Select the correct substream for period elapsed */
- if(pchannel->use) {
+ if (pchannel->use) {
snd_pcm_period_elapsed(pchannel->epcm->substream);
- //printk(KERN_INFO "interrupt [%d] used\n", i);
+ /* printk(KERN_INFO "interrupt [%d] used\n", i); */
}
}
- //printk(KERN_INFO "channel=%p\n",pchannel);
- //printk(KERN_INFO "interrupt stat76[%d] = %08x, use=%d, channel=%d\n", i, stat76, pchannel->use, pchannel->number);
+ /* printk(KERN_INFO "channel=%p\n",pchannel); */
+ /* printk(KERN_INFO "interrupt stat76[%d] = %08x, use=%d, channel=%d\n", i, stat76, pchannel->use, pchannel->number); */
mask <<= 1;
}
mask = 0x110000; /* 0x1 for one half, 0x10 for the other half period. */
- for(i = 0; i < 4; i++) {
+ for (i = 0; i < 4; i++) {
pchannel = &(chip->capture_channels[i]);
if (stat76 & mask) {
/* FIXME: Select the correct substream for period elapsed */
- if(pchannel->use) {
+ if (pchannel->use) {
snd_pcm_period_elapsed(pchannel->epcm->substream);
- //printk(KERN_INFO "interrupt [%d] used\n", i);
+ /* printk(KERN_INFO "interrupt [%d] used\n", i); */
}
}
- //printk(KERN_INFO "channel=%p\n",pchannel);
- //printk(KERN_INFO "interrupt stat76[%d] = %08x, use=%d, channel=%d\n", i, stat76, pchannel->use, pchannel->number);
+ /* printk(KERN_INFO "channel=%p\n",pchannel); */
+ /* printk(KERN_INFO "interrupt stat76[%d] = %08x, use=%d, channel=%d\n", i, stat76, pchannel->use, pchannel->number); */
mask <<= 1;
}
@@ -1198,7 +1198,7 @@ static irqreturn_t snd_ca0106_interrupt(int irq, void *dev_id)
chip->midi.interrupt_disable(&chip->midi, chip->midi.tx_enable | chip->midi.rx_enable);
}
- // acknowledge the interrupt if necessary
+ /* acknowledge the interrupt if necessary */
outl(status, chip->port+IPR);
return IRQ_HANDLED;
@@ -1209,12 +1209,12 @@ static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct s
struct snd_pcm *pcm;
struct snd_pcm_substream *substream;
int err;
-
+
if (rpcm)
*rpcm = NULL;
if ((err = snd_pcm_new(emu->card, "ca0106", device, 1, 1, &pcm)) < 0)
return err;
-
+
pcm->private_data = emu;
switch (device) {
@@ -1241,29 +1241,29 @@ static int __devinit snd_ca0106_pcm(struct snd_ca0106 *emu, int device, struct s
strcpy(pcm->name, "CA0106");
emu->pcm = pcm;
- for(substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
- substream;
+ for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream;
+ substream;
substream = substream->next) {
- if ((err = snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
+ if ((err = snd_pcm_lib_preallocate_pages(substream,
+ SNDRV_DMA_TYPE_DEV,
+ snd_dma_pci_data(emu->pci),
64*1024, 64*1024)) < 0) /* FIXME: 32*1024 for sound buffer, between 32and64 for Periods table. */
return err;
}
- for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
- substream;
+ for (substream = pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream;
+ substream;
substream = substream->next) {
- if ((err = snd_pcm_lib_preallocate_pages(substream,
- SNDRV_DMA_TYPE_DEV,
- snd_dma_pci_data(emu->pci),
+ if ((err = snd_pcm_lib_preallocate_pages(substream,
+ SNDRV_DMA_TYPE_DEV,
+ snd_dma_pci_data(emu->pci),
64*1024, 64*1024)) < 0)
return err;
}
-
+
if (rpcm)
*rpcm = pcm;
-
+
return 0;
}
@@ -1313,9 +1313,9 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
static struct snd_device_ops ops = {
.dev_free = snd_ca0106_dev_free,
};
-
+
*rchip = NULL;
-
+
if ((err = pci_enable_device(pci)) < 0)
return err;
if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 ||
@@ -1324,22 +1324,22 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
pci_disable_device(pci);
return -ENXIO;
}
-
+
chip = kzalloc(sizeof(*chip), GFP_KERNEL);
if (chip == NULL) {
pci_disable_device(pci);
return -ENOMEM;
}
-
+
chip->card = card;
chip->pci = pci;
chip->irq = -1;
spin_lock_init(&chip->emu_lock);
-
+
chip->port = pci_resource_start(pci, 0);
if ((chip->res_port = request_region(chip->port, 0x20,
- "snd_ca0106")) == NULL) {
+ "snd_ca0106")) == NULL) {
snd_ca0106_free(chip);
printk(KERN_ERR "cannot allocate the port\n");
return -EBUSY;
@@ -1352,9 +1352,9 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
return -EBUSY;
}
chip->irq = pci->irq;
-
- /* This stores the periods table. */
- if(snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1024, &chip->buffer) < 0) {
+
+ /* This stores the periods table. */
+ if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(pci), 1024, &chip->buffer) < 0) {
snd_ca0106_free(chip);
return -ENOMEM;
}
@@ -1441,13 +1441,13 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
snd_ca0106_ptr_write(chip, 0x44, 0, 0x2108006);
#endif
- //snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0xf0f003f); /* OSS drivers set this. */
+ /* snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0xf0f003f); OSS drivers set this. */
/* Analog or Digital output */
snd_ca0106_ptr_write(chip, SPDIF_SELECT1, 0, 0xf);
snd_ca0106_ptr_write(chip, SPDIF_SELECT2, 0, 0x000f0000); /* 0x0b000000 for digital, 0x000b0000 for analog, from win2000 drivers. Use 0x000f0000 for surround71 */
chip->spdif_enable = 0; /* Set digital SPDIF output off */
- //snd_ca0106_ptr_write(chip, 0x45, 0, 0); /* Analogue out */
- //snd_ca0106_ptr_write(chip, 0x45, 0, 0xf00); /* Digital out */
+ /* snd_ca0106_ptr_write(chip, 0x45, 0, 0); Analogue out */
+ /* snd_ca0106_ptr_write(chip, 0x45, 0, 0xf00); Digital out */
snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 0, 0x40c81000); /* goes to 0x40c80000 when doing SPDIF IN/OUT */
snd_ca0106_ptr_write(chip, CAPTURE_CONTROL, 1, 0xffffffff); /* (Mute) CAPTURE feedback into PLAYBACK volume. Only lower 16 bits matter. */
@@ -1457,11 +1457,11 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
snd_ca0106_ptr_write(chip, PLAYBACK_ROUTING2, 0, 0x76767676);
snd_ca0106_ptr_write(chip, CAPTURE_ROUTING1, 0, 0x32765410);
snd_ca0106_ptr_write(chip, CAPTURE_ROUTING2, 0, 0x76767676);
- for(ch = 0; ch < 4; ch++) {
+ for (ch = 0; ch < 4; ch++) {
snd_ca0106_ptr_write(chip, CAPTURE_VOLUME1, ch, 0x30303030); /* Only high 16 bits matter */
snd_ca0106_ptr_write(chip, CAPTURE_VOLUME2, ch, 0x30303030);
- //snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0x40404040); /* Mute */
- //snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0x40404040); /* Mute */
+ /* snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0x40404040); Mute */
+ /* snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0x40404040); Mute */
snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME1, ch, 0xffffffff); /* Mute */
snd_ca0106_ptr_write(chip, PLAYBACK_VOLUME2, ch, 0xffffffff); /* Mute */
}
@@ -1485,30 +1485,30 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
if (chip->details->gpio_type == 2) { /* The SB0438 use GPIO differently. */
/* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */
outl(0x0, chip->port+GPIO);
- //outl(0x00f0e000, chip->port+GPIO); /* Analog */
+ /* outl(0x00f0e000, chip->port+GPIO); Analog */
outl(0x005f5301, chip->port+GPIO); /* Analog */
} else if (chip->details->gpio_type == 1) { /* The SB0410 and SB0413 use GPIO differently. */
/* FIXME: Still need to find out what the other GPIO bits do. E.g. For digital spdif out. */
outl(0x0, chip->port+GPIO);
- //outl(0x00f0e000, chip->port+GPIO); /* Analog */
+ /* outl(0x00f0e000, chip->port+GPIO); Analog */
outl(0x005f5301, chip->port+GPIO); /* Analog */
} else {
outl(0x0, chip->port+GPIO);
outl(0x005f03a3, chip->port+GPIO); /* Analog */
- //outl(0x005f02a2, chip->port+GPIO); /* SPDIF */
+ /* outl(0x005f02a2, chip->port+GPIO); SPDIF */
}
snd_ca0106_intr_enable(chip, 0x105); /* Win2000 uses 0x1e0 */
- //outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG);
- //outl(0x00001409, chip->port+HCFG); /* 0x1000 causes AC3 to fails. Maybe it effects 24 bit output. */
- //outl(0x00000009, chip->port+HCFG);
+ /* outl(HCFG_LOCKSOUNDCACHE|HCFG_AUDIOENABLE, chip->port+HCFG); */
+ /* outl(0x00001409, chip->port+HCFG); 0x1000 causes AC3 to fails. Maybe it effects 24 bit output. */
+ /* outl(0x00000009, chip->port+HCFG); */
outl(HCFG_AC97 | HCFG_AUDIOENABLE, chip->port+HCFG); /* AC97 2.0, Enable outputs. */
if (chip->details->i2c_adc == 1) { /* The SB0410 and SB0413 use I2C to control ADC. */
int size, n;
size = ARRAY_SIZE(i2c_adc_init);
- //snd_printk("I2C:array size=0x%x\n", size);
+ /* snd_printk("I2C:array size=0x%x\n", size); */
for (n=0; n < size; n++) {
snd_ca0106_i2c_write(chip, i2c_adc_init[n][0], i2c_adc_init[n][1]);
}
@@ -1517,7 +1517,7 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card,
chip->i2c_capture_volume[n][1]= 0xcf;
}
chip->i2c_capture_source=2; /* Line in */
- //snd_ca0106_i2c_write(chip, ADC_MUX, ADC_MUX_LINEIN); /* Enable Line-in capture. MIC in currently untested. */
+ /* snd_ca0106_i2c_write(chip, ADC_MUX, ADC_MUX_LINEIN); Enable Line-in capture. MIC in currently untested. */
}
if (chip->details->spi_dac == 1) { /* The SB0570 use SPI to control DAC. */
int size, n;
@@ -1616,7 +1616,7 @@ static int __devinit snd_ca0106_midi(struct snd_ca0106 *chip, unsigned int chann
midi->get_dev_id_port = ca0106_dev_id_port;
midi->dev_id = chip;
-
+
if ((err = ca_midi_init(chip, midi, 0, name)) < 0)
return err;
diff --git a/sound/pci/ca0106/ca0106_mixer.c b/sound/pci/ca0106/ca0106_mixer.c
index 3025ed1..9bfc92d 100644
--- a/sound/pci/ca0106/ca0106_mixer.c
+++ b/sound/pci/ca0106/ca0106_mixer.c
@@ -5,7 +5,7 @@
*
* FEATURES currently supported:
* See ca0106_main.c for features.
- *
+ *
* Changelog:
* Support interrupts per period.
* Removed noise from Center/LFE channel when in Analog mode.
@@ -71,7 +71,7 @@
#include <sound/ac97_codec.h>
#include <sound/info.h>
#include <sound/tlv.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "ca0106.h"
@@ -157,7 +157,7 @@ static int snd_ca0106_capture_source_put(struct snd_kcontrol *kcontrol,
u32 mask;
u32 source;
- val = ucontrol->value.enumerated.item[0] ;
+ val = ucontrol->value.enumerated.item[0];
if (val >= 6)
return -EINVAL;
change = (emu->capture_source != val);
@@ -207,7 +207,7 @@ static int snd_ca0106_i2c_capture_source_put(struct snd_kcontrol *kcontrol,
* update the capture volume from the cached value
* for the particular source.
*/
- source_id = ucontrol->value.enumerated.item[0] ;
+ source_id = ucontrol->value.enumerated.item[0];
if (source_id >= 4)
return -EINVAL;
change = (emu->i2c_capture_source != source_id);
@@ -273,23 +273,23 @@ static int snd_ca0106_capture_mic_line_in_put(struct snd_kcontrol *kcontrol,
int change = 0;
u32 tmp;
- val = ucontrol->value.enumerated.item[0] ;
+ val = ucontrol->value.enumerated.item[0];
if (val > 1)
return -EINVAL;
change = (emu->capture_mic_line_in != val);
if (change) {
emu->capture_mic_line_in = val;
if (val) {
- //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
+ /* snd_ca0106_i2c_write(emu, ADC_MUX, 0); Mute input */
tmp = inl(emu->port+GPIO) & ~0x400;
tmp = tmp | 0x400;
outl(tmp, emu->port+GPIO);
- //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC);
+ /* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_MIC); */
} else {
- //snd_ca0106_i2c_write(emu, ADC_MUX, 0); /* Mute input */
+ /* snd_ca0106_i2c_write(emu, ADC_MUX, 0); Mute input */
tmp = inl(emu->port+GPIO) & ~0x400;
outl(tmp, emu->port+GPIO);
- //snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN);
+ /* snd_ca0106_i2c_write(emu, ADC_MUX, ADC_MUX_LINEIN); */
}
}
return change;
@@ -405,7 +405,7 @@ static int snd_ca0106_volume_put(struct snd_kcontrol *kcontrol,
nval = ((0xff - ucontrol->value.integer.value[0]) << 24) |
((0xff - ucontrol->value.integer.value[1]) << 16);
nval |= ((0xff - ucontrol->value.integer.value[0]) << 8) |
- ((0xff - ucontrol->value.integer.value[1]) );
+ ((0xff - ucontrol->value.integer.value[1]));
if (oval == nval)
return 0;
snd_ca0106_ptr_write(emu, reg, channel_id, nval);
@@ -451,7 +451,7 @@ static int snd_ca0106_i2c_volume_put(struct snd_kcontrol *kcontrol,
return -EINVAL;
if (ogain != ngain) {
if (emu->i2c_capture_source == source_id)
- snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff) );
+ snd_ca0106_i2c_write(emu, ADC_ATTEN_ADCL, ((ngain) & 0xff));
emu->i2c_capture_volume[source_id][0] = ucontrol->value.integer.value[0];
change = 1;
}
diff --git a/sound/pci/ca0106/ca0106_proc.c b/sound/pci/ca0106/ca0106_proc.c
index c62b7d1..16789b4 100644
--- a/sound/pci/ca0106/ca0106_proc.c
+++ b/sound/pci/ca0106/ca0106_proc.c
@@ -5,7 +5,7 @@
*
* FEATURES currently supported:
* See ca0106_main.c for features.
- *
+ *
* Changelog:
* Support interrupts per period.
* Removed noise from Center/LFE channel when in Analog mode.
@@ -71,7 +71,7 @@
#include <sound/ac97_codec.h>
#include <sound/info.h>
#include <sound/asoundef.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "ca0106.h"
@@ -98,7 +98,7 @@ static struct snd_ca0106_category_str snd_ca0106_con_category[] = {
};
-static void snd_ca0106_proc_dump_iec958( struct snd_info_buffer *buffer, u32 value)
+static void snd_ca0106_proc_dump_iec958(struct snd_info_buffer *buffer, u32 value)
{
int i;
u32 status[4];
@@ -106,8 +106,8 @@ static void snd_ca0106_proc_dump_iec958( struct snd_info_buffer *buffer, u32 val
status[1] = (value >> 8) & 0xff;
status[2] = (value >> 16) & 0xff;
status[3] = (value >> 24) & 0xff;
-
- if (! (status[0] & IEC958_AES0_PROFESSIONAL)) {
+
+ if (!(status[0] & IEC958_AES0_PROFESSIONAL)) {
/* consumer */
snd_iprintf(buffer, "Mode: consumer\n");
snd_iprintf(buffer, "Data: ");
@@ -272,7 +272,7 @@ static void snd_ca0106_proc_dump_iec958( struct snd_info_buffer *buffer, u32 val
}
}
-static void snd_ca0106_proc_iec958(struct snd_info_entry *entry,
+static void snd_ca0106_proc_iec958(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -282,9 +282,9 @@ static void snd_ca0106_proc_iec958(struct snd_info_entry *entry,
snd_iprintf(buffer, "Status: %s, %s, %s\n",
(value & 0x100000) ? "Rate Locked" : "Not Rate Locked",
(value & 0x200000) ? "SPDIF Locked" : "No SPDIF Lock",
- (value & 0x400000) ? "Audio Valid" : "No valid audio" );
- snd_iprintf(buffer, "Estimated sample rate: %u\n",
- ((value & 0xfffff) * 48000) / 0x8000 );
+ (value & 0x400000) ? "Audio Valid" : "No valid audio");
+ snd_iprintf(buffer, "Estimated sample rate: %u\n",
+ ((value & 0xfffff) * 48000) / 0x8000);
if (value & 0x200000) {
snd_iprintf(buffer, "IEC958/SPDIF input status:\n");
value = snd_ca0106_ptr_read(emu, SPDIF_INPUT_STATUS, 0);
@@ -294,7 +294,7 @@ static void snd_ca0106_proc_iec958(struct snd_info_entry *entry,
snd_iprintf(buffer, "\n");
}
-static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -304,7 +304,7 @@ static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry,
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%x %x", ®, &val) != 2)
continue;
- if ((reg < 0x40) && (reg >=0) && (val <= 0xffffffff) ) {
+ if ((reg < 0x40) && (reg >=0) && (val <= 0xffffffff)) {
spin_lock_irqsave(&emu->emu_lock, flags);
outl(val, emu->port + (reg & 0xfffffffc));
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -312,7 +312,7 @@ static void snd_ca0106_proc_reg_write32(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -320,7 +320,7 @@ static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry,
unsigned long flags;
int i;
snd_iprintf(buffer, "Registers:\n\n");
- for(i = 0; i < 0x20; i+=4) {
+ for (i = 0; i < 0x20; i += 4) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inl(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -328,7 +328,7 @@ static void snd_ca0106_proc_reg_read32(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -336,7 +336,7 @@ static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry,
unsigned long flags;
int i;
snd_iprintf(buffer, "Registers:\n\n");
- for(i = 0; i < 0x20; i+=2) {
+ for (i = 0; i < 0x20; i += 2) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inw(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -344,7 +344,7 @@ static void snd_ca0106_proc_reg_read16(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -352,7 +352,7 @@ static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry,
unsigned long flags;
int i;
snd_iprintf(buffer, "Registers:\n\n");
- for(i = 0; i < 0x20; i+=1) {
+ for (i = 0; i < 0x20; i++) {
spin_lock_irqsave(&emu->emu_lock, flags);
value = inb(emu->port + i);
spin_unlock_irqrestore(&emu->emu_lock, flags);
@@ -360,7 +360,7 @@ static void snd_ca0106_proc_reg_read8(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -368,7 +368,7 @@ static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry,
int i,j;
snd_iprintf(buffer, "Registers\n");
- for(i = 0; i < 0x40; i++) {
+ for (i = 0; i < 0x40; i++) {
snd_iprintf(buffer, "%02X: ",i);
for (j = 0; j < 4; j++) {
value = snd_ca0106_ptr_read(emu, i, j);
@@ -378,7 +378,7 @@ static void snd_ca0106_proc_reg_read1(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -386,7 +386,7 @@ static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry,
int i,j;
snd_iprintf(buffer, "Registers\n");
- for(i = 0x40; i < 0x80; i++) {
+ for (i = 0x40; i < 0x80; i++) {
snd_iprintf(buffer, "%02X: ",i);
for (j = 0; j < 4; j++) {
value = snd_ca0106_ptr_read(emu, i, j);
@@ -396,7 +396,7 @@ static void snd_ca0106_proc_reg_read2(struct snd_info_entry *entry,
}
}
-static void snd_ca0106_proc_reg_write(struct snd_info_entry *entry,
+static void snd_ca0106_proc_reg_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -405,12 +405,12 @@ static void snd_ca0106_proc_reg_write(struct snd_info_entry *entry,
while (!snd_info_get_line(buffer, line, sizeof(line))) {
if (sscanf(line, "%x %x %x", ®, &channel_id, &val) != 3)
continue;
- if ((reg < 0x80) && (reg >=0) && (val <= 0xffffffff) && (channel_id >=0) && (channel_id <= 3) )
+ if ((reg < 0x80) && (reg >=0) && (val <= 0xffffffff) && (channel_id >=0) && (channel_id <= 3))
snd_ca0106_ptr_write(emu, reg, channel_id, val);
}
}
-static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry,
+static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ca0106 *emu = entry->private_data;
@@ -425,32 +425,32 @@ static void snd_ca0106_proc_i2c_write(struct snd_info_entry *entry,
}
}
-int __devinit snd_ca0106_proc_init(struct snd_ca0106 * emu)
+int __devinit snd_ca0106_proc_init(struct snd_ca0106 *emu)
{
struct snd_info_entry *entry;
-
- if(! snd_card_proc_new(emu->card, "iec958", &entry))
+
+ if (!snd_card_proc_new(emu->card, "iec958", &entry))
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_iec958);
- if(! snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ca0106_reg32", &entry)) {
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read32);
entry->c.text.write = snd_ca0106_proc_reg_write32;
entry->mode |= S_IWUSR;
}
- if(! snd_card_proc_new(emu->card, "ca0106_reg16", &entry))
+ if (!snd_card_proc_new(emu->card, "ca0106_reg16", &entry))
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read16);
- if(! snd_card_proc_new(emu->card, "ca0106_reg8", &entry))
+ if (!snd_card_proc_new(emu->card, "ca0106_reg8", &entry))
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read8);
- if(! snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ca0106_regs1", &entry)) {
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read1);
entry->c.text.write = snd_ca0106_proc_reg_write;
entry->mode |= S_IWUSR;
}
- if(! snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
+ if (!snd_card_proc_new(emu->card, "ca0106_i2c", &entry)) {
entry->c.text.write = snd_ca0106_proc_i2c_write;
entry->private_data = emu;
entry->mode |= S_IWUSR;
}
- if(! snd_card_proc_new(emu->card, "ca0106_regs2", &entry))
+ if (!snd_card_proc_new(emu->card, "ca0106_regs2", &entry))
snd_info_set_text_ops(entry, emu, snd_ca0106_proc_reg_read2);
return 0;
}
diff --git a/sound/pci/ca0106/ca_midi.c b/sound/pci/ca0106/ca_midi.c
index c788511..3056f98 100644
--- a/sound/pci/ca0106/ca_midi.c
+++ b/sound/pci/ca0106/ca_midi.c
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright 10/16/2005 Tilman Kranz <tilde(a)tk-sls.de>
* Creative Audio MIDI, for the CA0106 Driver
* Version: 0.0.1
@@ -66,7 +66,7 @@ static void ca_midi_interrupt(struct snd_ca_midi *midi, unsigned int status)
ca_midi_clear_rx(midi);
} else {
byte = ca_midi_read_data(midi);
- if(midi->substream_input)
+ if (midi->substream_input)
snd_rawmidi_receive(midi->substream_input, &byte, 1);
@@ -124,7 +124,7 @@ static int ca_midi_input_open(struct snd_rawmidi_substream *substream)
{
struct snd_ca_midi *midi = substream->rmidi->private_data;
unsigned long flags;
-
+
if (snd_BUG_ON(!midi->dev_id))
return -ENXIO;
spin_lock_irqsave(&midi->open_lock, flags);
@@ -187,13 +187,13 @@ static int ca_midi_output_close(struct snd_rawmidi_substream *substream)
if (snd_BUG_ON(!midi->dev_id))
return -ENXIO;
-
+
spin_lock_irqsave(&midi->open_lock, flags);
midi->interrupt_disable(midi,midi->tx_enable);
midi->midi_mode &= ~CA_MIDI_MODE_OUTPUT;
midi->substream_output = NULL;
-
+
if (!(midi->midi_mode & CA_MIDI_MODE_INPUT)) {
spin_unlock_irqrestore(&midi->open_lock, flags);
ca_midi_cmd(midi, midi->reset, 0);
@@ -230,7 +230,7 @@ static void ca_midi_output_trigger(struct snd_rawmidi_substream *substream, int
unsigned char byte;
spin_lock_irqsave(&midi->output_lock, flags);
-
+
/* try to send some amount of bytes here before interrupts */
while (max > 0) {
if (ca_midi_output_ready(midi)) {
@@ -309,7 +309,7 @@ int __devinit ca_midi_init(void *dev_id, struct snd_ca_midi *midi, int device, c
SNDRV_RAWMIDI_INFO_DUPLEX;
rmidi->private_data = midi;
rmidi->private_free = ca_rmidi_free;
-
+
midi->rmidi = rmidi;
return 0;
}
diff --git a/sound/pci/ca0106/ca_midi.h b/sound/pci/ca0106/ca_midi.h
index 922ed3e..d285456 100644
--- a/sound/pci/ca0106/ca_midi.h
+++ b/sound/pci/ca0106/ca_midi.h
@@ -1,4 +1,4 @@
-/*
+/*
* Copyright 10/16/2005 Tilman Kranz <tilde(a)tk-sls.de>
* Creative Audio MIDI, for the CA0106 Driver
* Version: 0.0.1
@@ -46,8 +46,8 @@ struct snd_ca_midi {
unsigned int midi_mode;
int port;
int tx_enable, rx_enable;
- int ipr_tx, ipr_rx;
-
+ int ipr_tx, ipr_rx;
+
int input_avail, output_ready;
int ack, reset, enter_uart;
1
0

[alsa-devel] [PATCH 03/24] sound/pci: coding style fixes: sound/pci/a*
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/ad1889.c | 116 +++++++++++++++++++++---------------------
sound/pci/ak4531_codec.c | 14 +++---
sound/pci/als300.c | 16 +++---
sound/pci/als4000.c | 70 +++++++++++++-------------
sound/pci/atiixp.c | 64 ++++++++++++------------
sound/pci/atiixp_modem.c | 46 +++++++++---------
sound/pci/aw2/aw2-alsa.c | 2 +-
sound/pci/aw2/aw2-saa7146.c | 2 +-
sound/pci/azt3328.c | 12 ++--
sound/pci/azt3328.h | 6 +-
10 files changed, 174 insertions(+), 174 deletions(-)
diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index 92f3a97..5fdca0e 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -45,7 +45,7 @@
#include <sound/initval.h>
#include <sound/ac97_codec.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include "ad1889.h"
#include "ac97/ac97_id.h"
@@ -137,7 +137,7 @@ static inline void
ad1889_unmute(struct snd_ad1889 *chip)
{
u16 st;
- st = ad1889_readw(chip, AD_DS_WADA) &
+ st = ad1889_readw(chip, AD_DS_WADA) &
~(AD_DS_WADA_RWAM | AD_DS_WADA_LWAM);
ad1889_writew(chip, AD_DS_WADA, st);
ad1889_readw(chip, AD_DS_WADA);
@@ -198,13 +198,13 @@ static void
ad1889_channel_reset(struct snd_ad1889 *chip, unsigned int channel)
{
u16 reg;
-
+
if (channel & AD_CHAN_WAV) {
/* Disable wave channel */
reg = ad1889_readw(chip, AD_DS_WSMC) & ~AD_DS_WSMC_WAEN;
ad1889_writew(chip, AD_DS_WSMC, reg);
chip->wave.reg = reg;
-
+
/* disable IRQs */
reg = ad1889_readw(chip, AD_DMA_WAV);
reg &= AD_DMA_IM_DIS;
@@ -219,7 +219,7 @@ ad1889_channel_reset(struct snd_ad1889 *chip, unsigned int channel)
/* flush */
ad1889_readw(chip, AD_DMA_WAV);
}
-
+
if (channel & AD_CHAN_ADC) {
/* Disable ADC channel */
reg = ad1889_readw(chip, AD_DS_RAMC) & ~AD_DS_RAMC_ADEN;
@@ -230,7 +230,7 @@ ad1889_channel_reset(struct snd_ad1889 *chip, unsigned int channel)
reg &= AD_DMA_IM_DIS;
reg &= ~AD_DMA_LOOP;
ad1889_writew(chip, AD_DMA_ADC, reg);
-
+
ad1889_load_adc_buffer_address(chip, 0x0);
ad1889_load_adc_buffer_count(chip, 0x0);
ad1889_load_adc_interrupt_count(chip, 0x0);
@@ -258,8 +258,8 @@ static int
snd_ad1889_ac97_ready(struct snd_ad1889 *chip)
{
int retry = 400; /* average needs 352 msec */
-
- while (!(ad1889_readw(chip, AD_AC97_ACIC) & AD_AC97_ACIC_ACRDY)
+
+ while (!(ad1889_readw(chip, AD_AC97_ACIC) & AD_AC97_ACIC_ACRDY)
&& --retry)
mdelay(1);
if (!retry) {
@@ -272,11 +272,11 @@ snd_ad1889_ac97_ready(struct snd_ad1889 *chip)
return 0;
}
-static int
+static int
snd_ad1889_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *hw_params)
{
- return snd_pcm_lib_malloc_pages(substream,
+ return snd_pcm_lib_malloc_pages(substream,
params_buffer_bytes(hw_params));
}
@@ -372,7 +372,7 @@ snd_ad1889_playback_prepare(struct snd_pcm_substream *ss)
ad1889_channel_reset(chip, AD_CHAN_WAV);
reg = ad1889_readw(chip, AD_DS_WSMC);
-
+
/* Mask out 16-bit / Stereo */
reg &= ~(AD_DS_WSMC_WA16 | AD_DS_WSMC_WAST);
@@ -384,13 +384,13 @@ snd_ad1889_playback_prepare(struct snd_pcm_substream *ss)
/* let's make sure we don't clobber ourselves */
spin_lock_irq(&chip->lock);
-
+
chip->wave.size = size;
chip->wave.reg = reg;
chip->wave.addr = rt->dma_addr;
ad1889_writew(chip, AD_DS_WSMC, chip->wave.reg);
-
+
/* Set sample rates on the codec */
ad1889_writew(chip, AD_DS_WAS, rt->rate);
@@ -401,9 +401,9 @@ snd_ad1889_playback_prepare(struct snd_pcm_substream *ss)
/* writes flush */
ad1889_readw(chip, AD_DS_WSMC);
-
+
spin_unlock_irq(&chip->lock);
-
+
ad1889_debug("prepare playback: addr = 0x%x, count = %u, "
"size = %u, reg = 0x%x, rate = %u\n", chip->wave.addr,
count, size, reg, rt->rate);
@@ -420,7 +420,7 @@ snd_ad1889_capture_prepare(struct snd_pcm_substream *ss)
u16 reg;
ad1889_channel_reset(chip, AD_CHAN_ADC);
-
+
reg = ad1889_readw(chip, AD_DS_RAMC);
/* Mask out 16-bit / Stereo */
@@ -434,7 +434,7 @@ snd_ad1889_capture_prepare(struct snd_pcm_substream *ss)
/* let's make sure we don't clobber ourselves */
spin_lock_irq(&chip->lock);
-
+
chip->ramc.size = size;
chip->ramc.reg = reg;
chip->ramc.addr = rt->dma_addr;
@@ -448,9 +448,9 @@ snd_ad1889_capture_prepare(struct snd_pcm_substream *ss)
/* writes flush */
ad1889_readw(chip, AD_DS_RAMC);
-
+
spin_unlock_irq(&chip->lock);
-
+
ad1889_debug("prepare capture: addr = 0x%x, count = %u, "
"size = %u, reg = 0x%x, rate = %u\n", chip->ramc.addr,
count, size, reg, rt->rate);
@@ -466,7 +466,7 @@ snd_ad1889_playback_trigger(struct snd_pcm_substream *ss, int cmd)
{
u16 wsmc;
struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
-
+
wsmc = ad1889_readw(chip, AD_DS_WSMC);
switch (cmd) {
@@ -486,9 +486,9 @@ snd_ad1889_playback_trigger(struct snd_pcm_substream *ss, int cmd)
snd_BUG();
return -EINVAL;
}
-
+
chip->wave.reg = wsmc;
- ad1889_writew(chip, AD_DS_WSMC, wsmc);
+ ad1889_writew(chip, AD_DS_WSMC, wsmc);
ad1889_readw(chip, AD_DS_WSMC); /* flush */
/* reset the chip when STOP - will disable IRQs */
@@ -509,7 +509,7 @@ snd_ad1889_capture_trigger(struct snd_pcm_substream *ss, int cmd)
struct snd_ad1889 *chip = snd_pcm_substream_chip(ss);
ramc = ad1889_readw(chip, AD_DS_RAMC);
-
+
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
/* enable DMA loop & interrupts */
@@ -524,15 +524,15 @@ snd_ad1889_capture_trigger(struct snd_pcm_substream *ss, int cmd)
default:
return -EINVAL;
}
-
+
chip->ramc.reg = ramc;
- ad1889_writew(chip, AD_DS_RAMC, ramc);
+ ad1889_writew(chip, AD_DS_RAMC, ramc);
ad1889_readw(chip, AD_DS_RAMC); /* flush */
-
+
/* reset the chip when STOP - will disable IRQs */
if (cmd == SNDRV_PCM_TRIGGER_STOP)
ad1889_channel_reset(chip, AD_CHAN_ADC);
-
+
return 0;
}
@@ -548,10 +548,10 @@ snd_ad1889_playback_pointer(struct snd_pcm_substream *ss)
ptr = ad1889_readl(chip, AD_DMA_WAVCA);
ptr -= chip->wave.addr;
-
+
if (snd_BUG_ON(ptr >= chip->wave.size))
return 0;
-
+
return bytes_to_frames(ss->runtime, ptr);
}
@@ -570,7 +570,7 @@ snd_ad1889_capture_pointer(struct snd_pcm_substream *ss)
if (snd_BUG_ON(ptr >= chip->ramc.size))
return 0;
-
+
return bytes_to_frames(ss->runtime, ptr);
}
@@ -582,7 +582,7 @@ static struct snd_pcm_ops snd_ad1889_playback_ops = {
.hw_free = snd_ad1889_hw_free,
.prepare = snd_ad1889_playback_prepare,
.trigger = snd_ad1889_playback_trigger,
- .pointer = snd_ad1889_playback_pointer,
+ .pointer = snd_ad1889_playback_pointer,
};
static struct snd_pcm_ops snd_ad1889_capture_ops = {
@@ -593,7 +593,7 @@ static struct snd_pcm_ops snd_ad1889_capture_ops = {
.hw_free = snd_ad1889_hw_free,
.prepare = snd_ad1889_capture_prepare,
.trigger = snd_ad1889_capture_trigger,
- .pointer = snd_ad1889_capture_pointer,
+ .pointer = snd_ad1889_capture_pointer,
};
static irqreturn_t
@@ -636,7 +636,7 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, struct snd_pcm **rpcm)
if (err < 0)
return err;
- snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
+ snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK,
&snd_ad1889_playback_ops);
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
&snd_ad1889_capture_ops);
@@ -644,7 +644,7 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, struct snd_pcm **rpcm)
pcm->private_data = chip;
pcm->info_flags = 0;
strcpy(pcm->name, chip->card->shortname);
-
+
chip->pcm = pcm;
chip->psubs = NULL;
chip->csubs = NULL;
@@ -658,10 +658,10 @@ snd_ad1889_pcm_init(struct snd_ad1889 *chip, int device, struct snd_pcm **rpcm)
snd_printk(KERN_ERR PFX "buffer allocation error: %d\n", err);
return err;
}
-
+
if (rpcm)
*rpcm = pcm;
-
+
return 0;
}
@@ -679,24 +679,24 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
snd_iprintf(buffer, "Wave Quality: %d-bit linear\n",
(reg & AD_DS_WSMC_WA16) ? 16 : 8);
-
+
/* WARQ is at offset 12 */
tmp = (reg & AD_DS_WSMC_WARQ) ?
(((reg & AD_DS_WSMC_WARQ >> 12) & 0x01) ? 12 : 18) : 4;
tmp /= (reg & AD_DS_WSMC_WAST) ? 2 : 1;
-
+
snd_iprintf(buffer, "Wave FIFO: %d %s words\n\n", tmp,
(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
-
-
+
+
snd_iprintf(buffer, "Synthesis output: %s\n",
reg & AD_DS_WSMC_SYEN ? "enabled" : "disabled");
-
+
/* SYRQ is at offset 4 */
tmp = (reg & AD_DS_WSMC_SYRQ) ?
(((reg & AD_DS_WSMC_SYRQ >> 4) & 0x01) ? 12 : 18) : 4;
tmp /= (reg & AD_DS_WSMC_WAST) ? 2 : 1;
-
+
snd_iprintf(buffer, "Synthesis FIFO: %d %s words\n\n", tmp,
(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
@@ -707,27 +707,27 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
(reg & AD_DS_RAMC_ADST) ? "stereo" : "mono");
snd_iprintf(buffer, "ADC Quality: %d-bit linear\n",
(reg & AD_DS_RAMC_AD16) ? 16 : 8);
-
+
/* ACRQ is at offset 4 */
tmp = (reg & AD_DS_RAMC_ACRQ) ?
(((reg & AD_DS_RAMC_ACRQ >> 4) & 0x01) ? 12 : 18) : 4;
tmp /= (reg & AD_DS_RAMC_ADST) ? 2 : 1;
-
+
snd_iprintf(buffer, "ADC FIFO: %d %s words\n\n", tmp,
(reg & AD_DS_RAMC_ADST) ? "stereo" : "mono");
-
+
snd_iprintf(buffer, "Resampler input: %s\n",
reg & AD_DS_RAMC_REEN ? "enabled" : "disabled");
-
+
/* RERQ is at offset 12 */
tmp = (reg & AD_DS_RAMC_RERQ) ?
(((reg & AD_DS_RAMC_RERQ >> 12) & 0x01) ? 12 : 18) : 4;
tmp /= (reg & AD_DS_RAMC_ADST) ? 2 : 1;
-
+
snd_iprintf(buffer, "Resampler FIFO: %d %s words\n\n", tmp,
(reg & AD_DS_WSMC_WAST) ? "stereo" : "mono");
-
-
+
+
/* doc says LSB represents -1.5dB, but the max value (-94.5dB)
suggests that LSB is -3dB, which is more coherent with the logarithmic
nature of the dB scale */
@@ -739,7 +739,7 @@ snd_ad1889_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffe
snd_iprintf(buffer, "Right: %s, -%d dB\n",
(reg & AD_DS_WADA_RWAM) ? "mute" : "unmute",
((reg & AD_DS_WADA_RWAA) >> 8) * 3);
-
+
reg = ad1889_readw(chip, AD_DS_WAS);
snd_iprintf(buffer, "Wave samplerate: %u Hz\n", reg);
reg = ad1889_readw(chip, AD_DS_RES);
@@ -779,7 +779,7 @@ snd_ad1889_ac97_xinit(struct snd_ad1889 *chip)
/* Interface Enable */
reg |= AD_AC97_ACIC_ACIE;
ad1889_writew(chip, AD_AC97_ACIC, reg);
-
+
snd_ad1889_ac97_ready(chip);
/* Audio Stream Output | Variable Sample Rate Mode */
@@ -820,7 +820,7 @@ snd_ad1889_ac97_init(struct snd_ad1889 *chip, const char *quirk_override)
err = snd_ac97_bus(chip->card, 0, &ops, chip, &chip->ac97_bus);
if (err < 0)
return err;
-
+
chip->ac97_bus->private_free = snd_ad1889_ac97_bus_free;
memset(&ac97, 0, sizeof(ac97));
@@ -831,9 +831,9 @@ snd_ad1889_ac97_init(struct snd_ad1889 *chip, const char *quirk_override)
err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97);
if (err < 0)
return err;
-
+
snd_ac97_tune_hardware(chip->ac97, ac97_quirks, quirk_override);
-
+
return 0;
}
@@ -871,14 +871,14 @@ skip_hw:
}
static int
-snd_ad1889_dev_free(struct snd_device *device)
+snd_ad1889_dev_free(struct snd_device *device)
{
struct snd_ad1889 *chip = device->device_data;
return snd_ad1889_free(chip);
}
static int __devinit
-snd_ad1889_init(struct snd_ad1889 *chip)
+snd_ad1889_init(struct snd_ad1889 *chip)
{
ad1889_writew(chip, AD_DS_CCS, AD_DS_CCS_CLKEN); /* turn on clock */
ad1889_readw(chip, AD_DS_CCS); /* flush posted write */
@@ -938,7 +938,7 @@ snd_ad1889_create(struct snd_card *card,
err = -EBUSY;
goto free_and_ret;
}
-
+
pci_set_master(pci);
spin_lock_init(&chip->lock); /* only now can we call ad1889_free */
@@ -1017,7 +1017,7 @@ snd_ad1889_probe(struct pci_dev *pci,
err = snd_ad1889_ac97_init(chip, ac97_quirk[devno]);
if (err < 0)
goto free_and_ret;
-
+
err = snd_ad1889_pcm_init(chip, 0, NULL);
if (err < 0)
goto free_and_ret;
diff --git a/sound/pci/ak4531_codec.c b/sound/pci/ak4531_codec.c
index 0f819dd..0275686 100644
--- a/sound/pci/ak4531_codec.c
+++ b/sound/pci/ak4531_codec.c
@@ -43,13 +43,13 @@ static void snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak453
/*
*
*/
-
+
#if 0
static void snd_ak4531_dump(struct snd_ak4531 *ak4531)
{
int idx;
-
+
for (idx = 0; idx < 0x19; idx++)
printk("ak4531 0x%x: 0x%x\n", idx, ak4531->regs[idx]);
}
@@ -84,7 +84,7 @@ static int snd_ak4531_info_single(struct snd_kcontrol *kcontrol, struct snd_ctl_
uinfo->value.integer.max = mask;
return 0;
}
-
+
static int snd_ak4531_get_single(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ak4531 *ak4531 = snd_kcontrol_chip(kcontrol);
@@ -151,7 +151,7 @@ static int snd_ak4531_info_double(struct snd_kcontrol *kcontrol, struct snd_ctl_
uinfo->value.integer.max = mask;
return 0;
}
-
+
static int snd_ak4531_get_double(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ak4531 *ak4531 = snd_kcontrol_chip(kcontrol);
@@ -226,7 +226,7 @@ static int snd_ak4531_info_input_sw(struct snd_kcontrol *kcontrol, struct snd_ct
uinfo->value.integer.max = 1;
return 0;
}
-
+
static int snd_ak4531_get_input_sw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
struct snd_ak4531 *ak4531 = snd_kcontrol_chip(kcontrol);
@@ -469,7 +469,7 @@ void snd_ak4531_resume(struct snd_ak4531 *ak4531)
* /proc interface
*/
-static void snd_ak4531_proc_read(struct snd_info_entry *entry,
+static void snd_ak4531_proc_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
struct snd_ak4531 *ak4531 = entry->private_data;
@@ -486,7 +486,7 @@ snd_ak4531_proc_init(struct snd_card *card, struct snd_ak4531 *ak4531)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(card, "ak4531", &entry))
+ if (!snd_card_proc_new(card, "ak4531", &entry))
snd_info_set_text_ops(entry, ak4531, snd_ak4531_proc_read);
}
#endif
diff --git a/sound/pci/als300.c b/sound/pci/als300.c
index 8df6824..9799051 100644
--- a/sound/pci/als300.c
+++ b/sound/pci/als300.c
@@ -38,7 +38,7 @@
#include <linux/interrupt.h>
#include <linux/slab.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/control.h>
@@ -104,7 +104,7 @@
#define snd_als300_dbgplay(format, args...) printk(KERN_ERR format, ##args)
#else
#define snd_als300_dbgplay(format, args...)
-#endif
+#endif
enum {DEVICE_ALS300, DEVICE_ALS300_PLUS};
@@ -136,7 +136,7 @@ struct snd_als300 {
int chip_type; /* ALS300 or ALS300+ */
- char revision;
+ char revision;
};
struct snd_als300_substream_data {
@@ -239,7 +239,7 @@ static irqreturn_t snd_als300plus_interrupt(int irq, void *dev_id)
u8 general, mpu, dram;
struct snd_als300 *chip = dev_id;
struct snd_als300_substream_data *data;
-
+
general = inb(chip->port+ALS300P_IRQ_STATUS);
mpu = inb(chip->port+MPU_IRQ_STATUS);
dram = inb(chip->port+ALS300P_DRAM_IRQ_STATUS);
@@ -461,7 +461,7 @@ static int snd_als300_playback_prepare(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
unsigned short period_bytes = snd_pcm_lib_period_bytes(substream);
unsigned short buffer_bytes = snd_pcm_lib_buffer_bytes(substream);
-
+
snd_als300_dbgcallenter();
spin_lock_irq(&chip->reg_lock);
tmp = snd_als300_gcr_read(chip->port, PLAYBACK_CONTROL);
@@ -469,7 +469,7 @@ static int snd_als300_playback_prepare(struct snd_pcm_substream *substream)
snd_als300_dbgplay("Period bytes: %d Buffer bytes %d\n",
period_bytes, buffer_bytes);
-
+
/* set block size */
tmp &= 0xffff0000;
tmp |= period_bytes - 1;
@@ -571,7 +571,7 @@ static snd_pcm_uframes_t snd_als300_pointer(struct snd_pcm_substream *substream)
data = substream->runtime->private_data;
period_bytes = snd_pcm_lib_period_bytes(substream);
-
+
snd_als300_dbgcallenter();
spin_lock(&chip->reg_lock);
current_ptr = (u16) snd_als300_gcr_read(chip->port,
@@ -641,7 +641,7 @@ static void snd_als300_init(struct snd_als300 *chip)
{
unsigned long flags;
u32 tmp;
-
+
snd_als300_dbgcallenter();
spin_lock_irqsave(&chip->reg_lock, flags);
chip->revision = (snd_als300_gcr_read(chip->port, MISC_CONTROL) >> 16)
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index ba57005..14d58d8 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -33,15 +33,15 @@
* refer to: ALS4000a.PDF specs Ver 1.0, May 28th, 1998.
*
* The ALS4000 seems to be the PCI-cousin of the ALS100. It contains an
- * ALS100-like SB DSP/mixer, an OPL3 synth, a MPU401 and a gameport
- * interface. These subsystems can be mapped into ISA io-port space,
- * using the PCI-interface. In addition, the PCI-bit provides DMA and IRQ
+ * ALS100-like SB DSP/mixer, an OPL3 synth, a MPU401 and a gameport
+ * interface. These subsystems can be mapped into ISA io-port space,
+ * using the PCI-interface. In addition, the PCI-bit provides DMA and IRQ
* services to the subsystems.
- *
+ *
* While ALS4000 is very similar to a SoundBlaster, the differences in
* DMA and capturing require more changes to the SoundBlaster than
* desirable, so I made this separate driver.
- *
+ *
* The ALS4000 can do real full duplex playback/capture.
*
* FMDAC:
@@ -65,7 +65,7 @@
* - power management? (card can do voice wakeup according to datasheet!!)
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/slab.h>
@@ -228,7 +228,7 @@ static inline void snd_als4k_gcr_write(struct snd_sb *sb,
u32 val)
{
snd_als4k_gcr_write_addr(sb->alt_port, reg, val);
-}
+}
static inline u32 snd_als4k_gcr_read_addr(unsigned long iobase,
enum als4k_gcr_t reg)
@@ -337,7 +337,7 @@ static const struct {
} playback_cmd_vals[]={
/* ALS4000_FORMAT_U8_MONO */
{ SB_DSP4_OUT8_AI, SB_DSP_DMA8_ON, SB_DSP_DMA8_OFF, SB_DSP4_MODE_UNS_MONO },
-/* ALS4000_FORMAT_S8_MONO */
+/* ALS4000_FORMAT_S8_MONO */
{ SB_DSP4_OUT8_AI, SB_DSP_DMA8_ON, SB_DSP_DMA8_OFF, SB_DSP4_MODE_SIGN_MONO },
/* ALS4000_FORMAT_U16L_MONO */
{ SB_DSP4_OUT16_AI, SB_DSP_DMA16_ON, SB_DSP_DMA16_OFF, SB_DSP4_MODE_UNS_MONO },
@@ -345,7 +345,7 @@ static const struct {
{ SB_DSP4_OUT16_AI, SB_DSP_DMA16_ON, SB_DSP_DMA16_OFF, SB_DSP4_MODE_SIGN_MONO },
/* ALS4000_FORMAT_U8_STEREO */
{ SB_DSP4_OUT8_AI, SB_DSP_DMA8_ON, SB_DSP_DMA8_OFF, SB_DSP4_MODE_UNS_STEREO },
-/* ALS4000_FORMAT_S8_STEREO */
+/* ALS4000_FORMAT_S8_STEREO */
{ SB_DSP4_OUT8_AI, SB_DSP_DMA8_ON, SB_DSP_DMA8_OFF, SB_DSP4_MODE_SIGN_STEREO },
/* ALS4000_FORMAT_U16L_STEREO */
{ SB_DSP4_OUT16_AI, SB_DSP_DMA16_ON, SB_DSP_DMA16_OFF, SB_DSP4_MODE_UNS_STEREO },
@@ -359,14 +359,14 @@ enum { CMD_WIDTH8=0x04, CMD_SIGNED=0x10, CMD_MONO=0x80, CMD_STEREO=0xA0 };
static const unsigned char capture_cmd_vals[]=
{
CMD_WIDTH8|CMD_MONO, /* ALS4000_FORMAT_U8_MONO */
-CMD_WIDTH8|CMD_SIGNED|CMD_MONO, /* ALS4000_FORMAT_S8_MONO */
+CMD_WIDTH8|CMD_SIGNED|CMD_MONO, /* ALS4000_FORMAT_S8_MONO */
CMD_MONO, /* ALS4000_FORMAT_U16L_MONO */
CMD_SIGNED|CMD_MONO, /* ALS4000_FORMAT_S16L_MONO */
CMD_WIDTH8|CMD_STEREO, /* ALS4000_FORMAT_U8_STEREO */
-CMD_WIDTH8|CMD_SIGNED|CMD_STEREO, /* ALS4000_FORMAT_S8_STEREO */
+CMD_WIDTH8|CMD_SIGNED|CMD_STEREO, /* ALS4000_FORMAT_S8_STEREO */
CMD_STEREO, /* ALS4000_FORMAT_U16L_STEREO */
CMD_SIGNED|CMD_STEREO, /* ALS4000_FORMAT_S16L_STEREO */
-};
+};
#define capture_cmd(chip) (capture_cmd_vals[(chip)->capture_format])
static int snd_als4000_hw_params(struct snd_pcm_substream *substream,
@@ -389,10 +389,10 @@ static int snd_als4000_capture_prepare(struct snd_pcm_substream *substream)
unsigned count;
chip->capture_format = snd_als4000_get_format(runtime);
-
+
size = snd_pcm_lib_buffer_bytes(substream);
count = snd_pcm_lib_period_bytes(substream);
-
+
if (chip->capture_format & ALS4000_FORMAT_16BIT)
count >>= 1;
count--;
@@ -416,14 +416,14 @@ static int snd_als4000_playback_prepare(struct snd_pcm_substream *substream)
unsigned count;
chip->playback_format = snd_als4000_get_format(runtime);
-
+
size = snd_pcm_lib_buffer_bytes(substream);
count = snd_pcm_lib_period_bytes(substream);
-
+
if (chip->playback_format & ALS4000_FORMAT_16BIT)
count >>= 1;
count--;
-
+
/* FIXME: from second playback on, there's a lot more clicks and pops
* involved here than on first playback. Fiddling with
* tons of different settings didn't help (DMA, speaker on/off,
@@ -433,16 +433,16 @@ static int snd_als4000_playback_prepare(struct snd_pcm_substream *substream)
spin_lock_irq(&chip->reg_lock);
snd_als4000_set_rate(chip, runtime->rate);
snd_als4000_set_playback_dma(chip, runtime->dma_addr, size);
-
+
/* SPEAKER_ON not needed, since dma_on seems to also enable speaker */
/* snd_sbdsp_command(chip, SB_DSP_SPEAKER_ON); */
snd_sbdsp_command(chip, playback_cmd(chip).dsp_cmd);
snd_sbdsp_command(chip, playback_cmd(chip).format);
snd_sbdsp_command(chip, count & 0xff);
snd_sbdsp_command(chip, count >> 8);
- snd_sbdsp_command(chip, playback_cmd(chip).dma_off);
+ snd_sbdsp_command(chip, playback_cmd(chip).dma_off);
spin_unlock_irq(&chip->reg_lock);
-
+
return 0;
}
@@ -450,7 +450,7 @@ static int snd_als4000_capture_trigger(struct snd_pcm_substream *substream, int
{
struct snd_sb *chip = snd_pcm_substream_chip(substream);
int result = 0;
-
+
/* FIXME race condition in here!!!
chip->mode non-atomic update gets consistently protected
by reg_lock always, _except_ for this place!!
@@ -509,11 +509,11 @@ static snd_pcm_uframes_t snd_als4000_capture_pointer(struct snd_pcm_substream *s
struct snd_sb *chip = snd_pcm_substream_chip(substream);
unsigned int result;
- spin_lock(&chip->reg_lock);
+ spin_lock(&chip->reg_lock);
result = snd_als4k_gcr_read(chip, ALS4K_GCRA4_FIFO2_CURRENT_ADDR);
spin_unlock(&chip->reg_lock);
result &= 0xffff;
- return bytes_to_frames( substream->runtime, result );
+ return bytes_to_frames(substream->runtime, result);
}
static snd_pcm_uframes_t snd_als4000_playback_pointer(struct snd_pcm_substream *substream)
@@ -521,11 +521,11 @@ static snd_pcm_uframes_t snd_als4000_playback_pointer(struct snd_pcm_substream *
struct snd_sb *chip = snd_pcm_substream_chip(substream);
unsigned result;
- spin_lock(&chip->reg_lock);
+ spin_lock(&chip->reg_lock);
result = snd_als4k_gcr_read(chip, ALS4K_GCRA0_FIFO1_CURRENT_ADDR);
spin_unlock(&chip->reg_lock);
result &= 0xffff;
- return bytes_to_frames( substream->runtime, result );
+ return bytes_to_frames(substream->runtime, result);
}
/* FIXME: this IRQ routine doesn't really support IRQ sharing (we always
@@ -563,12 +563,12 @@ static irqreturn_t snd_als4000_interrupt(int irq, void *dev_id)
/* ACK the PCI block IRQ */
snd_als4k_iobase_writeb(chip->alt_port,
ALS4K_IOB_0E_IRQTYPE_SB_CR1E_MPU, pci_irqstatus);
-
+
spin_lock(&chip->mixer_lock);
/* SPECS_PAGE: 20 */
sb_irqstatus = snd_sbmixer_read(chip, SB_DSP4_IRQSTATUS);
spin_unlock(&chip->mixer_lock);
-
+
if (sb_irqstatus & SB_IRQTYPE_8BIT)
snd_sb_ack_8bit(chip);
if (sb_irqstatus & SB_IRQTYPE_16BIT)
@@ -755,7 +755,7 @@ static void snd_als4000_configure(struct snd_sb *chip)
snd_als4_cr_write(chip, ALS4K_CR0_SB_CONFIG,
tmp & ~ALS4K_CR0_MX80_81_REG_WRITE_ENABLE);
spin_unlock_irq(&chip->mixer_lock);
-
+
spin_lock_irq(&chip->reg_lock);
/* enable interrupts */
snd_als4k_gcr_write(chip, ALS4K_GCR8C_MISC_CTRL,
@@ -764,7 +764,7 @@ static void snd_als4000_configure(struct snd_sb *chip)
/* SPECS_PAGE: 39 */
for (i = ALS4K_GCR91_DMA0_ADDR; i <= ALS4K_GCR96_DMA3_MODE_COUNT; ++i)
snd_als4k_gcr_write(chip, i, 0);
-
+
snd_als4k_gcr_write(chip, ALS4K_GCR99_DMA_EMULATION_CTRL,
snd_als4k_gcr_read(chip, ALS4K_GCR99_DMA_EMULATION_CTRL));
spin_unlock_irq(&chip->reg_lock);
@@ -836,7 +836,7 @@ static inline int snd_als4000_create_gameport(struct snd_card_als4000 *acard, in
static inline void snd_als4000_free_gameport(struct snd_card_als4000 *acard) { }
#endif
-static void snd_card_als4000_free( struct snd_card *card )
+static void snd_card_als4000_free(struct snd_card *card)
{
struct snd_card_als4000 *acard = card->private_data;
@@ -888,8 +888,8 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
pci_read_config_word(pci, PCI_COMMAND, &word);
pci_write_config_word(pci, PCI_COMMAND, word | PCI_COMMAND_IO);
pci_set_master(pci);
-
- card = snd_card_new(index[dev], id[dev], THIS_MODULE,
+
+ card = snd_card_new(index[dev], id[dev], THIS_MODULE,
sizeof(*acard) /* private_data: acard */);
if (card == NULL) {
pci_release_regions(pci);
@@ -948,7 +948,7 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
}
if ((err = snd_sbmixer_new(chip)) < 0) {
goto out_err;
- }
+ }
if (snd_opl3_create(card,
iobase + ALS4K_IOB_10_ADLIB_ADDR0,
@@ -975,7 +975,7 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
out_err:
snd_card_free(card);
-
+
out:
return err;
}
@@ -994,7 +994,7 @@ static int snd_als4000_suspend(struct pci_dev *pci, pm_message_t state)
struct snd_sb *chip = acard->chip;
snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
-
+
snd_pcm_suspend_all(chip->pcm);
snd_sbmixer_suspend(chip);
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index 085a52b..3f9a2c5 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -19,7 +19,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -265,7 +265,7 @@ struct atiixp {
unsigned long addr;
void __iomem *remap_addr;
int irq;
-
+
struct snd_ac97_bus *ac97_bus;
struct snd_ac97 *ac97[NUM_ATI_CODECS];
@@ -350,7 +350,7 @@ static int snd_atiixp_update_bits(struct atiixp *chip, unsigned int reg,
* list. although we can change the list dynamically, in this version,
* a static RING of buffer descriptors is used.
*
- * the ring is built in this function, and is set up to the hardware.
+ * the ring is built in this function, and is set up to the hardware.
*/
static int atiixp_build_dma_packets(struct atiixp *chip, struct atiixp_dma *dma,
struct snd_pcm_substream *substream,
@@ -430,7 +430,7 @@ static int snd_atiixp_acquire_codec(struct atiixp *chip)
int timeout = 1000;
while (atiixp_read(chip, PHYS_OUT_ADDR) & ATI_REG_PHYS_OUT_ADDR_EN) {
- if (! timeout--) {
+ if (!timeout--) {
snd_printk(KERN_WARNING "atiixp: codec acquire timeout\n");
return -EBUSY;
}
@@ -471,7 +471,7 @@ static void snd_atiixp_codec_write(struct atiixp *chip, unsigned short codec,
unsigned short reg, unsigned short val)
{
unsigned int data;
-
+
if (snd_atiixp_acquire_codec(chip) < 0)
return;
data = ((unsigned int)val << ATI_REG_PHYS_OUT_DATA_SHIFT) |
@@ -486,7 +486,7 @@ static unsigned short snd_atiixp_ac97_read(struct snd_ac97 *ac97,
{
struct atiixp *chip = ac97->private_data;
return snd_atiixp_codec_read(chip, ac97->num, reg);
-
+
}
static void snd_atiixp_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
@@ -512,9 +512,9 @@ static int snd_atiixp_aclink_reset(struct atiixp *chip)
atiixp_read(chip, CMD);
udelay(10);
atiixp_update(chip, CMD, ATI_REG_CMD_AC_SOFT_RESET, 0);
-
+
timeout = 10;
- while (! (atiixp_read(chip, CMD) & ATI_REG_CMD_ACLINK_ACTIVE)) {
+ while (!(atiixp_read(chip, CMD) & ATI_REG_CMD_ACLINK_ACTIVE)) {
/* do a hard reset */
atiixp_update(chip, CMD, ATI_REG_CMD_AC_SYNC|ATI_REG_CMD_AC_RESET,
ATI_REG_CMD_AC_SYNC);
@@ -537,8 +537,8 @@ static int snd_atiixp_aclink_reset(struct atiixp *chip)
#ifdef CONFIG_PM
static int snd_atiixp_aclink_down(struct atiixp *chip)
{
- // if (atiixp_read(chip, MODEM_MIRROR) & 0x1) /* modem running, too? */
- // return -EBUSY;
+ /* if (atiixp_read(chip, MODEM_MIRROR) & 0x1) modem running, too? */
+ /* return -EBUSY; */
atiixp_update(chip, CMD,
ATI_REG_CMD_POWERDOWN | ATI_REG_CMD_AC_RESET,
ATI_REG_CMD_POWERDOWN);
@@ -582,7 +582,7 @@ static int __devinit snd_atiixp_codec_detect(struct atiixp *chip)
if (ac97_codec == -1)
ac97_codec = ac97_probing_bugs(chip->pci);
if (ac97_codec >= 0) {
- chip->codec_not_ready_bits |=
+ chip->codec_not_ready_bits |=
CODEC_CHECK_BITS ^ (1 << (ac97_codec + 10));
return 0;
}
@@ -684,7 +684,7 @@ static snd_pcm_uframes_t snd_atiixp_pcm_pointer(struct snd_pcm_substream *substr
*/
static void snd_atiixp_xrun_dma(struct atiixp *chip, struct atiixp_dma *dma)
{
- if (! dma->substream || ! dma->running)
+ if (!dma->substream || !dma->running)
return;
snd_printdd("atiixp: XRUN detected (DMA %d)\n", dma->ops->type);
snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN);
@@ -695,7 +695,7 @@ static void snd_atiixp_xrun_dma(struct atiixp *chip, struct atiixp_dma *dma)
*/
static void snd_atiixp_update_dma(struct atiixp *chip, struct atiixp_dma *dma)
{
- if (! dma->substream || ! dma->running)
+ if (!dma->substream || !dma->running)
return;
snd_pcm_period_elapsed(dma->substream);
}
@@ -747,7 +747,7 @@ static int snd_atiixp_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
err = -EINVAL;
break;
}
- if (! err) {
+ if (!err) {
snd_atiixp_check_bus_busy(chip);
if (cmd == SNDRV_PCM_TRIGGER_STOP) {
dma->ops->flush_dma(chip);
@@ -805,7 +805,7 @@ static void atiixp_in_enable_transfer(struct atiixp *chip, int on)
{
if (on) {
unsigned int data = atiixp_read(chip, CMD);
- if (! (data & ATI_REG_CMD_RECEIVE_EN)) {
+ if (!(data & ATI_REG_CMD_RECEIVE_EN)) {
data |= ATI_REG_CMD_RECEIVE_EN;
#if 0 /* FIXME: this causes the endless loop */
/* wait until slot 3/4 are finished */
@@ -852,10 +852,10 @@ static void atiixp_spdif_flush_dma(struct atiixp *chip)
/* DMA off, transfer on */
atiixp_spdif_enable_dma(chip, 0);
atiixp_spdif_enable_transfer(chip, 1);
-
+
timeout = 100;
do {
- if (! (atiixp_read(chip, SPDF_DMA_DT_SIZE) & ATI_REG_DMA_FIFO_USED))
+ if (!(atiixp_read(chip, SPDF_DMA_DT_SIZE) & ATI_REG_DMA_FIFO_USED))
break;
udelay(1);
} while (timeout-- > 0);
@@ -930,7 +930,7 @@ static int snd_atiixp_playback_prepare(struct snd_pcm_substream *substream)
*/
atiixp_update(chip, 6CH_REORDER, ATI_REG_6CH_REORDER_EN,
substream->runtime->channels >= 6 ? ATI_REG_6CH_REORDER_EN: 0);
-
+
spin_unlock_irq(&chip->reg_lock);
return 0;
}
@@ -1226,7 +1226,7 @@ static struct atiixp_dma_ops snd_atiixp_playback_dma_ops = {
.enable_transfer = atiixp_out_enable_transfer,
.flush_dma = atiixp_out_flush_dma,
};
-
+
static struct atiixp_dma_ops snd_atiixp_capture_dma_ops = {
.type = ATI_DMA_CAPTURE,
.llp_offset = ATI_REG_IN_DMA_LINKPTR,
@@ -1235,7 +1235,7 @@ static struct atiixp_dma_ops snd_atiixp_capture_dma_ops = {
.enable_transfer = atiixp_in_enable_transfer,
.flush_dma = atiixp_in_flush_dma,
};
-
+
static struct atiixp_dma_ops snd_atiixp_spdif_dma_ops = {
.type = ATI_DMA_SPDIF,
.llp_offset = ATI_REG_SPDF_DMA_LINKPTR,
@@ -1244,7 +1244,7 @@ static struct atiixp_dma_ops snd_atiixp_spdif_dma_ops = {
.enable_transfer = atiixp_spdif_enable_transfer,
.flush_dma = atiixp_spdif_flush_dma,
};
-
+
static int __devinit snd_atiixp_pcm_new(struct atiixp *chip)
{
@@ -1255,7 +1255,7 @@ static int __devinit snd_atiixp_pcm_new(struct atiixp *chip)
/* initialize constants */
chip->dmas[ATI_DMA_PLAYBACK].ops = &snd_atiixp_playback_dma_ops;
chip->dmas[ATI_DMA_CAPTURE].ops = &snd_atiixp_capture_dma_ops;
- if (! chip->spdif_over_aclink)
+ if (!chip->spdif_over_aclink)
chip->dmas[ATI_DMA_SPDIF].ops = &snd_atiixp_spdif_dma_ops;
/* assign AC97 pcm */
@@ -1293,9 +1293,9 @@ static int __devinit snd_atiixp_pcm_new(struct atiixp *chip)
64*1024, 128*1024);
/* no SPDIF support on codec? */
- if (chip->pcms[ATI_PCM_SPDIF] && ! chip->pcms[ATI_PCM_SPDIF]->rates)
+ if (chip->pcms[ATI_PCM_SPDIF] && !chip->pcms[ATI_PCM_SPDIF]->rates)
return 0;
-
+
/* FIXME: non-48k sample rate doesn't work on my test machine with AD1888 */
if (chip->pcms[ATI_PCM_SPDIF])
chip->pcms[ATI_PCM_SPDIF]->rates = SNDRV_PCM_RATE_48000;
@@ -1340,7 +1340,7 @@ static irqreturn_t snd_atiixp_interrupt(int irq, void *dev_id)
status = atiixp_read(chip, ISR);
- if (! status)
+ if (!status)
return IRQ_NONE;
/* process audio DMA */
@@ -1352,7 +1352,7 @@ static irqreturn_t snd_atiixp_interrupt(int irq, void *dev_id)
snd_atiixp_xrun_dma(chip, &chip->dmas[ATI_DMA_CAPTURE]);
else if (status & ATI_REG_ISR_IN_STATUS)
snd_atiixp_update_dma(chip, &chip->dmas[ATI_DMA_CAPTURE]);
- if (! chip->spdif_over_aclink) {
+ if (!chip->spdif_over_aclink) {
if (status & ATI_REG_ISR_SPDF_XRUN)
snd_atiixp_xrun_dma(chip, &chip->dmas[ATI_DMA_SPDIF]);
else if (status & ATI_REG_ISR_SPDF_STATUS)
@@ -1430,7 +1430,7 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp *chip, int clock,
ac97.pci = chip->pci;
ac97.num = i;
ac97.scaps = AC97_SCAP_SKIP_MODEM | AC97_SCAP_POWER_SAVE;
- if (! chip->spdif_over_aclink)
+ if (!chip->spdif_over_aclink)
ac97.scaps |= AC97_SCAP_NO_SPDIF;
if ((err = snd_ac97_mixer(pbus, &ac97, &chip->ac97[i])) < 0) {
chip->ac97[i] = NULL; /* to be sure */
@@ -1440,7 +1440,7 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp *chip, int clock,
codec_count++;
}
- if (! codec_count) {
+ if (!codec_count) {
snd_printk(KERN_ERR "atiixp: no codec available\n");
return -ENODEV;
}
@@ -1541,7 +1541,7 @@ static void __devinit snd_atiixp_proc_init(struct atiixp *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "atiixp", &entry))
+ if (!snd_card_proc_new(chip->card, "atiixp", &entry))
snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read);
}
#else /* !CONFIG_PROC_FS */
@@ -1559,7 +1559,7 @@ static int snd_atiixp_free(struct atiixp *chip)
goto __hw_end;
snd_atiixp_chip_stop(chip);
- __hw_end:
+__hw_end:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
if (chip->remap_addr)
@@ -1665,7 +1665,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
if ((err = snd_atiixp_pcm_new(chip)) < 0)
goto __error;
-
+
snd_atiixp_proc_init(chip);
snd_atiixp_chip_start(chip);
@@ -1682,7 +1682,7 @@ static int __devinit snd_atiixp_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/atiixp_modem.c b/sound/pci/atiixp_modem.c
index 2f10630..b198f4c 100644
--- a/sound/pci/atiixp_modem.c
+++ b/sound/pci/atiixp_modem.c
@@ -19,7 +19,7 @@
*
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/init.h>
@@ -240,7 +240,7 @@ struct atiixp_modem {
unsigned long addr;
void __iomem *remap_addr;
int irq;
-
+
struct snd_ac97_bus *ac97_bus;
struct snd_ac97 *ac97[NUM_ATI_CODECS];
@@ -319,7 +319,7 @@ static int snd_atiixp_update_bits(struct atiixp_modem *chip, unsigned int reg,
* list. although we can change the list dynamically, in this version,
* a static RING of buffer descriptors is used.
*
- * the ring is built in this function, and is set up to the hardware.
+ * the ring is built in this function, and is set up to the hardware.
*/
static int atiixp_build_dma_packets(struct atiixp_modem *chip,
struct atiixp_dma *dma,
@@ -399,7 +399,7 @@ static int snd_atiixp_acquire_codec(struct atiixp_modem *chip)
int timeout = 1000;
while (atiixp_read(chip, PHYS_OUT_ADDR) & ATI_REG_PHYS_OUT_ADDR_EN) {
- if (! timeout--) {
+ if (!timeout--) {
snd_printk(KERN_WARNING "atiixp-modem: codec acquire timeout\n");
return -EBUSY;
}
@@ -443,7 +443,7 @@ static void snd_atiixp_codec_write(struct atiixp_modem *chip,
unsigned short reg, unsigned short val)
{
unsigned int data;
-
+
if (snd_atiixp_acquire_codec(chip) < 0)
return;
data = ((unsigned int)val << ATI_REG_PHYS_OUT_DATA_SHIFT) |
@@ -458,7 +458,7 @@ static unsigned short snd_atiixp_ac97_read(struct snd_ac97 *ac97,
{
struct atiixp_modem *chip = ac97->private_data;
return snd_atiixp_codec_read(chip, ac97->num, reg);
-
+
}
static void snd_atiixp_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
@@ -489,9 +489,9 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip)
atiixp_read(chip, CMD);
udelay(10);
atiixp_update(chip, CMD, ATI_REG_CMD_AC_SOFT_RESET, 0);
-
+
timeout = 10;
- while (! (atiixp_read(chip, CMD) & ATI_REG_CMD_ACLINK_ACTIVE)) {
+ while (!(atiixp_read(chip, CMD) & ATI_REG_CMD_ACLINK_ACTIVE)) {
/* do a hard reset */
atiixp_update(chip, CMD, ATI_REG_CMD_AC_SYNC|ATI_REG_CMD_AC_RESET,
ATI_REG_CMD_AC_SYNC);
@@ -514,8 +514,8 @@ static int snd_atiixp_aclink_reset(struct atiixp_modem *chip)
#ifdef CONFIG_PM
static int snd_atiixp_aclink_down(struct atiixp_modem *chip)
{
- // if (atiixp_read(chip, MODEM_MIRROR) & 0x1) /* modem running, too? */
- // return -EBUSY;
+ /* if (atiixp_read(chip, MODEM_MIRROR) & 0x1) modem running, too? */
+ /* return -EBUSY; */
atiixp_update(chip, CMD,
ATI_REG_CMD_POWERDOWN | ATI_REG_CMD_AC_RESET,
ATI_REG_CMD_POWERDOWN);
@@ -570,7 +570,7 @@ static int snd_atiixp_chip_start(struct atiixp_modem *chip)
/* set up spdif, enable burst mode */
reg = atiixp_read(chip, CMD);
reg |= ATI_REG_CMD_BURST_EN;
- if(!(reg & ATI_REG_CMD_MODEM_PRESENT))
+ if (!(reg & ATI_REG_CMD_MODEM_PRESENT))
reg |= ATI_REG_CMD_MODEM_PRESENT;
atiixp_write(chip, CMD, reg);
@@ -635,7 +635,7 @@ static snd_pcm_uframes_t snd_atiixp_pcm_pointer(struct snd_pcm_substream *substr
static void snd_atiixp_xrun_dma(struct atiixp_modem *chip,
struct atiixp_dma *dma)
{
- if (! dma->substream || ! dma->running)
+ if (!dma->substream || !dma->running)
return;
snd_printdd("atiixp-modem: XRUN detected (DMA %d)\n", dma->ops->type);
snd_pcm_stop(dma->substream, SNDRV_PCM_STATE_XRUN);
@@ -647,7 +647,7 @@ static void snd_atiixp_xrun_dma(struct atiixp_modem *chip,
static void snd_atiixp_update_dma(struct atiixp_modem *chip,
struct atiixp_dma *dma)
{
- if (! dma->substream || ! dma->running)
+ if (!dma->substream || !dma->running)
return;
snd_pcm_period_elapsed(dma->substream);
}
@@ -692,7 +692,7 @@ static int snd_atiixp_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
err = -EINVAL;
break;
}
- if (! err) {
+ if (!err) {
snd_atiixp_check_bus_busy(chip);
if (cmd == SNDRV_PCM_TRIGGER_STOP) {
dma->ops->flush_dma(chip);
@@ -750,7 +750,7 @@ static void atiixp_in_enable_transfer(struct atiixp_modem *chip, int on)
{
if (on) {
unsigned int data = atiixp_read(chip, CMD);
- if (! (data & ATI_REG_CMD_MODEM_RECEIVE_EN)) {
+ if (!(data & ATI_REG_CMD_MODEM_RECEIVE_EN)) {
data |= ATI_REG_CMD_MODEM_RECEIVE_EN;
atiixp_write(chip, CMD, data);
}
@@ -811,7 +811,7 @@ static int snd_atiixp_pcm_hw_params(struct snd_pcm_substream *substream,
/* set up modem rate */
for (i = 0; i < NUM_ATI_CODECS; i++) {
- if (! chip->ac97[i])
+ if (!chip->ac97[i])
continue;
snd_ac97_write(chip->ac97[i], AC97_LINE1_RATE, params_rate(hw_params));
snd_ac97_write(chip->ac97[i], AC97_LINE1_LEVEL, 0);
@@ -978,7 +978,7 @@ static struct atiixp_dma_ops snd_atiixp_playback_dma_ops = {
.enable_transfer = atiixp_out_enable_transfer,
.flush_dma = atiixp_out_flush_dma,
};
-
+
static struct atiixp_dma_ops snd_atiixp_capture_dma_ops = {
.type = ATI_DMA_CAPTURE,
.llp_offset = ATI_REG_MODEM_IN_DMA_LINKPTR,
@@ -1027,7 +1027,7 @@ static irqreturn_t snd_atiixp_interrupt(int irq, void *dev_id)
status = atiixp_read(chip, ISR);
- if (! status)
+ if (!status)
return IRQ_NONE;
/* process audio DMA */
@@ -1102,7 +1102,7 @@ static int __devinit snd_atiixp_mixer_new(struct atiixp_modem *chip, int clock)
codec_count++;
}
- if (! codec_count) {
+ if (!codec_count) {
snd_printk(KERN_ERR "atiixp-modem: no codec available\n");
return -ENODEV;
}
@@ -1184,7 +1184,7 @@ static void __devinit snd_atiixp_proc_init(struct atiixp_modem *chip)
{
struct snd_info_entry *entry;
- if (! snd_card_proc_new(chip->card, "atiixp-modem", &entry))
+ if (!snd_card_proc_new(chip->card, "atiixp-modem", &entry))
snd_info_set_text_ops(entry, chip, snd_atiixp_proc_read);
}
#else
@@ -1202,7 +1202,7 @@ static int snd_atiixp_free(struct atiixp_modem *chip)
goto __hw_end;
snd_atiixp_chip_stop(chip);
- __hw_end:
+__hw_end:
if (chip->irq >= 0)
free_irq(chip->irq, chip);
if (chip->remap_addr)
@@ -1306,7 +1306,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci,
if ((err = snd_atiixp_pcm_new(chip)) < 0)
goto __error;
-
+
snd_atiixp_proc_init(chip);
snd_atiixp_chip_start(chip);
@@ -1320,7 +1320,7 @@ static int __devinit snd_atiixp_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/aw2/aw2-alsa.c b/sound/pci/aw2/aw2-alsa.c
index 3f00ddf..efb0802 100644
--- a/sound/pci/aw2/aw2-alsa.c
+++ b/sound/pci/aw2/aw2-alsa.c
@@ -26,7 +26,7 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
diff --git a/sound/pci/aw2/aw2-saa7146.c b/sound/pci/aw2/aw2-saa7146.c
index 6a3891a..3be6ac2 100644
--- a/sound/pci/aw2/aw2-saa7146.c
+++ b/sound/pci/aw2/aw2-saa7146.c
@@ -29,7 +29,7 @@
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <asm/system.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/initval.h>
#include <sound/pcm.h>
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index 333007c..72cca10 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -159,7 +159,7 @@
* - use MMIO (memory-mapped I/O)? Slightly faster access, e.g. for gameport.
*/
-#include <asm/io.h>
+#include <linux/io.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/delay.h>
@@ -1360,7 +1360,7 @@ snd_azf3328_playback_pointer(struct snd_pcm_substream *substream)
/* calculate offset */
result -= bufptr;
- frmres = bytes_to_frames( substream->runtime, result);
+ frmres = bytes_to_frames(substream->runtime, result);
snd_azf3328_dbgplay("PLAY @ 0x%8lx, frames %8ld\n", result, frmres);
return frmres;
}
@@ -1381,7 +1381,7 @@ snd_azf3328_capture_pointer(struct snd_pcm_substream *substream)
/* calculate offset */
result -= bufptr;
- frmres = bytes_to_frames( substream->runtime, result);
+ frmres = bytes_to_frames(substream->runtime, result);
snd_azf3328_dbgplay("REC @ 0x%8lx, frames %8ld\n", result, frmres);
return frmres;
}
@@ -2063,14 +2063,14 @@ snd_azf3328_debug_show_ports(const struct snd_azf3328 *chip)
snd_azf3328_game_inb(chip, 5)
);
- for (tmp = 0; tmp < 0x07; tmp += 1)
+ for (tmp = 0; tmp < 0x07; tmp++)
snd_azf3328_dbgmisc("mpu_io 0x%04x\n", inb(chip->mpu_io + tmp));
- for (tmp = 0; tmp <= 0x07; tmp += 1)
+ for (tmp = 0; tmp <= 0x07; tmp++)
snd_azf3328_dbgmisc("0x%02x: game200 0x%04x, game208 0x%04x\n",
tmp, inb(0x200 + tmp), inb(0x208 + tmp));
- for (tmp = 0; tmp <= 0x01; tmp += 1)
+ for (tmp = 0; tmp <= 0x01; tmp++)
snd_azf3328_dbgmisc(
"0x%02x: mpu300 0x%04x, mpu310 0x%04x, mpu320 0x%04x, "
"mpu330 0x%04x opl388 0x%04x opl38c 0x%04x\n",
diff --git a/sound/pci/azt3328.h b/sound/pci/azt3328.h
index 974e051..3038efb 100644
--- a/sound/pci/azt3328.h
+++ b/sound/pci/azt3328.h
@@ -119,7 +119,7 @@ enum azf_freq_t {
/* general */
#define IDX_IO_42H 0x42 /* PU:0x0001 */
-/** DirectX timer, main interrupt area (FIXME: and something else?) **/
+/** DirectX timer, main interrupt area (FIXME: and something else?) **/
#define IDX_IO_TIMER_VALUE 0x60 /* found this timer area by pure luck :-) */
/* timer countdown value; triggers IRQ when timer is finished */
#define TIMER_VALUE_MASK 0x000fffffUL
@@ -204,7 +204,7 @@ enum azf_freq_t {
/*** Gameport area port indices ***/
-/* (only 0x06 of 0x08 bytes saved/restored by Windows driver) */
+/* (only 0x06 of 0x08 bytes saved/restored by Windows driver) */
#define AZF_IO_SIZE_GAME 0x08
#define AZF_IO_SIZE_GAME_PM 0x06
@@ -333,7 +333,7 @@ enum {
#define MIXER_ADVCTL2_MIX 0x0200 /* Mono output select 0=Mix, 1=Mic; Win driver: "MonoSelectSource"?? */
#define MIXER_ADVCTL2_3D 0x2000 /* 3D Enhancement 1=on */
#define MIXER_ADVCTL2_POP 0x8000 /* Pcm Out Path, 0=pre 3D, 1=post 3D */
-
+
#define IDX_MIXER_SOMETHING30H 0x30 /* used, but unknown??? */
/* driver internal flags */
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/au88x0/au88x0.c | 46 ++++----
sound/pci/au88x0/au88x0.h | 4 +-
sound/pci/au88x0/au88x0_a3d.c | 46 ++++----
sound/pci/au88x0/au88x0_core.c | 254 +++++++++++++++++++-------------------
sound/pci/au88x0/au88x0_eq.c | 24 ++--
sound/pci/au88x0/au88x0_mixer.c | 2 +-
sound/pci/au88x0/au88x0_mpu401.c | 2 +-
sound/pci/au88x0/au88x0_pcm.c | 46 ++++----
sound/pci/au88x0/au88x0_synth.c | 46 ++++----
sound/pci/au88x0/au88x0_xtalk.c | 26 ++--
sound/pci/au88x0/au88x0_xtalk.h | 2 +-
11 files changed, 249 insertions(+), 249 deletions(-)
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index 68368e4..440be0b 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -125,7 +125,7 @@ static int snd_vortex_dev_free(struct snd_device *device)
vortex_gameport_unregister(vortex);
vortex_core_shutdown(vortex);
- // Take down PCI interface.
+ /* Take down PCI interface. */
free_irq(vortex->irq, vortex);
iounmap(vortex->mmio);
pci_release_regions(vortex->pci_dev);
@@ -148,7 +148,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
*rchip = NULL;
- // check PCI availability (DMA).
+ /* check PCI availability (DMA). */
if ((err = pci_enable_device(pci)) < 0)
return err;
if (pci_set_dma_mask(pci, DMA_32BIT_MASK) < 0 ||
@@ -166,7 +166,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
chip->card = card;
- // initialize the stuff
+ /* initialize the stuff */
chip->pci_dev = pci;
chip->io = pci_resource_start(pci, 0);
chip->vendor = pci->vendor;
@@ -174,8 +174,8 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
chip->card = card;
chip->irq = -1;
- // (1) PCI resource allocation
- // Get MMIO area
+ /* (1) PCI resource allocation */
+ /* Get MMIO area */
//
if ((err = pci_request_regions(pci, CARD_NAME_SHORT)) != 0)
goto regions_out;
@@ -205,9 +205,9 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
chip->irq = pci->irq;
pci_set_master(pci);
- // End of PCI setup.
+ /* End of PCI setup. */
- // Register alsa root device.
+ /* Register alsa root device. */
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
goto alloc_out;
}
@@ -228,7 +228,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
pci_release_regions(chip->pci_dev);
regions_out:
pci_disable_device(chip->pci_dev);
- //FIXME: this not the right place to unregister the gameport
+ /* FIXME: this not the right place to unregister the gameport */
vortex_gameport_unregister(chip);
kfree(chip);
return err;
@@ -243,64 +243,64 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
vortex_t *chip;
int err;
- // (1)
+ /* (1) */
if (dev >= SNDRV_CARDS)
return -ENODEV;
if (!enable[dev]) {
dev++;
return -ENOENT;
}
- // (2)
+ /* (2) */
card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0);
if (card == NULL)
return -ENOMEM;
- // (3)
+ /* (3) */
if ((err = snd_vortex_create(card, pci, &chip)) < 0) {
snd_card_free(card);
return err;
}
snd_vortex_workaround(pci, pcifix[dev]);
- // Card details needed in snd_vortex_midi
+ /* Card details needed in snd_vortex_midi */
strcpy(card->driver, CARD_NAME_SHORT);
sprintf(card->shortname, "Aureal Vortex %s", CARD_NAME_SHORT);
sprintf(card->longname, "%s at 0x%lx irq %i",
card->shortname, chip->io, chip->irq);
- // (4) Alloc components.
- // ADB pcm.
+ /* (4) Alloc components. */
+ /* ADB pcm. */
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_ADB, NR_ADB)) < 0) {
snd_card_free(card);
return err;
}
#ifndef CHIP_AU8820
- // ADB SPDIF
+ /* ADB SPDIF */
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_SPDIF, 1)) < 0) {
snd_card_free(card);
return err;
}
- // A3D
+ /* A3D */
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_A3D, NR_A3D)) < 0) {
snd_card_free(card);
return err;
}
#endif
/*
- // ADB I2S
+ //ADB I2S
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_I2S, 1)) < 0) {
snd_card_free(card);
return err;
}
*/
#ifndef CHIP_AU8810
- // WT pcm.
+ /* WT pcm. */
if ((err = snd_vortex_new_pcm(chip, VORTEX_PCM_WT, NR_WT)) < 0) {
snd_card_free(card);
return err;
}
#endif
- // snd_ac97_mixer and Vortex mixer.
+ /* snd_ac97_mixer and Vortex mixer. */
if ((err = snd_vortex_mixer(chip)) < 0) {
snd_card_free(card);
return err;
@@ -329,12 +329,12 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
}
#endif
- // (5)
+ /* (5) */
if ((err = pci_read_config_word(pci, PCI_DEVICE_ID,
&(chip->device))) < 0) {
snd_card_free(card);
return err;
- }
+ }
if ((err = pci_read_config_word(pci, PCI_VENDOR_ID,
&(chip->vendor))) < 0) {
snd_card_free(card);
@@ -354,12 +354,12 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
}
#endif
- // (6)
+ /* (6) */
if ((err = snd_card_register(card)) < 0) {
snd_card_free(card);
return err;
}
- // (7)
+ /* (7) */
pci_set_drvdata(pci, card);
dev++;
vortex_connect_default(chip, 1);
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
index cf46bba..02e949d 100644
--- a/sound/pci/au88x0/au88x0.h
+++ b/sound/pci/au88x0/au88x0.h
@@ -13,13 +13,13 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
#ifndef __SOUND_AU88X0_H
#define __SOUND_AU88X0_H
#ifdef __KERNEL__
#include <linux/pci.h>
-#include <asm/io.h>
+#include <linux/io.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/rawmidi.h>
diff --git a/sound/pci/au88x0/au88x0_a3d.c b/sound/pci/au88x0/au88x0_a3d.c
index 649849e..526fb5f 100644
--- a/sound/pci/au88x0/au88x0_a3d.c
+++ b/sound/pci/au88x0/au88x0_a3d.c
@@ -49,7 +49,7 @@ static void
a3dsrc_GetTimeConsts(a3dsrc_t * a, short *HrtfTrack, short *ItdTrack,
short *GTrack, short *CTrack)
{
- // stub!
+ /* stub! */
}
#endif
@@ -219,7 +219,7 @@ static void a3dsrc_GetHrtfState(a3dsrc_t * a, a3d_Hrtf_t aa, a3d_Hrtf_t b)
{
vortex_t *vortex = (vortex_t *) (a->vortex);
int i;
- // FIXME: verify this!
+ /* FIXME: verify this! */
for (i = 0; i < HRTF_SZ; i++)
aa[i] =
hwread(vortex->mmio,
@@ -245,10 +245,10 @@ static void a3dsrc_GetHrtfOutput(a3dsrc_t * a, short *left, short *right)
#endif
-/* Interaural Time Difference.
- * "The other main clue that humans use to locate sounds, is called
- * Interaural Time Difference (ITD). The differences in distance from
- * the sound source to a listeners ears means that the sound will
+/* Interaural Time Difference.
+ * "The other main clue that humans use to locate sounds, is called
+ * Interaural Time Difference (ITD). The differences in distance from
+ * the sound source to a listeners ears means that the sound will
* reach one ear slightly before the other....", found somewhere with google.*/
static void a3dsrc_SetItdTarget(a3dsrc_t * a, short litd, short ritd)
{
@@ -265,7 +265,7 @@ static void a3dsrc_SetItdTarget(a3dsrc_t * a, short litd, short ritd)
hwwrite(vortex->mmio,
a3d_addrB(a->slice, a->source, A3D_B_ITDTarget),
(ritd << 0x10) | litd);
- //hwwrite(vortex->mmio, addr(0x191DF+5, this04, this08), (ritd<<0x10)|litd);
+ /* hwwrite(vortex->mmio, addr(0x191DF+5, this04, this08), (ritd<<0x10)|litd); */
}
static void a3dsrc_SetItdCurrent(a3dsrc_t * a, short litd, short ritd)
@@ -283,7 +283,7 @@ static void a3dsrc_SetItdCurrent(a3dsrc_t * a, short litd, short ritd)
hwwrite(vortex->mmio,
a3d_addrB(a->slice, a->source, A3D_B_ITDCurrent),
(ritd << 0x10) | litd);
- //hwwrite(vortex->mmio, addr(0x191DF+1, this04, this08), (ritd<<0x10)|litd);
+ /* hwwrite(vortex->mmio, addr(0x191DF+1, this04, this08), (ritd<<0x10)|litd); */
}
static void a3dsrc_SetItdDline(a3dsrc_t * a, a3d_ItdDline_t const dline)
@@ -392,7 +392,7 @@ static void a3dsrc_SetA3DSampleRate(a3dsrc_t * a, int sr)
esp0 = (((esp0 & 0x7fffffff) | 0xB8000000) & 0x7) | ((sr & 0x1f) << 3);
hwwrite(vortex->mmio, A3D_SLICE_Control + ((a->slice) << 0xd), esp0);
- //hwwrite(vortex->mmio, 0x19C38 + (this08<<0xd), esp0);
+ /* hwwrite(vortex->mmio, 0x19C38 + (this08<<0xd), esp0); */
}
static void a3dsrc_EnableA3D(a3dsrc_t * a)
@@ -400,7 +400,7 @@ static void a3dsrc_EnableA3D(a3dsrc_t * a)
vortex_t *vortex = (vortex_t *) (a->vortex);
hwwrite(vortex->mmio, A3D_SLICE_Control + ((a->slice) << 0xd),
0xF0000001);
- //hwwrite(vortex->mmio, 0x19C38 + (this08<<0xd), 0xF0000001);
+ /* hwwrite(vortex->mmio, 0x19C38 + (this08<<0xd), 0xF0000001); */
}
static void a3dsrc_DisableA3D(a3dsrc_t * a)
@@ -428,7 +428,7 @@ static void a3dsrc_GetA3DSampleRate(a3dsrc_t * a, int *sr)
vortex_t *vortex = (vortex_t *) (a->vortex);
*sr = ((hwread(vortex->mmio, A3D_SLICE_Control + (a->slice << 0xd))
>> 3) & 0x1f);
- //*sr = ((hwread(vortex->mmio, 0x19C38 + (this08<<0xd))>>3)&0x1f);
+ /**sr = ((hwread(vortex->mmio, 0x19C38 + (this08<<0xd))>>3)&0x1f); */
}
static void a3dsrc_GetA3DControlReg(a3dsrc_t * a, unsigned long *ctrl)
@@ -463,7 +463,7 @@ static void a3dsrc_ZeroSliceIO(a3dsrc_t * a)
static void a3dsrc_ZeroState(a3dsrc_t * a)
{
- //printk("vortex: ZeroState slice: %d, source %d\n", a->slice, a->source);
+ /* printk("vortex: ZeroState slice: %d, source %d\n", a->slice, a->source); */
a3dsrc_SetAtmosState(a, 0, 0, 0, 0);
a3dsrc_SetHrtfState(a, A3dHrirZeros, A3dHrirZeros);
@@ -500,7 +500,7 @@ static void a3dsrc_ZeroStateA3D(a3dsrc_t * a)
for (i = 0; i < 4; i++) {
a->slice = i;
a3dsrc_ZeroSliceIO(a);
- //a3dsrc_ZeroState(a);
+ /* a3dsrc_ZeroState(a); */
}
a->source = var2;
a->slice = var;
@@ -524,8 +524,8 @@ static void a3dsrc_ProgramPipe(a3dsrc_t * a)
a3dsrc_SetHrtfTarget(a, A3dHrirImpulse, A3dHrirImpulse);
/* Test: Sounds saturated. */
- //a3dsrc_SetHrtfCurrent(a, A3dHrirSatTest, A3dHrirSatTest);
- //a3dsrc_SetHrtfTarget(a, A3dHrirSatTest, A3dHrirSatTest);
+ /* a3dsrc_SetHrtfCurrent(a, A3dHrirSatTest, A3dHrirSatTest); */
+ /* a3dsrc_SetHrtfTarget(a, A3dHrirSatTest, A3dHrirSatTest); */
}
/* VDB = Vortex audio Dataflow Bus */
@@ -534,7 +534,7 @@ static void a3dsrc_ClearVDBData(a3dsrc_t * a, unsigned long aa)
{
vortex_t *vortex = (vortex_t *) (a->vortex);
- // ((aa >> 2) << 8) - (aa >> 2)
+ /* ((aa >> 2) << 8) - (aa >> 2) */
hwwrite(vortex->mmio,
a3d_addrS(a->slice, A3D_SLICE_VDBDest) + (a->source << 2), 0);
hwwrite(vortex->mmio,
@@ -552,7 +552,7 @@ static void a3dsrc_ClearVDBData(a3dsrc_t * a, unsigned long aa)
static void vortex_A3dSourceHw_Initialize(vortex_t * v, int source, int slice)
{
a3dsrc_t *a3dsrc = &(v->a3d[source + (slice * 4)]);
- //a3dsrc_t *a3dsrc = &(v->a3d[source + (slice*4)]);
+ /* a3dsrc_t *a3dsrc = &(v->a3d[source + (slice*4)]); */
a3dsrc->vortex = (void *)v;
a3dsrc->source = source; /* source */
@@ -616,12 +616,12 @@ static void vortex_Vort3D_disable(vortex_t * v)
static void vortex_Vort3D_connect(vortex_t * v, int en)
{
int i;
-
+
// Disable AU8810 routes, since they seem to be wrong (in au8810.h).
#ifdef CHIP_AU8810
return;
#endif
-
+
#if 1
/* Alloc Xtalk mixin resources */
v->mixxtlk[0] =
@@ -642,7 +642,7 @@ static void vortex_Vort3D_connect(vortex_t * v, int en)
/* Connect A3D -> XTALK */
for (i = 0; i < 4; i++) {
- // 2 outputs per each A3D slice.
+ /* 2 outputs per each A3D slice. */
vortex_route(v, en, 0x11, ADB_A3DOUT(i * 2), ADB_XTALKIN(i));
vortex_route(v, en, 0x11, ADB_A3DOUT(i * 2) + 1, ADB_XTALKIN(5 + i));
}
@@ -689,8 +689,8 @@ static void vortex_Vort3D_InitializeSource(a3dsrc_t * a, int en)
ItdTCDefault, GainTCDefault,
CoefTCDefault);
/* Remark: zero gain is muted. */
- //a3dsrc_SetGainTarget(a,0,0);
- //a3dsrc_SetGainCurrent(a,0,0);
+ /* a3dsrc_SetGainTarget(a,0,0); */
+ /* a3dsrc_SetGainCurrent(a,0,0); */
a3dsrc_EnableA3D(a);
} else {
a3dsrc_DisableA3D(a);
@@ -764,7 +764,7 @@ snd_vortex_a3d_filter_info(struct snd_kcontrol *kcontrol,
static int
snd_vortex_a3d_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol)
{
- //a3dsrc_t *a = kcontrol->private_data;
+ /* a3dsrc_t *a = kcontrol->private_data; */
/* No read yet. Would this be really useable/needed ? */
return 0;
diff --git a/sound/pci/au88x0/au88x0_core.c b/sound/pci/au88x0/au88x0_core.c
index b070e57..9009d38 100644
--- a/sound/pci/au88x0/au88x0_core.c
+++ b/sound/pci/au88x0/au88x0_core.c
@@ -16,7 +16,7 @@
/*
Vortex core low level functions.
-
+
Author: Manuel Jander (mjander(a)users.sourceforge.cl)
These functions are mainly the result of translations made
from the original disassembly of the au88x0 binary drivers,
@@ -73,7 +73,7 @@
06-06-2003 Buffer shifter bugfix. Mixer volume fix.
07-12-2003 A3D routing finally fixed. Believed to be OK.
25-03-2004 Many thanks to Claudia, for such valuable bug reports.
-
+
*/
#include "au88x0.h"
@@ -112,7 +112,7 @@ static int vortex_mix_getvolume(vortex_t * vortex, unsigned char mix)
{
int a;
a = hwread(vortex->mmio, VORTEX_MIX_VOL_A + (mix << 2)) & 0xff;
- //FP2LinearFrac(a);
+ /* FP2LinearFrac(a); */
return (a);
}
@@ -144,7 +144,7 @@ static void vortex_mix_rampvolume(vortex_t * vortex, int mix)
{
int ch;
char a;
- // This function is intended for ramping down only (see vortex_disableinput()).
+ /* This function is intended for ramping down only (see vortex_disableinput()). */
for (ch = 0; ch < 0x20; ch++) {
if (((1 << ch) & rampchs[mix]) == 0)
continue;
@@ -260,8 +260,8 @@ vortex_mix_disableinput(vortex_t * vortex, unsigned char mix, int channel,
{
if (ramp) {
rampchs[mix] |= (1 << channel);
- // Register callback.
- //vortex_mix_startrampvolume(vortex);
+ /* Register callback. */
+ /* vortex_mix_startrampvolume(vortex); */
vortex_mix_killinput(vortex, mix, channel);
} else
vortex_mix_killinput(vortex, mix, channel);
@@ -283,7 +283,7 @@ vortex_mixer_addWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
while (temp & 0x10) {
prev = VORTEX_MIXER_RTBASE + ((temp & 0xf) << 2);
temp = hwread(vortex->mmio, prev);
- //printk(KERN_INFO "vortex: mixAddWTD: while addr=%x, val=%x\n", prev, temp);
+ /* printk(KERN_INFO "vortex: mixAddWTD: while addr=%x, val=%x\n", prev, temp); */
if ((++lifeboat) > 0xf) {
printk(KERN_ERR
"vortex_mixer_addWTD: lifeboat overflow\n");
@@ -299,7 +299,7 @@ static int
vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
{
int esp14 = -1, esp18, eax, ebx, edx, ebp, esi = 0;
- //int esp1f=edi(while)=src, esp10=ch;
+ /* int esp1f=edi(while)=src, esp10=ch; */
eax = hwread(vortex->mmio, VORTEX_MIXER_SR);
if (((1 << ch) & eax) == 0) {
@@ -313,15 +313,15 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
if (mix == ebx) {
ebx = VORTEX_MIXER_RTBASE + (mix << 2);
edx = hwread(vortex->mmio, ebx);
- //7b60
+ /* 7b60 */
hwwrite(vortex->mmio, ebp, edx);
hwwrite(vortex->mmio, ebx, 0);
} else {
- //7ad3
+ /* 7ad3 */
edx =
hwread(vortex->mmio,
VORTEX_MIXER_RTBASE + (ebx << 2));
- //printk(KERN_INFO "vortex: mixdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src);
+ /* printk(KERN_INFO "vortex: mixdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src); */
while ((edx & 0xf) != mix) {
if ((esi) > 0xf) {
printk(KERN_ERR
@@ -334,21 +334,21 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
edx =
hwread(vortex->mmio,
VORTEX_MIXER_RTBASE + ebp);
- //printk(KERN_INFO "vortex: mixdelWTD: while addr=%x, val=%x\n", ebp, edx);
+ /* printk(KERN_INFO "vortex: mixdelWTD: while addr=%x, val=%x\n", ebp, edx); */
esi++;
}
- //7b30
+ /* 7b30 */
ebp = ebx << 2;
if (edx & 0x10) { /* Delete entry in between others */
ebx = VORTEX_MIXER_RTBASE + ((edx & 0xf) << 2);
edx = hwread(vortex->mmio, ebx);
- //7b60
+ /* 7b60 */
hwwrite(vortex->mmio,
VORTEX_MIXER_RTBASE + ebp, edx);
hwwrite(vortex->mmio, ebx, 0);
- //printk(KERN_INFO "vortex mixdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx);
+ /* printk(KERN_INFO "vortex mixdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx); */
} else { /* Delete last entry */
- //7b83
+ /* 7b83 */
if (esp14 == -1)
hwwrite(vortex->mmio,
VORTEX_MIXER_CHNBASE +
@@ -358,7 +358,7 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
hwwrite(vortex->mmio,
VORTEX_MIXER_RTBASE +
(esp14 << 2), ebx);
- //printk(KERN_INFO "vortex mixdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx);
+ /* printk(KERN_INFO "vortex mixdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx); */
}
hwwrite(vortex->mmio,
VORTEX_MIXER_RTBASE + ebp, 0);
@@ -366,8 +366,8 @@ vortex_mixer_delWTD(vortex_t * vortex, unsigned char mix, unsigned char ch)
}
}
} else {
- //printk(KERN_INFO "removed last mix\n");
- //7be0
+ /* printk(KERN_INFO "removed last mix\n"); */
+ /* 7be0 */
vortex_mixer_dis_sr(vortex, ch);
hwwrite(vortex->mmio, ebp, 0);
}
@@ -379,7 +379,7 @@ static void vortex_mixer_init(vortex_t * vortex)
u32 addr;
int x;
- // FIXME: get rid of this crap.
+ /* FIXME: get rid of this crap. */
memset(mchannels, 0, NR_MIXOUT * sizeof(int));
memset(rampchs, 0, NR_MIXOUT * sizeof(int));
@@ -572,12 +572,12 @@ static void vortex_src_setupchannel(vortex_t * card, unsigned char src,
unsigned int cr, unsigned int b, int sweep, int d,
int dirplay, int sl, unsigned int tr, int thsource)
{
- // noplayback: d=2,4,7,0xa,0xb when using first 2 src's.
- // c: enables pitch sweep.
- // looks like g is c related. Maybe g is a sweep parameter ?
- // g = cvr
- // dirplay: 0 = recording, 1 = playback
- // d = src hw index.
+ /* noplayback: d=2,4,7,0xa,0xb when using first 2 src's. */
+ /* c: enables pitch sweep. */
+ /* looks like g is c related. Maybe g is a sweep parameter ? */
+ /* g = cvr */
+ /* dirplay: 0 = recording, 1 = playback */
+ /* d = src hw index. */
int esi, ebp = 0, esp10;
@@ -634,7 +634,7 @@ static void vortex_src_setupchannel(vortex_t * card, unsigned char src,
hwwrite(card->mmio, VORTEX_SRC_U2 + (src << 2),
(tr << 0x11) | (dirplay << 0x10) | (ebp << 0x8) | esp10);
/* 0x30f00 e=g=1 esp10=0 ebp=f */
- //printk(KERN_INFO "vortex: SRC %d, d=0x%x, esi=0x%x, esp10=0x%x, ebp=0x%x\n", src, d, esi, esp10, ebp);
+ /* printk(KERN_INFO "vortex: SRC %d, d=0x%x, esi=0x%x, esp10=0x%x, ebp=0x%x\n", src, d, esi, esp10, ebp); */
}
static void vortex_srcblock_init(vortex_t * vortex)
@@ -647,15 +647,15 @@ static void vortex_srcblock_init(vortex_t * vortex)
vortex_src_init(&vortex_src[x], x);
}
*/
- //addr = 0xcc3c;
- //addr = 0x26c3c;
+ /* addr = 0xcc3c; */
+ /* addr = 0x26c3c; */
addr = VORTEX_SRC_RTBASE + 0x3c;
for (x = 0xf; x >= 0; x--) {
hwwrite(vortex->mmio, addr, 0);
addr -= 4;
}
- //addr = 0xcc94;
- //addr = 0x26c94;
+ /* addr = 0xcc94; */
+ /* addr = 0x26c94; */
addr = VORTEX_SRC_CHNBASE + 0x54;
for (x = 0x15; x >= 0; x--) {
hwwrite(vortex->mmio, addr, 0);
@@ -667,7 +667,7 @@ static int
vortex_src_addWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
{
int temp, lifeboat = 0, prev;
- // esp13 = src
+ /* esp13 = src */
temp = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR);
if ((temp & (1 << ch)) == 0) {
@@ -677,12 +677,12 @@ vortex_src_addWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
}
prev = VORTEX_SRC_CHNBASE + (ch << 2); /*ebp */
temp = hwread(vortex->mmio, prev);
- //while (temp & NR_SRC) {
+ /* while (temp & NR_SRC) { */
while (temp & 0x10) {
prev = VORTEX_SRC_RTBASE + ((temp & 0xf) << 2); /*esp12 */
- //prev = VORTEX_SRC_RTBASE + ((temp & (NR_SRC-1)) << 2); /*esp12*/
+ /* prev = VORTEX_SRC_RTBASE + ((temp & (NR_SRC-1)) << 2); esp12 */
temp = hwread(vortex->mmio, prev);
- //printk(KERN_INFO "vortex: srcAddWTD: while addr=%x, val=%x\n", prev, temp);
+ /* printk(KERN_INFO "vortex: srcAddWTD: while addr=%x, val=%x\n", prev, temp); */
if ((++lifeboat) > 0xf) {
printk(KERN_ERR
"vortex_src_addWTD: lifeboat overflow\n");
@@ -690,7 +690,7 @@ vortex_src_addWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
}
}
hwwrite(vortex->mmio, VORTEX_SRC_RTBASE + ((temp & 0xf) << 2), src);
- //hwwrite(vortex->mmio, prev, (temp & (NR_SRC-1)) | NR_SRC);
+ /* hwwrite(vortex->mmio, prev, (temp & (NR_SRC-1)) | NR_SRC); */
hwwrite(vortex->mmio, prev, (temp & 0xf) | 0x10);
return 1;
}
@@ -699,7 +699,7 @@ static int
vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
{
int esp14 = -1, esp18, eax, ebx, edx, ebp, esi = 0;
- //int esp1f=edi(while)=src, esp10=ch;
+ /* int esp1f=edi(while)=src, esp10=ch; */
eax = hwread(vortex->mmio, VORTEX_SRCBLOCK_SR);
if (((1 << ch) & eax) == 0) {
@@ -713,15 +713,15 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
if (src == ebx) {
ebx = VORTEX_SRC_RTBASE + (src << 2);
edx = hwread(vortex->mmio, ebx);
- //7b60
+ /* 7b60 */
hwwrite(vortex->mmio, ebp, edx);
hwwrite(vortex->mmio, ebx, 0);
} else {
- //7ad3
+ /* 7ad3 */
edx =
hwread(vortex->mmio,
VORTEX_SRC_RTBASE + (ebx << 2));
- //printk(KERN_INFO "vortex: srcdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src);
+ /* printk(KERN_INFO "vortex: srcdelWTD: 1 addr=%x, val=%x, src=%x\n", ebx, edx, src); */
while ((edx & 0xf) != src) {
if ((esi) > 0xf) {
printk
@@ -734,21 +734,21 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
edx =
hwread(vortex->mmio,
VORTEX_SRC_RTBASE + ebp);
- //printk(KERN_INFO "vortex: srcdelWTD: while addr=%x, val=%x\n", ebp, edx);
+ /* printk(KERN_INFO "vortex: srcdelWTD: while addr=%x, val=%x\n", ebp, edx); */
esi++;
}
- //7b30
+ /* 7b30 */
ebp = ebx << 2;
if (edx & 0x10) { /* Delete entry in between others */
ebx = VORTEX_SRC_RTBASE + ((edx & 0xf) << 2);
edx = hwread(vortex->mmio, ebx);
- //7b60
+ /* 7b60 */
hwwrite(vortex->mmio,
VORTEX_SRC_RTBASE + ebp, edx);
hwwrite(vortex->mmio, ebx, 0);
- //printk(KERN_INFO "vortex srcdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx);
+ /* printk(KERN_INFO "vortex srcdelWTD between addr= 0x%x, val= 0x%x\n", ebp, edx); */
} else { /* Delete last entry */
- //7b83
+ /* 7b83 */
if (esp14 == -1)
hwwrite(vortex->mmio,
VORTEX_SRC_CHNBASE +
@@ -758,7 +758,7 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
hwwrite(vortex->mmio,
VORTEX_SRC_RTBASE +
(esp14 << 2), ebx);
- //printk(KERN_INFO"vortex srcdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx);
+ /* printk(KERN_INFO"vortex srcdelWTD last addr= 0x%x, val= 0x%x\n", esp14, ebx); */
}
hwwrite(vortex->mmio,
VORTEX_SRC_RTBASE + ebp, 0);
@@ -766,14 +766,14 @@ vortex_src_delWTD(vortex_t * vortex, unsigned char src, unsigned char ch)
}
}
} else {
- //7be0
+ /* 7be0 */
vortex_src_dis_sr(vortex, ch);
hwwrite(vortex->mmio, ebp, 0);
}
return 1;
}
- /*FIFO*/
+ /*FIFO*/
static void
vortex_fifo_clearadbdata(vortex_t * vortex, int fifo, int x)
@@ -809,7 +809,7 @@ vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int b, int priority,
int empty, int valid, int f)
{
int temp, lifeboat = 0;
- //int this_8[NR_ADB] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; /* position */
+ /* int this_8[NR_ADB] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; position */
int this_4 = 0x2;
/* f seems priority related.
* CAsp4AdbDma::SetPriority is the only place that calls SetAdbCtrl with f set to 1
@@ -826,12 +826,12 @@ vortex_fifo_setadbctrl(vortex_t * vortex, int fifo, int b, int priority,
}
while (temp & FIFO_RDONLY);
- // AU8830 semes to take some special care about fifo content (data).
- // But i'm just to lazy to translate that :)
+ /* AU8830 semes to take some special care about fifo content (data). */
+ /* But i'm just to lazy to translate that :) */
if (valid) {
if ((temp & FIFO_VALID) == 0) {
- //this_8[fifo] = 0;
- vortex_fifo_clearadbdata(vortex, fifo, FIFO_SIZE); // this_4
+ /* this_8[fifo] = 0; */
+ vortex_fifo_clearadbdata(vortex, fifo, FIFO_SIZE); /* this_4 */
#ifdef CHIP_AU8820
temp = (this_4 & 0x1f) << 0xb;
#else
@@ -923,7 +923,7 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
if (valid) {
if ((temp & FIFO_VALID) == 0) {
- vortex_fifo_clearwtdata(vortex, fifo, FIFO_SIZE); // this_4
+ vortex_fifo_clearwtdata(vortex, fifo, FIFO_SIZE); /* this_4 */
#ifdef CHIP_AU8820
temp = (this_4 & 0x1f) << 0xb;
#else
@@ -966,7 +966,7 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp);
hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2));
-/*
+/*
do {
temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2));
if (lifeboat++ > 0xbb8) {
@@ -974,8 +974,8 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
break;
}
} while ((temp & FIFO_RDONLY)&&(temp & FIFO_VALID)&&(temp != 0xFFFFFFFF));
-
-
+
+
if (valid) {
if (temp & FIFO_VALID) {
temp = 0x40000;
@@ -1001,8 +1001,8 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
temp |= 0x00400000;
hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp);
temp = hwread(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2));
- //((temp >> 6) & 0x3f)
-
+ //((temp >> 6) & 0x3f)
+
priority = 0;
if (((temp & 0x0fc0) ^ ((temp >> 6) & 0x0fc0)) & 0FFFFFFC0)
vortex_fifo_clearwtdata(vortex, fifo, FIFO_SIZE);
@@ -1014,7 +1014,7 @@ vortex_fifo_setwtctrl(vortex_t * vortex, int fifo, int ctrl, int priority,
temp = (temp & 0xffffffdf) | ((empty & 1) << 5);
hwwrite(vortex->mmio, VORTEX_FIFO_WTCTRL + (fifo << 2), temp);
}
-
+
*/
/*
@@ -1062,7 +1062,7 @@ static void vortex_fifo_init(vortex_t * vortex)
#endif
/* trigger... */
#ifdef CHIP_AU8820
- hwwrite(vortex->mmio, 0xf8c0, 0xd03); //0x0843 0xd6b
+ hwwrite(vortex->mmio, 0xf8c0, 0xd03); /* 0x0843 0xd6b */
#else
#ifdef CHIP_AU8830
hwwrite(vortex->mmio, 0x17000, 0x61); /* wt a */
@@ -1089,7 +1089,7 @@ static void vortex_adbdma_setfirstbuffer(vortex_t * vortex, int adbdma)
static void vortex_adbdma_setstartbuffer(vortex_t * vortex, int adbdma, int sb)
{
stream_t *dma = &vortex->dma_adb[adbdma];
- //hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2), sb << (((NR_ADB-1)-((adbdma&0xf)*2))));
+ /* hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2), sb << (((NR_ADB-1)-((adbdma&0xf)*2)))); */
hwwrite(vortex->mmio, VORTEX_ADBDMA_START + (adbdma << 2),
sb << ((0xf - (adbdma & 0xf)) * 2));
dma->period_real = dma->period_virt = sb;
@@ -1135,7 +1135,7 @@ vortex_adbdma_setbuffers(vortex_t * vortex, int adbdma,
snd_pcm_sgbuf_get_addr(dma->substream, 0));
break;
}
- //printk("vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", dma->cfg0, dma->cfg1);
+ /* printk("vortex: cfg0 = 0x%x\nvortex: cfg1=0x%x\n", dma->cfg0, dma->cfg1); */
hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG0 + (adbdma << 3), dma->cfg0);
hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFCFG1 + (adbdma << 3), dma->cfg1);
@@ -1195,7 +1195,7 @@ static int vortex_adbdma_bufshift(vortex_t * vortex, int adbdma)
pp = dma->period_real + i;
if (pp >= 4)
pp -= 4;
- //hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFBASE+(((adbdma << 2)+pp) << 2), dma->table[p].addr);
+ /* hwwrite(vortex->mmio, VORTEX_ADBDMA_BUFBASE+(((adbdma << 2)+pp) << 2), dma->table[p].addr); */
hwwrite(vortex->mmio,
VORTEX_ADBDMA_BUFBASE + (((adbdma << 2) + pp) << 2),
snd_pcm_sgbuf_get_addr(dma->substream,
@@ -1222,7 +1222,7 @@ static void vortex_adbdma_resetup(vortex_t *vortex, int adbdma) {
int p, pp, i;
/* refresh hw page table */
- for (i=0 ; i < 4 && i < dma->nr_periods; i++) {
+ for (i = 0; i < 4 && i < dma->nr_periods; i++) {
/* p: audio buffer page index */
p = dma->period_virt + i;
if (p >= dma->nr_periods)
@@ -1258,7 +1258,7 @@ static int inline vortex_adbdma_getlinearpos(vortex_t * vortex, int adbdma)
static void vortex_adbdma_startfifo(vortex_t * vortex, int adbdma)
{
- int this_8 = 0 /*empty */ , this_4 = 0 /*priority */ ;
+ int this_8 = 0, /*empty */ this_4 = 0; /*priority */
stream_t *dma = &vortex->dma_adb[adbdma];
switch (dma->fifo_status) {
@@ -1325,7 +1325,7 @@ static void vortex_adbdma_pausefifo(vortex_t * vortex, int adbdma)
dma->fifo_status = FIFO_PAUSE;
}
-#if 0 // Using pause instead
+#if 0 /* Using pause instead */
static void vortex_adbdma_stopfifo(vortex_t * vortex, int adbdma)
{
stream_t *dma = &vortex->dma_adb[adbdma];
@@ -1346,7 +1346,7 @@ static void vortex_adbdma_stopfifo(vortex_t * vortex, int adbdma)
#ifndef CHIP_AU8810
static void vortex_wtdma_setfirstbuffer(vortex_t * vortex, int wtdma)
{
- //int this_7c=dma_ctrl;
+ /* int this_7c=dma_ctrl; */
stream_t *dma = &vortex->dma_wt[wtdma];
hwwrite(vortex->mmio, VORTEX_WTDMA_CTRL + (wtdma << 2), dma->dma_ctrl);
@@ -1355,7 +1355,7 @@ static void vortex_wtdma_setfirstbuffer(vortex_t * vortex, int wtdma)
static void vortex_wtdma_setstartbuffer(vortex_t * vortex, int wtdma, int sb)
{
stream_t *dma = &vortex->dma_wt[wtdma];
- //hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2), sb << ((0x1f-(wtdma&0xf)*2)));
+ /* hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2), sb << ((0x1f-(wtdma&0xf)*2))); */
hwwrite(vortex->mmio, VORTEX_WTDMA_START + (wtdma << 2),
sb << ((0xf - (wtdma & 0xf)) * 2));
dma->period_real = dma->period_virt = sb;
@@ -1410,7 +1410,7 @@ vortex_wtdma_setmode(vortex_t * vortex, int wtdma, int ie, int fmt, int d,
{
stream_t *dma = &vortex->dma_wt[wtdma];
- //dma->this_08 = e;
+ /* dma->this_08 = e; */
dma->dma_unknown = d;
dma->dma_ctrl = 0;
dma->dma_ctrl =
@@ -1501,7 +1501,7 @@ static int inline vortex_wtdma_getlinearpos(vortex_t * vortex, int wtdma)
int temp;
temp = hwread(vortex->mmio, VORTEX_WTDMA_STAT + (wtdma << 2));
- //temp = (temp & POS_MASK) + (((temp>>WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK)*(dma->cfg0&POS_MASK));
+ /* temp = (temp & POS_MASK) + (((temp>>WT_SUBBUF_SHIFT) & WT_SUBBUF_MASK)*(dma->cfg0&POS_MASK)); */
temp = (temp & POS_MASK) + ((dma->period_virt) * (dma->period_bytes));
return temp;
}
@@ -1846,7 +1846,7 @@ vortex_connection_mixin_mix(vortex_t * vortex, int en, unsigned char mixin,
{
if (en) {
vortex_mix_enableinput(vortex, mix, mixin);
- vortex_mix_setinputvolumebyte(vortex, mix, mixin, MIX_DEFIGAIN); // added to original code.
+ vortex_mix_setinputvolumebyte(vortex, mix, mixin, MIX_DEFIGAIN); /* added to original code. */
} else
vortex_mix_disableinput(vortex, mix, mixin, a);
}
@@ -1883,7 +1883,7 @@ vortex_connection_mix_adb(vortex_t * vortex, int en, unsigned char ch,
unsigned char mix, unsigned char dest)
{
vortex_route(vortex, en, ch, ADB_MIXOUT(mix), dest);
- vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); // added to original code.
+ vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); /* added to original code. */
}
// mixer to src.
@@ -1892,7 +1892,7 @@ vortex_connection_mix_src(vortex_t * vortex, int en, unsigned char ch,
unsigned char mix, unsigned char src)
{
vortex_route(vortex, en, ch, ADB_MIXOUT(mix), ADB_SRCIN(src));
- vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); // added to original code.
+ vortex_mix_setvolumebyte(vortex, mix, MIX_DEFOGAIN); /* added to original code. */
}
#if 0
@@ -1943,7 +1943,7 @@ vortex_connect_codecplay(vortex_t * vortex, int en, unsigned char mixers[])
vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_CODECOUT(1));
#else
#if 1
- // Connect front channels through EQ.
+ /* Connect front channels through EQ. */
vortex_connection_mix_adb(vortex, en, 0x11, mixers[0], ADB_EQIN(0));
vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_EQIN(1));
/* Lower volume, since EQ has some gain. */
@@ -1959,10 +1959,10 @@ vortex_connect_codecplay(vortex_t * vortex, int en, unsigned char mixers[])
ADB_CODECOUT(0 + 4));
vortex_connection_mix_adb(vortex, en, 0x11, mixers[3],
ADB_CODECOUT(1 + 4));
- //printk("SDAC detected ");
+ /* printk("SDAC detected "); */
}
#else
- // Use plain direct output to codec.
+ /* Use plain direct output to codec. */
vortex_connection_mix_adb(vortex, en, 0x11, mixers[0], ADB_CODECOUT(0));
vortex_connection_mix_adb(vortex, en, 0x11, mixers[1], ADB_CODECOUT(1));
#endif
@@ -1989,7 +1989,7 @@ vortex_connect_codecrec(vortex_t * vortex, int en, unsigned char mixin0,
static int resnum[VORTEX_RESOURCE_LAST] =
{ NR_ADB, NR_SRC, NR_MIXIN, NR_MIXOUT, NR_A3D };
/*
- Checkout/Checkin resource of given type.
+ Checkout/Checkin resource of given type.
resmap: resource map to be used. If NULL means that we want to allocate
a DMA resource (root of all other resources of a dma channel).
out: Mean checkout if != 0. Else mean Checkin resource.
@@ -2013,7 +2013,7 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
resmap[restype] |= (1 << i);
else
vortex->dma_adb[i].resources[restype] |= (1 << i);
- //printk("vortex: ResManager: type %d out %d\n", restype, i);
+ /* printk("vortex: ResManager: type %d out %d\n", restype, i); */
return i;
}
}
@@ -2024,7 +2024,7 @@ vortex_adb_checkinout(vortex_t * vortex, int resmap[], int out, int restype)
for (i = 0; i < qty; i++) {
if (resmap[restype] & (1 << i)) {
resmap[restype] &= ~(1 << i);
- //printk("vortex: ResManager: type %d in %d\n",restype, i);
+ /* printk("vortex: ResManager: type %d in %d\n",restype, i); */
return i;
}
}
@@ -2039,7 +2039,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type);
static void vortex_connect_default(vortex_t * vortex, int en)
{
- // Connect AC97 codec.
+ /* Connect AC97 codec. */
vortex->mixplayb[0] = vortex_adb_checkinout(vortex, vortex->fixed_res, en,
VORTEX_RESOURCE_MIXOUT);
vortex->mixplayb[1] = vortex_adb_checkinout(vortex, vortex->fixed_res, en,
@@ -2058,7 +2058,7 @@ static void vortex_connect_default(vortex_t * vortex, int en)
VORTEX_RESOURCE_MIXIN);
vortex_connect_codecrec(vortex, en, MIX_CAPT(0), MIX_CAPT(1));
- // Connect SPDIF
+ /* Connect SPDIF */
#ifndef CHIP_AU8820
vortex->mixspdif[0] = vortex_adb_checkinout(vortex, vortex->fixed_res, en,
VORTEX_RESOURCE_MIXOUT);
@@ -2069,20 +2069,20 @@ static void vortex_connect_default(vortex_t * vortex, int en)
vortex_connection_mix_adb(vortex, en, 0x14, vortex->mixspdif[1],
ADB_SPDIFOUT(1));
#endif
- // Connect WT
+ /* Connect WT */
#ifndef CHIP_AU8810
vortex_wt_connect(vortex, en);
#endif
- // A3D (crosstalk canceler and A3D slices). AU8810 disabled for now.
+ /* A3D (crosstalk canceler and A3D slices). AU8810 disabled for now. */
#ifndef CHIP_AU8820
vortex_Vort3D_connect(vortex, en);
#endif
- // Connect I2S
+ /* Connect I2S */
+
+ /* Connect DSP interface for SQ3500 turbo (not here i think...) */
- // Connect DSP interface for SQ3500 turbo (not here i think...)
+ /* Connect AC98 modem codec */
- // Connect AC98 modem codec
-
}
/*
@@ -2099,7 +2099,7 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
{
stream_t *stream;
int i, en;
-
+
if ((nr_ch == 3)
|| ((dir == SNDRV_PCM_STREAM_CAPTURE) && (nr_ch > 2)))
return -EBUSY;
@@ -2203,13 +2203,13 @@ vortex_adb_allocroute(vortex_t * vortex, int dma, int nr_ch, int dir, int type)
#ifndef CHIP_AU8820
if (stream->type == VORTEX_PCM_A3D) {
vortex_connection_adbdma_src(vortex, en,
- src[nr_ch - 1],
+ src[nr_ch - 1],
dma,
src[i]);
vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_A3DIN(a3d));
/* XTalk test. */
- //vortex_route(vortex, en, 0x11, dma, ADB_XTALKIN(i?9:4));
- //vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_XTALKIN(i?4:9));
+ /* vortex_route(vortex, en, 0x11, dma, ADB_XTALKIN(i?9:4)); */
+ /* vortex_route(vortex, en, 0x11, ADB_SRCOUT(src[i]), ADB_XTALKIN(i?4:9)); */
}
if (stream->type == VORTEX_PCM_SPDIF)
vortex_route(vortex, en, 0x14,
@@ -2331,7 +2331,7 @@ vortex_adb_setsrc(vortex_t * vortex, int adbdma, unsigned int rate, int dir)
stream_t *stream = &(vortex->dma_adb[adbdma]);
int i, cvrt;
- /* dir=1:play ; dir=0:rec */
+ /* dir=1:play; dir=0:rec */
if (dir)
cvrt = SRC_RATIO(rate, 48000);
else
@@ -2348,7 +2348,7 @@ vortex_adb_setsrc(vortex_t * vortex, int adbdma, unsigned int rate, int dir)
static void vortex_settimer(vortex_t * vortex, int period)
{
- //set the timer period to <period> 48000ths of a second.
+ /* set the timer period to <period> 48000ths of a second. */
hwwrite(vortex->mmio, VORTEX_IRQ_STAT, period);
}
@@ -2368,7 +2368,7 @@ static void vortex_disable_timer_int(vortex_t * card)
#endif
static void vortex_enable_int(vortex_t * card)
{
- // CAsp4ISR__EnableVortexInt_void_
+ /* CAsp4ISR__EnableVortexInt_void_ */
hwwrite(card->mmio, VORTEX_CTRL,
hwread(card->mmio, VORTEX_CTRL) | CTRL_IRQ_ENABLE);
hwwrite(card->mmio, VORTEX_IRQ_CTRL,
@@ -2387,26 +2387,26 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
int i, handled;
u32 source;
- //check if the interrupt is ours.
+ /* check if the interrupt is ours. */
if (!(hwread(vortex->mmio, VORTEX_STAT) & 0x1))
return IRQ_NONE;
- // This is the Interrupt Enable flag we set before (consistency check).
+ /* This is the Interrupt Enable flag we set before (consistency check). */
if (!(hwread(vortex->mmio, VORTEX_CTRL) & CTRL_IRQ_ENABLE))
return IRQ_NONE;
source = hwread(vortex->mmio, VORTEX_IRQ_SOURCE);
- // Reset IRQ flags.
+ /* Reset IRQ flags. */
hwwrite(vortex->mmio, VORTEX_IRQ_SOURCE, source);
hwread(vortex->mmio, VORTEX_IRQ_SOURCE);
- // Is at least one IRQ flag set?
+ /* Is at least one IRQ flag set? */
if (source == 0) {
printk(KERN_ERR "vortex: missing irq source\n");
return IRQ_NONE;
}
handled = 0;
- // Attend every interrupt source.
+ /* Attend every interrupt source. */
if (unlikely(source & IRQ_ERR_MASK)) {
if (source & IRQ_FATAL) {
printk(KERN_ERR "vortex: IRQ fatal error\n");
@@ -2430,7 +2430,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
spin_lock(&vortex->lock);
for (i = 0; i < NR_ADB; i++) {
if (vortex->dma_adb[i].fifo_status == FIFO_START) {
- if (vortex_adbdma_bufshift(vortex, i)) ;
+ if (vortex_adbdma_bufshift(vortex, i));
spin_unlock(&vortex->lock);
snd_pcm_period_elapsed(vortex->dma_adb[i].
substream);
@@ -2440,7 +2440,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
#ifndef CHIP_AU8810
for (i = 0; i < NR_WT; i++) {
if (vortex->dma_wt[i].fifo_status == FIFO_START) {
- if (vortex_wtdma_bufshift(vortex, i)) ;
+ if (vortex_wtdma_bufshift(vortex, i));
spin_unlock(&vortex->lock);
snd_pcm_period_elapsed(vortex->dma_wt[i].
substream);
@@ -2451,7 +2451,7 @@ static irqreturn_t vortex_interrupt(int irq, void *dev_id)
spin_unlock(&vortex->lock);
handled = 1;
}
- //Acknowledge the Timer interrupt
+ /* Acknowledge the Timer interrupt */
if (source & IRQ_TIMER) {
hwread(vortex->mmio, VORTEX_IRQ_STAT);
handled = 1;
@@ -2510,7 +2510,7 @@ static void vortex_codec_init(vortex_t * vortex)
}
static void
-vortex_codec_write(struct snd_ac97 * codec, unsigned short addr, unsigned short data)
+vortex_codec_write(struct snd_ac97 *codec, unsigned short addr, unsigned short data)
{
vortex_t *card = (vortex_t *) codec->private_data;
@@ -2529,13 +2529,13 @@ vortex_codec_write(struct snd_ac97 * codec, unsigned short addr, unsigned short
((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK) |
((data << VORTEX_CODEC_DATSHIFT) & VORTEX_CODEC_DATMASK) |
VORTEX_CODEC_WRITE |
- (codec->num << VORTEX_CODEC_ID_SHIFT) );
+ (codec->num << VORTEX_CODEC_ID_SHIFT));
/* Flush Caches. */
hwread(card->mmio, VORTEX_CODEC_IO);
}
-static unsigned short vortex_codec_read(struct snd_ac97 * codec, unsigned short addr)
+static unsigned short vortex_codec_read(struct snd_ac97 *codec, unsigned short addr)
{
vortex_t *card = (vortex_t *) codec->private_data;
@@ -2552,7 +2552,7 @@ static unsigned short vortex_codec_read(struct snd_ac97 * codec, unsigned short
}
/* set up read address */
read_addr = ((addr << VORTEX_CODEC_ADDSHIFT) & VORTEX_CODEC_ADDMASK) |
- (codec->num << VORTEX_CODEC_ID_SHIFT) ;
+ (codec->num << VORTEX_CODEC_ID_SHIFT);
hwwrite(card->mmio, VORTEX_CODEC_IO, read_addr);
/* wait for address */
@@ -2579,10 +2579,10 @@ static void vortex_spdif_init(vortex_t * vortex, int spdif_sr, int spdif_mode)
/* CAsp4Spdif::InitializeSpdifHardware(void) */
hwwrite(vortex->mmio, VORTEX_SPDIF_FLAGS,
hwread(vortex->mmio, VORTEX_SPDIF_FLAGS) & 0xfff3fffd);
- //for (i=0x291D4; i<0x29200; i+=4)
+ /* for (i = 0x291D4; i < 0x29200; i += 4) */
for (i = 0; i < 11; i++)
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1 + (i << 2), 0);
- //hwwrite(vortex->mmio, 0x29190, hwread(vortex->mmio, 0x29190) | 0xc0000);
+ /* hwwrite(vortex->mmio, 0x29190, hwread(vortex->mmio, 0x29190) | 0xc0000); */
hwwrite(vortex->mmio, VORTEX_CODEC_EN,
hwread(vortex->mmio, VORTEX_CODEC_EN) | EN_SPDIF);
@@ -2644,8 +2644,8 @@ static void vortex_spdif_init(vortex_t * vortex, int spdif_sr, int spdif_mode)
break;
}
- /* looks like the next 2 lines transfer a 16-bit value into 2 8-bit
- registers. seems to be for the standard IEC/SPDIF initialization
+ /* looks like the next 2 lines transfer a 16-bit value into 2 8-bit
+ registers. seems to be for the standard IEC/SPDIF initialization
stuff */
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG0, this_38 & 0xffff);
hwwrite(vortex->mmio, VORTEX_SPDIF_CFG1, this_38 >> 0x10);
@@ -2677,7 +2677,7 @@ static int __devinit vortex_core_init(vortex_t * vortex)
/* Init audio engine. */
vortex_adbdma_init(vortex);
- hwwrite(vortex->mmio, VORTEX_ENGINE_CTRL, 0x0); //, 0xc83c7e58, 0xc5f93e58
+ hwwrite(vortex->mmio, VORTEX_ENGINE_CTRL, 0x0); /*, 0xc83c7e58, 0xc5f93e58 */
vortex_adb_init(vortex);
/* Init processing blocks. */
vortex_fifo_init(vortex);
@@ -2691,16 +2691,16 @@ static int __devinit vortex_core_init(vortex_t * vortex)
#ifndef CHIP_AU8810
vortex_wt_init(vortex);
#endif
- // Moved to au88x0.c
- //vortex_connect_default(vortex, 1);
+ /* Moved to au88x0.c */
+ /* vortex_connect_default(vortex, 1); */
vortex_settimer(vortex, 0x90);
- // Enable Interrupts.
- // vortex_enable_int() must be first !!
- // hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, 0);
- // vortex_enable_int(vortex);
- //vortex_enable_timer_int(vortex);
- //vortex_disable_timer_int(vortex);
+ /* Enable Interrupts. */
+ /* vortex_enable_int() must be first !! */
+ /* hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, 0); */
+ /* vortex_enable_int(vortex); */
+ /* vortex_enable_timer_int(vortex); */
+ /* vortex_disable_timer_int(vortex); */
printk(KERN_INFO "done.\n");
spin_lock_init(&vortex->lock);
@@ -2716,7 +2716,7 @@ static int vortex_core_shutdown(vortex_t * vortex)
vortex_eq_free(vortex);
vortex_Vort3D_disable(vortex);
#endif
- //vortex_disable_timer_int(vortex);
+ /* vortex_disable_timer_int(vortex); */
vortex_disable_int(vortex);
vortex_connect_default(vortex, 0);
/* Reset all DMA fifos. */
@@ -2725,8 +2725,8 @@ static int vortex_core_shutdown(vortex_t * vortex)
vortex_adb_init(vortex);
/* Disable MPU401 */
- //hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, hwread(vortex->mmio, VORTEX_IRQ_CTRL) & ~IRQ_MIDI);
- //hwwrite(vortex->mmio, VORTEX_CTRL, hwread(vortex->mmio, VORTEX_CTRL) & ~CTRL_MIDI_EN);
+ /* hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, hwread(vortex->mmio, VORTEX_IRQ_CTRL) & ~IRQ_MIDI); */
+ /* hwwrite(vortex->mmio, VORTEX_CTRL, hwread(vortex->mmio, VORTEX_CTRL) & ~CTRL_MIDI_EN); */
hwwrite(vortex->mmio, VORTEX_IRQ_CTRL, 0);
hwwrite(vortex->mmio, VORTEX_CTRL, 0);
@@ -2795,17 +2795,17 @@ vortex_translateformat(vortex_t * vortex, char bits, char nch, int encod)
switch (encod) {
case 0:
if (bits == 0x10)
- a = 8; // 16 bit
+ a = 8; /* 16 bit */
break;
case 1:
if (bits == 8)
- a = 1; // 8 bit
+ a = 1; /* 8 bit */
break;
case 2:
- a = 2; // U_LAW
+ a = 2; /* U_LAW */
break;
case 3:
- a = 3; // A_LAW
+ a = 3; /* A_LAW */
break;
}
switch (nch) {
diff --git a/sound/pci/au88x0/au88x0_eq.c b/sound/pci/au88x0/au88x0_eq.c
index 38602b8..5b911b9 100644
--- a/sound/pci/au88x0/au88x0_eq.c
+++ b/sound/pci/au88x0/au88x0_eq.c
@@ -4,7 +4,7 @@
*
* Sun Jun 8 18:19:19 2003
* 2003 Manuel Jander (mjander(a)users.sourceforge.net)
- *
+ *
* 02 July 2003: First time something works :)
* November 2003: A3D Bypass code completed but untested.
*
@@ -32,7 +32,7 @@
/*
The Aureal Hardware EQ is found on AU8810 and AU8830 chips only.
- it has 4 inputs (2 for general mix, 2 for A3D) and 2 outputs (supposed
+ it has 4 inputs (2 for general mix, 2 for A3D) and 2 outputs (supposed
to be routed to the codec).
*/
@@ -444,9 +444,9 @@ static void vortex_EqHw_ZeroState(vortex_t * vortex)
vortex_EqHw_SetRightGainsTarget(vortex, eq_gains_zero);
vortex_EqHw_SetBypassGain(vortex, 0, 0);
- //vortex_EqHw_SetCurrBypassGain(vortex, 0, 0);
+ /* vortex_EqHw_SetCurrBypassGain(vortex, 0, 0); */
vortex_EqHw_SetA3DBypassGain(vortex, 0, 0);
- //vortex_EqHw_SetCurrA3DBypassGain(vortex, 0, 0);
+ /* vortex_EqHw_SetCurrA3DBypassGain(vortex, 0, 0); */
vortex_EqHw_SetLeftStates(vortex, eq_states_zero, asEqOutStateZeros);
vortex_EqHw_SetRightStates(vortex, eq_states_zero, asEqOutStateZeros);
vortex_EqHw_SetLevels(vortex, (u16 *) eq_levels);
@@ -570,7 +570,7 @@ vortex_Eqlzr_GetAllBands(vortex_t * vortex, u16 * gains, s32 *cnt)
return 1;
si++;
}
- while (eq->this10 > si) ;
+ while (eq->this10 > si);
*cnt = si * 2;
return 0;
}
@@ -597,7 +597,7 @@ vortex_Eqlzr_SetAllBands(vortex_t * vortex, u16 gains[], s32 count)
for (i = 0; i < count; i++) {
eq->this130[i] = gains[i];
}
-
+
if (eq->this54)
return 0;
return vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex);
@@ -643,7 +643,7 @@ static void vortex_Eqlzr_ShutDownA3d(vortex_t * vortex)
static void vortex_Eqlzr_SetBypass(vortex_t * vortex, u32 bp)
{
eqlzr_t *eq = &(vortex->eq);
-
+
if ((eq->this28) && (bp == 0)) {
/* EQ enabled */
vortex_Eqlzr_SetAllBandsFromActiveCoeffSet(vortex);
@@ -691,7 +691,7 @@ static void vortex_Eqlzr_init(vortex_t * vortex)
eqlzr_t *eq = &(vortex->eq);
/* Object constructor */
- //eq->this04 = 0;
+ /* eq->this04 = 0; */
eq->this08 = 0; /* Bypass gain with EQ in use. */
eq->this0a = 0x5999;
eq->this0c = 0x5999; /* Bypass gain with EQ disabled. */
@@ -736,7 +736,7 @@ snd_vortex_eqtoggle_get(struct snd_kcontrol *kcontrol,
{
vortex_t *vortex = snd_kcontrol_chip(kcontrol);
eqlzr_t *eq = &(vortex->eq);
- //int i = kcontrol->private_value;
+ /* int i = kcontrol->private_value; */
ucontrol->value.integer.value[0] = eq->this54 ? 0 : 1;
@@ -749,7 +749,7 @@ snd_vortex_eqtoggle_put(struct snd_kcontrol *kcontrol,
{
vortex_t *vortex = snd_kcontrol_chip(kcontrol);
eqlzr_t *eq = &(vortex->eq);
- //int i = kcontrol->private_value;
+ /* int i = kcontrol->private_value; */
eq->this54 = ucontrol->value.integer.value[0] ? 0 : 1;
vortex_Eqlzr_SetBypass(vortex, eq->this54);
@@ -900,7 +900,7 @@ static int __devinit vortex_eq_init(vortex_t * vortex)
kcontrol->private_value = i;
if ((err = snd_ctl_add(vortex->card, kcontrol)) < 0)
return err;
- //vortex->eqctrl[i] = kcontrol;
+ /* vortex->eqctrl[i] = kcontrol; */
}
/* EQ band levels */
if ((kcontrol = snd_ctl_new1(&vortex_levels_kcontrol, vortex)) == NULL)
@@ -916,7 +916,7 @@ static int vortex_eq_free(vortex_t * vortex)
/*
//FIXME: segfault because vortex->eqctrl[i] == 4
int i;
- for (i=0; i<10; i++) {
+ for (i = 0; i < 10; i++) {
if (vortex->eqctrl[i])
snd_ctl_remove(vortex->card, vortex->eqctrl[i]);
}
diff --git a/sound/pci/au88x0/au88x0_mixer.c b/sound/pci/au88x0/au88x0_mixer.c
index c92f493..cd3daf8 100644
--- a/sound/pci/au88x0/au88x0_mixer.c
+++ b/sound/pci/au88x0/au88x0_mixer.c
@@ -23,7 +23,7 @@ static int __devinit snd_vortex_mixer(vortex_t * vortex)
if ((err = snd_ac97_bus(vortex->card, 0, &ops, NULL, &pbus)) < 0)
return err;
memset(&ac97, 0, sizeof(ac97));
- // Intialize AC97 codec stuff.
+ /* Intialize AC97 codec stuff. */
ac97.private_data = vortex;
ac97.scaps = AC97_SCAP_NO_SPDIF;
err = snd_ac97_mixer(pbus, &ac97, &vortex->codec);
diff --git a/sound/pci/au88x0/au88x0_mpu401.c b/sound/pci/au88x0/au88x0_mpu401.c
index 0dc8d25..4d9154f 100644
--- a/sound/pci/au88x0/au88x0_mpu401.c
+++ b/sound/pci/au88x0/au88x0_mpu401.c
@@ -72,7 +72,7 @@ static int __devinit snd_vortex_midi(vortex_t * vortex)
/* Check if anything is OK. */
temp = hwread(vortex->mmio, VORTEX_MIDI_DATA);
- if (temp != MPU401_ACK /*0xfe */ ) {
+ if (temp != MPU401_ACK /*0xfe */) {
printk(KERN_ERR "midi port doesn't acknowledge!\n");
return -ENODEV;
}
diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index b9d2f20..149769f 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -13,12 +13,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
/*
* Vortex PCM ALSA driver.
*
* Supports ADB and WT DMA. Unfortunately, WT channels do not run yet.
- * It remains stuck,and DMA transfers do not happen.
+ * It remains stuck,and DMA transfers do not happen.
*/
#include <sound/asoundef.h>
#include <linux/time.h>
@@ -103,7 +103,7 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_wt = {
SNDRV_PCM_INFO_INTERLEAVED |
SNDRV_PCM_INFO_BLOCK_TRANSFER | SNDRV_PCM_INFO_MMAP_VALID),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
- .rates = SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_CONTINUOUS, // SNDRV_PCM_RATE_48000,
+ .rates = SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_CONTINUOUS, /* SNDRV_PCM_RATE_48000, */
.rate_min = 8000,
.rate_max = 48000,
.channels_min = 1,
@@ -121,7 +121,7 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
vortex_t *vortex = snd_pcm_substream_chip(substream);
struct snd_pcm_runtime *runtime = substream->runtime;
int err;
-
+
/* Force equal size periods */
if ((err =
snd_pcm_hw_constraint_integer(runtime,
@@ -170,10 +170,10 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
/* close callback */
static int snd_vortex_pcm_close(struct snd_pcm_substream *substream)
{
- //vortex_t *chip = snd_pcm_substream_chip(substream);
+ /* vortex_t *chip = snd_pcm_substream_chip(substream); */
stream_t *stream = (stream_t *) substream->runtime->private_data;
- // the hardware-specific codes will be here
+ /* the hardware-specific codes will be here */
if (stream != NULL) {
stream->substream = NULL;
stream->nr_ch = 0;
@@ -191,7 +191,7 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
stream_t *stream = (stream_t *) (substream->runtime->private_data);
int err;
- // Alloc buffer memory.
+ /* Alloc buffer memory. */
err =
snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params));
if (err < 0) {
@@ -203,7 +203,7 @@ snd_vortex_pcm_hw_params(struct snd_pcm_substream *substream,
params_period_bytes(hw_params), params_channels(hw_params));
*/
spin_lock_irq(&chip->lock);
- // Make audio routes and config buffer DMA.
+ /* Make audio routes and config buffer DMA. */
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
int dma, type = VORTEX_PCM_TYPE(substream->pcm);
/* Dealloc any routes. */
@@ -253,7 +253,7 @@ static int snd_vortex_pcm_hw_free(struct snd_pcm_substream *substream)
stream_t *stream = (stream_t *) (substream->runtime->private_data);
spin_lock_irq(&chip->lock);
- // Delete audio routes.
+ /* Delete audio routes. */
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
if (stream != NULL)
vortex_adb_allocroute(chip, stream->dma,
@@ -280,7 +280,7 @@ static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream)
stream_t *stream = (stream_t *) substream->runtime->private_data;
int dma = stream->dma, fmt, dir;
- // set up the hardware with the current configuration.
+ /* set up the hardware with the current configuration. */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
dir = 1;
else
@@ -297,7 +297,7 @@ static int snd_vortex_pcm_prepare(struct snd_pcm_substream *substream)
#ifndef CHIP_AU8810
else {
vortex_wtdma_setmode(chip, dma, 1, fmt, 0, 0);
- // FIXME: Set rate (i guess using vortex_wt_writereg() somehow).
+ /* FIXME: Set rate (i guess using vortex_wt_writereg() somehow). */
vortex_wtdma_setstartbuffer(chip, dma, 0);
}
#endif
@@ -315,8 +315,8 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
spin_lock(&chip->lock);
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
- // do something to start the PCM engine
- //printk(KERN_INFO "vortex: start %d\n", dma);
+ /* do something to start the PCM engine */
+ /* printk(KERN_INFO "vortex: start %d\n", dma); */
stream->fifo_enabled = 1;
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT) {
vortex_adbdma_resetup(chip, dma);
@@ -330,12 +330,12 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
#endif
break;
case SNDRV_PCM_TRIGGER_STOP:
- // do something to stop the PCM engine
- //printk(KERN_INFO "vortex: stop %d\n", dma);
+ /* do something to stop the PCM engine */
+ /* printk(KERN_INFO "vortex: stop %d\n", dma); */
stream->fifo_enabled = 0;
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT)
vortex_adbdma_pausefifo(chip, dma);
- //vortex_adbdma_stopfifo(chip, dma);
+ /* vortex_adbdma_stopfifo(chip, dma); */
#ifndef CHIP_AU8810
else {
printk(KERN_INFO "vortex: wt stop %d\n", dma);
@@ -344,7 +344,7 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
#endif
break;
case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
- //printk(KERN_INFO "vortex: pause %d\n", dma);
+ /* printk(KERN_INFO "vortex: pause %d\n", dma); */
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT)
vortex_adbdma_pausefifo(chip, dma);
#ifndef CHIP_AU8810
@@ -353,7 +353,7 @@ static int snd_vortex_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
#endif
break;
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
- //printk(KERN_INFO "vortex: resume %d\n", dma);
+ /* printk(KERN_INFO "vortex: resume %d\n", dma); */
if (VORTEX_PCM_TYPE(substream->pcm) != VORTEX_PCM_WT)
vortex_adbdma_resumefifo(chip, dma);
#ifndef CHIP_AU8810
@@ -384,7 +384,7 @@ static snd_pcm_uframes_t snd_vortex_pcm_pointer(struct snd_pcm_substream *substr
else
current_ptr = vortex_wtdma_getlinearpos(chip, dma);
#endif
- //printk(KERN_INFO "vortex: pointer = 0x%x\n", current_ptr);
+ /* printk(KERN_INFO "vortex: pointer = 0x%x\n", current_ptr); */
spin_unlock(&chip->lock);
return (bytes_to_frames(substream->runtime, current_ptr));
}
@@ -498,7 +498,7 @@ static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
if (!chip || idx < 0 || idx >= VORTEX_PCM_LAST)
return -ENODEV;
- /* idx indicates which kind of PCM device. ADB, SPDIF, I2S and A3D share the
+ /* idx indicates which kind of PCM device. ADB, SPDIF, I2S and A3D share the
* same dma engine. WT uses it own separate dma engine whcih cant capture. */
if (idx == VORTEX_PCM_ADB)
nr_capt = nr;
@@ -510,7 +510,7 @@ static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
return err;
strcpy(pcm->name, vortex_pcm_name[idx]);
chip->pcm[idx] = pcm;
- // This is an evil hack, but it saves a lot of duplicated code.
+ /* This is an evil hack, but it saves a lot of duplicated code. */
VORTEX_PCM_TYPE(pcm) = idx;
pcm->private_data = chip;
/* set operators */
@@ -519,9 +519,9 @@ static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
if (idx == VORTEX_PCM_ADB)
snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE,
&snd_vortex_playback_ops);
-
+
/* pre-allocation of Scatter-Gather buffers */
-
+
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
snd_dma_pci_data(chip->pci_dev),
0x10000, 0x10000);
diff --git a/sound/pci/au88x0/au88x0_synth.c b/sound/pci/au88x0/au88x0_synth.c
index 978b856..1fcd430 100644
--- a/sound/pci/au88x0/au88x0_synth.c
+++ b/sound/pci/au88x0/au88x0_synth.c
@@ -41,10 +41,10 @@ static void vortex_wt_setstereo(vortex_t * vortex, u32 wt, u32 stereo)
{
int temp;
- //temp = hwread(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2));
+ /* temp = hwread(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2)); */
temp = hwread(vortex->mmio, WT_STEREO(wt));
temp = (temp & 0xfe) | (stereo & 1);
- //hwwrite(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2), temp);
+ /* hwwrite(vortex->mmio, 0x80 + ((wt >> 0x5)<< 0xf) + (((wt & 0x1f) >> 1) << 2), temp); */
hwwrite(vortex->mmio, WT_STEREO(wt), temp);
}
@@ -68,22 +68,22 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
wt_voice_t *voice = &(vortex->wt_voice[wt]);
int temp;
- //FIXME: WT audio routing.
+ /* FIXME: WT audio routing. */
if (nr_ch) {
vortex_fifo_wtinitialize(vortex, wt, 1);
vortex_fifo_setwtvalid(vortex, wt, 1);
vortex_wt_setstereo(vortex, wt, nr_ch - 1);
} else
vortex_fifo_setwtvalid(vortex, wt, 0);
-
+
/* Set mixdown mode. */
vortex_wt_setdsout(vortex, wt, 1);
/* Set other parameter registers. */
hwwrite(vortex->mmio, WT_SRAMP(0), 0x880000);
- //hwwrite(vortex->mmio, WT_GMODE(0), 0xffffffff);
+ /* hwwrite(vortex->mmio, WT_GMODE(0), 0xffffffff); */
#ifdef CHIP_AU8830
hwwrite(vortex->mmio, WT_SRAMP(1), 0x880000);
- //hwwrite(vortex->mmio, WT_GMODE(1), 0xffffffff);
+ /* hwwrite(vortex->mmio, WT_GMODE(1), 0xffffffff); */
#endif
hwwrite(vortex->mmio, WT_PARM(wt, 0), 0);
hwwrite(vortex->mmio, WT_PARM(wt, 1), 0);
@@ -91,7 +91,7 @@ static int vortex_wt_allocroute(vortex_t * vortex, int wt, int nr_ch)
temp = hwread(vortex->mmio, WT_PARM(wt, 3));
printk(KERN_DEBUG "vortex: WT PARM3: %x\n", temp);
- //hwwrite(vortex->mmio, WT_PARM(wt, 3), temp);
+ /* hwwrite(vortex->mmio, WT_PARM(wt, 3), temp); */
hwwrite(vortex->mmio, WT_DELAY(wt, 0), 0);
hwwrite(vortex->mmio, WT_DELAY(wt, 1), 0);
@@ -151,7 +151,7 @@ static void vortex_wt_connect(vortex_t * vortex, int en)
#if 0
static int vortex_wt_GetReg(vortex_t * vortex, char reg, int wt)
{
- //int eax, esi;
+ /* int eax, esi; */
if (reg == 4) {
return hwread(vortex->mmio, WT_PARM(wt, 3));
@@ -175,7 +175,7 @@ vortex_wt_SetReg2(vortex_t * vortex, unsigned char reg, int wt,
return 0;
if ((reg - 0x20) > 0) {
- if ((reg - 0x21) != 0)
+ if ((reg - 0x21) != 0)
return 0;
eax = ((((b & 0xff) << 0xb) + (edx & 0xff)) << 4) + 0x208; // param 2
} else {
@@ -186,7 +186,7 @@ vortex_wt_SetReg2(vortex_t * vortex, unsigned char reg, int wt,
return 1;
}
-/*public: static void __thiscall CWTHal::SetReg(unsigned char,int,unsigned long) */
+/*public: static void __thiscall CWTHal::SetReg(unsigned char, int, unsigned long) */
#endif
static int
vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
@@ -213,38 +213,38 @@ vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
switch (reg) {
/* Voice specific parameters */
case 0: /* running */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_RUN(wt), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_RUN(wt), (int)val); */
hwwrite(vortex->mmio, WT_RUN(wt), val);
return 0xc;
break;
case 1: /* param 0 */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,0), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,0), (int)val); */
hwwrite(vortex->mmio, WT_PARM(wt, 0), val);
return 0xc;
break;
case 2: /* param 1 */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,1), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,1), (int)val); */
hwwrite(vortex->mmio, WT_PARM(wt, 1), val);
return 0xc;
break;
case 3: /* param 2 */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,2), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,2), (int)val); */
hwwrite(vortex->mmio, WT_PARM(wt, 2), val);
return 0xc;
break;
case 4: /* param 3 */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,3), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_PARM(wt,3), (int)val); */
hwwrite(vortex->mmio, WT_PARM(wt, 3), val);
return 0xc;
break;
case 6: /* mute */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_MUTE(wt), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_MUTE(wt), (int)val); */
hwwrite(vortex->mmio, WT_MUTE(wt), val);
return 0xc;
break;
case 0xb:
{ /* delay */
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_DELAY(wt,0), (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", WT_DELAY(wt,0), (int)val); */
hwwrite(vortex->mmio, WT_DELAY(wt, 3), val);
hwwrite(vortex->mmio, WT_DELAY(wt, 2), val);
hwwrite(vortex->mmio, WT_DELAY(wt, 1), val);
@@ -272,7 +272,7 @@ vortex_wt_SetReg(vortex_t * vortex, unsigned char reg, int wt,
return 0;
break;
}
- //printk("vortex: WT SetReg(0x%x) = 0x%08x\n", ecx, (int)val);
+ /* printk("vortex: WT SetReg(0x%x) = 0x%08x\n", ecx, (int)val); */
hwwrite(vortex->mmio, ecx, val);
return 1;
}
@@ -289,7 +289,7 @@ static void vortex_wt_init(vortex_t * vortex)
var10 &= 0xfffffffe;
var10 &= 0xfffffbff;
var10 |= 0x1800;
- // var10 = 0x1AA2
+ /* var10 = 0x1AA2 */
var4 = 0x10000000;
varc = 0x00830000;
var8 = 0x00830000;
@@ -355,7 +355,7 @@ static void vortex_wt_SetFrequency(vortex_t * vortex, int wt, unsigned int sr)
wt_voice_t *voice = &(vortex->wt_voice[wt]);
u32 eax, edx;
- //FIXME: 64 bit operation.
+ /* FIXME: 64 bit operation. */
eax = ((sr << 0xf) * 0x57619F1) & 0xffffffff;
edx = (((sr << 0xf) * 0x57619F1)) >> 0x20;
@@ -384,9 +384,9 @@ static void vortex_wt_SetFrequency(vortex_t * vortex, int wt, unsigned int sr)
voice->parm0 &= 0xffff0001;
voice->parm0 |= (eax & 0x7fff) << 1;
voice->parm1 = voice->parm0 | 1;
- // Wt: this_1D4
- //AuWt::WriteReg((ulong)(this_1DC<<4)+0x200, (ulong)this_1E4);
- //AuWt::WriteReg((ulong)(this_1DC<<4)+0x204, (ulong)this_1E8);
+ /* Wt: this_1D4 */
+ /* AuWt::WriteReg((ulong)(this_1DC<<4)+0x200, (ulong)this_1E4); */
+ /* AuWt::WriteReg((ulong)(this_1DC<<4)+0x204, (ulong)this_1E8); */
hwwrite(vortex->mmio, WT_PARM(wt, 0), voice->parm0);
hwwrite(vortex->mmio, WT_PARM(wt, 1), voice->parm1);
}
diff --git a/sound/pci/au88x0/au88x0_xtalk.c b/sound/pci/au88x0/au88x0_xtalk.c
index b4151e2..c8acf62 100644
--- a/sound/pci/au88x0/au88x0_xtalk.c
+++ b/sound/pci/au88x0/au88x0_xtalk.c
@@ -64,7 +64,7 @@ static xtalk_gains_t const asXtalkGains1Chan = {
static xtalk_gains_t const asXtalkGainsAllChan = {
0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF, 0, 0x7FFF, 0x7FFF, 0x7FFF, 0x7FFF,
0
- //0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff
+ /* 0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7fff */
};
static xtalk_gains_t const asXtalkGainsZeros;
@@ -672,7 +672,7 @@ static void vortex_XtalkHw_ZeroIO(vortex_t * vortex)
static void vortex_XtalkHw_ZeroState(vortex_t * vortex)
{
- vortex_XtalkHw_ZeroIO(vortex); // inlined
+ vortex_XtalkHw_ZeroIO(vortex); /* inlined */
vortex_XtalkHw_SetLeftEQ(vortex, 0, 0, asXtalkCoefsZeros);
vortex_XtalkHw_SetRightEQ(vortex, 0, 0, asXtalkCoefsZeros);
@@ -680,14 +680,14 @@ static void vortex_XtalkHw_ZeroState(vortex_t * vortex)
vortex_XtalkHw_SetLeftXT(vortex, 0, 0, asXtalkCoefsZeros);
vortex_XtalkHw_SetRightXT(vortex, 0, 0, asXtalkCoefsZeros);
- vortex_XtalkHw_SetGains(vortex, asXtalkGainsZeros); // inlined
+ vortex_XtalkHw_SetGains(vortex, asXtalkGainsZeros); /* inlined */
- vortex_XtalkHw_SetDelay(vortex, 0, 0); // inlined
+ vortex_XtalkHw_SetDelay(vortex, 0, 0); /* inlined */
- vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros); // inlined
- vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros); // inlined
- vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros); // inlined
- vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros); // inlined
+ vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros); /* inlined */
+ vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros); /* inlined */
+ vortex_XtalkHw_SetLeftDline(vortex, alXtalkDlineZeros); /* inlined */
+ vortex_XtalkHw_SetRightDline(vortex, alXtalkDlineZeros); /* inlined */
vortex_XtalkHw_SetLeftEQStates(vortex, asXtalkInStateZeros,
asXtalkOutStateZeros);
@@ -707,7 +707,7 @@ static void vortex_XtalkHw_ProgramPipe(vortex_t * vortex)
vortex_XtalkHw_SetLeftXT(vortex, 0, 0, asXtalkCoefsZeros);
vortex_XtalkHw_SetRightXT(vortex, 0, 0, asXtalkCoefsZeros);
- vortex_XtalkHw_SetDelay(vortex, 0, 0); // inlined
+ vortex_XtalkHw_SetDelay(vortex, 0, 0); /* inlined */
}
static void vortex_XtalkHw_ProgramXtalkWide(vortex_t * vortex)
@@ -724,7 +724,7 @@ static void vortex_XtalkHw_ProgramXtalkWide(vortex_t * vortex)
sXtalkWideShiftLeftXt,
asXtalkWideCoefsLeftXt);
- vortex_XtalkHw_SetDelay(vortex, wXtalkWideRightDelay, wXtalkWideLeftDelay); // inlined
+ vortex_XtalkHw_SetDelay(vortex, wXtalkWideRightDelay, wXtalkWideLeftDelay); /* inlined */
}
static void vortex_XtalkHw_ProgramXtalkNarrow(vortex_t * vortex)
@@ -743,13 +743,13 @@ static void vortex_XtalkHw_ProgramXtalkNarrow(vortex_t * vortex)
sXtalkNarrowShiftLeftXt,
asXtalkNarrowCoefsLeftXt);
- vortex_XtalkHw_SetDelay(vortex, wXtalkNarrowRightDelay, wXtalkNarrowLeftDelay); // inlined
+ vortex_XtalkHw_SetDelay(vortex, wXtalkNarrowRightDelay, wXtalkNarrowLeftDelay); /* inlined */
}
static void vortex_XtalkHw_ProgramDiamondXtalk(vortex_t * vortex)
{
- //sDiamondKLeftEq,sDiamondKRightXt,asDiamondCoefsLeftEq
+ /* sDiamondKLeftEq,sDiamondKRightXt,asDiamondCoefsLeftEq */
vortex_XtalkHw_SetLeftEQ(vortex, sDiamondKLeftEq,
sDiamondShiftLeftEq, asDiamondCoefsLeftEq);
vortex_XtalkHw_SetRightEQ(vortex, sDiamondKRightEq,
@@ -759,7 +759,7 @@ static void vortex_XtalkHw_ProgramDiamondXtalk(vortex_t * vortex)
vortex_XtalkHw_SetRightXT(vortex, sDiamondKLeftXt,
sDiamondShiftLeftXt, asDiamondCoefsLeftXt);
- vortex_XtalkHw_SetDelay(vortex, wDiamondRightDelay, wDiamondLeftDelay); // inlined
+ vortex_XtalkHw_SetDelay(vortex, wDiamondRightDelay, wDiamondLeftDelay); /* inlined */
}
static void vortex_XtalkHw_init(vortex_t * vortex)
diff --git a/sound/pci/au88x0/au88x0_xtalk.h b/sound/pci/au88x0/au88x0_xtalk.h
index 7f4534b..ead8453 100644
--- a/sound/pci/au88x0/au88x0_xtalk.h
+++ b/sound/pci/au88x0/au88x0_xtalk.h
@@ -22,7 +22,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/* The crosstalk canceler supports 5 stereo input channels. The result is
+/* The crosstalk canceler supports 5 stereo input channels. The result is
available at one single output route pair (stereo). */
#ifndef _AU88X0_CXTALK_H
1
0

[alsa-devel] [PATCH 0/5] ARM: OMAP2: Add support for GUmstix Overo (rev 3)
by sakomanï¼ gmail.com 09 Sep '08
by sakomanï¼ gmail.com 09 Sep '08
09 Sep '08
This patch series adds support for the Gumstix Overo board.
This is the third submission and incorporates all previous feedback from both linux-omap and alsa-devel. Careful readers will also notice that this version includes nand support rather than onenand.
4
8

09 Sep '08
I started with Takashi's sound-unstable tree as a base:
Fixed:
* ice1724 compilation error (one { too much)
* checkpatch errors along the files
sound/pci/ice1712/ak4xxx.c total: 1 errors, 3 warnings, 0 checks, 196
lines checked
sound/pci/ice1712/amp.h total: 0 errors, 0 warnings, 1 checks, 51 lines checked
sound/pci/ice1712/aureon.c total: 0 errors, 121 warnings, 3 checks,
2284 lines checked
sound/pci/ice1712/aureon.h total: 0 errors, 1 warnings, 0 checks, 65
lines checked
sound/pci/ice1712/delta.c total: 17 errors, 44 warnings, 1 checks, 817
lines checked
sound/pci/ice1712/delta.h total: 0 errors, 8 warnings, 0 checks, 153
lines checked
sound/pci/ice1712/envy24ht.h total: 0 errors, 21 warnings, 0 checks,
221 lines checked
sound/pci/ice1712/ews.c total: 27 errors, 64 warnings, 2 checks, 1087
lines checked
sound/pci/ice1712/ews.h total: 0 errors, 7 warnings, 0 checks, 86 lines checked
sound/pci/ice1712/hoontech.c total: 13 errors, 10 warnings, 1 checks,
360 lines checked
sound/pci/ice1712/hoontech.h total: 2 errors, 7 warnings, 0 checks, 77
lines checked
sound/pci/ice1712/ice1712.c total: 14 errors, 162 warnings, 3 checks,
2799 lines checked
sound/pci/ice1712/ice1712.h total: 0 errors, 22 warnings, 3 checks,
511 lines checked
sound/pci/ice1712/ice1724.c total: 11 errors, 62 warnings, 8 checks,
2657 lines checked
sound/pci/ice1712/juli.c total: 0 errors, 0 warnings, 1 checks, 687
lines checked
sound/pci/ice1712/maya44.c total: 6 errors, 0 warnings, 16 checks, 761
lines checked
sound/pci/ice1712/pontis.c total: 0 errors, 40 warnings, 3 checks, 836
lines checked
sound/pci/ice1712/prodigy192.c total: 12 errors, 21 warnings, 0
checks, 817 lines checked
sound/pci/ice1712/prodigy_hifi.c total: 0 errors, 0 warnings, 1
checks, 1215 lines checked
sound/pci/ice1712/snd-ice1712.mod.c total: 0 errors, 1 warnings, 0
checks, 113 lines checked
sound/pci/ice1712/snd-ice1724.mod.c total: 0 errors, 1 warnings, 0
checks, 126 lines checked
sound/pci/ice1712/vt1732.c total: 51 errors, 3 warnings, 5 checks,
2759 lines checked
sound/pci/ice1712/vt1732.h total: 9 errors, 0 warnings, 2 checks, 452
lines checked
It compiles. At first run ice1724 complained about something
info-related (it's likely that it's not related to this patch at all)
and generated like 20 or 30 lines of warnings and errors along the
lines 890 - 900. On second run there was no errors or warnings
anymore.
--
Vedran Miletić
2
3

Re: [alsa-devel] [PATCH 3/5] ALSA: ASoC: Add support for TWL4030 audio codec (rev 4)
by Steve Sakoman 09 Sep '08
by Steve Sakoman 09 Sep '08
09 Sep '08
From: Steve Sakoman <steve(a)sakoman.com>
Signed-off-by: Steve Sakoman <steve(a)sakoman.com>
Acked-by: Mark Brown <broonie(a)opensource.wolfsonmicro.com>
---
sound/soc/codecs/Kconfig | 5 +
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/twl4030.c | 653 ++++++++++++++++++++++++++++++++++++++++++++
sound/soc/codecs/twl4030.h | 197 +++++++++++++
4 files changed, 857 insertions(+), 0 deletions(-)
create mode 100644 sound/soc/codecs/twl4030.c
create mode 100644 sound/soc/codecs/twl4030.h
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig
index 1db04a2..2f00e1e 100644
--- a/sound/soc/codecs/Kconfig
+++ b/sound/soc/codecs/Kconfig
@@ -50,3 +50,8 @@ config SND_SOC_CS4270_VD33_ERRATA
config SND_SOC_TLV320AIC3X
tristate
depends on I2C
+
+config SND_SOC_TWL4030
+ tristate
+ depends on SND_SOC && TWL4030_CORE
+
diff --git a/sound/soc/codecs/Makefile b/sound/soc/codecs/Makefile
index d7b97ab..a519ced 100644
--- a/sound/soc/codecs/Makefile
+++ b/sound/soc/codecs/Makefile
@@ -10,6 +10,7 @@ snd-soc-wm9712-objs := wm9712.o
snd-soc-wm9713-objs := wm9713.o
snd-soc-cs4270-objs := cs4270.o
snd-soc-tlv320aic3x-objs := tlv320aic3x.o
+snd-soc-twl4030-objs := twl4030.o
obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
obj-$(CONFIG_SND_SOC_AK4535) += snd-soc-ak4535.o
@@ -23,3 +24,4 @@ obj-$(CONFIG_SND_SOC_WM9712) += snd-soc-wm9712.o
obj-$(CONFIG_SND_SOC_WM9713) += snd-soc-wm9713.o
obj-$(CONFIG_SND_SOC_CS4270) += snd-soc-cs4270.o
obj-$(CONFIG_SND_SOC_TLV320AIC3X) += snd-soc-tlv320aic3x.o
+obj-$(CONFIG_SND_SOC_TWL4030) += snd-soc-twl4030.o
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
new file mode 100644
index 0000000..ee2f0d3
--- /dev/null
+++ b/sound/soc/codecs/twl4030.c
@@ -0,0 +1,653 @@
+/*
+ * ALSA SoC TWL4030 codec driver
+ *
+ * Author: Steve Sakoman, <steve(a)sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/moduleparam.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/pm.h>
+#include <linux/i2c.h>
+#include <linux/platform_device.h>
+#include <linux/i2c/twl4030.h>
+#include <sound/core.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+#include <sound/soc-dapm.h>
+#include <sound/initval.h>
+
+#include "twl4030.h"
+
+/*
+ * twl4030 register cache & default register settings
+ */
+static const u8 twl4030_reg[TWL4030_CACHEREGNUM] = {
+ 0x00, /* this register not used */
+ 0x93, /* REG_CODEC_MODE (0x1) */
+ 0xc3, /* REG_OPTION (0x2) */
+ 0x00, /* REG_UNKNOWN (0x3) */
+ 0x00, /* REG_MICBIAS_CTL (0x4) */
+ 0x24, /* REG_ANAMICL (0x5) */
+ 0x04, /* REG_ANAMICR (0x6) */
+ 0x0a, /* REG_AVADC_CTL (0x7) */
+ 0x00, /* REG_ADCMICSEL (0x8) */
+ 0x00, /* REG_DIGMIXING (0x9) */
+ 0x0c, /* REG_ATXL1PGA (0xA) */
+ 0x0c, /* REG_ATXR1PGA (0xB) */
+ 0x00, /* REG_AVTXL2PGA (0xC) */
+ 0x00, /* REG_AVTXR2PGA (0xD) */
+ 0x01, /* REG_AUDIO_IF (0xE) */
+ 0x00, /* REG_VOICE_IF (0xF) */
+ 0x00, /* REG_ARXR1PGA (0x10) */
+ 0x00, /* REG_ARXL1PGA (0x11) */
+ 0x6c, /* REG_ARXR2PGA (0x12) */
+ 0x6c, /* REG_ARXL2PGA (0x13) */
+ 0x00, /* REG_VRXPGA (0x14) */
+ 0x00, /* REG_VSTPGA (0x15) */
+ 0x00, /* REG_VRX2ARXPGA (0x16) */
+ 0x0c, /* REG_AVDAC_CTL (0x17) */
+ 0x00, /* REG_ARX2VTXPGA (0x18) */
+ 0x00, /* REG_ARXL1_APGA_CTL (0x19) */
+ 0x00, /* REG_ARXR1_APGA_CTL (0x1A) */
+ 0x4b, /* REG_ARXL2_APGA_CTL (0x1B) */
+ 0x4b, /* REG_ARXR2_APGA_CTL (0x1C) */
+ 0x00, /* REG_ATX2ARXPGA (0x1D) */
+ 0x00, /* REG_BT_IF (0x1E) */
+ 0x00, /* REG_BTPGA (0x1F) */
+ 0x00, /* REG_BTSTPGA (0x20) */
+ 0x00, /* REG_EAR_CTL (0x21) */
+ 0x24, /* REG_HS_SEL (0x22) */
+ 0x0a, /* REG_HS_GAIN_SET (0x23) */
+ 0x00, /* REG_HS_POPN_SET (0x24) */
+ 0x00, /* REG_PREDL_CTL (0x25) */
+ 0x00, /* REG_PREDR_CTL (0x26) */
+ 0x00, /* REG_PRECKL_CTL (0x27) */
+ 0x00, /* REG_PRECKR_CTL (0x28) */
+ 0x00, /* REG_HFL_CTL (0x29) */
+ 0x00, /* REG_HFR_CTL (0x2A) */
+ 0x00, /* REG_ALC_CTL (0x2B) */
+ 0x00, /* REG_ALC_SET1 (0x2C) */
+ 0x00, /* REG_ALC_SET2 (0x2D) */
+ 0x00, /* REG_BOOST_CTL (0x2E) */
+ 0x01, /* REG_SOFTVOL_CTL (0x2F) */
+ 0x00, /* REG_DTMF_FREQSEL (0x30) */
+ 0x00, /* REG_DTMF_TONEXT1H (0x31) */
+ 0x00, /* REG_DTMF_TONEXT1L (0x32) */
+ 0x00, /* REG_DTMF_TONEXT2H (0x33) */
+ 0x00, /* REG_DTMF_TONEXT2L (0x34) */
+ 0x00, /* REG_DTMF_TONOFF (0x35) */
+ 0x00, /* REG_DTMF_WANONOFF (0x36) */
+ 0x00, /* REG_I2S_RX_SCRAMBLE_H (0x37) */
+ 0x00, /* REG_I2S_RX_SCRAMBLE_M (0x38) */
+ 0x00, /* REG_I2S_RX_SCRAMBLE_L (0x39) */
+ 0x16, /* REG_APLL_CTL (0x3A) */
+ 0x00, /* REG_DTMF_CTL (0x3B) */
+ 0x00, /* REG_DTMF_PGA_CTL2 (0x3C) */
+ 0x00, /* REG_DTMF_PGA_CTL1 (0x3D) */
+ 0x00, /* REG_MISC_SET_1 (0x3E) */
+ 0x00, /* REG_PCMBTMUX (0x3F) */
+ 0x00, /* not used (0x40) */
+ 0x00, /* not used (0x41) */
+ 0x00, /* not used (0x42) */
+ 0x00, /* REG_RX_PATH_SEL (0x43) */
+ 0x00, /* REG_VDL_APGA_CTL (0x44) */
+ 0x00, /* REG_VIBRA_CTL (0x45) */
+ 0x00, /* REG_VIBRA_SET (0x46) */
+ 0x00, /* REG_VIBRA_PWM_SET (0x47) */
+ 0x00, /* REG_ANAMIC_GAIN (0x48) */
+ 0x00, /* REG_MISC_SET_2 (0x49) */
+};
+
+/*
+ * read twl4030 register cache
+ */
+static inline unsigned int twl4030_read_reg_cache(struct snd_soc_codec *codec,
+ unsigned int reg)
+{
+ u8 *cache = codec->reg_cache;
+
+ return cache[reg];
+}
+
+/*
+ * write twl4030 register cache
+ */
+static inline void twl4030_write_reg_cache(struct snd_soc_codec *codec,
+ u8 reg, u8 value)
+{
+ u8 *cache = codec->reg_cache;
+
+ if (reg >= TWL4030_CACHEREGNUM)
+ return;
+ cache[reg] = value;
+}
+
+/*
+ * write to the twl4030 register space
+ */
+static int twl4030_write(struct snd_soc_codec *codec,
+ unsigned int reg, unsigned int value)
+{
+ twl4030_write_reg_cache(codec, reg, value);
+ return twl4030_i2c_write_u8(TWL4030_MODULE_AUDIO_VOICE, value, reg);
+}
+
+static void twl4030_clear_codecpdz(struct snd_soc_codec *codec)
+{
+ u8 mode;
+
+ mode = twl4030_read_reg_cache(codec, TWL4030_REG_CODEC_MODE);
+ twl4030_write(codec, TWL4030_REG_CODEC_MODE,
+ mode & ~TWL4030_CODECPDZ);
+
+ /* REVISIT: this delay is present in TI sample drivers */
+ /* but there seems to be no TRM requirement for it */
+ udelay(10);
+}
+
+static void twl4030_set_codecpdz(struct snd_soc_codec *codec)
+{
+ u8 mode;
+
+ mode = twl4030_read_reg_cache(codec, TWL4030_REG_CODEC_MODE);
+ twl4030_write(codec, TWL4030_REG_CODEC_MODE,
+ mode | TWL4030_CODECPDZ);
+
+ /* REVISIT: this delay is present in TI sample drivers */
+ /* but there seems to be no TRM requirement for it */
+ udelay(10);
+}
+
+static void twl4030_init_chip(struct snd_soc_codec *codec)
+{
+ int i;
+
+ /* clear CODECPDZ prior to setting register defaults */
+ twl4030_clear_codecpdz(codec);
+
+ /* set all audio section registers to reasonable defaults */
+ for (i = TWL4030_REG_OPTION; i <= TWL4030_REG_MISC_SET_2; i++)
+ twl4030_write(codec, i, twl4030_reg[i]);
+
+}
+
+static const struct snd_kcontrol_new twl4030_snd_controls[] = {
+ SOC_DOUBLE_R("Master Playback Volume",
+ TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
+ 0, 127, 0),
+ SOC_DOUBLE_R("Capture Volume",
+ TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
+ 0, 127, 0),
+};
+
+/* add non dapm controls */
+static int twl4030_add_controls(struct snd_soc_codec *codec)
+{
+ int err, i;
+
+ for (i = 0; i < ARRAY_SIZE(twl4030_snd_controls); i++) {
+ err = snd_ctl_add(codec->card,
+ snd_soc_cnew(&twl4030_snd_controls[i],
+ codec, NULL));
+ if (err < 0)
+ return err;
+ }
+
+ return 0;
+}
+
+static const struct snd_soc_dapm_widget twl4030_dapm_widgets[] = {
+ SND_SOC_DAPM_INPUT("INL"),
+ SND_SOC_DAPM_INPUT("INR"),
+
+ SND_SOC_DAPM_OUTPUT("OUTL"),
+ SND_SOC_DAPM_OUTPUT("OUTR"),
+
+ SND_SOC_DAPM_DAC("DACL", "Left Playback", SND_SOC_NOPM, 0, 0),
+ SND_SOC_DAPM_DAC("DACR", "Right Playback", SND_SOC_NOPM, 0, 0),
+
+ SND_SOC_DAPM_ADC("ADCL", "Left Capture", SND_SOC_NOPM, 0, 0),
+ SND_SOC_DAPM_ADC("ADCR", "Right Capture", SND_SOC_NOPM, 0, 0),
+};
+
+static const struct snd_soc_dapm_route intercon[] = {
+ /* outputs */
+ {"OUTL", NULL, "DACL"},
+ {"OUTR", NULL, "DACR"},
+
+ /* inputs */
+ {"ADCL", NULL, "INL"},
+ {"ADCR", NULL, "INR"},
+};
+
+static int twl4030_add_widgets(struct snd_soc_codec *codec)
+{
+ snd_soc_dapm_new_controls(codec, twl4030_dapm_widgets,
+ ARRAY_SIZE(twl4030_dapm_widgets));
+
+ snd_soc_dapm_add_routes(codec, intercon, ARRAY_SIZE(intercon));
+
+ snd_soc_dapm_new_widgets(codec);
+ return 0;
+}
+
+static void twl4030_power_up(struct snd_soc_codec *codec)
+{
+ u8 anamicl, regmisc1, byte, popn, hsgain;
+ int i = 0;
+
+ /* set CODECPDZ to turn on codec */
+ twl4030_set_codecpdz(codec);
+
+ /* initiate offset cancellation */
+ anamicl = twl4030_read_reg_cache(codec, TWL4030_REG_ANAMICL);
+ twl4030_write(codec, TWL4030_REG_ANAMICL,
+ anamicl | TWL4030_CNCL_OFFSET_START);
+
+ /* wait for offset cancellation to complete */
+ do {
+ /* this takes a little while, so don't slam i2c */
+ udelay(2000);
+ twl4030_i2c_read_u8(TWL4030_MODULE_AUDIO_VOICE, &byte,
+ TWL4030_REG_ANAMICL);
+ } while ((i++ < 100) &&
+ ((byte & TWL4030_CNCL_OFFSET_START) ==
+ TWL4030_CNCL_OFFSET_START));
+
+ /* anti-pop when changing analog gain */
+ regmisc1 = twl4030_read_reg_cache(codec, TWL4030_REG_MISC_SET_1);
+ twl4030_write(codec, TWL4030_REG_MISC_SET_1,
+ regmisc1 | TWL4030_SMOOTH_ANAVOL_EN);
+
+ /* toggle CODECPDZ as per TRM */
+ twl4030_clear_codecpdz(codec);
+ twl4030_set_codecpdz(codec);
+
+ /* program anti-pop with bias ramp delay */
+ popn = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET);
+ popn &= TWL4030_RAMP_DELAY;
+ popn |= TWL4030_RAMP_DELAY_645MS;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+ popn |= TWL4030_VMID_EN;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+
+ /* enable output stage and gain setting */
+ hsgain = TWL4030_HSR_GAIN_0DB | TWL4030_HSL_GAIN_0DB;
+ twl4030_write(codec, TWL4030_REG_HS_GAIN_SET, hsgain);
+
+ /* enable anti-pop ramp */
+ popn |= TWL4030_RAMP_EN;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+}
+
+static void twl4030_power_down(struct snd_soc_codec *codec)
+{
+ u8 popn, hsgain;
+
+ /* disable anti-pop ramp */
+ popn = twl4030_read_reg_cache(codec, TWL4030_REG_HS_POPN_SET);
+ popn &= ~TWL4030_RAMP_EN;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+
+ /* disable output stage and gain setting */
+ hsgain = TWL4030_HSR_GAIN_PWR_DOWN | TWL4030_HSL_GAIN_PWR_DOWN;
+ twl4030_write(codec, TWL4030_REG_HS_GAIN_SET, hsgain);
+
+ /* disable bias out */
+ popn &= ~TWL4030_VMID_EN;
+ twl4030_write(codec, TWL4030_REG_HS_POPN_SET, popn);
+
+ /* power down */
+ twl4030_clear_codecpdz(codec);
+}
+
+static int twl4030_set_bias_level(struct snd_soc_codec *codec,
+ enum snd_soc_bias_level level)
+{
+ switch (level) {
+ case SND_SOC_BIAS_ON:
+ twl4030_power_up(codec);
+ break;
+ case SND_SOC_BIAS_PREPARE:
+ /* TODO: develop a twl4030_prepare function */
+ break;
+ case SND_SOC_BIAS_STANDBY:
+ /* TODO: develop a twl4030_standby function */
+ twl4030_power_down(codec);
+ break;
+ case SND_SOC_BIAS_OFF:
+ twl4030_power_down(codec);
+ break;
+ }
+ codec->bias_level = level;
+
+ return 0;
+}
+
+static int twl4030_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *rtd = substream->private_data;
+ struct snd_soc_device *socdev = rtd->socdev;
+ struct snd_soc_codec *codec = socdev->codec;
+ u8 mode, old_mode, format, old_format;
+
+
+ /* bit rate */
+ old_mode = twl4030_read_reg_cache(codec,
+ TWL4030_REG_CODEC_MODE) & ~TWL4030_CODECPDZ;
+ mode = old_mode & ~TWL4030_APLL_RATE;
+
+ switch (params_rate(params)) {
+ case 8000:
+ mode |= TWL4030_APLL_RATE_8000;
+ break;
+ case 11025:
+ mode |= TWL4030_APLL_RATE_11025;
+ break;
+ case 12000:
+ mode |= TWL4030_APLL_RATE_12000;
+ break;
+ case 16000:
+ mode |= TWL4030_APLL_RATE_16000;
+ break;
+ case 22050:
+ mode |= TWL4030_APLL_RATE_22050;
+ break;
+ case 24000:
+ mode |= TWL4030_APLL_RATE_24000;
+ break;
+ case 32000:
+ mode |= TWL4030_APLL_RATE_32000;
+ break;
+ case 44100:
+ mode |= TWL4030_APLL_RATE_44100;
+ break;
+ case 48000:
+ mode |= TWL4030_APLL_RATE_48000;
+ break;
+ default:
+ printk(KERN_ERR "TWL4030 hw params: unknown rate %d\n",
+ params_rate(params));
+ return -EINVAL;
+ }
+
+ if (mode != old_mode) {
+ /* change rate and set CODECPDZ */
+ twl4030_write(codec, TWL4030_REG_CODEC_MODE, mode);
+ twl4030_set_codecpdz(codec);
+ }
+
+ /* sample size */
+ old_format = twl4030_read_reg_cache(codec, TWL4030_REG_AUDIO_IF);
+ format = old_format;
+ format &= ~TWL4030_DATA_WIDTH;
+ switch (params_format(params)) {
+ case SNDRV_PCM_FORMAT_S16_LE:
+ format |= TWL4030_DATA_WIDTH_16S_16W;
+ break;
+ case SNDRV_PCM_FORMAT_S24_LE:
+ format |= TWL4030_DATA_WIDTH_32S_24W;
+ break;
+ default:
+ printk(KERN_ERR "TWL4030 hw params: unknown format %d\n",
+ params_format(params));
+ return -EINVAL;
+ }
+
+ if (format != old_format) {
+
+ /* clear CODECPDZ before changing format (codec requirement) */
+ twl4030_clear_codecpdz(codec);
+
+ /* change format */
+ twl4030_write(codec, TWL4030_REG_AUDIO_IF, format);
+
+ /* set CODECPDZ afterwards */
+ twl4030_set_codecpdz(codec);
+ }
+ return 0;
+}
+
+static int twl4030_set_dai_sysclk(struct snd_soc_dai *codec_dai,
+ int clk_id, unsigned int freq, int dir)
+{
+ struct snd_soc_codec *codec = codec_dai->codec;
+ u8 infreq;
+
+ switch (freq) {
+ case 19200000:
+ infreq = TWL4030_APLL_INFREQ_19200KHZ;
+ break;
+ case 26000000:
+ infreq = TWL4030_APLL_INFREQ_26000KHZ;
+ break;
+ case 38400000:
+ infreq = TWL4030_APLL_INFREQ_38400KHZ;
+ break;
+ default:
+ printk(KERN_ERR "TWL4030 set sysclk: unknown rate %d\n",
+ freq);
+ return -EINVAL;
+ }
+
+ infreq |= TWL4030_APLL_EN;
+ twl4030_write(codec, TWL4030_REG_APLL_CTL, infreq);
+
+ return 0;
+}
+
+static int twl4030_set_dai_fmt(struct snd_soc_dai *codec_dai,
+ unsigned int fmt)
+{
+ struct snd_soc_codec *codec = codec_dai->codec;
+ u8 old_format, format;
+
+ /* get format */
+ old_format = twl4030_read_reg_cache(codec, TWL4030_REG_AUDIO_IF);
+ format = old_format;
+
+ /* set master/slave audio interface */
+ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
+ case SND_SOC_DAIFMT_CBM_CFM:
+ format &= ~(TWL4030_AIF_SLAVE_EN);
+ format |= TWL4030_CLK256FS_EN;
+ break;
+ case SND_SOC_DAIFMT_CBS_CFS:
+ format &= ~(TWL4030_CLK256FS_EN);
+ format |= TWL4030_AIF_SLAVE_EN;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ /* interface format */
+ format &= ~TWL4030_AIF_FORMAT;
+ switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
+ case SND_SOC_DAIFMT_I2S:
+ format |= TWL4030_AIF_FORMAT_CODEC;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ if (format != old_format) {
+
+ /* clear CODECPDZ before changing format (codec requirement) */
+ twl4030_clear_codecpdz(codec);
+
+ /* change format */
+ twl4030_write(codec, TWL4030_REG_AUDIO_IF, format);
+
+ /* set CODECPDZ afterwards */
+ twl4030_set_codecpdz(codec);
+ }
+
+ return 0;
+}
+
+#define TWL4030_RATES (SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000)
+#define TWL4030_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FORMAT_S24_LE)
+
+struct snd_soc_dai twl4030_dai = {
+ .name = "twl4030",
+ .playback = {
+ .stream_name = "Playback",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = TWL4030_RATES,
+ .formats = TWL4030_FORMATS,},
+ .capture = {
+ .stream_name = "Capture",
+ .channels_min = 2,
+ .channels_max = 2,
+ .rates = TWL4030_RATES,
+ .formats = TWL4030_FORMATS,},
+ .ops = {
+ .hw_params = twl4030_hw_params,
+ },
+ .dai_ops = {
+ .set_sysclk = twl4030_set_dai_sysclk,
+ .set_fmt = twl4030_set_dai_fmt,
+ }
+};
+EXPORT_SYMBOL_GPL(twl4030_dai);
+
+static int twl4030_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ twl4030_set_bias_level(codec, SND_SOC_BIAS_OFF);
+
+ return 0;
+}
+
+static int twl4030_resume(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ twl4030_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+ twl4030_set_bias_level(codec, codec->suspend_bias_level);
+ return 0;
+}
+
+/*
+ * initialize the driver
+ * register the mixer and dsp interfaces with the kernel
+ */
+
+static int twl4030_init(struct snd_soc_device *socdev)
+{
+ struct snd_soc_codec *codec = socdev->codec;
+ int ret = 0;
+
+ printk(KERN_INFO "TWL4030 Audio Codec init \n");
+
+ codec->name = "twl4030";
+ codec->owner = THIS_MODULE;
+ codec->read = twl4030_read_reg_cache;
+ codec->write = twl4030_write;
+ codec->set_bias_level = twl4030_set_bias_level;
+ codec->dai = &twl4030_dai;
+ codec->num_dai = 1;
+ codec->reg_cache_size = sizeof(twl4030_reg);
+ codec->reg_cache = kmemdup(twl4030_reg, sizeof(twl4030_reg),
+ GFP_KERNEL);
+ if (codec->reg_cache == NULL)
+ return -ENOMEM;
+
+ /* register pcms */
+ ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
+ if (ret < 0) {
+ printk(KERN_ERR "twl4030: failed to create pcms\n");
+ goto pcm_err;
+ }
+
+ twl4030_init_chip(codec);
+
+ /* power on device */
+ twl4030_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
+
+ twl4030_add_controls(codec);
+ twl4030_add_widgets(codec);
+
+ ret = snd_soc_register_card(socdev);
+ if (ret < 0) {
+ printk(KERN_ERR "twl4030: failed to register card\n");
+ goto card_err;
+ }
+
+ return ret;
+
+card_err:
+ snd_soc_free_pcms(socdev);
+ snd_soc_dapm_free(socdev);
+pcm_err:
+ kfree(codec->reg_cache);
+ return ret;
+}
+
+static struct snd_soc_device *twl4030_socdev;
+
+static int twl4030_probe(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec;
+
+ codec = kzalloc(sizeof(struct snd_soc_codec), GFP_KERNEL);
+ if (codec == NULL)
+ return -ENOMEM;
+
+ socdev->codec = codec;
+ mutex_init(&codec->mutex);
+ INIT_LIST_HEAD(&codec->dapm_widgets);
+ INIT_LIST_HEAD(&codec->dapm_paths);
+
+ twl4030_socdev = socdev;
+ twl4030_init(socdev);
+
+ return 0;
+}
+
+static int twl4030_remove(struct platform_device *pdev)
+{
+ struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_codec *codec = socdev->codec;
+
+ printk(KERN_INFO "TWL4030 Audio Codec remove\n");
+ kfree(codec);
+
+ return 0;
+}
+
+struct snd_soc_codec_device soc_codec_dev_twl4030 = {
+ .probe = twl4030_probe,
+ .remove = twl4030_remove,
+ .suspend = twl4030_suspend,
+ .resume = twl4030_resume,
+};
+EXPORT_SYMBOL_GPL(soc_codec_dev_twl4030);
+
+MODULE_DESCRIPTION("ASoC TWL4030 codec driver");
+MODULE_AUTHOR("Steve Sakoman");
+MODULE_LICENSE("GPL");
diff --git a/sound/soc/codecs/twl4030.h b/sound/soc/codecs/twl4030.h
new file mode 100644
index 0000000..09865d9
--- /dev/null
+++ b/sound/soc/codecs/twl4030.h
@@ -0,0 +1,197 @@
+/*
+ * ALSA SoC TWL4030 codec driver
+ *
+ * Author: Steve Sakoman <steve(a)sakoman.com>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __TWL4030_AUDIO_H__
+#define __TWL4030_AUDIO_H__
+
+#define TWL4030_REG_CODEC_MODE 0x1
+#define TWL4030_REG_OPTION 0x2
+#define TWL4030_REG_UNKNOWN 0x3
+#define TWL4030_REG_MICBIAS_CTL 0x4
+#define TWL4030_REG_ANAMICL 0x5
+#define TWL4030_REG_ANAMICR 0x6
+#define TWL4030_REG_AVADC_CTL 0x7
+#define TWL4030_REG_ADCMICSEL 0x8
+#define TWL4030_REG_DIGMIXING 0x9
+#define TWL4030_REG_ATXL1PGA 0xA
+#define TWL4030_REG_ATXR1PGA 0xB
+#define TWL4030_REG_AVTXL2PGA 0xC
+#define TWL4030_REG_AVTXR2PGA 0xD
+#define TWL4030_REG_AUDIO_IF 0xE
+#define TWL4030_REG_VOICE_IF 0xF
+#define TWL4030_REG_ARXR1PGA 0x10
+#define TWL4030_REG_ARXL1PGA 0x11
+#define TWL4030_REG_ARXR2PGA 0x12
+#define TWL4030_REG_ARXL2PGA 0x13
+#define TWL4030_REG_VRXPGA 0x14
+#define TWL4030_REG_VSTPGA 0x15
+#define TWL4030_REG_VRX2ARXPGA 0x16
+#define TWL4030_REG_AVDAC_CTL 0x17
+#define TWL4030_REG_ARX2VTXPGA 0x18
+#define TWL4030_REG_ARXL1_APGA_CTL 0x19
+#define TWL4030_REG_ARXR1_APGA_CTL 0x1A
+#define TWL4030_REG_ARXL2_APGA_CTL 0x1B
+#define TWL4030_REG_ARXR2_APGA_CTL 0x1C
+#define TWL4030_REG_ATX2ARXPGA 0x1D
+#define TWL4030_REG_BT_IF 0x1E
+#define TWL4030_REG_BTPGA 0x1F
+#define TWL4030_REG_BTSTPGA 0x20
+#define TWL4030_REG_EAR_CTL 0x21
+#define TWL4030_REG_HS_SEL 0x22
+#define TWL4030_REG_HS_GAIN_SET 0x23
+#define TWL4030_REG_HS_POPN_SET 0x24
+#define TWL4030_REG_PREDL_CTL 0x25
+#define TWL4030_REG_PREDR_CTL 0x26
+#define TWL4030_REG_PRECKL_CTL 0x27
+#define TWL4030_REG_PRECKR_CTL 0x28
+#define TWL4030_REG_HFL_CTL 0x29
+#define TWL4030_REG_HFR_CTL 0x2A
+#define TWL4030_REG_ALC_CTL 0x2B
+#define TWL4030_REG_ALC_SET1 0x2C
+#define TWL4030_REG_ALC_SET2 0x2D
+#define TWL4030_REG_BOOST_CTL 0x2E
+#define TWL4030_REG_SOFTVOL_CTL 0x2F
+#define TWL4030_REG_DTMF_FREQSEL 0x30
+#define TWL4030_REG_DTMF_TONEXT1H 0x31
+#define TWL4030_REG_DTMF_TONEXT1L 0x32
+#define TWL4030_REG_DTMF_TONEXT2H 0x33
+#define TWL4030_REG_DTMF_TONEXT2L 0x34
+#define TWL4030_REG_DTMF_TONOFF 0x35
+#define TWL4030_REG_DTMF_WANONOFF 0x36
+#define TWL4030_REG_I2S_RX_SCRAMBLE_H 0x37
+#define TWL4030_REG_I2S_RX_SCRAMBLE_M 0x38
+#define TWL4030_REG_I2S_RX_SCRAMBLE_L 0x39
+#define TWL4030_REG_APLL_CTL 0x3A
+#define TWL4030_REG_DTMF_CTL 0x3B
+#define TWL4030_REG_DTMF_PGA_CTL2 0x3C
+#define TWL4030_REG_DTMF_PGA_CTL1 0x3D
+#define TWL4030_REG_MISC_SET_1 0x3E
+#define TWL4030_REG_PCMBTMUX 0x3F
+#define TWL4030_REG_RX_PATH_SEL 0x43
+#define TWL4030_REG_VDL_APGA_CTL 0x44
+#define TWL4030_REG_VIBRA_CTL 0x45
+#define TWL4030_REG_VIBRA_SET 0x46
+#define TWL4030_REG_VIBRA_PWM_SET 0x47
+#define TWL4030_REG_ANAMIC_GAIN 0x48
+#define TWL4030_REG_MISC_SET_2 0x49
+
+#define TWL4030_CACHEREGNUM (TWL4030_REG_MISC_SET_2 + 1)
+
+/* Bitfield Definitions */
+
+/* TWL4030_CODEC_MODE (0x01) Fields */
+
+#define TWL4030_APLL_RATE 0xF0
+#define TWL4030_APLL_RATE_8000 0x00
+#define TWL4030_APLL_RATE_11025 0x10
+#define TWL4030_APLL_RATE_12000 0x20
+#define TWL4030_APLL_RATE_16000 0x40
+#define TWL4030_APLL_RATE_22050 0x50
+#define TWL4030_APLL_RATE_24000 0x60
+#define TWL4030_APLL_RATE_32000 0x80
+#define TWL4030_APLL_RATE_44100 0x90
+#define TWL4030_APLL_RATE_48000 0xA0
+#define TWL4030_SEL_16K 0x04
+#define TWL4030_CODECPDZ 0x02
+#define TWL4030_OPT_MODE 0x01
+
+/* ANAMICL (0x05) Fields */
+#define TWL4030_CNCL_OFFSET_START 0x80
+#define TWL4030_OFFSET_CNCL_SEL 0x60
+#define TWL4030_OFFSET_CNCL_SEL_ARX1 0x00
+#define TWL4030_OFFSET_CNCL_SEL_ARX2 0x20
+#define TWL4030_OFFSET_CNCL_SEL_VRX 0x40
+#define TWL4030_OFFSET_CNCL_SEL_ALL 0x60
+#define TWL4030_MICAMPL_EN 0x10
+#define TWL4030_CKMIC_EN 0x08
+#define TWL4030_AUXL_EN 0x04
+#define TWL4030_HSMIC_EN 0x02
+#define TWL4030_MAINMIC_EN 0x01
+
+/* ANAMICR (0x06) Fields */
+#define TWL4030_MICAMPR_EN 0x10
+#define TWL4030_AUXR_EN 0x04
+#define TWL4030_SUBMIC_EN 0x01
+
+/* AUDIO_IF (0x0E) Fields */
+
+#define TWL4030_AIF_SLAVE_EN 0x80
+#define TWL4030_DATA_WIDTH 0x60
+#define TWL4030_DATA_WIDTH_16S_16W 0x00
+#define TWL4030_DATA_WIDTH_32S_16W 0x40
+#define TWL4030_DATA_WIDTH_32S_24W 0x60
+#define TWL4030_AIF_FORMAT 0x18
+#define TWL4030_AIF_FORMAT_CODEC 0x00
+#define TWL4030_AIF_FORMAT_LEFT 0x08
+#define TWL4030_AIF_FORMAT_RIGHT 0x10
+#define TWL4030_AIF_FORMAT_TDM 0x18
+#define TWL4030_AIF_TRI_EN 0x04
+#define TWL4030_CLK256FS_EN 0x02
+#define TWL4030_AIF_EN 0x01
+
+/* HS_GAIN_SET (0x23) Fields */
+
+#define TWL4030_HSR_GAIN 0x0C
+#define TWL4030_HSR_GAIN_PWR_DOWN 0x00
+#define TWL4030_HSR_GAIN_PLUS_6DB 0x04
+#define TWL4030_HSR_GAIN_0DB 0x08
+#define TWL4030_HSR_GAIN_MINUS_6DB 0x0C
+#define TWL4030_HSL_GAIN 0x03
+#define TWL4030_HSL_GAIN_PWR_DOWN 0x00
+#define TWL4030_HSL_GAIN_PLUS_6DB 0x01
+#define TWL4030_HSL_GAIN_0DB 0x02
+#define TWL4030_HSL_GAIN_MINUS_6DB 0x03
+
+/* HS_POPN_SET (0x24) Fields */
+
+#define TWL4030_VMID_EN 0x40
+#define TWL4030_EXTMUTE 0x20
+#define TWL4030_RAMP_DELAY 0x1C
+#define TWL4030_RAMP_DELAY_20MS 0x00
+#define TWL4030_RAMP_DELAY_40MS 0x04
+#define TWL4030_RAMP_DELAY_81MS 0x08
+#define TWL4030_RAMP_DELAY_161MS 0x0C
+#define TWL4030_RAMP_DELAY_323MS 0x10
+#define TWL4030_RAMP_DELAY_645MS 0x14
+#define TWL4030_RAMP_DELAY_1291MS 0x18
+#define TWL4030_RAMP_DELAY_2581MS 0x1C
+#define TWL4030_RAMP_EN 0x02
+
+/* APLL_CTL (0x3A) Fields */
+
+#define TWL4030_APLL_EN 0x10
+#define TWL4030_APLL_INFREQ 0x0F
+#define TWL4030_APLL_INFREQ_19200KHZ 0x05
+#define TWL4030_APLL_INFREQ_26000KHZ 0x06
+#define TWL4030_APLL_INFREQ_38400KHZ 0x0F
+
+/* REG_MISC_SET_1 (0x3E) Fields */
+
+#define TWL4030_CLK64_EN 0x80
+#define TWL4030_SCRAMBLE_EN 0x40
+#define TWL4030_FMLOOP_EN 0x20
+#define TWL4030_SMOOTH_ANAVOL_EN 0x02
+#define TWL4030_DIGMIC_LR_SWAP_EN 0x01
+
+extern struct snd_soc_dai twl4030_dai;
+extern struct snd_soc_codec_device soc_codec_dev_twl4030;
+
+#endif /* End of __TWL4030_AUDIO_H__ */
--
1.5.4.5
1
0

[alsa-devel] [RESEND, PATCH] Fix section for sa11xx-uda1341 platform driver
by Uwe Kleine-König 08 Sep '08
by Uwe Kleine-König 08 Sep '08
08 Sep '08
Don't use __init but __devinit to define probe function. A pointer to
sa11xx_uda1341_probe is passed to the core via platform_driver_register and
so the function must not disappear after the module is loaded. Using __init
and having HOTPLUG=y and SND_SA11XX_UDA1341=m the following probably oopses:
echo -n sa11xx_uda1341.1 > /sys/bus/platform/driver/sa11xx_uda1341/unbind
echo -n sa11xx_uda1341.1 > /sys/bus/platform/driver/sa11xx_uda1341/bind
Signed-off-by: Uwe Kleine-König <ukleinek(a)informatik.uni-freiburg.de>
Cc: Russell King <rmk+kernel(a)arm.linux.org.uk>
Cc: Jaroslav Kysela <perex(a)perex.cz>
Cc: Brian Avery <b.avery(a)hp.com>
Cc: alsa-devel(a)alsa-project.org
Cc: Andrew Morton <akpm(a)linux-foundation.org>
---
Hello,
uups, I forgot to add the right cc:. Sorry.
@Andrew, I have a few more patches of this type pending. Is it OK for
you if they go via you? This would ease the process a bit for me.
Uwe
sound/arm/sa11xx-uda1341.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/arm/sa11xx-uda1341.c b/sound/arm/sa11xx-uda1341.c
index b9c51bf..da25b41 100644
--- a/sound/arm/sa11xx-uda1341.c
+++ b/sound/arm/sa11xx-uda1341.c
@@ -879,7 +879,7 @@ void snd_sa11xx_uda1341_free(struct snd_card *card)
audio_dma_free(&chip->s[SNDRV_PCM_STREAM_CAPTURE]);
}
-static int __init sa11xx_uda1341_probe(struct platform_device *devptr)
+static int __devinit sa11xx_uda1341_probe(struct platform_device *devptr)
{
int err;
struct snd_card *card;
--
tg: (7686ad5..) t/sectionfixes/sa11xx_uda1341 (depends on: t/sectionfixes/sa11xx_uda1341)
--
Uwe Kleine-König
http://www.google.com/search?q=1+electron+mass%3D
1
0
Hi group,
What API call fo I use to wait for a callback to end? Right now I use
a select() and wait
for stdin input or a system interrupt. Is there another way?
--
William Estrada
MrUmunhum(a)popdial.com
Mt-Umunhum-Wireless.net ( http://Mt-Umunhum-Wireless.net )
Ymessenger: MrUmunhum
1
0