Alsa-devel
Threads by month
- ----- 2025 -----
- July
- June
- 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
- 8 participants
- 51270 discussions

09 Sep '08
- <asm/io.h> -> <linux/io.h>
- remove trailing whitespaces
- convert comments
Only compile tested.
Signed-off-by: Alexander Beregalov <a.beregalov(a)gmail.com>
---
sound/pci/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

Re: [alsa-devel] [PATCH1/1] hda: digital slave support for IDT codecs
by Matthew Ranostay 08 Sep '08
by Matthew Ranostay 08 Sep '08
08 Sep '08
Added slave_dig_outs entries for several IDT codecs that have multiple
SPDIF outs, and enabled these SPDIF outs in several pin configs.
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
---
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index ee24a0d..5280eff 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -235,6 +235,10 @@ static hda_nid_t stac92hd73xx_pwr_nids[8] = {
0x0f, 0x10, 0x11
};
+static hda_nid_t stac92hd73xx_slave_dig_outs[2] = {
+ 0x26, 0,
+};
+
static hda_nid_t stac92hd73xx_adc_nids[2] = {
0x1a, 0x1b
};
@@ -284,6 +288,10 @@ static hda_nid_t stac92hd83xxx_pwr_nids[4] = {
0xa, 0xb, 0xd, 0xe,
};
+static hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {
+ 0x1e, 0,
+};
+
static unsigned int stac92hd83xxx_pwr_mapping[4] = {
0x03, 0x0c, 0x10, 0x40,
};
@@ -317,6 +325,10 @@ static hda_nid_t stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS + 1] = {
0x18, 0x19, 0
};
+static hda_nid_t stac92hd71bxx_slave_dig_outs[2] = {
+ 0x22, 0
+};
+
static hda_nid_t stac925x_adc_nids[1] = {
0x03,
};
@@ -418,9 +430,10 @@ static hda_nid_t stac92hd83xxx_pin_nids[14] = {
0x0f, 0x10, 0x11, 0x12, 0x13,
0x1d, 0x1e, 0x1f, 0x20
};
-static hda_nid_t stac92hd71bxx_pin_nids[10] = {
+static hda_nid_t stac92hd71bxx_pin_nids[11] = {
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x14, 0x18, 0x19, 0x1e,
+ 0x1f,
};
static hda_nid_t stac927x_pin_nids[14] = {
@@ -1492,22 +1505,22 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
"DFI LanParty", STAC_92HD71BXX_REF),
};
-static unsigned int ref92hd71bxx_pin_configs[10] = {
+static unsigned int ref92hd71bxx_pin_configs[11] = {
0x02214030, 0x02a19040, 0x01a19020, 0x01014010,
0x0181302e, 0x01114010, 0x01019020, 0x90a000f0,
- 0x90a000f0, 0x01452050,
+ 0x90a000f0, 0x01452050, 0x01452050,
};
-static unsigned int dell_m4_1_pin_configs[10] = {
+static unsigned int dell_m4_1_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0,
- 0x40f000f0, 0x4f0000f0,
+ 0x40f000f0, 0x4f0000f0, 0x4f0000f0,
};
-static unsigned int dell_m4_2_pin_configs[10] = {
+static unsigned int dell_m4_2_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0,
- 0x40f000f0, 0x044413b0,
+ 0x40f000f0, 0x044413b0, 0x044413b0,
};
static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
@@ -3846,6 +3859,7 @@ static int patch_stac92hd73xx(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
spec->num_pins = ARRAY_SIZE(stac92hd73xx_pin_nids);
spec->pin_nids = stac92hd73xx_pin_nids;
spec->board_config = snd_hda_check_board_config(codec,
@@ -3984,6 +3998,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->mono_nid = 0x19;
spec->digbeep_nid = 0x21;
spec->dmic_nids = stac92hd83xxx_dmic_nids;
@@ -4134,6 +4149,7 @@ again:
case 0x111d76b5:
spec->mixer = stac92hd71bxx_mixer;
spec->init = stac92hd71bxx_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
break;
case 0x111d7608: /* 5 Port with Analog Mixer */
if ((codec->revision_id & 0xf) == 0 ||
@@ -4166,6 +4182,7 @@ again:
default:
spec->mixer = stac92hd71bxx_analog_mixer;
spec->init = stac92hd71bxx_analog_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
}
spec->aloopback_mask = 0x20;
1
0

08 Sep '08
Added slave_dig_outs entries for several IDT codecs that have multiple
SPDIF outs, and enabled these SPDIF outs in several pin configs.
---
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/pci/hda/patch_sigmatel.c b/pci/hda/patch_sigmatel.c
index 9968ee4..52b3579 100644
--- a/pci/hda/patch_sigmatel.c
+++ b/pci/hda/patch_sigmatel.c
@@ -229,6 +229,10 @@ static hda_nid_t stac92hd73xx_pwr_nids[8] = {
0x0f, 0x10, 0x11
};
+static hda_nid_t stac92hd73xx_slave_dig_outs[2] = {
+ 0x26, 0,
+};
+
static hda_nid_t stac92hd73xx_adc_nids[2] = {
0x1a, 0x1b
};
@@ -274,6 +278,10 @@ static hda_nid_t stac92hd83xxx_pwr_nids[4] = {
0xa, 0xb, 0xd, 0xe,
};
+static hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {
+ 0x1e, 0,
+};
+
static unsigned int stac92hd83xxx_pwr_mapping[4] = {
0x03, 0x0c, 0x10, 0x40,
};
@@ -303,6 +311,10 @@ static hda_nid_t stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS + 1] = {
0x18, 0x19, 0
};
+static hda_nid_t stac92hd71bxx_slave_dig_outs[2] = {
+ 0x22, 0
+};
+
static hda_nid_t stac925x_adc_nids[1] = {
0x03,
};
@@ -396,9 +408,10 @@ static hda_nid_t stac92hd83xxx_pin_nids[14] = {
0x0f, 0x10, 0x11, 0x12, 0x13,
0x1d, 0x1e, 0x1f, 0x20
};
-static hda_nid_t stac92hd71bxx_pin_nids[10] = {
+static hda_nid_t stac92hd71bxx_pin_nids[11] = {
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x14, 0x18, 0x19, 0x1e,
+ 0x1f,
};
static hda_nid_t stac927x_pin_nids[14] = {
@@ -1424,22 +1437,22 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
"DFI LanParty", STAC_92HD71BXX_REF),
};
-static unsigned int ref92hd71bxx_pin_configs[10] = {
+static unsigned int ref92hd71bxx_pin_configs[11] = {
0x02214030, 0x02a19040, 0x01a19020, 0x01014010,
0x0181302e, 0x01114010, 0x01019020, 0x90a000f0,
- 0x90a000f0, 0x01452050,
+ 0x90a000f0, 0x01452050, 0x01452050,
};
-static unsigned int dell_m4_1_pin_configs[10] = {
+static unsigned int dell_m4_1_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0,
- 0x40f000f0, 0x4f0000f0,
+ 0x40f000f0, 0x4f0000f0, 0x4f0000f0,
};
-static unsigned int dell_m4_2_pin_configs[10] = {
+static unsigned int dell_m4_2_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0,
- 0x40f000f0, 0x044413b0,
+ 0x40f000f0, 0x044413b0, 0x044413b0,
};
static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
@@ -3841,8 +3854,9 @@ again:
spec->num_pwrs = ARRAY_SIZE(stac92hd73xx_pwr_nids);
spec->pwr_nids = stac92hd73xx_pwr_nids;
+ codec->slave_dig_outs = stac92hd73xx_slave_dig_outs;
- err = stac92xx_parse_auto_config(codec, 0x22, 0x24);
+ err = stac92xx_parse_auto_config(codec, 0x22, 0x25);
if (!err) {
if (spec->board_config < 0) {
@@ -3883,6 +3897,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->mono_nid = 0x19;
spec->digbeep_nid = 0x21;
spec->dmic_nids = stac92hd83xxx_dmic_nids;
@@ -4033,6 +4048,7 @@ again:
case 0x111d76b5:
spec->mixer = stac92hd71bxx_mixer;
spec->init = stac92hd71bxx_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
break;
case 0x111d7608: /* 5 Port with Analog Mixer */
if ((codec->revision_id & 0xf) == 0 ||
@@ -4065,6 +4081,7 @@ again:
default:
spec->mixer = stac92hd71bxx_analog_mixer;
spec->init = stac92hd71bxx_analog_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
}
spec->aloopback_mask = 0x20;
3
8

08 Sep '08
Added slave_dig_outs entries for several IDT codecs that have multiple
SPDIF outs, and enabled these SPDIF outs in several pin configs.
---
Signed-off-by: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index ee24a0d..655a87c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -235,6 +235,10 @@ static hda_nid_t stac92hd73xx_pwr_nids[8] = {
0x0f, 0x10, 0x11
};
+static hda_nid_t stac92hd73xx_slave_dig_outs[2] = {
+ 0x26, 0,
+};
+
static hda_nid_t stac92hd73xx_adc_nids[2] = {
0x1a, 0x1b
};
@@ -284,6 +288,10 @@ static hda_nid_t stac92hd83xxx_pwr_nids[4] = {
0xa, 0xb, 0xd, 0xe,
};
+static hda_nid_t stac92hd83xxx_slave_dig_outs[2] = {
+ 0x1e, 0,
+};
+
static unsigned int stac92hd83xxx_pwr_mapping[4] = {
0x03, 0x0c, 0x10, 0x40,
};
@@ -317,6 +325,10 @@ static hda_nid_t stac92hd71bxx_dmic_nids[STAC92HD71BXX_NUM_DMICS + 1] = {
0x18, 0x19, 0
};
+static hda_nid_t stac92hd71bxx_slave_dig_outs[2] = {
+ 0x22, 0
+};
+
static hda_nid_t stac925x_adc_nids[1] = {
0x03,
};
@@ -418,9 +430,10 @@ static hda_nid_t stac92hd83xxx_pin_nids[14] = {
0x0f, 0x10, 0x11, 0x12, 0x13,
0x1d, 0x1e, 0x1f, 0x20
};
-static hda_nid_t stac92hd71bxx_pin_nids[10] = {
+static hda_nid_t stac92hd71bxx_pin_nids[11] = {
0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
0x0f, 0x14, 0x18, 0x19, 0x1e,
+ 0x1f,
};
static hda_nid_t stac927x_pin_nids[14] = {
@@ -1492,22 +1505,22 @@ static struct snd_pci_quirk stac92hd83xxx_cfg_tbl[] = {
"DFI LanParty", STAC_92HD71BXX_REF),
};
-static unsigned int ref92hd71bxx_pin_configs[10] = {
+static unsigned int ref92hd71bxx_pin_configs[11] = {
0x02214030, 0x02a19040, 0x01a19020, 0x01014010,
0x0181302e, 0x01114010, 0x01019020, 0x90a000f0,
- 0x90a000f0, 0x01452050,
+ 0x90a000f0, 0x01452050, 0x01452050,
};
-static unsigned int dell_m4_1_pin_configs[10] = {
+static unsigned int dell_m4_1_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x40f000f0, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x90a000f0,
- 0x40f000f0, 0x4f0000f0,
+ 0x40f000f0, 0x4f0000f0, 0x4f0000f0,
};
-static unsigned int dell_m4_2_pin_configs[10] = {
+static unsigned int dell_m4_2_pin_configs[11] = {
0x0421101f, 0x04a11221, 0x90a70330, 0x90170110,
0x23a1902e, 0x23014250, 0x40f000f0, 0x40f000f0,
- 0x40f000f0, 0x044413b0,
+ 0x40f000f0, 0x044413b0, 0x044413b0,
};
static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
@@ -3984,6 +3997,7 @@ static int patch_stac92hd83xxx(struct hda_codec *codec)
return -ENOMEM;
codec->spec = spec;
+ codec->slave_dig_outs = stac92hd83xxx_slave_dig_outs;
spec->mono_nid = 0x19;
spec->digbeep_nid = 0x21;
spec->dmic_nids = stac92hd83xxx_dmic_nids;
@@ -4134,6 +4148,7 @@ again:
case 0x111d76b5:
spec->mixer = stac92hd71bxx_mixer;
spec->init = stac92hd71bxx_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
break;
case 0x111d7608: /* 5 Port with Analog Mixer */
if ((codec->revision_id & 0xf) == 0 ||
@@ -4166,6 +4181,7 @@ again:
default:
spec->mixer = stac92hd71bxx_analog_mixer;
spec->init = stac92hd71bxx_analog_core_init;
+ codec->slave_dig_outs = stac92hd71bxx_slave_dig_outs;
}
spec->aloopback_mask = 0x20;
2
1
Changed the mux naming scheme from "IEC9258 Mux" to "IEC958 Playback Source" to match
the coding style.
---
Signed-by-off: Matthew Ranostay <mranostay(a)embeddedalley.com>
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index ee24a0d..173515d 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -1047,7 +1047,7 @@ static struct snd_kcontrol_new stac_dmux_mixer = {
static struct snd_kcontrol_new stac_smux_mixer = {
.iface = SNDRV_CTL_ELEM_IFACE_MIXER,
- .name = "IEC958 Mux",
+ .name = "IEC958 Playback Source",
/* count set later */
.info = stac92xx_smux_enum_info,
.get = stac92xx_smux_enum_get,
1
0