ASoC: samsung: Minor cleanup for old machines
Subsystems (5)
Krzysztof Kozlowski
maintainercover ASoC: samsung: Minor cleanup for old machines
Hi,
Few patches removing dead code (machines not supported).
The third patch ([RFT 3/6] ASoC: samsung: smdk_wm8580: Remove machine specific quirks) requires testing. I hope I understood the code correctly.
The last ARM patch is independent. I will take it through samsung-soc tree. I put it here for reference.
Best regards,
Krzysztof
Krzysztof Kozlowski (6):
ASoC: samsung: Remove non-existing MACH dependencies
ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types
usage
ASoC: samsung: smdk_wm8580: Remove machine specific quirks
ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580
ASoC: samsung: Enable COMPILE_TEST for entire Samsung ASoc
ARM: s5pv210_defconfig: Remove old MACHs
arch/arm/configs/s5pv210_defconfig | 4 ---- sound/soc/samsung/Kconfig | 8 +++++--- sound/soc/samsung/smdk_wm8580.c | 17 ++--------------- 3 files changed, 7 insertions(+), 22 deletions(-)
Signature · 1 line
2.7.4
Krzysztof Kozlowski
maintainerPATCH 1/6 ASoC: samsung: Remove non-existing MACH dependencies
MACH_SMDKC100 was removed in commit b8529ec1c1b0 ("ARM: S5PC100: no more support S5PC100 SoC"). MACH_SMDKV210 and MACH_SMDKC110 in commit 28c8331d386 ("ARM: S5PV210: Remove support for board files").
--- sound/soc/samsung/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/samsung/Kconfig +1 -1
@@ -49,7 +49,7 @@ config SND_SOC_SAMSUNG_JIVE_WM8750 config SND_SOC_SAMSUNG_SMDK_WM8580 tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDKV210 || MACH_SMDKC110 + depends on MACH_SMDK6410 depends on I2C select SND_SOC_WM8580 select SND_SAMSUNG_I2S
Signature · 1 line
2.7.4
Re: [PATCH 1/6] ASoC: samsung: Remove non-existing MACH dependencies
Quoted 5 lines · Krzysztof Kozlowski
MACH_SMDKC100was removed in commitb8529ec1c1b0("ARM: S5PC100: no more support S5PC100 SoC").MACH_SMDKV210andMACH_SMDKC110in commit28c8331d386("ARM: S5PV210: Remove support for board files").Signed-off-by Krzysztof Kozlowski <[email protected]>
Mark Brown
maintainerApplied "ASoC: samsung: Remove non-existing MACH dependencies" to the asoc tree
In reply to Krzysztof KozlowskiThe patch
ASoC: samsung: Remove non-existing MACH dependencies
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
f8cbab42d98298ab9c4878dc9105d350b0b902ffMon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <[email protected]>
Date: Sun, 20 Nov 2016 21:24:51 +0200
Subject: [PATCH] ASoC: samsung: Remove non-existing MACH dependencies
MACH_SMDKC100 was removed in commit b8529ec1c1b0 ("ARM: S5PC100: no more support S5PC100 SoC"). MACH_SMDKV210 and MACH_SMDKC110 in commit 28c8331d386 ("ARM: S5PV210: Remove support for board files").
--- sound/soc/samsung/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/samsung/Kconfig +1 -1
@@ -49,7 +49,7 @@ config SND_SOC_SAMSUNG_JIVE_WM8750 config SND_SOC_SAMSUNG_SMDK_WM8580 tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on MACH_SMDK6410 || MACH_SMDKC100 || MACH_SMDKV210 || MACH_SMDKC110 + depends on MACH_SMDK6410 depends on I2C select SND_SOC_WM8580 select SND_SAMSUNG_I2S
Signature · 1 line
2.10.2
Krzysztof Kozlowski
maintainerPATCH 2/6 ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
In reply to Krzysztof KozlowskiMACH_SMDKC100, MACH_SMDKV210 and MACH_SMDKC110 are no longer supported so drop the dead code.
--- sound/soc/samsung/smdk_wm8580.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
sound/soc/samsung/smdk_wm8580.c +4 -11
@@ -14,8 +14,6 @@#include <sound/soc.h> #include <sound/pcm_params.h> -#include <asm/mach-types.h> -#include "../codecs/wm8580.h" #include "i2s.h"
@@ -206,15 +204,10 @@ static int __init smdk_audio_init(void)int ret;char *str; -if (machine_is_smdkc100 () - ||machine_is_smdkv210 () ||machine_is_smdkc110 ()) { - smdk.num_links =3 ; - }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' ; - } + 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 );if (!smdk_snd_device)
Signature · 1 line
2.7.4
Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
On 11/19/2016 03:48 PM, Krzysztof Kozlowski wrote:
[...]
Quoted 7 lines
sound/soc/samsung/smdk_wm8580.c +0
-3@@ -206,15 +204,10 @@ static int __init smdk_audio_init(void)int ret;char *str; -if (machine_is_smdkc100 () - ||machine_is_smdkv210 () ||machine_is_smdkc110 ()) { - smdk.num_links =3 ;
sound/soc/samsung/smdk_wm8580.c static int __init smdk_audio_init(void) · line 210
Quoted 10 lines
sound/soc/samsung/smdk_wm8580.c +4
-6- }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' ; - } + 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' ;
This could be further simplified by just updating the initial cpu_dai_name string in the dai_link struct.
Especially considering that the cpu_dai_name is a string literal and the ARM kernel now has rodata write protection enabled by default, so modifying it will crash the kernel.
Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
Quoted 23 lines · Lars-Peter Clausen
On 11/19/2016 03:48 PM, Krzysztof Kozlowski wrote:
[...]Quoted 7 lines
sound/soc/samsung/smdk_wm8580.c +0
-3@@ -206,15 +204,10 @@ static int __init smdk_audio_init(void)int ret;char *str; -if (machine_is_smdkc100 () - ||machine_is_smdkv210 () ||machine_is_smdkc110 ()) { - smdk.num_links =3 ;sound/soc/samsung/smdk_wm8580.c static int __init smdk_audio_init(void) · line 210
Quoted 10 lines
sound/soc/samsung/smdk_wm8580.c +4
-6- }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' ; - } + 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' ;This could be further simplified by just updating the initial
cpu_dai_namestring in thedai_linkstruct.
Quoted 3 lines
Especially considering that the
cpu_dai_nameis a string literal and the ARM kernel now has rodata write protection enabled by default, so modifying it will crash the kernel.
Spoke too soon, you fix this up in the next patch. But I'd just squash that change into this patch. I think it is pretty safe to assume that it is correct.
Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
Quoted 24 lines · Lars-Peter Clausen
Quoted 23 lines · Lars-Peter Clausen
On 11/19/2016 03:48 PM, Krzysztof Kozlowski wrote:
[...]Quoted 7 lines
sound/soc/samsung/smdk_wm8580.c +0
-3@@ -206,15 +204,10 @@ static int __init smdk_audio_init(void)int ret;char *str; -if (machine_is_smdkc100 () - ||machine_is_smdkv210 () ||machine_is_smdkc110 ()) { - smdk.num_links =3 ;sound/soc/samsung/smdk_wm8580.c static int __init smdk_audio_init(void) · line 210
Quoted 10 lines
sound/soc/samsung/smdk_wm8580.c +4
-6- }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' ; - } + 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' ;This could be further simplified by just updating the initial
cpu_dai_namestring in thedai_linkstruct.
Quoted 7 lines
Quoted 3 lines
Especially considering that the
cpu_dai_nameis a string literal and the ARM kernel now has rodata write protection enabled by default, so modifying it will crash the kernel.Spoke too soon, you fix this up in the next patch. But I'd just squash that change into this patch. I think it is pretty safe to assume that it is correct.
And another thing. Since num_links is always 2 now the last entry from the smdk_dai array can be removed and num_links can be initialized using ARRAY_SIZE().
Krzysztof Kozlowski
maintainerRe: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
Quoted 25 lines · Lars-Peter Clausen
Quoted 24 lines · Lars-Peter Clausen
Quoted 23 lines · Lars-Peter Clausen
On 11/19/2016 03:48 PM, Krzysztof Kozlowski wrote:
[...]Quoted 7 lines
sound/soc/samsung/smdk_wm8580.c +0
-3@@ -206,15 +204,10 @@ static int __init smdk_audio_init(void)int ret;char *str; -if (machine_is_smdkc100 () - ||machine_is_smdkv210 () ||machine_is_smdkc110 ()) { - smdk.num_links =3 ;sound/soc/samsung/smdk_wm8580.c static int __init smdk_audio_init(void) · line 210
Quoted 10 lines
sound/soc/samsung/smdk_wm8580.c +4
-6- }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' ; - } + 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' ;This could be further simplified by just updating the initial
cpu_dai_namestring in thedai_linkstruct.
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Especially considering that the
cpu_dai_nameis a string literal and the ARM kernel now has rodata write protection enabled by default, so modifying it will crash the kernel.Spoke too soon, you fix this up in the next patch. But I'd just squash that change into this patch. I think it is pretty safe to assume that it is correct.
Yes, I wanted to split trivial change from something which would be nice to test (I did not test it). However you're right that logically this is the same change.
Quoted 3 lines
And another thing. Since
num_linksis always 2 now the last entry from thesmdk_daiarray can be removed andnum_linkscan be initialized usingARRAY_SIZE().
Ahh, indeed. The third DAI link (SEC_PLAYBACK) could be removed now.
Thanks for feedback,
Krzysztof
Krzysztof Kozlowski
maintainerPATCH 3/6 ASoC: samsung: smdk_wm8580: Remove machine specific quirks
In reply to Krzysztof KozlowskiThe driver no longer differentiates between machines (S3C24xx machines are not supported by it) so there is no need to override I2S device id in cpu_dai_name.
---
Not tested. The driver did not override .platform_name which looks suspicious to me. However I did not want to add changes which could have some visible impact on output code.
--- sound/soc/samsung/smdk_wm8580.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
sound/soc/samsung/smdk_wm8580.c +2 -8
@@ -155,7 +155,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.0", + .cpu_dai_name = "samsung-i2s.2", .codec_dai_name = "wm8580-hifi-playback", .platform_name = "samsung-i2s.0", .codec_name = "wm8580.0-001b",
@@ -165,7 +165,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.0", + .cpu_dai_name = "samsung-i2s.2", .codec_dai_name = "wm8580-hifi-capture", .platform_name = "samsung-i2s.0", .codec_name = "wm8580.0-001b",
@@ -202,12 +202,6 @@ static struct platform_device *smdk_snd_device;static int __init smdk_audio_init (void ) {int ret; -char *str; - - 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 );if (!smdk_snd_device)
Signature · 1 line
2.7.4
Krzysztof Kozlowski
maintainerPATCH 4/6 ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580
In reply to Krzysztof KozlowskiThe I2S sound drivers for SmartQ board and WM8580 codec can be compile tested to increase build coverage.
--- sound/soc/samsung/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/samsung/Kconfig +3 -2
@@ -49,7 +49,7 @@ config SND_SOC_SAMSUNG_JIVE_WM8750 config SND_SOC_SAMSUNG_SMDK_WM8580 tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on MACH_SMDK6410 + depends on MACH_SMDK6410 || COMPILE_TEST depends on I2C select SND_SOC_WM8580 select SND_SAMSUNG_I2S
@@ -109,7 +109,8 @@ config SND_SOC_SAMSUNG_RX1950_UDA1380 config SND_SOC_SMARTQ tristate "SoC I2S Audio support for SmartQ board" - depends on MACH_SMARTQ && I2C + depends on MACH_SMARTQ || COMPILE_TEST + depends on I2C select SND_SAMSUNG_I2S select SND_SOC_WM8750
Signature · 1 line
2.7.4
Mark Brown
maintainerApplied "ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580" to the asoc tree
The patch
ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
95f5609d223d661419061bd6231da01a317c30d9Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <[email protected]>
Date: Sun, 20 Nov 2016 21:24:53 +0200
Subject: [PATCH] ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580
The I2S sound drivers for SmartQ board and WM8580 codec can be compile tested to increase build coverage.
--- sound/soc/samsung/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
sound/soc/samsung/Kconfig +3 -2
@@ -50,7 +50,7 @@ config SND_SOC_SAMSUNG_JIVE_WM8750 config SND_SOC_SAMSUNG_SMDK_WM8580 tristate "SoC I2S Audio support for WM8580 on SMDK" - depends on MACH_SMDK6410 + depends on MACH_SMDK6410 || COMPILE_TEST depends on I2C select SND_SOC_WM8580 select SND_SAMSUNG_I2S
@@ -110,7 +110,8 @@ config SND_SOC_SAMSUNG_RX1950_UDA1380 config SND_SOC_SMARTQ tristate "SoC I2S Audio support for SmartQ board" - depends on MACH_SMARTQ && I2C + depends on MACH_SMARTQ || COMPILE_TEST + depends on I2C select SND_SAMSUNG_I2S select SND_SOC_WM8750
Signature · 1 line
2.10.2
Krzysztof Kozlowski
maintainerPATCH 5/6 ASoC: samsung: Enable COMPILE_TEST for entire Samsung ASoc
In reply to Krzysztof KozlowskiInstead of build time, Samsung ASoC drivers have rather runtime dependency on Exynos or other Samsung platforms. For building they require Common Clock Framework. If it is provided they could be compile tested to increase build coverage.
--- sound/soc/samsung/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/samsung/Kconfig +2 -1
@@ -1,6 +1,7 @@ menuconfig SND_SOC_SAMSUNG tristate "ASoC support for Samsung" - depends on (PLAT_SAMSUNG || ARCH_EXYNOS) + depends on PLAT_SAMSUNG || ARCH_EXYNOS || COMPILE_TEST + depends on COMMON_CLK select SND_SOC_GENERIC_DMAENGINE_PCM ---help--- Say Y or M if you want to add support for codecs attached to
Signature · 1 line
2.7.4
Mark Brown
maintainerApplied "ASoC: samsung: Enable COMPILE_TEST for entire Samsung ASoc" to the asoc tree
The patch
ASoC: samsung: Enable COMPILE_TEST for entire Samsung ASoc
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Quoted 1 line
From
a41dcdeee5d87cf3852b857cc3a8507832ec8b42Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski <[email protected]>
Date: Sun, 20 Nov 2016 21:24:54 +0200
Subject: [PATCH] ASoC: samsung: Enable COMPILE_TEST for entire Samsung ASoc
Instead of build time, Samsung ASoC drivers have rather runtime dependency on Exynos or other Samsung platforms. For building they require Common Clock Framework. If it is provided they could be compile tested to increase build coverage.
--- sound/soc/samsung/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/samsung/Kconfig +2 -1
@@ -1,6 +1,7 @@ menuconfig SND_SOC_SAMSUNG tristate "ASoC support for Samsung" - depends on (PLAT_SAMSUNG || ARCH_EXYNOS) + depends on PLAT_SAMSUNG || ARCH_EXYNOS || COMPILE_TEST + depends on COMMON_CLK select SND_SOC_GENERIC_DMAENGINE_PCM ---help--- Say Y or M if you want to add support for codecs attached to
Signature · 1 line
2.10.2
Krzysztof Kozlowski
maintainerPATCH 6/6 ARM: s5pv210_defconfig: Remove old MACHs
In reply to Krzysztof KozlowskiRemove non-existing MACH symbols from S5PV210 defconfig.
--- arch/arm/configs/s5pv210_defconfig | 4 ---- 1 file changed, 4 deletions(-)
arch/arm/configs/s5pv210_defconfig +0 -4
@@ -9,10 +9,6 @@ CONFIG_ARCH_S5PV210=y CONFIG_S3C_LOWLEVEL_UART_PORT=1 CONFIG_S3C_DEV_FB=y CONFIG_S5PV210_SETUP_FB_24BPP=y -CONFIG_MACH_AQUILA=y -CONFIG_MACH_GONI=y -CONFIG_MACH_SMDKC110=y -CONFIG_MACH_SMDKV210=y CONFIG_NO_HZ=y CONFIG_HIGH_RES_TIMERS=y CONFIG_VMSPLIT_2G=y
Signature · 1 line
2.7.4