public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ARM: OMAP1: N770: Convert audio_pwr_sem in a mutex
@ 2008-05-05 20:31 Matthias Kaehlcke
  2008-05-12 16:09 ` Daniel Walker
  0 siblings, 1 reply; 5+ messages in thread
From: Matthias Kaehlcke @ 2008-05-05 20:31 UTC (permalink / raw)
  To: Tony Lindgren, Russell King; +Cc: linux-kernel, akpm

ARM: OMAP1: N770: The semaphore audio_pwr_sem is used as a
mutex. Convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>

--

diff --git a/arch/arm/mach-omap1/board-nokia770.c b/arch/arm/mach-omap1/board-nokia770.c
index bcb984f..db235ad 100644
--- a/arch/arm/mach-omap1/board-nokia770.c
+++ b/arch/arm/mach-omap1/board-nokia770.c
@@ -202,7 +202,7 @@ static struct omap_board_config_kernel nokia770_config[] __initdata = {
 #define	AMPLIFIER_CTRL_GPIO	58
 
 static struct clk *dspxor_ck;
-static DECLARE_MUTEX(audio_pwr_sem);
+static DEFINE_MUTEX(audio_pwr_lock);
 /*
  * audio_pwr_state
  * +--+-------------------------+---------------------------------------+
@@ -218,7 +218,7 @@ static DECLARE_MUTEX(audio_pwr_sem);
 static int audio_pwr_state = -1;
 
 /*
- * audio_pwr_up / down should be called under audio_pwr_sem
+ * audio_pwr_up / down should be called under audio_pwr_lock
  */
 static void nokia770_audio_pwr_up(void)
 {
@@ -237,11 +237,11 @@ static void nokia770_audio_pwr_up(void)
 
 static void codec_delayed_power_down(struct work_struct *work)
 {
-	down(&audio_pwr_sem);
+	mutex_lock(&audio_pwr_lock);
 	if (audio_pwr_state == -1)
 		aic23_power_down();
 	clk_disable(dspxor_ck);
-	up(&audio_pwr_sem);
+	mutex_unlock(&audio_pwr_lock);
 }
 
 static DECLARE_DELAYED_WORK(codec_power_down_work, codec_delayed_power_down);
@@ -258,19 +258,19 @@ static void nokia770_audio_pwr_down(void)
 static int
 nokia770_audio_pwr_up_request(struct dsp_kfunc_device *kdev, int stage)
 {
-	down(&audio_pwr_sem);
+	mutex_lock(&audio_pwr_lock);
 	if (audio_pwr_state == -1)
 		nokia770_audio_pwr_up();
 	/* force audio_pwr_state = 0, even if it was 1. */
 	audio_pwr_state = 0;
-	up(&audio_pwr_sem);
+	mutex_unlock(&audio_pwr_lock);
 	return 0;
 }
 
 static int
 nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage)
 {
-	down(&audio_pwr_sem);
+	mutex_lock(&audio_pwr_lock);
 	switch (stage) {
 	case 1:
 		if (audio_pwr_state == 0)
@@ -283,7 +283,7 @@ nokia770_audio_pwr_down_request(struct dsp_kfunc_device *kdev, int stage)
 		}
 		break;
 	}
-	up(&audio_pwr_sem);
+	mutex_unlock(&audio_pwr_lock);
 	return 0;
 }
 
-- 
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona

                If you don't know where you are going,
               you will probably end up somewhere else
                         (Laurence J. Peter)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-

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

* Re: [PATCH] ARM: OMAP1: N770: Convert audio_pwr_sem in a mutex
  2008-05-05 20:31 [PATCH] ARM: OMAP1: N770: Convert audio_pwr_sem in a mutex Matthias Kaehlcke
@ 2008-05-12 16:09 ` Daniel Walker
  2008-05-14 21:09   ` Tony Lindgren
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2008-05-12 16:09 UTC (permalink / raw)
  To: Matthias Kaehlcke; +Cc: Tony Lindgren, Russell King, linux-kernel, akpm


On Mon, 2008-05-05 at 22:31 +0200, Matthias Kaehlcke wrote:
> ARM: OMAP1: N770: The semaphore audio_pwr_sem is used as a
> mutex. Convert it to the mutex API
> 

I submitted an identical patch to Tony in January .. I assumed it was
making it's way through the ARM tree .. I'm surprised it's not in
mainline yet ..

Tony any status on this?

Daniel


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

* Re: [PATCH] ARM: OMAP1: N770: Convert audio_pwr_sem in a mutex
  2008-05-12 16:09 ` Daniel Walker
