ASoC: Samsung: Enable latest SoCs
Subsystems (3)
cover ASoC: Samsung: Enable latest SoCs
From: Jassi Brar <[email protected]>
Hi,
Next coming are patches that enable I2S and AC97 support on
Samsung's latest SoC based SMDKs. The platform side support has been submitted to the LAML.
Thanks,
Jassi
PATCH 1/10 ASoC: Samsung: Set default rclk source rate
From: Jassi Brar <[email protected]>
Since the rclk_srcrate is cleared upon startup, it should be initialized upon second and later 'open' calls to the device with same root-clock source. The bug is otherwise visible in Codec-Slave mode.
--- sound/soc/samsung/i2s.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/samsung/i2s.c +2 -0
@@ -525,6 +525,8 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,clk_disable (i2s->op_clk);clk_put (i2s->op_clk); }else { + i2s->rclk_srcrate = +clk_get_rate (i2s->op_clk);return 0 ; } }
Signature · 1 line
1.6.2.5
PATCH 2/10 ASoC: Samsung: I2S: Flush FIFO after stop
In reply to [email protected]From: Jassi Brar <[email protected]>
Flush the FIFO while stopping the channel rather than starting. This saves time during stream start and keeps the FIFOs clean when the channel is idling.
--- sound/soc/samsung/i2s.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
sound/soc/samsung/i2s.c +5 -5
@@ -843,11 +843,6 @@ static int i2s_trigger(struct snd_pcm_substream *substream,case SNDRV_PCM_TRIGGER_PAUSE_RELEASE :local_irq_save (flags); -if (capture) -i2s_fifo (i2s,FIC_RXFLUSH ); -else -i2s_fifo (i2s,FIC_TXFLUSH ); -if (config_setup (i2s)) {local_irq_restore (flags);return -EINVAL ;
@@ -870,6 +865,11 @@ static int i2s_trigger(struct snd_pcm_substream *substream,else i2s_txctrl (i2s,0 ); +if (capture) +i2s_fifo (i2s,FIC_RXFLUSH ); +else +i2s_fifo (i2s,FIC_TXFLUSH ); +local_irq_restore (flags);break ; }
Signature · 1 line
1.6.2.5
PATCH 3/10 ASoC: SMDK_WM8580: Make I2S0 as default dai
In reply to [email protected]From: Jassi Brar <[email protected]>
Since most newer SMDKs have I2S0 routed to the WM8580's Primary DAI, future changes can be minimized if the default CPU DAIs are set to 0, rather than 2.
--- sound/soc/samsung/smdk_wm8580.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-)
sound/soc/samsung/smdk_wm8580.c +7 -7
@@ -212,7 +212,7 @@ static struct snd_soc_dai_link smdk_dai[] = { [PRI_PLAYBACK] = { /* Primary Playback i/f */ .name = "WM8580 PAIF RX", .stream_name = "Playback", - .cpu_dai_name = "samsung-i2s.2", + .cpu_dai_name = "samsung-i2s.0", .codec_dai_name = "wm8580-hifi-playback", .platform_name = "samsung-audio", .codec_name = "wm8580-codec.0-001b",
@@ -222,7 +222,7 @@ static struct snd_soc_dai_link smdk_dai[] = { [PRI_CAPTURE] = { /* Primary Capture i/f */ .name = "WM8580 PAIF TX", .stream_name = "Capture", - .cpu_dai_name = "samsung-i2s.2", + .cpu_dai_name = "samsung-i2s.0", .codec_dai_name = "wm8580-hifi-capture", .platform_name = "samsung-audio", .codec_name = "wm8580-codec.0-001b",
@@ -256,14 +256,14 @@ static int __init smdk_audio_init(void)if (machine_is_smdkc100 ()) { smdk.num_links =3 ; -/* S5PC100 has I2S0 as v5 */ - str = (char *)smdk_dai[PRI_PLAYBACK ].cpu_dai_name; - str[strlen (str) -1 ] ='0' ; - str = (char *)smdk_dai[PRI_CAPTURE ].cpu_dai_name; - str[strlen (str) -1 ] ='0' ;/* Secondary is at offset SAMSUNG_I2S_SECOFF from Primary */ str = (char *)smdk_dai[SEC_PLAYBACK ].cpu_dai_name; str[strlen (str) -1 ] ='0' +SAMSUNG_I2S_SECOFF ; + }else if (machine_is_smdk6410 ()) { + str = (char *)smdk_dai[PRI_PLAYBACK ].cpu_dai_name; + str[strlen (str) -1 ] ='2' ; + str = (char *)smdk_dai[PRI_CAPTURE ].cpu_dai_name; + str[strlen (str) -1 ] ='2' ; } smdk_snd_device =platform_device_alloc ("soc-audio" ,-1 );
Signature · 1 line
1.6.2.5
PATCH 4/10 ASoC: SMDK6440: Enable I2S device
In reply to [email protected]From: Jassi Brar <[email protected]>
--- sound/soc/samsung/Kconfig | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/samsung/Kconfig +2 -2
@@ -1,6 +1,6 @@ config ASOC_SAMSUNG tristate "ASoC support for Samsung" - depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 + depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5P64X0 select S3C64XX_DMA if ARCH_S3C64XX select S3C2410_DMA if ARCH_S3C2410 help
@@ -62,7 +62,7 @@ config ASOC_SAMSUNG_JIVE_WM8750 config ASOC_SAMSUNG_SMDK_WM8580 tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100) + depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440) select SND_SOC_WM8580 select SND_SAMSUNG_I2S help
Signature · 1 line
1.6.2.5
PATCH 5/10 ASoC: SMDK6450: Enable I2S device
In reply to [email protected]From: Jassi Brar <[email protected]>
--- sound/soc/samsung/Kconfig | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/samsung/Kconfig +1 -1
@@ -62,7 +62,7 @@ config ASOC_SAMSUNG_JIVE_WM8750 config ASOC_SAMSUNG_SMDK_WM8580 tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440) + depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440 || MACH_SMDK6450) select SND_SOC_WM8580 select SND_SAMSUNG_I2S help
Signature · 1 line
1.6.2.5
Re: [PATCH 05/10] ASoC: SMDK6450: Enable I2S device
sound/soc/samsung/Kconfig config ASOC_SAMSUNG_JIVE_WM8750 · line 65
Quoted 4 lines · On Mon, Dec 20, 2010 at 11:05:51AM +0900, [email protected]…
config
ASOC_SAMSUNG_SMDK_WM8580sound/soc/samsung/Kconfig +1
-1tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440) + depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440 || MACH_SMDK6450)
Might be worth adding a HAS_SMDK_WM8580 or something that the machines can select otherwise this line couldget very long.
PATCH 6/10 ASoC: SMDK6442: Enable I2S device
In reply to [email protected]From: Jassi Brar <[email protected]>
--- sound/soc/samsung/Kconfig | 4 ++-- sound/soc/samsung/smdk_wm8580.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/samsung/Kconfig +2 -2
@@ -1,6 +1,6 @@ config ASOC_SAMSUNG tristate "ASoC support for Samsung" - depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5P64X0 + depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5P64X0 || ARCH_S5P6442 select S3C64XX_DMA if ARCH_S3C64XX select S3C2410_DMA if ARCH_S3C2410 help
@@ -62,7 +62,7 @@ config ASOC_SAMSUNG_JIVE_WM8750 config ASOC_SAMSUNG_SMDK_WM8580 tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440 || MACH_SMDK6450) + depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440 || MACH_SMDK6450 || MACH_SMDK6442) select SND_SOC_WM8580 select SND_SAMSUNG_I2S help
sound/soc/samsung/smdk_wm8580.c +1 -1
@@ -254,7 +254,7 @@ static int __init smdk_audio_init(void)int ret;char *str; -if (machine_is_smdkc100 ()) { +if (machine_is_smdkc100 () ||machine_is_smdk6442 ()) { smdk.num_links =3 ;/* Secondary is at offset SAMSUNG_I2S_SECOFF from Primary */ str = (char *)smdk_dai[SEC_PLAYBACK ].cpu_dai_name;
Signature · 1 line
1.6.2.5
PATCH 7/10 ASoC: SMDKV210: Enable I2S device
In reply to [email protected]From: Jassi Brar <[email protected]>
--- sound/soc/samsung/Kconfig | 2 +- sound/soc/samsung/smdk_wm8580.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
sound/soc/samsung/Kconfig +1 -1
@@ -62,7 +62,7 @@ config ASOC_SAMSUNG_JIVE_WM8750 config ASOC_SAMSUNG_SMDK_WM8580 tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440 || MACH_SMDK6450 || MACH_SMDK6442) + depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440 || MACH_SMDK6450 || MACH_SMDK6442 || MACH_SMDKV210) select SND_SOC_WM8580 select SND_SAMSUNG_I2S help
sound/soc/samsung/smdk_wm8580.c +2 -1
@@ -254,7 +254,8 @@ static int __init smdk_audio_init(void)int ret;char *str; -if (machine_is_smdkc100 () ||machine_is_smdk6442 ()) { +if (machine_is_smdkc100 () ||machine_is_smdk6442 () + ||machine_is_smdkv210 ()) { smdk.num_links =3 ;/* Secondary is at offset SAMSUNG_I2S_SECOFF from Primary */ str = (char *)smdk_dai[SEC_PLAYBACK ].cpu_dai_name;
Signature · 1 line
1.6.2.5
PATCH 8/10 ASoC: SMDKC110: Enable I2S device
In reply to [email protected]From: Jassi Brar <[email protected]>
--- sound/soc/samsung/Kconfig | 2 +- sound/soc/samsung/smdk_wm8580.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
sound/soc/samsung/Kconfig +1 -1
@@ -62,7 +62,7 @@ config ASOC_SAMSUNG_JIVE_WM8750 config ASOC_SAMSUNG_SMDK_WM8580 tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440 || MACH_SMDK6450 || MACH_SMDK6442 || MACH_SMDKV210) + depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDK6440 || MACH_SMDK6450 || MACH_SMDK6442 || MACH_SMDKV210 || MACH_SMDKC110) select SND_SOC_WM8580 select SND_SAMSUNG_I2S help
sound/soc/samsung/smdk_wm8580.c +1 -1
@@ -255,7 +255,7 @@ static int __init smdk_audio_init(void)char *str;if (machine_is_smdkc100 () ||machine_is_smdk6442 () - ||machine_is_smdkv210 ()) { + ||machine_is_smdkv210 () ||machine_is_smdkc110 ()) { smdk.num_links =3 ;/* Secondary is at offset SAMSUNG_I2S_SECOFF from Primary */ str = (char *)smdk_dai[SEC_PLAYBACK ].cpu_dai_name;
Signature · 1 line
1.6.2.5
PATCH 9/10 ASoC: SMDKV310: Enable AC97 device
In reply to [email protected]From: Jassi Brar <[email protected]>
Enable AC97 audio device on SMDKV310/C210.
--- sound/soc/samsung/Kconfig | 4 ++-- sound/soc/samsung/smdk_wm9713.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-)
sound/soc/samsung/Kconfig +2 -2
@@ -1,6 +1,6 @@ config ASOC_SAMSUNG tristate "ASoC support for Samsung" - depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5P64X0 || ARCH_S5P6442 + depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5PC100 || ARCH_S5PV210 || ARCH_S5P64X0 || ARCH_S5P6442 || ARCH_S5PV310 select S3C64XX_DMA if ARCH_S3C64XX select S3C2410_DMA if ARCH_S3C2410 help
@@ -134,7 +134,7 @@ config ASOC_SAMSUNG_RX1950_UDA1380 config ASOC_SAMSUNG_SMDK_WM9713 tristate "SoC AC97 Audio support for SMDK with WM9713" - depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDKV210 || MACH_SMDKC110) + depends on ASOC_SAMSUNG && (MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDKV210 || MACH_SMDKC110 || MACH_SMDKV310 || MACH_SMDKC210) select SND_SOC_WM9713 select SND_SAMSUNG_AC97 help
sound/soc/samsung/smdk_wm9713.c +1 -0
@@ -27,6 +27,7 @@ static struct snd_soc_card smdk;* SMDKC100: Set CFG6 1-3 On, CFG7 1 On * SMDKC110: Set CFGB10 1-2 Off, CFGB12 1-3 On * SMDKV210: Set CFGB10 1-2 Off, CFGB12 1-3 On +* SMDKV310: Set CFG2 1-2 Off, CFG4 All On, CFG7 All Off, CFG8 1-On */ /*
Signature · 1 line
1.6.2.5
PATCH 10/10 ASoC: SMDKV310: Add I2S support
In reply to [email protected]From: Jassi Brar <[email protected]>
Add ASoC machine driver for SMDKV310/C210 boards that have a WM8994 attached to I2S-0.
--- sound/soc/samsung/Kconfig | 8 ++ sound/soc/samsung/Makefile | 2 + sound/soc/samsung/smdk_wm8994.c | 180 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 190 insertions(+), 0 deletions(-) create mode 100644 sound/soc/samsung/smdk_wm8994.c
sound/soc/samsung/Kconfig +8 -0
@@ -68,6 +68,14 @@ config ASOC_SAMSUNG_SMDK_WM8580 help Say Y if you want to add support for SoC audio on the SMDKs. +config ASOC_SAMSUNG_SMDK_WM8994 + tristate "SoC I2S Audio support for WM8994 on SMDK" + depends on ASOC_SAMSUNG && (MACH_SMDKV310 || MACH_SMDKC210) + select SND_SOC_WM8994 + select SND_SAMSUNG_I2S + help + Say Y if you want to add support for SoC audio on the SMDKs. + config ASOC_SAMSUNG_SMDK2443_WM9710 tristate "SoC AC97 Audio support for SMDK2443 - WM9710" depends on ASOC_SAMSUNG && MACH_SMDK2443
sound/soc/samsung/Makefile +2 -0
@@ -30,6 +30,7 @@ snd-soc-s3c24xx-simtec-tlv320aic23-objs := s3c24xx_simtec_tlv320aic23.o snd-soc-h1940-uda1380-objs := h1940_uda1380.o snd-soc-rx1950-uda1380-objs := rx1950_uda1380.o snd-soc-smdk-wm8580-objs := smdk_wm8580.o +snd-soc-smdk-wm8994-objs := smdk_wm8994.o snd-soc-smdk-wm9713-objs := smdk_wm9713.o snd-soc-s3c64xx-smartq-wm8987-objs := smartq_wm8987.o snd-soc-goni-wm8994-objs := goni_wm8994.o
@@ -47,6 +48,7 @@ obj-$(CONFIG_ASOC_SAMSUNG_SIMTEC_TLV320AIC23) += snd-soc-s3c24xx-simtec-tlv320ai obj-$(CONFIG_ASOC_SAMSUNG_H1940_UDA1380) += snd-soc-h1940-uda1380.o obj-$(CONFIG_ASOC_SAMSUNG_RX1950_UDA1380) += snd-soc-rx1950-uda1380.o obj-$(CONFIG_ASOC_SAMSUNG_SMDK_WM8580) += snd-soc-smdk-wm8580.o +obj-$(CONFIG_ASOC_SAMSUNG_SMDK_WM8994) += snd-soc-smdk-wm8994.o obj-$(CONFIG_ASOC_SAMSUNG_SMDK_WM9713) += snd-soc-smdk-wm9713.o obj-$(CONFIG_ASOC_SMARTQ) += snd-soc-s3c64xx-smartq-wm8987.o obj-$(CONFIG_ASOC_SAMSUNG_SMDK_SPDIF) += snd-soc-smdk-spdif.o
sound/soc/samsung/smdk_wm8994.c new file +176 -0
176 lines not on this page · raw message
Signature · 1 line
1.6.2.5
Re: [PATCH 10/10] ASoC: SMDKV310: Add I2S support
Quoted 9 lines · On Mon, Dec 20, 2010 at 11:05:57AM +0900, [email protected]…
sound/soc/samsung/smdk_wm8994.c new file +9
-0+ ret =snd_soc_dai_set_pll (codec_dai,WM8994_FLL1 ,WM8994_FLL_SRC_MCLK1 , +SMDK_WM8994_FREQ , pll_out); +if (ret <0 ) +return ret; + + ret =snd_soc_dai_set_sysclk (codec_dai,WM8994_SYSCLK_FLL1 , + pll_out,SND_SOC_CLOCK_IN ); +if (ret <0 ) +return ret;
...
sound/soc/samsung/smdk_wm8994.c line 82
Quoted 3 lines
sound/soc/samsung/smdk_wm8994.c new file +3
-0+static struct snd_soc_ops smdk_ops = { + .hw_params = smdk_hw_params, +};
This means that the FLL won't ever get powered off when it goes idle. While it's not going to be such an issue on a board like this as it is a reference design it's likely people will lift the code into places where it does matter so it'd be good to get such support into the driver.
sound/soc/samsung/smdk_wm8994.c line 91
Quoted 3 lines
sound/soc/samsung/smdk_wm8994.c new file +3
-0+/* HeadPhone */ +snd_soc_dapm_enable_pin (dapm,"HPOUT1R" ); +snd_soc_dapm_enable_pin (dapm,"HPOUT1L" );
There's no need to explicitly enable pins that aren't being actively managed - the default is for all pins to be enabled.
Review
Quoted 2 lines
(quoted diff) +2
-0+ snd_soc_dapm_sync(dapm); +
Core should be doing this automatically for you these days, on the other hand this does no harm.
Quoted 7 lines · On Mon, 2010-12-20 at 11:04 +0900, [email protected] wrote:
From: Jassi Brar <[email protected]>
Hi,
Next coming are patches that enable I2S and AC97 support on
Samsung's latest SoC based SMDKs. The platform side support has been submitted to the LAML.
All
Signature · 3 lines
Freelance Developer, SlimLogic Ltd ASoC and Voltage Regulator Maintainer. http://www.slimlogic.co.uk
Quoted 3 lines · On Mon, Dec 20, 2010 at 11:04:27AM +0900, [email protected]…
Next coming are patches that enable I2S and AC97 support on
Samsung's latest SoC based SMDKs. The platform side support has been submitted to the LAML.
All applied, thanks. I did have a couple of minor comments but nothing to stop the merge.
Quoted 8 lines · Mark Brown
Quoted 3 lines · On Mon, Dec 20, 2010 at 11:04:27AM +0900, [email protected]…
Next coming are patches that enable I2S and AC97 support on Samsung's latest SoC based SMDKs. The platform side support has been submitted to the LAML.
All applied, thanks. I did have a couple of minor comments but nothing to stop the merge.
Thanks.
Though I would have happily resubmitted after modifying as per your comments. Only I read your comments and this mail just now when I reached office :)
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel