From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Andrew Morton <akpm@osdl.org>
Cc: linuxppc64-dev <linuxppc64-dev@ozlabs.org>,
Linux Kernel list <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@osdl.org>
Subject: [PATCH] ppc64: improve g5 sound headphone mute
Date: Wed, 13 Apr 2005 21:23:02 +1000 [thread overview]
Message-ID: <1113391382.5463.20.camel@gaston> (raw)
In-Reply-To: <jefyxvruip.fsf@sykes.suse.de>
Hi !
This patch fixes a couple more issues with the management of the GPIOs
dealing with headphone and line out mute on the G5. It should fix the
remaining problems of people not getting any sound out of the headphone
jack.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Index: linux-work/sound/ppc/tumbler.c
===================================================================
--- linux-work.orig/sound/ppc/tumbler.c 2005-04-12 18:07:50.000000000 +1000
+++ linux-work/sound/ppc/tumbler.c 2005-04-13 18:02:26.000000000 +1000
@@ -177,11 +177,22 @@
if (! gp->addr)
return;
active = active ? gp->active_val : gp->inactive_val;
-
do_gpio_write(gp, active);
DBG("(I) gpio %x write %d\n", gp->addr, active);
}
+static int check_audio_gpio(pmac_gpio_t *gp)
+{
+ int ret;
+
+ if (! gp->addr)
+ return 0;
+
+ ret = do_gpio_read(gp);
+
+ return (ret & 0xd) == (gp->active_val & 0xd);
+}
+
static int read_audio_gpio(pmac_gpio_t *gp)
{
int ret;
@@ -683,7 +694,7 @@
}
if (gp == NULL)
return -EINVAL;
- ucontrol->value.integer.value[0] = ! read_audio_gpio(gp);
+ ucontrol->value.integer.value[0] = !check_audio_gpio(gp);
return 0;
}
@@ -711,7 +722,7 @@
}
if (gp == NULL)
return -EINVAL;
- val = ! read_audio_gpio(gp);
+ val = ! check_audio_gpio(gp);
if (val != ucontrol->value.integer.value[0]) {
write_audio_gpio(gp, ! ucontrol->value.integer.value[0]);
return 1;
@@ -897,11 +908,11 @@
static void check_mute(pmac_t *chip, pmac_gpio_t *gp, int val, int do_notify, snd_kcontrol_t *sw)
{
- //pmac_tumbler_t *mix = chip->mixer_data;
- if (val != read_audio_gpio(gp)) {
+ if (check_audio_gpio(gp) != val) {
write_audio_gpio(gp, val);
if (do_notify)
- snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE, &sw->id);
+ snd_ctl_notify(chip->card, SNDRV_CTL_EVENT_MASK_VALUE,
+ &sw->id);
}
}
next prev parent reply other threads:[~2005-04-13 11:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-12 5:07 [PATCH] ppc64: very basic desktop g5 sound support (#2) Benjamin Herrenschmidt
2005-04-12 18:28 ` Lee Revell
2005-04-12 18:49 ` Linus Torvalds
2005-04-12 18:52 ` Lee Revell
2005-04-12 22:16 ` Benjamin Herrenschmidt
2005-04-12 19:32 ` Andreas Schwab
2005-04-12 20:14 ` Christoph Hellwig
2005-04-12 22:17 ` Benjamin Herrenschmidt
2005-04-12 22:33 ` Andreas Schwab
2005-04-12 22:39 ` Benjamin Herrenschmidt
2005-04-12 22:57 ` Andreas Schwab
[not found] ` <jed5szk3gh.fsf@sykes.suse.de>
[not found] ` <1113347296.5388.121.camel@gaston>
[not found] ` <je8y3nk117.fsf@sykes.suse.de>
[not found] ` <1113350355.5387.129.camel@gaston>
[not found] ` <jefyxvruip.fsf@sykes.suse.de>
2005-04-13 11:23 ` Benjamin Herrenschmidt [this message]
2005-04-14 0:31 ` [PATCH] ppc64: improve g5 sound headphone mute Andrea Arcangeli
2005-04-16 12:56 ` Andreas Schwab
2005-04-16 14:27 ` Benjamin Herrenschmidt
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=1113391382.5463.20.camel@gaston \
--to=benh@kernel.crashing.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc64-dev@ozlabs.org \
--cc=torvalds@osdl.org \
/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