@ 2008-05-14 21:09   ` Tony Lindgren
  2008-05-14 22:41     ` Daniel Walker
  0 siblings, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2008-05-14 21:09 UTC (permalink / raw)
  To: Daniel Walker; +Cc: Matthias Kaehlcke, Russell King, linux-kernel, akpm

Hi,

* Daniel Walker <dwalker@mvista.com> [080512 09:09]:
> 
> On Mon, 2008-05-05 at 22:31 +0200, Matthias Kaehlcke wrote:
> > ARM: OMAP1: N770: The semaphore audio_pwr_sem is used as a
> > mutex. Convert it to the mutex API
> > 
> 
> I submitted an identical patch to Tony in January .. I assumed it was
> making it's way through the ARM tree .. I'm surprised it's not in
> mainline yet ..
> 
> Tony any status on this?

Hmm, I can't seem to find your patch and it does not show up in git-log
either in linux-omap. Maybe I never got it or never applied it?

Do you have a link for you patch in the mailing list archives so I can
look into it further?

Regards,

Tony

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

* Re: [PATCH] ARM: OMAP1: N770: Convert audio_pwr_sem in a mutex
  2008-05-14 21:09   ` Tony Lindgren
@ 2008-05-14 22:41     ` Daniel Walker
  2008-05-14 23:21       ` Tony Lindgren
  0 siblings, 1 reply; 5+ messages in thread
From: Daniel Walker @ 2008-05-14 22:41 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: Matthias Kaehlcke, Russell King, linux-kernel, akpm


On Wed, 2008-05-14 at 14:09 -0700, Tony Lindgren wrote:
> Hi,
> 
> * Daniel Walker <dwalker@mvista.com> [080512 09:09]:
> > 
> > On Mon, 2008-05-05 at 22:31 +0200, Matthias Kaehlcke wrote:
> > > ARM: OMAP1: N770: The semaphore audio_pwr_sem is used as a
> > > mutex. Convert it to the mutex API
> > > 
> > 
> > I submitted an identical patch to Tony in January .. I assumed it was
> > making it's way through the ARM tree .. I'm surprised it's not in
> > mainline yet ..
> > 
> > Tony any status on this?
> 
> Hmm, I can't seem to find your patch and it does not show up in git-log
> either in linux-omap. Maybe I never got it or never applied it?
> 
> Do you have a link for you patch in the mailing list archives so I can
> look into it further?
> 
> Regards,

http://marc.info/?l=linux-omap&m=120063553504911&w=2

We had a discussion about it as I recall.

Daniel


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

* Re: [PATCH] ARM: OMAP1: N770: Convert audio_pwr_sem in a mutex
  2008-05-14 22:41     ` Daniel Walker
@ 2008-05-14 23:21       ` Tony Lindgren
  0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2008-05-14 23:21 UTC (permalink / raw)
  To: Daniel Walker; +Cc: Matthias Kaehlcke, Russell King, linux-kernel, akpm

* Daniel Walker <dwalker@mvista.com> [080514 16:04]:
> 
> On Wed, 2008-05-14 at 14:09 -0700, Tony Lindgren wrote:
> > Hi,
> > 
> > * Daniel Walker <dwalker@mvista.com> [080512 09:09]:
> > > 
> > > On Mon, 2008-05-05 at 22:31 +0200, Matthias Kaehlcke wrote:
> > > > ARM: OMAP1: N770: The semaphore audio_pwr_sem is used as a
> > > > mutex. Convert it to the mutex API
> > > > 
> > > 
> > > I submitted an identical patch to Tony in January .. I assumed it was
> > > making it's way through the ARM tree .. I'm surprised it's not in
> > > mainline yet ..
> > > 
> > > Tony any status on this?
> > 
> > Hmm, I can't seem to find your patch and it does not show up in git-log
> > either in linux-omap. Maybe I never got it or never applied it?
> > 
> > Do you have a link for you patch in the mailing list archives so I can
> > look into it further?
> > 
> > Regards,
> 
> http://marc.info/?l=linux-omap&m=120063553504911&w=2
> 
> We had a discussion about it as I recall.

Thanks, I must have run git-reset --hard before I got it committed or
something. Sorry about that.

Tony

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

end of thread, other threads:[~2008-05-14 23:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-05 20:31 [PATCH] ARM: OMAP1: N770: Convert audio_pwr_sem in a mutex Matthias Kaehlcke
2008-05-12 16:09 ` Daniel Walker
2008-05-14 21:09   ` Tony Lindgren
2008-05-14 22:41     ` Daniel Walker
2008-05-14 23:21       ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox