ALSA SOC driver for s3c24xx with uda134x
PATCH RESEND 1/2 ALSA SOC driver for s3c24xx with uda134x
This patch adds a sound card definition for one of these UDAs connected to the s3c24xx. It is *heavily* based on the one made by Zoltan Devai but:
* the driver has the possibility to specify the pins used by codec via platform data so it can work on SMDK2410, SMDK2440 or any custom design.
* it tries to guess the right clock source and divider so it is not tied to a particular crystal used.
Generated on 20081113 against f7e1798a78a30bae1cf3ebc3e1b6f7c1bac57756
--- include/sound/s3c24xx_uda134x.h | 14 ++ sound/soc/s3c24xx/Kconfig | 5 + sound/soc/s3c24xx/Makefile | 2 + sound/soc/s3c24xx/s3c24xx_uda134x.c | 347 +++++++++++++++++++++++++++++++++++ 4 files changed, 368 insertions(+), 0 deletions(-)
include/sound/s3c24xx_uda134x.h new file +14 -0
@@ -0,0 +1,14 @@ +#ifndef _S3C24XX_UDA134X_H_ +#define _S3C24XX_UDA134X_H_ 1 + +#include <sound/uda134x.h> + +struct s3c24xx_uda134x_platform_data { +int l3_clk; +int l3_mode; +int l3_data; +void (*power) (int ); +int model; +}; + +#endif
sound/soc/s3c24xx/Kconfig +5 -0
@@ -44,3 +44,8 @@ config SND_S3C24XX_SOC_LN2440SBC_ALC650 Say Y if you want to add support for SoC audio on ln2440sbc with the ALC650. +config SND_S3C24XX_SOC_S3C24XX_UDA134X + tristate "SoC I2S Audio support UDA134X wired to a S3C24XX" + depends on SND_S3C24XX_SOC + select SND_S3C24XX_SOC_I2S + select SND_SOC_UDA134X
sound/soc/s3c24xx/Makefile +2 -0
@@ -13,7 +13,9 @@ obj-$(CONFIG_SND_S3C2412_SOC_I2S) += snd-soc-s3c2412-i2s.o snd-soc-neo1973-wm8753-objs := neo1973_wm8753.o snd-soc-smdk2443-wm9710-objs := smdk2443_wm9710.o snd-soc-ln2440sbc-alc650-objs := ln2440sbc_alc650.o +snd-soc-s3c24xx-uda134x-objs := s3c24xx_uda134x.o obj-$(CONFIG_SND_S3C24XX_SOC_NEO1973_WM8753) += snd-soc-neo1973-wm8753.o obj-$(CONFIG_SND_S3C24XX_SOC_SMDK2443_WM9710) += snd-soc-smdk2443-wm9710.o obj-$(CONFIG_SND_S3C24XX_SOC_LN2440SBC_ALC650) += snd-soc-ln2440sbc-alc650.o +obj-$(CONFIG_SND_S3C24XX_SOC_S3C24XX_UDA134X) += snd-soc-s3c24xx-uda134x.o
sound/soc/s3c24xx/s3c24xx_uda134x.c new file +347 -0
347 lines not on this page · raw message
--
1.4.4.4
On Thu, Nov 13, 2008 at 04:41:56PM +0100, Christian Pellegrin wrote:
This looks OK from an ASoC point of view but one small issue...
sound/soc/s3c24xx/s3c24xx_uda134x.c line 295
Quoted 11 lines
sound/soc/s3c24xx/s3c24xx_uda134x.c new file +11
-0+ s3c24xx_uda134x_l3_pins = pdev->dev.platform_data; +if (s3c24xx_uda134x_l3_pins ==NULL ) { +printk (KERN_ERR "S3C24XX_UDA134X SoC Audio: " +"unable to find platform data\n" ); +return -ENODEV ; + } + s3c24xx_uda134x.power = s3c24xx_uda134x_l3_pins->power; + s3c24xx_uda134x.model = s3c24xx_uda134x_l3_pins->model; +gpio_direction_output (s3c24xx_uda134x_l3_pins->l3_data,0 ); +gpio_direction_output (s3c24xx_uda134x_l3_pins->l3_clk,0 ); +gpio_direction_output (s3c24xx_uda134x_l3_pins->l3_mode,0 );
You should request the GPIOs with gpio_request() before using them (and then free them with gpio_free() when the driver exits).
Quoted 9 lines · Mark Brown
sound/soc/s3c24xx/s3c24xx_uda134x.c line 295
Quoted 3 lines · Christian Pellegrin
sound/soc/s3c24xx/s3c24xx_uda134x.c new file +3
-0+gpio_direction_output (s3c24xx_uda134x_l3_pins->l3_data,0 ); +gpio_direction_output (s3c24xx_uda134x_l3_pins->l3_clk,0 ); +gpio_direction_output (s3c24xx_uda134x_l3_pins->l3_mode,0 );You should request the GPIOs with
gpio_request()before using them (and then free them withgpio_free()when the driver exits).
ack
Signature · 5 lines
Christian Pellegrin, see http://www.evolware.org/chri/ "Real Programmers don't play tennis, or any other sport which requires you to change clothes. Mountain climbing is OK, and Real Programmers wear their climbing boots to work in case a mountain should suddenly spring up in the middle of the computer room."