Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1526006 > unrolled thread

[PATCH 0/6] ASoC: samsung: Minor cleanup for old machines

Started byKrzysztof Kozlowski <krzk@kernel.org>
First post2016-11-19 15:50 +0100
Last post2016-11-22 18:30 +0100
Articles 9 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/6] ASoC: samsung: Minor cleanup for old machines Krzysztof Kozlowski <krzk@kernel.org> - 2016-11-19 15:50 +0100
    [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage Krzysztof Kozlowski <krzk@kernel.org> - 2016-11-19 15:50 +0100
      Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and  drop mach-types usage Lars-Peter Clausen <lars@metafoo.de> - 2016-11-19 16:50 +0100
        Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and  drop mach-types usage Lars-Peter Clausen <lars@metafoo.de> - 2016-11-19 16:50 +0100
          Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and  drop mach-types usage Lars-Peter Clausen <lars@metafoo.de> - 2016-11-19 16:50 +0100
            Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and  drop mach-types usage Krzysztof Kozlowski <krzk@kernel.org> - 2016-11-19 19:10 +0100
    [RFT 3/6] ASoC: samsung: smdk_wm8580: Remove machine specific quirks Krzysztof Kozlowski <krzk@kernel.org> - 2016-11-19 15:50 +0100
    [PATCH 4/6] ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580 Krzysztof Kozlowski <krzk@kernel.org> - 2016-11-19 15:50 +0100
      Applied "ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580" to the asoc tree Mark Brown <broonie@kernel.org> - 2016-11-22 18:30 +0100

#1526006 — [PATCH 0/6] ASoC: samsung: Minor cleanup for old machines

FromKrzysztof Kozlowski <krzk@kernel.org>
Date2016-11-19 15:50 +0100
Subject[PATCH 0/6] ASoC: samsung: Minor cleanup for old machines
Message-ID<sFf7P-6c4-3@gated-at.bofh.it>
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(-)

-- 
2.7.4

[toc] | [next] | [standalone]


#1526007 — [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage

FromKrzysztof Kozlowski <krzk@kernel.org>
Date2016-11-19 15:50 +0100
Subject[PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
Message-ID<sFf7Q-6c4-19@gated-at.bofh.it>
In reply to#1526006
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)
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1526016 — Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage

FromLars-Peter Clausen <lars@metafoo.de>
Date2016-11-19 16:50 +0100
SubjectRe: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
Message-ID<sFg3U-6NE-9@gated-at.bofh.it>
In reply to#1526007
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.

[toc] | [prev] | [next] | [standalone]


#1526017 — Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage

FromLars-Peter Clausen <lars@metafoo.de>
Date2016-11-19 16:50 +0100
SubjectRe: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
Message-ID<sFg3U-6NE-17@gated-at.bofh.it>
In reply to#1526016
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.

[toc] | [prev] | [next] | [standalone]


#1526021 — Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage

FromLars-Peter Clausen <lars@metafoo.de>
Date2016-11-19 16:50 +0100
SubjectRe: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
Message-ID<sFg3U-6NE-19@gated-at.bofh.it>
In reply to#1526017
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().

[toc] | [prev] | [next] | [standalone]


#1526104 — Re: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage

FromKrzysztof Kozlowski <krzk@kernel.org>
Date2016-11-19 19:10 +0100
SubjectRe: [PATCH 2/6] ASoC: samsung: smdk_wm8580: Remove old platforms and drop mach-types usage
Message-ID<sFifn-8mz-5@gated-at.bofh.it>
In reply to#1526021
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

[toc] | [prev] | [next] | [standalone]


#1526008 — [RFT 3/6] ASoC: samsung: smdk_wm8580: Remove machine specific quirks

FromKrzysztof Kozlowski <krzk@kernel.org>
Date2016-11-19 15:50 +0100
Subject[RFT 3/6] ASoC: samsung: smdk_wm8580: Remove machine specific quirks
Message-ID<sFf7Q-6c4-13@gated-at.bofh.it>
In reply to#1526006
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)
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1526009 — [PATCH 4/6] ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580

FromKrzysztof Kozlowski <krzk@kernel.org>
Date2016-11-19 15:50 +0100
Subject[PATCH 4/6] ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580
Message-ID<sFf7Q-6c4-15@gated-at.bofh.it>
In reply to#1526006
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
 
-- 
2.7.4

[toc] | [prev] | [next] | [standalone]


#1527746 — Applied "ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580" to the asoc tree

FromMark Brown <broonie@kernel.org>
Date2016-11-22 18:30 +0100
SubjectApplied "ASoC: samsung: Enable COMPILE_TEST for SmartQ and WM8580" to the asoc tree
Message-ID<sGn3k-1LJ-57@gated-at.bofh.it>
In reply to#1526009
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
 
-- 
2.10.2

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web