All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: No shutdown code in soc-core.c
@ 2010-04-19 13:19 ANISH KUMAR
  2010-04-19 14:10 ` Liam Girdwood
  0 siblings, 1 reply; 11+ messages in thread
From: ANISH KUMAR @ 2010-04-19 13:19 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: liam.girdwood, alsa-devel, broonie


>Did you see Mark's reply on dev_pm_ops ? 

>i.e. 

>static const struct dev_pm_ops soc_pm_ops = { 
>   .suspend = soc_suspend, 
>    .resume = soc_resume, 
>   .poweroff = soc_poweroff, 
>};
 
 I missed out Mark reply.However i checked now  this structure is 
 not there in my code base.As i mentioned in my previous mail 
 the flow of events when restart takes place.
 Anyway i thought something is amiss in this struct platform_driver soc_driver 
 that is why i am mailing to the experts here otherwise my
 problem is fixed by having the code as mentioned in my previous 
 mail.
I just wanted to know the reason?Or Am i missing something probably the concept
of turning off the audio driver??
Kerenl version used: 2.6.29

Regards,
anish

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: No shutdown code in soc-core.c
  2010-04-19 13:19 No shutdown code in soc-core.c ANISH KUMAR
@ 2010-04-19 14:10 ` Liam Girdwood
  2010-04-19 16:59   ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Liam Girdwood @ 2010-04-19 14:10 UTC (permalink / raw)
  To: anish.singh; +Cc: liam.girdwood, alsa-devel, broonie

On Mon, 2010-04-19 at 13:19 +0000, ANISH KUMAR wrote:
> >Did you see Mark's reply on dev_pm_ops ? 
> 
> >i.e. 
> 
> >static const struct dev_pm_ops soc_pm_ops = { 
> >   .suspend = soc_suspend, 
> >    .resume = soc_resume, 
> >   .poweroff = soc_poweroff, 
> >};
>  
>  I missed out Mark reply.However i checked now  this structure is 
>  not there in my code base.As i mentioned in my previous mail 
>  the flow of events when restart takes place.
>  Anyway i thought something is amiss in this struct platform_driver soc_driver 
>  that is why i am mailing to the experts here otherwise my
>  problem is fixed by having the code as mentioned in my previous 
>  mail.
> I just wanted to know the reason?Or Am i missing something probably the concept
> of turning off the audio driver??
> Kerenl version used: 2.6.29
> 

Ah, your kernel is very old. I would just do what you are currently
doing with shutdown and use the dev_pm_ops when you upgrade your kernel.

Thanks

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: No shutdown code in soc-core.c
  2010-04-19 14:10 ` Liam Girdwood
@ 2010-04-19 16:59   ` Mark Brown
  0 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2010-04-19 16:59 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: liam.girdwood, alsa-devel, anish.singh

On Mon, Apr 19, 2010 at 03:10:55PM +0100, Liam Girdwood wrote:

> Ah, your kernel is very old. I would just do what you are currently
> doing with shutdown and use the dev_pm_ops when you upgrade your kernel.

Actually, IME it's probably as easy to just backport current ASoC to
2.6.29 if you're doing anything non-trivial - the backport is very
straightforward for most platforms and the benefits of the enhancements
in ASoC are well worth the effort.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: No shutdown code in soc-core.c
@ 2010-04-22  8:10 ANISH KUMAR
  0 siblings, 0 replies; 11+ messages in thread
From: ANISH KUMAR @ 2010-04-22  8:10 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: liam.girdwood, alsa-devel


Thanks everyone for the replies but i think for this trivial problem
i don't need to backport the kernel.Anyway now i know the answer
for my posted question.I have kept backporting as an excersie
as my assignment which i will do in due period of time.

 
 

------- Original Message-------
Sender: Mark Brown<broonie@opensource.wolfsonmicro.com>
Date: Apr 20, 2010 01:59 (GMT+09:00)
Title: Re: [alsa-devel] No shutdown code in soc-core.c

On Mon, Apr 19, 2010 at 03:10:55PM +0100, Liam Girdwood wrote: 

