All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olaf Hering <olh@suse.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: alsa-devel@alsa-project.org, Ben Collins <ben.collins@ubuntu.com>,
	linuxppc-dev@ozlabs.org
Subject: Re: [PPC,SOUND] Fix audio gpio state detection
Date: Wed, 1 Mar 2006 23:30:34 +0100	[thread overview]
Message-ID: <20060301223034.GA5965@suse.de> (raw)
In-Reply-To: <20060226173908.GA4871@suse.de>

 On Sun, Feb 26, Olaf Hering wrote:

>  On Mon, Feb 13, Benjamin Herrenschmidt wrote:
> 
> > On Sat, 2006-02-11 at 17:10 +0100, Andreas Schwab wrote:
> > > When booting with line out or headphone plugged, you won't hear anything.
> > > The problem is that after reset all channels are muted, but the actual
> > > value of the gpio port doesn't exactly match the active_val settings as
> > > expected by check_audio_gpio.  For example, the line_mute port is set to
> > > 7, but check_audio_gpio would expect 0xd or 0xf, thus its return value
> > > indicates that it is not active, even though it is.  AFAICS only looking
> > > at the low bit is enough to determine whether the port is active.
> > > 
> > > Signed-off-by: Andreas Schwab <schwab@suse.de>
> > > 
> > > Index: linux-2.6.16-rc2/sound/ppc/tumbler.c
> > > ===================================================================
> > > --- linux-2.6.16-rc2.orig/sound/ppc/tumbler.c	2006-02-03 19:43:50.000000000 +0100
> > > +++ linux-2.6.16-rc2/sound/ppc/tumbler.c	2006-02-11 03:46:30.000000000 +0100
> > > @@ -207,7 +207,7 @@ static int check_audio_gpio(struct pmac_
> > >  
> > >  	ret = do_gpio_read(gp);
> > >  
> > > -	return (ret & 0xd) == (gp->active_val & 0xd);
> > > +	return (ret & 0x1) == (gp->active_val & 0x1);
> > >  }
> > >  
> > >  static int read_audio_gpio(struct pmac_gpio *gp)
> 
> This (sort of) breaks PowerMac3,4 (69 (PowerMac G4 Silver)). I have to
> force it on up to now, but with this patch the internal speaker will not
> work with or without my patch to force it on.

But the patch fixes also my PowerBook4,1, I dont have to toggle the headphone
once to get the built-in speakers enabled.
Looks like 2.6.16 stuff, but its been broken for so long now...


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

WARNING: multiple messages have this Message-ID (diff)
From: Olaf Hering <olh@suse.de>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: linuxppc-dev@ozlabs.org, alsa-devel@alsa-project.org,
	Ben Collins <ben.collins@ubuntu.com>
Subject: Re: [PPC,SOUND] Fix audio gpio state detection
Date: Wed, 1 Mar 2006 23:30:34 +0100	[thread overview]
Message-ID: <20060301223034.GA5965@suse.de> (raw)
In-Reply-To: <20060226173908.GA4871@suse.de>

 On Sun, Feb 26, Olaf Hering wrote:

>  On Mon, Feb 13, Benjamin Herrenschmidt wrote:
> 
> > On Sat, 2006-02-11 at 17:10 +0100, Andreas Schwab wrote:
> > > When booting with line out or headphone plugged, you won't hear anything.
> > > The problem is that after reset all channels are muted, but the actual
> > > value of the gpio port doesn't exactly match the active_val settings as
> > > expected by check_audio_gpio.  For example, the line_mute port is set to
> > > 7, but check_audio_gpio would expect 0xd or 0xf, thus its return value
> > > indicates that it is not active, even though it is.  AFAICS only looking
> > > at the low bit is enough to determine whether the port is active.
> > > 
> > > Signed-off-by: Andreas Schwab <schwab@suse.de>
> > > 
> > > Index: linux-2.6.16-rc2/sound/ppc/tumbler.c
> > > ===================================================================
> > > --- linux-2.6.16-rc2.orig/sound/ppc/tumbler.c	2006-02-03 19:43:50.000000000 +0100
> > > +++ linux-2.6.16-rc2/sound/ppc/tumbler.c	2006-02-11 03:46:30.000000000 +0100
> > > @@ -207,7 +207,7 @@ static int check_audio_gpio(struct pmac_
> > >  
> > >  	ret = do_gpio_read(gp);
> > >  
> > > -	return (ret & 0xd) == (gp->active_val & 0xd);
> > > +	return (ret & 0x1) == (gp->active_val & 0x1);
> > >  }
> > >  
> > >  static int read_audio_gpio(struct pmac_gpio *gp)
> 
> This (sort of) breaks PowerMac3,4 (69 (PowerMac G4 Silver)). I have to
> force it on up to now, but with this patch the internal speaker will not
> work with or without my patch to force it on.

But the patch fixes also my PowerBook4,1, I dont have to toggle the headphone
once to get the built-in speakers enabled.
Looks like 2.6.16 stuff, but its been broken for so long now...

  parent reply	other threads:[~2006-03-01 22:30 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-11 16:10 [PPC,SOUND] Fix audio gpio state detection Andreas Schwab
2006-02-11 16:10 ` Andreas Schwab
2006-02-12 22:35 ` Benjamin Herrenschmidt
2006-02-12 22:35   ` Benjamin Herrenschmidt
2006-02-12 22:46   ` Ben Collins
2006-02-12 22:46     ` Ben Collins
2006-02-12 23:27     ` Benjamin Herrenschmidt
2006-02-12 23:27       ` Benjamin Herrenschmidt
2006-02-26 17:39   ` Olaf Hering
2006-02-26 17:39     ` Olaf Hering
2006-02-26 19:19     ` Lee Revell
2006-02-26 19:19       ` [Alsa-devel] " Lee Revell
2006-02-26 19:26       ` Olaf Hering
2006-02-26 19:26         ` [Alsa-devel] " Olaf Hering
2006-03-01 22:30     ` Olaf Hering [this message]
2006-03-01 22:30       ` Olaf Hering
2006-03-01 23:09       ` Benjamin Herrenschmidt
2006-03-01 23:09         ` Benjamin Herrenschmidt
2006-03-01 23:49         ` Ben Collins
2006-03-01 23:49           ` Ben Collins
2006-03-02  0:00           ` Olaf Hering
2006-03-02  0:00             ` Olaf Hering
2006-03-02  0:04             ` Benjamin Herrenschmidt
2006-03-02  0:04               ` Benjamin Herrenschmidt
2006-03-02  0:04           ` Benjamin Herrenschmidt
2006-03-02  0:04             ` 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=20060301223034.GA5965@suse.de \
    --to=olh@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=ben.collins@ubuntu.com \
    --cc=benh@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.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 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.