From eae17754ab1ffc88190ebcbd33b6bec79e6e559a Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Mon, 13 Apr 2009 11:48:03 +0100 Subject: [ARM] pxa: merge AC97 platform data structures Currently there are two possible platform datas for the PXA AC97 driver: one supported by the generic AC97 driver only which provides callbacks to allow board-specific configuration at stream startup and teardown, and another for pxa2xx-ac97-lib which allows configuration of the reset GPIO for PXA2xx CPUs. Obviously this won't actually work when using the generic AC97 driver since the drivers will attempt to parse the platform data in both formats. Fix this by merging the two structures. Signed-off-by: Mark Brown Acked-by: Robert Jarzmik Cc: Marek Vasut Signed-off-by: Eric Miao --- arch/arm/mach-pxa/include/mach/audio.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/arm') diff --git a/arch/arm/mach-pxa/include/mach/audio.h b/arch/arm/mach-pxa/include/mach/audio.h index f82f96dd105..16eb02552d5 100644 --- a/arch/arm/mach-pxa/include/mach/audio.h +++ b/arch/arm/mach-pxa/include/mach/audio.h @@ -4,12 +4,22 @@ #include #include +/* + * @reset_gpio: AC97 reset gpio (normally gpio113 or gpio95) + * a -1 value means no gpio will be used for reset + + * reset_gpio should only be specified for pxa27x CPUs where a silicon + * bug prevents correct operation of the reset line. If not specified, + * the default behaviour on these CPUs is to consider gpio 113 as the + * AC97 reset line, which is the default on most boards. + */ typedef struct { int (*startup)(struct snd_pcm_substream *, void *); void (*shutdown)(struct snd_pcm_substream *, void *); void (*suspend)(void *); void (*resume)(void *); void *priv; + int reset_gpio; } pxa2xx_audio_ops_t; extern void pxa_set_ac97_info(pxa2xx_audio_ops_t *ops); -- cgit v1.2.3 From cc8d2730ad6fe79699cedd9cccfe632570830c3c Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Mon, 13 Apr 2009 16:07:55 +0200 Subject: [ARM] pxa/mioa701: use GPIO95 as AC97 reset line MioA701 board's GPIO95 is the AC97 line. The other GPIO113 is not connected to the sound chip, but to the GSM chip as a wakeup line. It happens that when the pxa2xx_ac97 driver reconfigures the gpio as an "out gpio" for AC97 reset (bug workaround), it hangs the GSM chip. As AC97 platform data now enables to specify the AC97 reset line, use it. Signed-off-by: Robert Jarzmik Signed-off-by: Eric Miao --- arch/arm/mach-pxa/mioa701.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 9203b069b35..ff8052ce0a0 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c @@ -742,6 +742,10 @@ struct i2c_pxa_platform_data i2c_pdata = { .fast_mode = 1, }; +static pxa2xx_audio_ops_t mioa701_ac97_info = { + .reset_gpio = 95, +}; + /* * Mio global */ @@ -815,7 +819,7 @@ static void __init mioa701_machine_init(void) pxa_set_keypad_info(&mioa701_keypad_info); wm97xx_bat_set_pdata(&mioa701_battery_data); pxa_set_udc_info(&mioa701_udc_info); - pxa_set_ac97_info(NULL); + pxa_set_ac97_info(&mioa701_ac97_info); pm_power_off = mioa701_poweroff; arm_pm_restart = mioa701_restart; platform_add_devices(devices, ARRAY_SIZE(devices)); -- cgit v1.2.3 From e91fb9137dd235ab959d7675d0e4104974dad5eb Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Fri, 17 Apr 2009 11:37:35 +0200 Subject: [ARM] pxa/palm27x: General fix for Palm27x aSoC driver Firstly, this patch makes the palm27x asoc driver a little more sane. Also, since all affected devices use GPIO95 as AC97_nRESET, this patch sets that properly. Affected are PalmT5, TX and LifeDrive. Signed-off-by: Marek Vasut Signed-off-by: Eric Miao --- arch/arm/mach-pxa/include/mach/palmasoc.h | 7 +------ arch/arm/mach-pxa/palmld.c | 18 +++++++++++++++--- arch/arm/mach-pxa/palmt5.c | 18 +++++++++++++++--- arch/arm/mach-pxa/palmtx.c | 23 ++++++++++++++++++++++- 4 files changed, 53 insertions(+), 13 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-pxa/include/mach/palmasoc.h b/arch/arm/mach-pxa/include/mach/palmasoc.h index 6c4b1f7de20..58afb30d529 100644 --- a/arch/arm/mach-pxa/include/mach/palmasoc.h +++ b/arch/arm/mach-pxa/include/mach/palmasoc.h @@ -1,13 +1,8 @@ #ifndef _INCLUDE_PALMASOC_H_ #define _INCLUDE_PALMASOC_H_ + struct palm27x_asoc_info { int jack_gpio; }; -#ifdef CONFIG_SND_PXA2XX_SOC_PALM27X -void __init palm27x_asoc_set_pdata(struct palm27x_asoc_info *data); -#else -static inline void palm27x_asoc_set_pdata(struct palm27x_asoc_info *data) {} -#endif - #endif diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index ecf5910e39d..1cec1806f00 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c @@ -477,10 +477,22 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = { /****************************************************************************** * aSoC audio ******************************************************************************/ -static struct palm27x_asoc_info palm27x_asoc_pdata = { +static struct palm27x_asoc_info palmld_asoc_pdata = { .jack_gpio = GPIO_NR_PALMLD_EARPHONE_DETECT, }; +static pxa2xx_audio_ops_t palmld_ac97_pdata = { + .reset_gpio = 95, +}; + +static struct platform_device palmld_asoc = { + .name = "palm27x-asoc", + .id = -1, + .dev = { + .platform_data = &palmld_asoc_pdata, + }, +}; + /****************************************************************************** * Framebuffer ******************************************************************************/ @@ -544,6 +556,7 @@ static struct platform_device *devices[] __initdata = { &palmld_backlight, &palmld_leds, &power_supply, + &palmld_asoc, }; static struct map_desc palmld_io_desc[] __initdata = { @@ -573,11 +586,10 @@ static void __init palmld_init(void) set_pxa_fb_info(&palmld_lcd_screen); pxa_set_mci_info(&palmld_mci_platform_data); - pxa_set_ac97_info(NULL); + pxa_set_ac97_info(&palmld_ac97_pdata); pxa_set_ficp_info(&palmld_ficp_platform_data); pxa_set_keypad_info(&palmld_keypad_platform_data); wm97xx_bat_set_pdata(&wm97xx_batt_pdata); - palm27x_asoc_set_pdata(&palm27x_asoc_pdata); platform_add_devices(devices, ARRAY_SIZE(devices)); } diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c index d7f81068c61..30662363907 100644 --- a/arch/arm/mach-pxa/palmt5.c +++ b/arch/arm/mach-pxa/palmt5.c @@ -420,10 +420,22 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = { /****************************************************************************** * aSoC audio ******************************************************************************/ -static struct palm27x_asoc_info palm27x_asoc_pdata = { +static struct palm27x_asoc_info palmt5_asoc_pdata = { .jack_gpio = GPIO_NR_PALMT5_EARPHONE_DETECT, }; +static pxa2xx_audio_ops_t palmt5_ac97_pdata = { + .reset_gpio = 95, +}; + +static struct platform_device palmt5_asoc = { + .name = "palm27x-asoc", + .id = -1, + .dev = { + .platform_data = &palmt5_asoc_pdata, + }, +}; + /****************************************************************************** * Framebuffer ******************************************************************************/ @@ -486,6 +498,7 @@ static struct platform_device *devices[] __initdata = { #endif &palmt5_backlight, &power_supply, + &palmt5_asoc, }; /* setup udc GPIOs initial state */ @@ -504,12 +517,11 @@ static void __init palmt5_init(void) set_pxa_fb_info(&palmt5_lcd_screen); pxa_set_mci_info(&palmt5_mci_platform_data); palmt5_udc_init(); + pxa_set_ac97_info(&palmt5_ac97_pdata); pxa_set_udc_info(&palmt5_udc_info); - pxa_set_ac97_info(NULL); pxa_set_ficp_info(&palmt5_ficp_platform_data); pxa_set_keypad_info(&palmt5_keypad_platform_data); wm97xx_bat_set_pdata(&wm97xx_batt_pdata); - palm27x_asoc_set_pdata(&palm27x_asoc_pdata); platform_add_devices(devices, ARRAY_SIZE(devices)); } diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index 14393d0ad8b..e2d44b1a8a9 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "generic.h" #include "devices.h" @@ -433,6 +434,25 @@ static struct wm97xx_batt_info wm97xx_batt_pdata = { .batt_name = "main-batt", }; +/****************************************************************************** + * aSoC audio + ******************************************************************************/ +static struct palm27x_asoc_info palmtx_asoc_pdata = { + .jack_gpio = GPIO_NR_PALMTX_EARPHONE_DETECT, +}; + +static pxa2xx_audio_ops_t palmtx_ac97_pdata = { + .reset_gpio = 95, +}; + +static struct platform_device palmtx_asoc = { + .name = "palm27x-asoc", + .id = -1, + .dev = { + .platform_data = &palmtx_asoc_pdata, + }, +}; + /****************************************************************************** * Framebuffer ******************************************************************************/ @@ -495,6 +515,7 @@ static struct platform_device *devices[] __initdata = { #endif &palmtx_backlight, &power_supply, + &palmtx_asoc, }; static struct map_desc palmtx_io_desc[] __initdata = { @@ -529,8 +550,8 @@ static void __init palmtx_init(void) set_pxa_fb_info(&palmtx_lcd_screen); pxa_set_mci_info(&palmtx_mci_platform_data); palmtx_udc_init(); + pxa_set_ac97_info(&palmtx_ac97_pdata); pxa_set_udc_info(&palmtx_udc_info); - pxa_set_ac97_info(NULL); pxa_set_ficp_info(&palmtx_ficp_platform_data); pxa_set_keypad_info(&palmtx_keypad_platform_data); wm97xx_bat_set_pdata(&wm97xx_batt_pdata); -- cgit v1.2.3 From a48dc30da44769ea3f3562c18f54878a9a3e78a1 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Wed, 15 Apr 2009 13:56:08 +0200 Subject: [ARM] pxa/pcm990: start external GPIOs immediately after built-in ones As a result of an off-by-1 error pcm990 leaves one unused GPIO number between built-in GPIOs and the pca9536 extender. Fix it. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Eric Miao --- arch/arm/mach-pxa/pcm990-baseboard.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/arm') diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index 6112740b4ae..6c12b5a3132 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c @@ -377,7 +377,7 @@ struct pxacamera_platform_data pcm990_pxacamera_platform_data = { #include static struct pca953x_platform_data pca9536_data = { - .gpio_base = NR_BUILTIN_GPIO + 1, + .gpio_base = NR_BUILTIN_GPIO, }; static int gpio_bus_switch; @@ -405,9 +405,9 @@ static unsigned long pcm990_camera_query_bus_param(struct soc_camera_link *link) int ret; if (!gpio_bus_switch) { - ret = gpio_request(NR_BUILTIN_GPIO + 1, "camera"); + ret = gpio_request(NR_BUILTIN_GPIO, "camera"); if (!ret) { - gpio_bus_switch = NR_BUILTIN_GPIO + 1; + gpio_bus_switch = NR_BUILTIN_GPIO; gpio_direction_output(gpio_bus_switch, 0); } else gpio_bus_switch = -EINVAL; -- cgit v1.2.3