ASoC updates
Subsystems (4)
cover ASoC updates
The following changes since commit 3e3b5651631629482e0e1541f8c4298a435bb100:
Mark Brown (1):
ALSA: ASoC: Use codec digital mute when stopping playback
are available in the git repository at:
git://opensource.wolfsonmicro.com/linux-2.6-asoc for-tiwai
Alan Horstmann (1):
ASoC: Fix WM8731 SPI write
Dmitry Baryshkov (4):
ASoC: Support runtime selection of CPU in pxa2xx-i2s
ALSA: Separate common pxa2xx-ac97 code
ALSA: pxa2xx-ac97-lib: support building for several CPUs
ALSA: Separate common pxa2xx-pcm code
Kenneth Kiraly (1):
ASoC: Add WM8971 CODEC driver
include/sound/pxa2xx-lib.h | 45 ++ sound/arm/Kconfig | 9 + sound/arm/Makefile | 4 + sound/arm/pxa2xx-ac97-lib.c | 384 ++++++++++++++++++ sound/arm/pxa2xx-ac97.c | 247 +----------- sound/arm/pxa2xx-pcm-lib.c | 278 +++++++++++++ sound/arm/pxa2xx-pcm.c | 252 +----------- sound/arm/pxa2xx-pcm.h | 13 +- sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/wm8731.c | 5 +- sound/soc/codecs/wm8971.c | 942 +++++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8971.h | 64 +++ sound/soc/pxa/Kconfig | 3 + sound/soc/pxa/pxa2xx-ac97.c | 272 +------------ sound/soc/pxa/pxa2xx-i2s.c | 20 +- sound/soc/pxa/pxa2xx-pcm.c | 261 +------------ sound/soc/pxa/pxa2xx-pcm.h | 15 - 18 files changed, 1802 insertions(+), 1018 deletions(-) create mode 100644 include/sound/pxa2xx-lib.h create mode 100644 sound/arm/pxa2xx-ac97-lib.c create mode 100644 sound/arm/pxa2xx-pcm-lib.c create mode 100644 sound/soc/codecs/wm8971.c create mode 100644 sound/soc/codecs/wm8971.h
PATCH 1/6 ASoC: Fix WM8731 SPI write
From: Alan Horstmann <[email protected]>
Ensure wm8731_spi_write byte order is consistent regardless of endianess.
--- sound/soc/codecs/wm8731.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
sound/soc/codecs/wm8731.c +3 -2
@@ -688,12 +688,13 @@ static int wm8731_spi_write(struct spi_device *spi, const char *data, int len) {struct spi_transfer t;struct spi_message m; -u16 msg[2 ]; +u8 msg[2 ];if (len <=0 )return 0 ; - msg[0 ] = (data[0 ] <<8 ) + data[1 ]; + msg[0 ] = data[0 ]; + msg[1 ] = data[1 ];spi_message_init (&m);memset (&t,0 , (sizeof t));
Signature · 1 line
1.5.6.5
PATCH 2/6 ASoC: Add WM8971 CODEC driver
From: Kenneth Kiraly <[email protected]>
The WM8971 is a low power, high quality stereo codec designed for portable digital audio applications.
This driver was originally written by Kenneth Kiraly. While out of tree it has had updates to reflect current kernel APIs and coding standards from Graeme Gregory and Mark Brown.
--- sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/wm8971.c | 942 +++++++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8971.h | 64 +++ 4 files changed, 1012 insertions(+), 0 deletions(-) create mode 100644 sound/soc/codecs/wm8971.c create mode 100644 sound/soc/codecs/wm8971.h
sound/soc/codecs/Kconfig +4 -0
@@ -16,6 +16,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_WM8753 select SND_SOC_WM8900 select SND_SOC_WM8903 + select SND_SOC_WM8971 select SND_SOC_WM8990 help Normally ASoC codec drivers are only built if a machine driver which
@@ -89,6 +90,9 @@ config SND_SOC_WM8900 config SND_SOC_WM8903 tristate +config SND_SOC_WM8971 + tristate + config SND_SOC_WM8990 tristate
sound/soc/codecs/Makefile +2 -0
@@ -13,6 +13,7 @@ snd-soc-wm8750-objs := wm8750.o snd-soc-wm8753-objs := wm8753.o snd-soc-wm8900-objs := wm8900.o snd-soc-wm8903-objs := wm8903.o +snd-soc-wm8971-objs := wm8971.o snd-soc-wm8990-objs := wm8990.o snd-soc-wm9712-objs := wm9712.o snd-soc-wm9713-objs := wm9713.o
@@ -32,6 +33,7 @@ obj-$(CONFIG_SND_SOC_WM8750) += snd-soc-wm8750.o obj-$(CONFIG_SND_SOC_WM8753) += snd-soc-wm8753.o obj-$(CONFIG_SND_SOC_WM8900) += snd-soc-wm8900.o obj-$(CONFIG_SND_SOC_WM8903) += snd-soc-wm8903.o +obj-$(CONFIG_SND_SOC_WM8971) += snd-soc-wm8971.o obj-$(CONFIG_SND_SOC_WM8990) += snd-soc-wm8990.o obj-$(CONFIG_SND_SOC_WM9712) += snd-soc-wm9712.o obj-$(CONFIG_SND_SOC_WM9713) += snd-soc-wm9713.o
sound/soc/codecs/wm8971.c new file +942 -0
942 lines not on this page · raw message
sound/soc/codecs/wm8971.h new file +64 -0
64 lines not on this page · raw message
Signature · 1 line
1.5.6.5
PATCH 3/6 ASoC: Support runtime selection of CPU in pxa2xx-i2s
From: Dmitry Baryshkov <[email protected]>
--- sound/soc/pxa/pxa2xx-i2s.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
sound/soc/pxa/pxa2xx-i2s.c +5 -5
@@ -65,11 +65,6 @@ static struct pxa2xx_gpio gpio_bus[] = { .frm = GPIO31_SYNC_I2S_MD, }, {/* I2S SoC Master */ -#ifdef CONFIG_PXA27x - .sys = GPIO113_I2S_SYSCLK_MD, -#else - .sys = GPIO32_SYSCLK_I2S_MD, -#endif .rx = GPIO29_SDATA_IN_I2S_MD, .tx = GPIO30_SDATA_OUT_I2S_MD, .clk = GPIO28_BITCLK_OUT_I2S_MD,
@@ -343,6 +338,11 @@ static struct platform_driver pxa2xx_i2s_driver = {static int __init pxa2xx_i2s_init (void ) { +if (cpu_is_pxa27x ()) + gpio_bus[1 ].sys =GPIO113_I2S_SYSCLK_MD ; +else + gpio_bus[1 ].sys =GPIO32_SYSCLK_I2S_MD ; + clk_i2s =ERR_PTR (-ENOENT );return platform_driver_register (&pxa2xx_i2s_driver); }
Signature · 1 line
1.5.6.5
PATCH 4/6 ALSA: Separate common pxa2xx-ac97 code
From: Dmitry Baryshkov <[email protected]>
ASoC and non-ASoC drivers for ACLINK on PXA share lot's of common code. Move all common code into separate module snd-pxa2xx-lib.
[Fixed handing of SND_AC97_CODEC in Kconfig and some checkpatch warnings
-- broonie]
--- include/sound/pxa2xx-lib.h | 20 +++ sound/arm/Kconfig | 5 + sound/arm/Makefile | 3 + sound/arm/pxa2xx-ac97-lib.c | 325 +++++++++++++++++++++++++++++++++++++++++++ sound/arm/pxa2xx-ac97.c | 247 +++------------------------------ sound/soc/pxa/Kconfig | 2 + sound/soc/pxa/pxa2xx-ac97.c | 272 ++---------------------------------- 7 files changed, 382 insertions(+), 492 deletions(-) create mode 100644 include/sound/pxa2xx-lib.h create mode 100644 sound/arm/pxa2xx-ac97-lib.c
include/sound/pxa2xx-lib.h new file +20 -0
@@ -0,0 +1,20 @@ +#ifndef PXA2XX_LIB_H +#define PXA2XX_LIB_H + +#include <linux/platform_device.h> +#include <sound/ac97_codec.h> + +extern unsigned short pxa2xx_ac97_read (struct snd_ac97 *ac97,unsigned short reg); +extern void pxa2xx_ac97_write (struct snd_ac97 *ac97,unsigned short reg,unsigned short val); + +extern bool pxa2xx_ac97_try_warm_reset (struct snd_ac97 *ac97); +extern bool pxa2xx_ac97_try_cold_reset (struct snd_ac97 *ac97); +extern void pxa2xx_ac97_finish_reset (struct snd_ac97 *ac97); + +extern int pxa2xx_ac97_hw_suspend (void ); +extern int pxa2xx_ac97_hw_resume (void ); + +extern int pxa2xx_ac97_hw_probe (struct platform_device *dev); +extern void pxa2xx_ac97_hw_remove (struct platform_device *dev); + +#endif
sound/arm/Kconfig +5 -0
@@ -32,11 +32,16 @@ config SND_PXA2XX_PCM tristate select SND_PCM +config SND_PXA2XX_LIB + tristate + select SND_AC97_CODEC + config SND_PXA2XX_AC97 tristate "AC97 driver for the Intel PXA2xx chip" depends on ARCH_PXA select SND_PXA2XX_PCM select SND_AC97_CODEC + select SND_PXA2XX_LIB help Say Y or M if you want to support any AC97 codec attached to the PXA2xx AC97 interface.
sound/arm/Makefile +3 -0
@@ -11,5 +11,8 @@ snd-aaci-objs := aaci.o devdma.o obj-$(CONFIG_SND_PXA2XX_PCM) += snd-pxa2xx-pcm.o snd-pxa2xx-pcm-objs := pxa2xx-pcm.o +obj-$(CONFIG_SND_PXA2XX_LIB) += snd-pxa2xx-lib.o +snd-pxa2xx-lib-objs := pxa2xx-ac97-lib.o + obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o snd-pxa2xx-ac97-objs := pxa2xx-ac97.o
sound/arm/pxa2xx-ac97-lib.c new file +325 -0
325 lines not on this page · raw message
sound/arm/pxa2xx-ac97.c +18 -229
310 lines not on this page · raw message
sound/soc/pxa/Kconfig +2 -0
@@ -13,6 +13,8 @@ config SND_PXA2XX_AC97 config SND_PXA2XX_SOC_AC97 tristate select AC97_BUS + select SND_ARM + select SND_PXA2XX_LIB select SND_SOC_AC97_BUS config SND_PXA2XX_SOC_I2S
sound/soc/pxa/pxa2xx-ac97.c +9 -263
319 lines not on this page · raw message
Signature · 1 line
1.5.6.5
PATCH 5/6 ALSA: pxa2xx-ac97-lib: support building for several CPUs
From: Dmitry Baryshkov <[email protected]>
Support building of pxa2xx-ac97-lib for several CPUs by making code run-time selected, not only compile-time.
[Fixed 3XX->3xx typos in ifdef checks -- broonie.]
--- sound/arm/pxa2xx-ac97-lib.c | 215 +++++++++++++++++++++++++++---------------- 1 files changed, 137 insertions(+), 78 deletions(-)
sound/arm/pxa2xx-ac97-lib.c +137 -78
@@ -30,9 +30,7 @@ static DEFINE_MUTEX(car_mutex);static DECLARE_WAIT_QUEUE_HEAD (gsr_wq);static volatile long gsr_bits;static struct clk *ac97_clk; -#ifdef CONFIG_PXA27xstatic struct clk *ac97conf_clk; -#endif /* * Beware PXA27x bugs:
@@ -52,14 +50,10 @@ unsigned short pxa2xx_ac97_read(struct snd_ac97 *ac97, unsigned short reg)mutex_lock (&car_mutex);/* set up primary or secondary codec space */ -#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) - reg_addr = (ac97->num &1 ) ? &SAC_REG_BASE : &PAC_REG_BASE ; -#else -if (reg ==AC97_GPIO_STATUS ) +if ((cpu_is_pxa21x () ||cpu_is_pxa25x ()) && reg ==AC97_GPIO_STATUS ) reg_addr = ac97->num ? &SMC_REG_BASE : &PMC_REG_BASE ;else reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE ; -#endif reg_addr += (reg >>1 );/* start read access across the ac97 link */
@@ -96,14 +90,10 @@ void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg,mutex_lock (&car_mutex);/* set up primary or secondary codec space */ -#if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) - reg_addr = (ac97->num &1 ) ? &SAC_REG_BASE : &PAC_REG_BASE ; -#else -if (reg ==AC97_GPIO_STATUS ) +if ((cpu_is_pxa21x () ||cpu_is_pxa25x ()) && reg ==AC97_GPIO_STATUS ) reg_addr = ac97->num ? &SMC_REG_BASE : &PMC_REG_BASE ;else reg_addr = ac97->num ? &SAC_REG_BASE : &PAC_REG_BASE ; -#endif reg_addr += (reg >>1 );GSR =GSR_CDONE |GSR_SDONE ;
@@ -118,14 +108,33 @@ void pxa2xx_ac97_write(struct snd_ac97 *ac97, unsigned short reg, }EXPORT_SYMBOL_GPL (pxa2xx_ac97_write); -bool pxa2xx_ac97_try_warm_reset (struct snd_ac97 *ac97) +#ifdef CONFIG_PXA25x +static inline void pxa_ac97_warm_pxa25x (void ) { -#ifdef CONFIG_PXA3xx -int timeout =100 ; -#endif gsr_bits =0 ; +GCR |=GCR_WARM_RST |GCR_PRIRDY_IEN |GCR_SECRDY_IEN ; +wait_event_timeout (gsr_wq, gsr_bits & (GSR_PCR |GSR_SCR ),1 ); +} + +static inline void pxa_ac97_cold_pxa25x (void ) +{ +GCR &=GCR_COLD_RST ;/* clear everything but nCRST */ +GCR &= ~GCR_COLD_RST ;/* then assert nCRST */ + + gsr_bits =0 ; + +GCR =GCR_COLD_RST ; +GCR |=GCR_CDONE_IE |GCR_SDONE_IE ; +wait_event_timeout (gsr_wq, gsr_bits & (GSR_PCR |GSR_SCR ),1 ); +} +#endif +#ifdef CONFIG_PXA27x +static inline void pxa_ac97_warm_pxa27x (void ) +{ + gsr_bits =0 ; +/* warm reset broken on Bulverde, so manually keep AC97 reset high */ pxa_gpio_mode (113 |GPIO_OUT |GPIO_DFLT_HIGH );
@@ -133,30 +142,39 @@ bool pxa2xx_ac97_try_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 ); +} + +static inline void pxa_ac97_cold_pxa27x (void ) +{ +GCR &=GCR_COLD_RST ;/* clear everything but nCRST */ +GCR &= ~GCR_COLD_RST ;/* then assert nCRST */ + + gsr_bits =0 ; + +/* PXA27x Developers Manual section 13.5.2.2.1 */ +clk_enable (ac97conf_clk); +udelay (5 ); +clk_disable (ac97conf_clk); +GCR =GCR_COLD_RST ; +udelay (50 ); +}#endif -if (!((GSR | gsr_bits) & (GSR_PCR |GSR_SCR ))) { -printk (KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n" , - __func__, gsr_bits); +#ifdef CONFIG_PXA3xx +static inline void pxa_ac97_warm_pxa3xx (void ) +{ +int timeout =100 ; -return false; - } + gsr_bits =0 ; -return true; +/* Can't use interrupts */ +GCR |=GCR_WARM_RST ; +while (!((GSR | gsr_bits) & (GSR_PCR |GSR_SCR )) && timeout--) +mdelay (1 ); } -EXPORT_SYMBOL_GPL (pxa2xx_ac97_try_warm_reset); -bool pxa2xx_ac97_try_cold_reset (struct snd_ac97 *ac97) +static inline void pxa_ac97_cold_pxa3xx (void ) { -#ifdef CONFIG_PXA3xxint timeout =1000 ;/* Hold CLKBPB for 100us */
@@ -164,31 +182,69 @@ bool pxa2xx_ac97_try_cold_reset(struct snd_ac97 *ac97)GCR =GCR_CLKBPB ;udelay (100 );GCR =0 ; -#endif GCR &=GCR_COLD_RST ;/* clear everything but nCRST */ GCR &= ~GCR_COLD_RST ;/* then assert nCRST */ gsr_bits =0 ; -#ifdef CONFIG_PXA27x -/* PXA27x Developers Manual section 13.5.2.2.1 */ -clk_enable (ac97conf_clk); -udelay (5 ); -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 ; -wait_event_timeout (gsr_wq, gsr_bits & (GSR_PCR |GSR_SCR ),1 ); +} +#endif + +bool pxa2xx_ac97_try_warm_reset (struct snd_ac97 *ac97) +{ +#ifdef CONFIG_PXA25x +if (cpu_is_pxa21x () ||cpu_is_pxa25x ()) +pxa_ac97_warm_pxa25x (); + else#endif +#ifdef CONFIG_PXA27x +if (cpu_is_pxa27x ()) +pxa_ac97_warm_pxa27x (); + else +#endif +#ifdef CONFIG_PXA3xx +if (cpu_is_pxa3xx ()) +pxa_ac97_warm_pxa3xx (); + else +#endif +BUG (); + +if (!((GSR | gsr_bits) & (GSR_PCR |GSR_SCR ))) { +printk (KERN_INFO "%s: warm reset timeout (GSR=%#lx)\n" , + __func__, gsr_bits); + +return false; + } + +return true; +} +EXPORT_SYMBOL_GPL (pxa2xx_ac97_try_warm_reset); + +bool pxa2xx_ac97_try_cold_reset (struct snd_ac97 *ac97) +{ +#ifdef CONFIG_PXA25x +if (cpu_is_pxa21x () ||cpu_is_pxa25x ()) +pxa_ac97_cold_pxa25x (); + else +#endif +#ifdef CONFIG_PXA27x +if (cpu_is_pxa27x ()) +pxa_ac97_cold_pxa27x (); + else +#endif +#ifdef CONFIG_PXA3xx +if (cpu_is_pxa3xx ()) +pxa_ac97_cold_pxa3xx (); + else +#endif +BUG ();if (!((GSR | gsr_bits) & (GSR_PCR |GSR_SCR ))) { printk(KERN_INFO "%s: cold reset timeout (GSR=%#lx)\n",
@@ -219,14 +275,14 @@ static irqreturn_t pxa2xx_ac97_irq(int irq, void *dev_id) gsr_bits |= status;wake_up (&gsr_wq); -#ifdef CONFIG_PXA27x/* Although we don't use those we still need to clear them since they tend to spuriously trigger when MMC is used (hardware bug? go figure)... */ -MISR =MISR_EOC ; -PISR =PISR_EOC ; -MCSR =MCSR_EOC ; -#endif +if (cpu_is_pxa27x ()) { +MISR =MISR_EOC ; +PISR =PISR_EOC ; +MCSR =MCSR_EOC ; + }return IRQ_HANDLED ; }
@@ -245,14 +301,16 @@ EXPORT_SYMBOL_GPL(pxa2xx_ac97_hw_suspend);int pxa2xx_ac97_hw_resume (void ) { -pxa_gpio_mode (GPIO31_SYNC_AC97_MD ); -pxa_gpio_mode (GPIO30_SDATA_OUT_AC97_MD ); -pxa_gpio_mode (GPIO28_BITCLK_AC97_MD ); -pxa_gpio_mode (GPIO29_SDATA_IN_AC97_MD ); -#ifdef CONFIG_PXA27x -/* Use GPIO 113 as AC97 Reset on Bulverde */ -pxa_gpio_mode (113 |GPIO_ALT_FN_2_OUT ); -#endif +if (cpu_is_pxa21x () ||cpu_is_pxa25x () ||cpu_is_pxa27x ()) { +pxa_gpio_mode (GPIO31_SYNC_AC97_MD ); +pxa_gpio_mode (GPIO30_SDATA_OUT_AC97_MD ); +pxa_gpio_mode (GPIO28_BITCLK_AC97_MD ); +pxa_gpio_mode (GPIO29_SDATA_IN_AC97_MD ); + } +if (cpu_is_pxa27x ()) { +/* Use GPIO 113 as AC97 Reset on Bulverde */ +pxa_gpio_mode (113 |GPIO_ALT_FN_2_OUT ); + }clk_enable (ac97_clk);return 0 ; }
@@ -267,20 +325,23 @@ int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev)if (ret <0 ) goto err; -pxa_gpio_mode (GPIO31_SYNC_AC97_MD ); -pxa_gpio_mode (GPIO30_SDATA_OUT_AC97_MD ); -pxa_gpio_mode (GPIO28_BITCLK_AC97_MD ); -pxa_gpio_mode (GPIO29_SDATA_IN_AC97_MD ); -#ifdef CONFIG_PXA27x -/* Use GPIO 113 as AC97 Reset on Bulverde */ -pxa_gpio_mode (113 |GPIO_ALT_FN_2_OUT ); - ac97conf_clk =clk_get (&dev->dev,"AC97CONFCLK" ); -if (IS_ERR (ac97conf_clk)) { - ret =PTR_ERR (ac97conf_clk); - ac97conf_clk =NULL ; - goto err_irq; +if (cpu_is_pxa21x () ||cpu_is_pxa25x () ||cpu_is_pxa27x ()) { +pxa_gpio_mode (GPIO31_SYNC_AC97_MD ); +pxa_gpio_mode (GPIO30_SDATA_OUT_AC97_MD ); +pxa_gpio_mode (GPIO28_BITCLK_AC97_MD ); +pxa_gpio_mode (GPIO29_SDATA_IN_AC97_MD ); + } + +if (cpu_is_pxa27x ()) { +/* Use GPIO 113 as AC97 Reset on Bulverde */ +pxa_gpio_mode (113 |GPIO_ALT_FN_2_OUT ); + ac97conf_clk =clk_get (&dev->dev,"AC97CONFCLK" ); +if (IS_ERR (ac97conf_clk)) { + ret =PTR_ERR (ac97conf_clk); + ac97conf_clk =NULL ; + goto err_irq; + } } -#endif ac97_clk =clk_get (&dev->dev,"AC97CLK" );if (IS_ERR (ac97_clk)) {
@@ -293,12 +354,10 @@ int __devinit pxa2xx_ac97_hw_probe(struct platform_device *dev) err_irq:GCR |=GCR_ACLINK_OFF ; -#ifdef CONFIG_PXA27xif (ac97conf_clk) {clk_put (ac97conf_clk); ac97conf_clk =NULL ; } -#endif free_irq (IRQ_AC97 ,NULL ); err:return ret;
@@ -309,10 +368,10 @@ void pxa2xx_ac97_hw_remove(struct platform_device *dev) {GCR |=GCR_ACLINK_OFF ;free_irq (IRQ_AC97 ,NULL ); -#ifdef CONFIG_PXA27x -clk_put (ac97conf_clk); - ac97conf_clk =NULL ; -#endif +if (ac97conf_clk) { +clk_put (ac97conf_clk); + ac97conf_clk =NULL ; + }clk_disable (ac97_clk);clk_put (ac97_clk); ac97_clk =NULL ;
Signature · 1 line
1.5.6.5
PATCH 6/6 ALSA: Separate common pxa2xx-pcm code
From: Dmitry Baryshkov <[email protected]>
ASoC and non-ASoC drivers for PCM DMA on PXA share lots of common code. Move it to pxa2xx-lib.
[Fixed some checkpatch warnings -- broonie]
--- include/sound/pxa2xx-lib.h | 25 ++++ sound/arm/Kconfig | 6 +- sound/arm/Makefile | 3 +- sound/arm/pxa2xx-pcm-lib.c | 278 ++++++++++++++++++++++++++++++++++++++++++++ sound/arm/pxa2xx-pcm.c | 252 ++-------------------------------------- sound/arm/pxa2xx-pcm.h | 13 +- sound/soc/pxa/Kconfig | 3 +- sound/soc/pxa/pxa2xx-i2s.c | 10 ++ sound/soc/pxa/pxa2xx-pcm.c | 261 +---------------------------------------- sound/soc/pxa/pxa2xx-pcm.h | 15 --- 10 files changed, 344 insertions(+), 522 deletions(-) create mode 100644 sound/arm/pxa2xx-pcm-lib.c
include/sound/pxa2xx-lib.h +25 -0
@@ -4,6 +4,31 @@#include <linux/platform_device.h> #include <sound/ac97_codec.h> +/* PCM */ + +struct pxa2xx_pcm_dma_params { +char *name;/* stream identifier */ +u32 dcmd;/* DMA descriptor dcmd field */ +volatile u32 *drcmr;/* the DMA request channel to use */ +u32 dev_addr;/* device physical address for DMA */ +}; + +extern int __pxa2xx_pcm_hw_params (struct snd_pcm_substream *substream, +struct snd_pcm_hw_params *params); +extern int __pxa2xx_pcm_hw_free (struct snd_pcm_substream *substream); +extern int pxa2xx_pcm_trigger (struct snd_pcm_substream *substream,int cmd); +extern snd_pcm_uframes_t pxa2xx_pcm_pointer (struct snd_pcm_substream *substream); +extern int __pxa2xx_pcm_prepare (struct snd_pcm_substream *substream); +extern void pxa2xx_pcm_dma_irq (int dma_ch,void *dev_id); +extern int __pxa2xx_pcm_open (struct snd_pcm_substream *substream); +extern int __pxa2xx_pcm_close (struct snd_pcm_substream *substream); +extern int pxa2xx_pcm_mmap (struct snd_pcm_substream *substream, +struct vm_area_struct *vma); +extern int pxa2xx_pcm_preallocate_dma_buffer (struct snd_pcm *pcm,int stream); +extern void pxa2xx_pcm_free_dma_buffers (struct snd_pcm *pcm); + +/* AC97 */ +extern unsigned short pxa2xx_ac97_read (struct snd_ac97 *ac97,unsigned short reg);extern void pxa2xx_ac97_write (struct snd_ac97 *ac97,unsigned short reg,unsigned short val);
sound/arm/Kconfig +5 -1
@@ -34,7 +34,10 @@ config SND_PXA2XX_PCM config SND_PXA2XX_LIB tristate - select SND_AC97_CODEC + select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97 + +config SND_PXA2XX_LIB_AC97 + bool config SND_PXA2XX_AC97 tristate "AC97 driver for the Intel PXA2xx chip"
@@ -42,6 +45,7 @@ config SND_PXA2XX_AC97 select SND_PXA2XX_PCM select SND_AC97_CODEC select SND_PXA2XX_LIB + select SND_PXA2XX_LIB_AC97 help Say Y or M if you want to support any AC97 codec attached to the PXA2xx AC97 interface.
sound/arm/Makefile +2 -1
@@ -12,7 +12,8 @@ obj-$(CONFIG_SND_PXA2XX_PCM) += snd-pxa2xx-pcm.o snd-pxa2xx-pcm-objs := pxa2xx-pcm.o obj-$(CONFIG_SND_PXA2XX_LIB) += snd-pxa2xx-lib.o -snd-pxa2xx-lib-objs := pxa2xx-ac97-lib.o +snd-pxa2xx-lib-y := pxa2xx-pcm-lib.o +snd-pxa2xx-lib-$(CONFIG_SND_PXA2XX_LIB_AC97) += pxa2xx-ac97-lib.o obj-$(CONFIG_SND_PXA2XX_AC97) += snd-pxa2xx-ac97.o snd-pxa2xx-ac97-objs := pxa2xx-ac97.o
sound/arm/pxa2xx-pcm-lib.c new file +278 -0
278 lines not on this page · raw message
sound/arm/pxa2xx-pcm.c +8 -244
310 lines not on this page · raw message
sound/arm/pxa2xx-pcm.h +7 -6
@@ -9,14 +9,15 @@* it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ +#include <asm/dma.h> -struct pxa2xx_pcm_dma_params { -char *name;/* stream identifier */ -u32 dcmd;/* DMA descriptor dcmd field */ -volatile u32 *drcmr;/* the DMA request channel to use */ -u32 dev_addr;/* device physical address for DMA */ +struct pxa2xx_runtime_data { +int dma_ch; +struct pxa2xx_pcm_dma_params *params; +pxa_dma_desc *dma_desc_array; +dma_addr_t dma_desc_array_phys; }; - +struct pxa2xx_pcm_client {struct pxa2xx_pcm_dma_params *playback_params;struct pxa2xx_pcm_dma_params *capture_params;
sound/soc/pxa/Kconfig +2 -1
@@ -1,6 +1,7 @@ config SND_PXA2XX_SOC tristate "SoC Audio for the Intel PXA2xx chip" depends on ARCH_PXA + select SND_PXA2XX_LIB help Say Y or M if you want to add support for codecs attached to the PXA2xx AC97, I2S or SSP interface. You will also need
@@ -14,7 +15,7 @@ config SND_PXA2XX_SOC_AC97 tristate select AC97_BUS select SND_ARM - select SND_PXA2XX_LIB + select SND_PXA2XX_LIB_AC97 select SND_SOC_AC97_BUS config SND_PXA2XX_SOC_I2S
sound/soc/pxa/pxa2xx-i2s.c +10 -0
@@ -21,6 +21,7 @@#include <sound/pcm.h> #include <sound/initval.h> #include <sound/soc.h> +#include <sound/pxa2xx-lib.h> #include <mach/hardware.h> #include <mach/pxa-regs.h>
@@ -30,6 +31,15 @@#include "pxa2xx-pcm.h" #include "pxa2xx-i2s.h" +struct pxa2xx_gpio { +u32 sys; +u32 rx; +u32 tx; +u32 clk; +u32 frm; +}; + +struct pxa_i2s_port {u32 sadiv;u32 sacr0;
sound/soc/pxa/pxa2xx-pcm.c +7 -254
308 lines not on this page · raw message
sound/soc/pxa/pxa2xx-pcm.h +0 -15
@@ -13,21 +13,6 @@#ifndef _PXA2XX_PCM_H#define _PXA2XX_PCM_H -struct pxa2xx_pcm_dma_params { -char *name;/* stream identifier */ -u32 dcmd;/* DMA descriptor dcmd field */ -volatile u32 *drcmr;/* the DMA request channel to use */ -u32 dev_addr;/* device physical address for DMA */ -}; - -struct pxa2xx_gpio { -u32 sys; -u32 rx; -u32 tx; -u32 clk; -u32 frm; -}; -/* platform data */ extern struct snd_soc_platform pxa2xx_soc_platform;
Signature · 1 line
1.5.6.5
At Mon, 15 Sep 2008 14:24:19 +0100,
Quoted 8 lines · Mark Brown
The following changes since commit
3e3b5651631629482e0e1541f8c4298a435bb100:
Mark Brown (1):
ALSA: ASoC: Use codec digital mute when stopping playbackare available in the git repository at:
git://opensource.wolfsonmicro.com/linux-2.6-asocfor-tiwai
Thanks, pulled in, pushed out.
Takashi