linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Liam Girdwood <lrg@slimlogic.co.uk>
Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
	Lars-Peter Clausen <lars@metafoo.de>
Subject: [PATCH 5/5] ASoC: JZ4740: qi_lb60: Use the SND_SOC_DAPM_EVENT_OFF for the speakers status
Date: Tue, 12 Apr 2011 19:31:05 +0200	[thread overview]
Message-ID: <1302629465-21315-5-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1302629465-21315-1-git-send-email-lars@metafoo.de>

Use SND_SOC_DAPM_EVENT_OFF for determining whether the speaker should be turned
on or off instead of open coding it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/jz4740/qi_lb60.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/sound/soc/jz4740/qi_lb60.c b/sound/soc/jz4740/qi_lb60.c
index 8c4e84b..c5fc339 100644
--- a/sound/soc/jz4740/qi_lb60.c
+++ b/sound/soc/jz4740/qi_lb60.c
@@ -27,11 +27,7 @@
 static int qi_lb60_spk_event(struct snd_soc_dapm_widget *widget,
 			     struct snd_kcontrol *ctrl, int event)
 {
-	int on = 0;
-	if (event & SND_SOC_DAPM_POST_PMU)
-		on = 1;
-	else if (event & SND_SOC_DAPM_PRE_PMD)
-		on = 0;
+	int on = !SND_SOC_DAPM_EVENT_OFF(event);
 
 	gpio_set_value(QI_LB60_SND_GPIO, on);
 	gpio_set_value(QI_LB60_AMP_GPIO, on);
-- 
1.7.2.5


  parent reply	other threads:[~2011-04-12 17:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-12 17:31 [PATCH 1/5] ASoC: Make struct snd_soc_card's dapm_widgets and dapm_routes const Lars-Peter Clausen
2011-04-12 17:31 ` [PATCH 2/5] ASoC: Call snd_soc_new_widgets() after registering cards DAPM widgets Lars-Peter Clausen
2011-04-13  0:38   ` Mark Brown
2011-04-13 12:32     ` Lars-Peter Clausen
2011-04-13 17:32       ` Mark Brown
2011-04-13 19:26         ` Lars-Peter Clausen
2011-04-12 17:31 ` [PATCH 3/5] ASoC: JZ4740: Convert qi_lb60 codec to table based DAPM setup Lars-Peter Clausen
2011-04-12 17:31 ` [PATCH 4/5] ASoC: JZ4740: qi_lb60: Use gpio_request_array to request and setup gpios Lars-Peter Clausen
2011-04-12 17:31 ` Lars-Peter Clausen [this message]
2011-04-13  7:39 ` [alsa-devel] [PATCH 1/5] ASoC: Make struct snd_soc_card's dapm_widgets and dapm_routes const Liam Girdwood
2011-04-13 17:36 ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1302629465-21315-5-git-send-email-lars@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@slimlogic.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).