> Ah, your kernel is very old. I would just do what you are currently 
> doing with shutdown and use the dev_pm_ops when you upgrade your kernel. 

Actually, IME it's probably as easy to just backport current ASoC to 
2.6.29 if you're doing anything non-trivial - the backport is very 
straightforward for most platforms and the benefits of the enhancements 
in ASoC are well worth the effort. 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: No shutdown code in soc-core.c
  2010-04-17  7:02 ANISH KUMAR
@ 2010-04-19 12:15 ` Liam Girdwood
  0 siblings, 0 replies; 11+ messages in thread
From: Liam Girdwood @ 2010-04-19 12:15 UTC (permalink / raw)
  To: anish.singh; +Cc: liam.girdwood, alsa-devel, broonie

On Sat, 2010-04-17 at 07:02 +0000, ANISH KUMAR wrote:
> Why this shutdown filed is not there in the struct shown below:
> static struct platform_driver soc_driver 
> {
> .shutdown       = soc_shutdown,                  //soc-core.c 
> }
> This shutdown call this codec_dev->shutdown function 
> In my case i am turning off the amplifier using this call.Which
> solved my problem of "TAK" sound during reset.
> 
> I agree that soc_codec_close() is calling the shutdown function
> but in my case there is a call to set the path after this which is
> turning on the amplifier and suddenly if we reset the phone it is
> causing "TAK" sound.Probably because AMPLIFIER was on.
> 
> Anyway why this function call soc_shutdown() is there in 
> soc-core.c if no one is calling it???
> I know there will be a redundancy if we have shutdown field
> in the struct shown above as soc_codec_close call also calls
> codec shutdown code.
> But in my case it is solving my problem. 
>  
> 

Did you see Mark's reply on dev_pm_ops ?

i.e.

static const struct dev_pm_ops soc_pm_ops = {
	.suspend = soc_suspend,
	.resume = soc_resume,
	.poweroff = soc_poweroff,
};

Thanks

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: No shutdown code in soc-core.c
@ 2010-04-17  7:02 ANISH KUMAR
  2010-04-19 12:15 ` Liam Girdwood
  0 siblings, 1 reply; 11+ messages in thread
From: ANISH KUMAR @ 2010-04-17  7:02 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: liam.girdwood, alsa-devel, broonie

Why this shutdown filed is not there in the struct shown below:
static struct platform_driver soc_driver 
{
.shutdown       = soc_shutdown,                  //soc-core.c 
}
This shutdown call this codec_dev->shutdown function 
In my case i am turning off the amplifier using this call.Which
solved my problem of "TAK" sound during reset.

I agree that soc_codec_close() is calling the shutdown function
but in my case there is a call to set the path after this which is
turning on the amplifier and suddenly if we reset the phone it is
causing "TAK" sound.Probably because AMPLIFIER was on.

Anyway why this function call soc_shutdown() is there in 
soc-core.c if no one is calling it???
I know there will be a redundancy if we have shutdown field
in the struct shown above as soc_codec_close call also calls
codec shutdown code.
But in my case it is solving my problem. 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: No shutdown code in soc-core.c
  2010-04-16  2:29 ANISH KUMAR
  2010-04-16 16:03 ` Liam Girdwood
@ 2010-04-16 18:47 ` Mark Brown
  1 sibling, 0 replies; 11+ messages in thread
From: Mark Brown @ 2010-04-16 18:47 UTC (permalink / raw)
  To: ANISH KUMAR; +Cc: liam.girdwood, alsa-devel

On Fri, Apr 16, 2010 at 02:29:21AM +0000, ANISH KUMAR wrote:
> I have a doubt regarding this soc_driver struct which is defined 
> in soc-core.c file.Why not soc_shutdown code is added in this 
> struct??

Power management for ASoC is handled by the dev_pm_ops for the driver
which does have a poweroff method.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: No shutdown code in soc-core.c
  2010-04-16 16:44 ANISH KUMAR
