aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/pxa
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 08:41:44 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-24 08:41:44 -0700
commit38ccc197eb85cad594eb5863ba5a408655da0062 (patch)
tree0066a0160e5dd28280a8db2a5814af7111ae3e1b /sound/soc/pxa
parentd02aacff4467806ee56f147ac8eff6911d95811a (diff)
parent3a841d519f91463361bbbe7addc24a0c1b2e9f99 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (250 commits) [ALSA] ice1724 - Fix IRQ lock-up with MPU access [ALSA] Define MPU401 registers in sound/mpu401_uart.h [ALSA] pcsp: fix wording in DEBUG_PAGEALLOC warning [ALSA] pcsp - Fix dependency in Kconfig [ALSA] soc - ac97 - Clean up checkpatch warnings [ALSA] soc - wm8750 - Clean up checkpatch warnings [ALSA] soc - wm8731 - Clean up checkpatch warnings [ALSA] soc - pxa2xx-pcm - Fix checkpatch warnings [ALSA] soc - spitz - Fix checkpatch warnings [ALSA] soc - poodle - Fix checkpatch warnings [ALSA] soc - corgi - Fix checkpatch warnings [ALSA] soc - s3c24xx-i2s - Add missing spaces [ALSA] soc - s3c24xx-i2s - Fix tab/space breakage [ALSA] soc - s3c24xx-i2s - Use linux/io.h [ALSA] hda - Fix Thinkpad X300 digital mic pcsp - Don't build pcspkr when snd-pcsp is enabled [ALSA] hda - Fix model for Acer Aspire 5720z [ALSA] soc - s3c24xx - Declare suspend and resume static [ALSA] soc - s3c24xx - Improve diagnostic output [ALSA] Fix possible races at free_irq in PCI drivers ...
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r--sound/soc/pxa/corgi.c11
-rw-r--r--sound/soc/pxa/poodle.c8
-rw-r--r--sound/soc/pxa/pxa2xx-ac97.c37
-rw-r--r--sound/soc/pxa/pxa2xx-pcm.c9
-rw-r--r--sound/soc/pxa/spitz.c6
5 files changed, 45 insertions, 26 deletions
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c
index 1a70a6ac98c..7f32a116757 100644
--- a/sound/soc/pxa/corgi.c
+++ b/sound/soc/pxa/corgi.c
@@ -297,21 +297,19 @@ static int corgi_wm8731_init(struct snd_soc_codec *codec)
/* Add corgi specific controls */
for (i = 0; i < ARRAY_SIZE(wm8731_corgi_controls); i++) {
err = snd_ctl_add(codec->card,
- snd_soc_cnew(&wm8731_corgi_controls[i],codec, NULL));
+ snd_soc_cnew(&wm8731_corgi_controls[i], codec, NULL));
if (err < 0)
return err;
}
/* Add corgi specific widgets */
- for(i = 0; i < ARRAY_SIZE(wm8731_dapm_widgets); i++) {
+ for (i = 0; i < ARRAY_SIZE(wm8731_dapm_widgets); i++)
snd_soc_dapm_new_control(codec, &wm8731_dapm_widgets[i]);
- }
/* Set up corgi specific audio path audio_map */
- for(i = 0; audio_map[i][0] != NULL; i++) {
+ for (i = 0; audio_map[i][0] != NULL; i++)
snd_soc_dapm_connect_input(codec, audio_map[i][0],
audio_map[i][1], audio_map[i][2]);
- }
snd_soc_dapm_sync_endpoints(codec);
return 0;
@@ -353,7 +351,8 @@ static int __init corgi_init(void)
{
int ret;
- if (!(machine_is_corgi() || machine_is_shepherd() || machine_is_husky()))
+ if (!(machine_is_corgi() || machine_is_shepherd() ||
+ machine_is_husky()))
return -ENODEV;
corgi_snd_device = platform_device_alloc("soc-audio", -1);
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c
index 4fbf8bba962..7e830b21894 100644
--- a/sound/soc/pxa/poodle.c
+++ b/sound/soc/pxa/poodle.c
@@ -257,21 +257,19 @@ static int poodle_wm8731_init(struct snd_soc_codec *codec)
/* Add poodle specific controls */
for (i = 0; i < ARRAY_SIZE(wm8731_poodle_controls); i++) {
err = snd_ctl_add(codec->card,
- snd_soc_cnew(&wm8731_poodle_controls[i],codec, NULL));
+ snd_soc_cnew(&wm8731_poodle_controls[i], codec, NULL));
if (err < 0)
return err;
}
/* Add poodle specific widgets */
- for (i = 0; i < ARRAY_SIZE(wm8731_dapm_widgets); i++) {
+ for (i = 0; i < ARRAY_SIZE(wm8731_dapm_widgets); i++)
snd_soc_dapm_new_control(codec, &wm8731_dapm_widgets[i]);
- }
/* Set up poodle specific audio path audio_map */
- for (i = 0; audio_map[i][0] != NULL; i++) {
+ for (i = 0; audio_map[i][0] != NULL; i++)
snd_soc_dapm_connect_input(codec, audio_map[i][0],
audio_map[i][1], audio_map[i][2]);
- }
snd_soc_dapm_sync_endpoints(codec);
return 0;
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c
index e1737999880..97ec2d90547 100644
--- a/sound/soc/pxa/pxa2xx-ac97.c
+++ b/sound/soc/pxa/pxa2xx-ac97.c
@@ -61,7 +61,7 @@ static unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97,
mutex_lock(&car_mutex);
/* set up primary or secondary codec/modem space */
-#ifdef CONFIG_PXA27x
+#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
#else
if (reg == AC97_GPIO_STATUS)
@@ -87,7 +87,7 @@ static unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97,
wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_SDONE, 1);
if (!((GSR | gsr_bits) & GSR_SDONE)) {
printk(KERN_ERR "%s: read error (ac97_reg=%x GSR=%#lx)\n",
- __FUNCTION__, reg, GSR | gsr_bits);
+ __func__, reg, GSR | gsr_bits);
val = -1;
goto out;
}
@@ -111,7 +111,7 @@ static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
mutex_lock(&car_mutex);
/* set up primary or secondary codec/modem space */
-#ifdef CONFIG_PXA27x
+#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx)
reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE;
#else
if (reg == AC97_GPIO_STATUS)
@@ -127,13 +127,16 @@ static void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
wait_event_timeout(gsr_wq, (GSR | gsr_bits) & GSR_CDONE, 1);
if (!((GSR | gsr_bits) & GSR_CDONE))
printk(KERN_ERR "%s: write error (ac97_reg=%x GSR=%#lx)\n",
- __FUNCTION__, reg, GSR | gsr_bits);
+ __func__, reg, GSR | gsr_bits);
mutex_unlock(&car_mutex);
}
static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97)
{
+#ifdef CONFIG_PXA3xx
+ int timeout = 100;
+#endif
gsr_bits = 0;
#ifdef CONFIG_PXA27x
@@ -144,6 +147,11 @@ static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97)
GCR |= GCR_WARM_RST;
pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT);
udelay(500);
+#elif defined(CONFIG_PXA3xx)
+ /* Can't use interrupts */
+ GCR |= GCR_WARM_RST;
+ while (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)) && timeout--)
+ mdelay(1);
#else
GCR |= GCR_WARM_RST | GCR_PRIRDY_IEN | GCR_SECRDY_IEN;
wait_event_timeout(gsr_wq, gsr_bits & (GSR_PCR | GSR_SCR), 1);
@@ -151,7 +159,7 @@ static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97)
if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)))
printk(KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n",
- __FUNCTION__, gsr_bits);
+ __func__, gsr_bits);
GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
GCR |= GCR_SDONE_IE|GCR_CDONE_IE;
@@ -159,6 +167,16 @@ static void pxa2xx_ac97_warm_reset(struct snd_ac97 *ac97)
static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97)
{
+#ifdef CONFIG_PXA3xx
+ int timeout = 1000;
+
+ /* Hold CLKBPB for 100us */
+ GCR = 0;
+ GCR = GCR_CLKBPB;
+ udelay(100);
+ GCR = 0;
+#endif
+
GCR &= GCR_COLD_RST; /* clear everything but nCRST */
GCR &= ~GCR_COLD_RST; /* then assert nCRST */
@@ -170,6 +188,13 @@ static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97)
clk_disable(ac97conf_clk);
GCR = GCR_COLD_RST;
udelay(50);
+#elif defined(CONFIG_PXA3xx)
+ /* Can't use interrupts on PXA3xx */
+ GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
+
+ GCR = GCR_WARM_RST | GCR_COLD_RST;
+ while (!(GSR & (GSR_PCR | GSR_SCR)) && timeout--)
+ mdelay(10);
#else
GCR = GCR_COLD_RST;
GCR |= GCR_CDONE_IE|GCR_SDONE_IE;
@@ -178,7 +203,7 @@ static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97)
if (!((GSR | gsr_bits) & (GSR_PCR | GSR_SCR)))
printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n",
- __FUNCTION__, gsr_bits);
+ __func__, gsr_bits);
GCR &= ~(GCR_PRIRDY_IEN|GCR_SECRDY_IEN);
GCR |= GCR_SDONE_IE|GCR_CDONE_IE;
diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c
index daeaa4c8b87..01ad7bf716b 100644
--- a/sound/soc/pxa/pxa2xx-pcm.c
+++ b/sound/soc/pxa/pxa2xx-pcm.c
@@ -64,8 +64,8 @@ static void pxa2xx_pcm_dma_irq(int dma_ch, void *dev_id)
if (dcsr & DCSR_ENDINTR) {
snd_pcm_period_elapsed(substream);
} else {
- printk( KERN_ERR "%s: DMA error on channel %d (DCSR=%#x)\n",
- prtd->params->name, dma_ch, dcsr );
+ printk(KERN_ERR "%s: DMA error on channel %d (DCSR=%#x)\n",
+ prtd->params->name, dma_ch, dcsr);
}
}
@@ -84,8 +84,8 @@ static int pxa2xx_pcm_hw_params(struct snd_pcm_substream *substream,
/* return if this is a bufferless transfer e.g.
* codec <--> BT codec or GSM modem -- lg FIXME */
- if (!dma)
- return 0;
+ if (!dma)
+ return 0;
/* this may get called several times by oss emulation
* with different params */
@@ -363,7 +363,6 @@ struct snd_soc_platform pxa2xx_soc_platform = {
.pcm_new = pxa2xx_pcm_new,
.pcm_free = pxa2xx_pcm_free_dma_buffers,
};
-
EXPORT_SYMBOL_GPL(pxa2xx_soc_platform);
MODULE_AUTHOR("Nicolas Pitre");
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c
index ecca39033fc..d8b8372db00 100644
--- a/sound/soc/pxa/spitz.c
+++ b/sound/soc/pxa/spitz.c
@@ -313,15 +313,13 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec)
}
/* Add spitz specific widgets */
- for (i = 0; i < ARRAY_SIZE(wm8750_dapm_widgets); i++) {
+ for (i = 0; i < ARRAY_SIZE(wm8750_dapm_widgets); i++)
snd_soc_dapm_new_control(codec, &wm8750_dapm_widgets[i]);
- }
/* Set up spitz specific audio path audio_map */
- for (i = 0; audio_map[i][0] != NULL; i++) {
+ for (i = 0; audio_map[i][0] != NULL; i++)
snd_soc_dapm_connect_input(codec, audio_map[i][0],
audio_map[i][1], audio_map[i][2]);
- }
snd_soc_dapm_sync_endpoints(codec);
return 0;