Skip to contentSkip to conversation

ASoC: SAMSUNG: Fix initial return value

PATCH In review Seungwhan Youn 4 participants 20 messages Dec 3, 2010 – Dec 8, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ASoC: SAMSUNG: Fix initial return value

This patch fixed intial return value to be a '0' as asuccess on set_audio_clock_heirachy(). This avoids unintended error on initialize.

---
 sound/soc/s3c24xx/smdk_spdif.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/s3c24xx/smdk_spdif.c +1 -1
index c8bd904..cb658d1 100644
@@ -28,7 +28,7 @@
 static int set_audio_clock_heirachy(struct platform_device *pdev)
 {
 	struct clk *fout_epll, *mout_epll, *sclk_audio0, *sclk_spdif;
-	int ret;
+	int ret = 0;
 
 	fout_epll = clk_get(NULL, "fout_epll");
 	if (IS_ERR(fout_epll)) {
Signature · 1 line
1.6.2.5
Acked-by on v1 1/3
#1 lore raw
Quoted 13 lines · Seungwhan Youn

This patch fixed intial return value to be a '0' as asuccess on set_audio_clock_heirachy(). This avoids unintended error on initialize.

---
 sound/soc/s3c24xx/smdk_spdif.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/s3c24xx/smdk_spdif.c +0 -0
index c8bd904..cb658d1 100644

sound/soc/s3c24xx/smdk_spdif.c line 34

Quoted 8 lines
sound/soc/s3c24xx/smdk_spdif.c +1 -1
@@ -28,7 +28,7 @@
  static int set_audio_clock_heirachy(struct platform_device *pdev)
  {
        struct clk *fout_epll, *mout_epll, *sclk_audio0, *sclk_spdif;
-       int ret;
+       int ret = 0;
 
        fout_epll = clk_get(NULL, "fout_epll");
        if (IS_ERR(fout_epll)) {

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#2 lore raw

PATCH 2/3 ASoC: SAMSUNG: Remove duplicated snd_card on smdk_spdif

In reply to Seungwhan Youn

This patch remove duplicated snd_card defination on smdk_spdif.

---
 sound/soc/s3c24xx/smdk_spdif.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
sound/soc/s3c24xx/smdk_spdif.c +0 -2
index cb658d1..0e1fe60 100644
@@ -152,8 +152,6 @@ static struct snd_soc_ops smdk_spdif_ops = {
 	.hw_params = smdk_hw_params,
 };
 
-static struct snd_soc_card smdk;
-
 static struct snd_soc_dai_link smdk_dai = {
 	.name = "S/PDIF",
 	.stream_name = "S/PDIF PCM Playback",
Signature · 1 line
1.6.2.5
Acked-by on v1 2/3
#3 lore raw

Re: [PATCH 2/3] ASoC: SAMSUNG: Remove duplicated snd_card on smdk_spdif

Quoted 8 lines · Seungwhan Youn

This patch remove duplicated snd_card defination on smdk_spdif.

sound/soc/s3c24xx/smdk_spdif.c +0 -2
-static struct snd_soc_card smdk;
-

 static struct snd_soc_dai_link smdk_dai = {
       .name = "S/PDIF",
       .stream_name = "S/PDIF PCM Playback",

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#4 lore raw

PATCH 3/3 ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

In reply to Seungwhan Youn

This patch modify to match ids between source clock id and asoc platform device that spdif driver can find sclk_audio0 with device id.

---
 sound/soc/s3c24xx/smdk_spdif.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/s3c24xx/smdk_spdif.c +1 -1
index 0e1fe60..b4ad231 100644
@@ -183,7 +183,7 @@ static int __init smdk_init(void)
 	if (ret)
 		goto err2;
 
-	smdk_snd_spdif_device = platform_device_alloc("soc-audio", -1);
+	smdk_snd_spdif_device = platform_device_alloc("soc-audio", 0);
 	if (!smdk_snd_spdif_device) {
 		ret = -ENOMEM;
 		goto err2;
Signature · 1 line
1.6.2.5
#5 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

Quoted 13 lines · Seungwhan Youn

This patch modify to match ids between source clock id and asoc platform device that spdif driver can find sclk_audio0 with device id.

---
 sound/soc/s3c24xx/smdk_spdif.c |    2 +-

 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/s3c24xx/smdk_spdif.c +0 -0
index 0e1fe60..b4ad231 100644

sound/soc/s3c24xx/smdk_spdif.c static int __init smdk_init(void) · line 186

Quoted 5 lines
sound/soc/s3c24xx/smdk_spdif.c +1 -1
@@ -183,7 +183,7 @@ static int __init smdk_init(void)
        if (ret)
                goto err2;
 
-       smdk_snd_spdif_device = platform_device_alloc("soc-audio", -1);
+       smdk_snd_spdif_device = platform_device_alloc("soc-audio", 0);

I think this is not appropriate.

Maybe you should do :-
sclk_audio0 = clk_get(NULL, "sclk_audio");
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#6 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

Quoted 7 lines
Quoted 2 lines

-       smdk_snd_spdif_device = platform_device_alloc("soc-audio", -1);
+       smdk_snd_spdif_device = platform_device_alloc("soc-audio", 0);

I think this is not appropriate.

Maybe you should do :-
 sclk_audio0 = clk_get(NULL, "sclk_audio");

Yes, I think so, but without id, there is no way to find sclk_audio0 in current samsung s5p. Because, current sclk_audio0,1,2 is only to distinguished by id not by name, and also all sclk_audio0's id for s5p is '0' for now. So, I think that this modification is more batter to modify all s5p's sclk_audio clock id to '-1'.
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#7 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

Quoted 5 lines · Seungwhan Youn
Quoted 5 lines
Quoted 2 lines

-       smdk_snd_spdif_device = platform_device_alloc("soc-audio", -1);
+       smdk_snd_spdif_device = platform_device_alloc("soc-audio", 0);

I think this is not appropriate.

Quoted 8 lines
Quoted 2 lines

Maybe you should do :-
 sclk_audio0 = clk_get(NULL, "sclk_audio");

Yes, I think so, but without id, there is no way to find sclk_audio0 in current samsung s5p. Because, current sclk_audio0,1,2 is only to distinguished by id not by name, and also all sclk_audio0's id for s5p is '0' for now. So, I think that this modification is more batter to modify all s5p's sclk_audio clock id to '-1'.

the platform_device soc-audio has nothing to do with a particular audio controller, so I don't favor associating with a controller. Good for us, SPDIF needs sclk_audio0 which is the first instance that clk_get will come across and hence we can still get the clock.
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#8 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

Quoted 15 lines · Jassi Brar
Quoted 5 lines · Seungwhan Youn
Quoted 5 lines
Quoted 2 lines

-       smdk_snd_spdif_device = platform_device_alloc("soc-audio", -1);
+       smdk_snd_spdif_device = platform_device_alloc("soc-audio", 0);

I think this is not appropriate.

Quoted 8 lines
Quoted 2 lines

Maybe you should do :-
 sclk_audio0 = clk_get(NULL, "sclk_audio");

Yes, I think so, but without id, there is no way to find sclk_audio0 in current samsung s5p. Because, current sclk_audio0,1,2 is only to distinguished by id not by name, and also all sclk_audio0's id for s5p is '0' for now. So, I think that this modification is more batter to modify all s5p's sclk_audio clock id to '-1'.

Quoted 4 lines

the platform_device soc-audio has nothing to do with a particular audio controller, so I don't favor associating with a controller. Good for us, SPDIF needs sclk_audio0 which is the first instance that clk_get will come across and hence we can still get the clock.

Ok, I see it wouldn't work as such.

Theoretically we have two parallel clocks from same source - one goes to I2S_0 and the other to SPDIF.
So, IMO, we need to clone the sclk_audio0 clock with SPDIF specific name and that has id as -1
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#9 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

Quoted 5 lines

Theoretically we have two parallel clocks from same source - one goes to I2S_0 and the other to SPDIF.
So, IMO, we need to clone the sclk_audio0 clock with SPDIF specific name and that has id as -1

Okay, I agree whit this.
So, how do you think about this Mr. Kukjin?
Is that okay to make a clone clock of sclk_audio0 for SPDIF?

#10 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

In reply to Seungwhan Youn
Quoted 2 lines · Seungwhan Youn

This patch modify to match ids between source clock id and asoc platform device that spdif driver can find sclk_audio0 with device id.

Something's seriously wrong if you need to do this...

sound/soc/s3c24xx/smdk_spdif.c static int __init smdk_init(void) · line 186

Quoted 2 lines
sound/soc/s3c24xx/smdk_spdif.c +1 -1
-	smdk_snd_spdif_device = platform_device_alloc("soc-audio", -1);
+	smdk_snd_spdif_device = platform_device_alloc("soc-audio", 0);

...the soc-audio device is a virtual device so should have no clocks associated with it. The driver should not be using the platform device as an argument for clk_get() in the first place.

#11 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

Quoted 4 lines · Mark Brown
Quoted 2 lines · Seungwhan Youn

This patch modify to match ids between source clock id and asoc platform device that spdif driver can find sclk_audio0 with device id.

Quoted 8 lines

Something's seriously wrong if you need to do this...

Quoted 2 lines

-     smdk_snd_spdif_device = platform_device_alloc("soc-audio", -1);
+     smdk_snd_spdif_device = platform_device_alloc("soc-audio", 0);

...the soc-audio device is a virtual device so should have no clocks associated with it.  The driver should not be using the platform device as an argument for clk_get() in the first place.

I see, I can clearly understand.
Thanks for your kindly reply. :)

Claude
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#12 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

In reply to Mark Brown
Quoted 4 lines · Mark Brown
Quoted 2 lines

This patch modify to match ids between source clock id and asoc platform device that spdif driver can find sclk_audio0 with device id.

Something's seriously wrong if you need to do this...

It's necessary evil ATM.
There is no access to SPDIF device in machine code and we need to get/set the clock.
So the soc-audio is used as a place-holder.

#13 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

Quoted 8 lines · Jassi Brar

On Fri, Dec 3, 2010 at 8:44 PM, Mark Brown

Quoted 1 line

Something's seriously wrong if you need to do this...

It's necessary evil ATM.
There is no access to SPDIF device in machine code and we need to get/set the clock.
So the soc-audio is used as a place-holder.

In order to do this you need to tell the clock framework about the ASoC virtual device - once you're doing stuff like that you may as well just fix the S/PDIF driver to let you do what you need.

#14 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

Quoted 10 lines · Mark Brown
Quoted 4 lines · Jassi Brar

It's necessary evil ATM.
There is no access to SPDIF device in machine code and we need to get/set the clock.
So the soc-audio is used as a place-holder.

In order to do this you need to tell the clock framework about the ASoC virtual device - once you're doing stuff like that you may as well just fix the S/PDIF driver to let you do what you need.

Assuming I understand you correctly, the problem still remains of having the S/PDIF driver to setup clock hierarchies -- which is the job of the board init code, IMHO.
So until we have proper clock subsystem and board init code to handle such scenarios
we have to do that in ASoC machine driver in such hackish way.

#15 lore raw

Re: [PATCH 3/3] ASoC: SAMSUNG: Match spdif source clock id and asoc platform device

Quoted 6 lines · Jassi Brar

On Mon, Dec 6, 2010 at 9:46 PM, Mark Brown

Quoted 3 lines

In order to do this you need to tell the clock framework about the ASoC virtual device - once you're doing stuff like that you may as well just fix the S/PDIF driver to let you do what you need.

Quoted 6 lines

Assuming I understand you correctly, the problem still remains of having the S/PDIF driver to setup clock hierarchies -- which is the job of the board init code, IMHO.
So until we have proper clock subsystem and board init code to handle such scenarios
we have to do that in ASoC machine driver in such hackish way.

It may be that what's needed in the S/PDIF driver is to provide a way to get the device for the S/PDIF controller so that the machine driver can fiddle with it. Actually, you can do that anyway as the device will be associated with the DAI - the machine driver can just look at dai->dev to get the struct device for the S/PDIF controller.

#16 lore raw
In reply to Seungwhan Youn
Quoted 6 lines · Seungwhan Youn

This patch fixed intial return value to be a '0' as asuccess on set_audio_clock_heirachy(). This avoids unintended error on initialize.

---
 sound/soc/s3c24xx/smdk_spdif.c |    2 +-

Could you regenerate against current for-2.6.38 please? The move to the Samsung directory means this won't apply any more.

#17 lore raw
Quoted 10 lines · Mark Brown
Quoted 6 lines · Seungwhan Youn

This patch fixed intial return value to be a '0' as asuccess on set_audio_clock_heirachy(). This avoids unintended error on initialize.

---
 sound/soc/s3c24xx/smdk_spdif.c |    2 +-

Could you regenerate against current for-2.6.38 please?  The move to the Samsung directory means this won't apply any more.

Of course, I do. :-)

Thanks.
Claude
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#18 lore raw
In reply to Mark Brown
Quoted 10 lines · Mark Brown
Quoted 6 lines · Seungwhan Youn

This patch fixed intial return value to be a '0' as asuccess on set_audio_clock_heirachy(). This avoids unintended error on initialize.

---
 sound/soc/s3c24xx/smdk_spdif.c |    2 +-

Could you regenerate against current for-2.6.38 please?  The move to the Samsung directory means this won't apply any more.

If there are something more needed to accept these 2 patches for 2.6.37, please let me know.

BRs,
Claude
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#19 lore raw
Quoted 2 lines · Seungwhan Youn

If there are something more needed to accept these 2 patches for 2.6.37, please let me know.

You'd need to at least resubmit against 2.6.37 but especially with the second patch I'm not sure there's any urgency - the second patch is just a minor code cleanup and has no practical effect.