@ 2010-04-16 17:21 ` Liam Girdwood
  0 siblings, 0 replies; 11+ messages in thread
From: Liam Girdwood @ 2010-04-16 17:21 UTC (permalink / raw)
  To: anish.singh; +Cc: liam.girdwood, alsa-devel, broonie

On Fri, 2010-04-16 at 16:44 +0000, ANISH KUMAR wrote:
> >What are you trying to do ?
>  
> There was a "TAK" noise because of non-presence of this code.
> This soc_shutdown calls the respective shutdown code in codec
> for prevention of this kind of strange noise.In my code it is turning
> off the Amplifier because of which i no longer get the "TAK" sound.
> 

Ok, so afaict you hear a "TAK" noise at stream shutdown and want to get
rid of it. ASoC calls shutdown/close for each of it's components :-

	if (cpu_dai->ops->shutdown)
		cpu_dai->ops->shutdown(substream, cpu_dai);

	if (codec_dai->ops->shutdown)
		codec_dai->ops->shutdown(substream, codec_dai);

	if (machine->ops && machine->ops->shutdown)
		machine->ops->shutdown(substream);

	if (platform->pcm_ops->close)
		platform->pcm_ops->close(substream);

> So i am just wondering why this code is not present in the struct 
> i mentioned in my previous mail.

You didn't mention any struct in your last mail.

Please explain your problems more clearly in the future. It's very
difficult to help here without a good problem description or a detailed
explanation of why you need this feature.

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: No shutdown code in soc-core.c
@ 2010-04-16 16:44 ANISH KUMAR
  2010-04-16 17:21 ` Liam Girdwood
  0 siblings, 1 reply; 11+ messages in thread
From: ANISH KUMAR @ 2010-04-16 16:44 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: liam.girdwood, alsa-devel, broonie


>What are you trying to do ?
 
There was a "TAK" noise because of non-presence of this code.
This soc_shutdown calls the respective shutdown code in codec
for prevention of this kind of strange noise.In my code it is turning
off the Amplifier because of which i no longer get the "TAK" sound.

So i am just wondering why this code is not present in the struct 
i mentioned in my previous mail.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: No shutdown code in soc-core.c
  2010-04-16  2:29 ANISH KUMAR
@ 2010-04-16 16:03 ` Liam Girdwood
  2010-04-16 18:47 ` Mark Brown
  1 sibling, 0 replies; 11+ messages in thread
From: Liam Girdwood @ 2010-04-16 16:03 UTC (permalink / raw)
  To: anish.singh; +Cc: liam.girdwood, alsa-devel, broonie

On Fri, 2010-04-16 at 02:29 +0000, ANISH KUMAR wrote:
> I have a doubt regarding this soc_driver struct which is defined 
> in soc-core.c file.Why not soc_shutdown code is added in this 
> struct??


What are you trying to do ?

Liam

-- 
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

^ permalink raw reply	[flat|nested] 11+ messages in thread

* No shutdown code in soc-core.c
@ 2010-04-16  2:29 ANISH KUMAR
  2010-04-16 16:03 ` Liam Girdwood
  2010-04-16 18:47 ` Mark Brown
  0 siblings, 2 replies; 11+ messages in thread
From: ANISH KUMAR @ 2010-04-16  2:29 UTC (permalink / raw)
  To: alsa-devel; +Cc: liam.girdwood, broonie

I have a doubt regarding this soc_driver struct which is defined 
in soc-core.c file.Why not soc_shutdown code is added in this 
struct??

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-04-22  8:12 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 13:19 No shutdown code in soc-core.c ANISH KUMAR
2010-04-19 14:10 ` Liam Girdwood
2010-04-19 16:59   ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2010-04-22  8:10 ANISH KUMAR
2010-04-17  7:02 ANISH KUMAR
2010-04-19 12:15 ` Liam Girdwood
2010-04-16 16:44 ANISH KUMAR
2010-04-16 17:21 ` Liam Girdwood
2010-04-16  2:29 ANISH KUMAR
2010-04-16 16:03 ` Liam Girdwood
2010-04-16 18:47 ` Mark Brown

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.