From c21098ea5608c98b5ada1b7ec82522c7c53869eb Mon Sep 17 00:00:00 2001 From: Andrew Victor Date: Tue, 8 Apr 2008 21:33:07 +0100 Subject: [ARM] 4912/2: [AT91] Endrelia audio driver must use GPIO interface The SoC audio driver for the Endrelia ETI_B1 board should not access the PIO controller directly, but must rather use the AT91 GPIO interface. (This is updated version of patch with removed trailing whitespace) Signed-off-by: Andrew Victor Signed-off-by: Russell King --- sound/soc/at91/eti_b1_wm8731.c | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/at91/eti_b1_wm8731.c b/sound/soc/at91/eti_b1_wm8731.c index ad3ad9d662f8..1347dcf3f80b 100644 --- a/sound/soc/at91/eti_b1_wm8731.c +++ b/sound/soc/at91/eti_b1_wm8731.c @@ -33,8 +33,7 @@ #include #include -#include -#include +#include #include #include "../codecs/wm8731.h" @@ -47,13 +46,6 @@ #define DBG(x...) #endif -#define AT91_PIO_TF1 (1 << (AT91_PIN_PB6 - PIN_BASE) % 32) -#define AT91_PIO_TK1 (1 << (AT91_PIN_PB7 - PIN_BASE) % 32) -#define AT91_PIO_TD1 (1 << (AT91_PIN_PB8 - PIN_BASE) % 32) -#define AT91_PIO_RD1 (1 << (AT91_PIN_PB9 - PIN_BASE) % 32) -#define AT91_PIO_RK1 (1 << (AT91_PIN_PB10 - PIN_BASE) % 32) -#define AT91_PIO_RF1 (1 << (AT91_PIN_PB11 - PIN_BASE) % 32) - static struct clk *pck1_clk; static struct clk *pllb_clk; @@ -276,7 +268,6 @@ static struct platform_device *eti_b1_snd_device; static int __init eti_b1_init(void) { int ret; - u32 ssc_pio_lines; struct at91_ssc_periph *ssc = eti_b1_dai.cpu_dai->private_data; if (!request_mem_region(AT91RM9200_BASE_SSC1, SZ_16K, "soc-audio")) { @@ -310,19 +301,12 @@ static int __init eti_b1_init(void) goto fail_io_unmap; } - ssc_pio_lines = AT91_PIO_TF1 | AT91_PIO_TK1 | AT91_PIO_TD1 - | AT91_PIO_RD1 /* | AT91_PIO_RK1 */ | AT91_PIO_RF1; - - /* Reset all PIO registers and assign lines to peripheral A */ - at91_sys_write(AT91_PIOB + PIO_PDR, ssc_pio_lines); - at91_sys_write(AT91_PIOB + PIO_ODR, ssc_pio_lines); - at91_sys_write(AT91_PIOB + PIO_IFDR, ssc_pio_lines); - at91_sys_write(AT91_PIOB + PIO_CODR, ssc_pio_lines); - at91_sys_write(AT91_PIOB + PIO_IDR, ssc_pio_lines); - at91_sys_write(AT91_PIOB + PIO_MDDR, ssc_pio_lines); - at91_sys_write(AT91_PIOB + PIO_PUDR, ssc_pio_lines); - at91_sys_write(AT91_PIOB + PIO_ASR, ssc_pio_lines); - at91_sys_write(AT91_PIOB + PIO_OWDR, ssc_pio_lines); + at91_set_A_periph(AT91_PIN_PB6, 0); /* TF1 */ + at91_set_A_periph(AT91_PIN_PB7, 0); /* TK1 */ + at91_set_A_periph(AT91_PIN_PB8, 0); /* TD1 */ + at91_set_A_periph(AT91_PIN_PB9, 0); /* RD1 */ +/* at91_set_A_periph(AT91_PIN_PB10, 0);*/ /* RK1 */ + at91_set_A_periph(AT91_PIN_PB11, 0); /* RF1 */ /* * Set PCK1 parent to PLLB and its rate to 12 Mhz. -- cgit v1.2.2 From 942de47bfee24143ecbf75b981b32143bd414529 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 4 Mar 2008 11:14:24 +0100 Subject: [ARM] 4834/3: Convert ASoC pxa2xx-ac97 driver to use the clock API Signed-off-by: Mark Brown Acked-by: Takashi Iwai Acked-by: eric miao Signed-off-by: Russell King --- sound/soc/pxa/pxa2xx-ac97.c | 49 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 11 deletions(-) (limited to 'sound/soc') diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 815c15336255..711b916e58a6 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -35,6 +36,10 @@ static DEFINE_MUTEX(car_mutex); static DECLARE_WAIT_QUEUE_HEAD(gsr_wq); static volatile long gsr_bits; +static struct clk *ac97_clk; +#ifdef CONFIG_PXA27x +static struct clk *ac97conf_clk; +#endif /* * Beware PXA27x bugs: @@ -159,9 +164,9 @@ static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97) gsr_bits = 0; #ifdef CONFIG_PXA27x /* PXA27x Developers Manual section 13.5.2.2.1 */ - pxa_set_cken(CKEN_AC97CONF, 1); + clk_enable(ac97conf_clk); udelay(5); - pxa_set_cken(CKEN_AC97CONF, 0); + clk_disable(ac97conf_clk); GCR = GCR_COLD_RST; udelay(50); #else @@ -255,7 +260,7 @@ static int pxa2xx_ac97_suspend(struct platform_device *pdev, struct snd_soc_cpu_dai *dai) { GCR |= GCR_ACLINK_OFF; - pxa_set_cken(CKEN_AC97, 0); + clk_disable(ac97_clk); return 0; } @@ -270,7 +275,7 @@ static int pxa2xx_ac97_resume(struct platform_device *pdev, /* Use GPIO 113 as AC97 Reset on Bulverde */ pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT); #endif - pxa_set_cken(CKEN_AC97, 1); + clk_enable(ac97_clk); return 0; } @@ -294,16 +299,32 @@ static int pxa2xx_ac97_probe(struct platform_device *pdev) #ifdef CONFIG_PXA27x /* Use GPIO 113 as AC97 Reset on Bulverde */ pxa_gpio_mode(113 | GPIO_ALT_FN_2_OUT); + + ac97conf_clk = clk_get(&pdev->dev, "AC97CONFCLK"); + if (IS_ERR(ac97conf_clk)) { + ret = PTR_ERR(ac97conf_clk); + ac97conf_clk = NULL; + goto err_irq; + } #endif - pxa_set_cken(CKEN_AC97, 1); + ac97_clk = clk_get(&pdev->dev, "AC97CLK"); + if (IS_ERR(ac97_clk)) { + ret = PTR_ERR(ac97_clk); + ac97_clk = NULL; + goto err_irq; + } return 0; - err: - if (CKEN & (1 << CKEN_AC97)) { - GCR |= GCR_ACLINK_OFF; - free_irq(IRQ_AC97, NULL); - pxa_set_cken(CKEN_AC97, 0); + err_irq: + GCR |= GCR_ACLINK_OFF; +#ifdef CONFIG_PXA27x + if (ac97conf_clk) { + clk_put(ac97conf_clk); + ac97conf_clk = NULL; } +#endif + free_irq(IRQ_AC97, NULL); + err: return ret; } @@ -311,7 +332,13 @@ static void pxa2xx_ac97_remove(struct platform_device *pdev) { GCR |= GCR_ACLINK_OFF; free_irq(IRQ_AC97, NULL); - pxa_set_cken(CKEN_AC97, 0); +#ifdef CONFIG_PXA27x + clk_put(ac97conf_clk); + ac97conf_clk = NULL; +#endif + clk_disable(ac97_clk); + clk_put(ac97_clk); + ac97_clk = NULL; } static int pxa2xx_ac97_hw_params(struct snd_pcm_substream *substream, -- cgit v1.2.2 From a683b14df8f4320d0ef6cac93a6d9806173bf339 Mon Sep 17 00:00:00 2001 From: eric miao Date: Mon, 3 Mar 2008 09:44:25 +0800 Subject: [ARM] pxa: separate GPIOs and their mode definitions to pxa2xx-gpio.h two reasons: 1. GPIO namings and their mode definitions are conceptually not part of the PXA register definitions 2. this is actually a temporary move in the transition of PXA2xx to use MFP-alike APIs (as what PXA3xx is now doing), so that legacy code will still work and new code can be added in step by step Signed-off-by: eric miao Signed-off-by: Russell King --- sound/soc/pxa/pxa2xx-ac97.c | 1 + sound/soc/pxa/pxa2xx-i2s.c | 1 + 2 files changed, 2 insertions(+) (limited to 'sound/soc') diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 711b916e58a6..fe9c297ae6f2 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "pxa2xx-pcm.h" diff --git a/sound/soc/pxa/pxa2xx-i2s.c b/sound/soc/pxa/pxa2xx-i2s.c index 692b90002489..425071030970 100644 --- a/sound/soc/pxa/pxa2xx-i2s.c +++ b/sound/soc/pxa/pxa2xx-i2s.c @@ -25,6 +25,7 @@ #include #include +#include #include #include "pxa2xx-pcm.h" -- cgit v1.2.2 From b907ef688ddb6d73fc1c83b6fbcd62f5c2c2a14f Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 15 Apr 2008 16:12:44 +0100 Subject: [ARM] 4977/2: soc - pxa2xx-ac97 - Add missing clk_enable() Add missing clk_enable() Signed-off-by: Mark Brown Acked-by: eric miao Signed-off-by: Russell King --- sound/soc/pxa/pxa2xx-ac97.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound/soc') diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index fe9c297ae6f2..e17379998802 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -314,6 +314,7 @@ static int pxa2xx_ac97_probe(struct platform_device *pdev) ac97_clk = NULL; goto err_irq; } + clk_enable(ac97_clk); return 0; err_irq: -- cgit v1.2.2