[alsa-devel] [PATCH 0/6] 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(-)
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").
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org --- sound/soc/samsung/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 79ae6a7c93ff..ea0fa9971a0c 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -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
On 11/19/2016 03:48 PM, Krzysztof Kozlowski wrote:
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").
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org
Reviewed-by: Sylwester Nawrocki s.nawrocki@samsung.com
The 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
From f8cbab42d98298ab9c4878dc9105d350b0b902ff Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski krzk@kernel.org 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").
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/samsung/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 79ae6a7c93ff..ea0fa9971a0c 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -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
MACH_SMDKC100, MACH_SMDKV210 and MACH_SMDKC110 are no longer supported so drop the dead code.
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org --- sound/soc/samsung/smdk_wm8580.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/sound/soc/samsung/smdk_wm8580.c b/sound/soc/samsung/smdk_wm8580.c index 548bfd993788..59fd3b8fd414 100644 --- a/sound/soc/samsung/smdk_wm8580.c +++ b/sound/soc/samsung/smdk_wm8580.c @@ -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)
On 11/19/2016 03:48 PM, Krzysztof Kozlowski wrote: [...]
@@ -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';
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.
On 11/19/2016 04:42 PM, Lars-Peter Clausen wrote:
On 11/19/2016 03:48 PM, Krzysztof Kozlowski wrote: [...]
@@ -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';
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.
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.
On 11/19/2016 04:45 PM, Lars-Peter Clausen wrote:
On 11/19/2016 04:42 PM, Lars-Peter Clausen wrote:
On 11/19/2016 03:48 PM, Krzysztof Kozlowski wrote: [...]
@@ -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';
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.
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().
On Sat, Nov 19, 2016 at 04:48:26PM +0100, Lars-Peter Clausen wrote:
On 11/19/2016 04:45 PM, Lars-Peter Clausen wrote:
On 11/19/2016 04:42 PM, Lars-Peter Clausen wrote:
On 11/19/2016 03:48 PM, Krzysztof Kozlowski wrote: [...]
@@ -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';
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.
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.
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().
Ahh, indeed. The third DAI link (SEC_PLAYBACK) could be removed now.
Thanks for feedback, Krzysztof
The 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.
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org
---
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(-)
diff --git a/sound/soc/samsung/smdk_wm8580.c b/sound/soc/samsung/smdk_wm8580.c index 59fd3b8fd414..3bf33387dfeb 100644 --- a/sound/soc/samsung/smdk_wm8580.c +++ b/sound/soc/samsung/smdk_wm8580.c @@ -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)
The I2S sound drivers for SmartQ board and WM8580 codec can be compile tested to increase build coverage.
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org --- sound/soc/samsung/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index ea0fa9971a0c..426ef1c7b265 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -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
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
From 95f5609d223d661419061bd6231da01a317c30d9 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski krzk@kernel.org 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.
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/samsung/Kconfig | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 48dcd3dd9ec7..a6cc6ca93fa7 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -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
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.
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org --- sound/soc/samsung/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index 426ef1c7b265..a6cc6ca93fa7 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -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
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
From a41dcdeee5d87cf3852b857cc3a8507832ec8b42 Mon Sep 17 00:00:00 2001
From: Krzysztof Kozlowski krzk@kernel.org 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.
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/samsung/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sound/soc/samsung/Kconfig b/sound/soc/samsung/Kconfig index ea0fa9971a0c..48dcd3dd9ec7 100644 --- a/sound/soc/samsung/Kconfig +++ b/sound/soc/samsung/Kconfig @@ -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
Remove non-existing MACH symbols from S5PV210 defconfig.
Signed-off-by: Krzysztof Kozlowski krzk@kernel.org --- arch/arm/configs/s5pv210_defconfig | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/arch/arm/configs/s5pv210_defconfig b/arch/arm/configs/s5pv210_defconfig index fa989902236d..c51f0f02012b 100644 --- a/arch/arm/configs/s5pv210_defconfig +++ b/arch/arm/configs/s5pv210_defconfig @@ -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
participants (4)
-
Krzysztof Kozlowski
-
Lars-Peter Clausen
-
Mark Brown
-
Sylwester Nawrocki