* WM9712 GPIO
@ 2010-05-12 11:47 Manuel Lauss
2010-05-12 12:30 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Manuel Lauss @ 2010-05-12 11:47 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-input
Hi Mark,
I'm playing with the GPIO interface on a WM9712G, specifically GPIO1
and 2 of the chip.
However I'm unable to get the chip to toggle any of these pins.
Setup is:
[...]
wm97xx_config_gpio(wm, WM97XX_GPIO_1, WM97XX_GPIO_OUT,
WM97XX_GPIO_POL_HIGH, WM97XX_GPIO_NOTSTICKY,
WM97XX_GPIO_NOWAKE);
wm97xx_config_gpio(wm, WM97XX_GPIO_2, WM97XX_GPIO_OUT,
WM97XX_GPIO_POL_HIGH, WM97XX_GPIO_NOTSTICKY,
WM97XX_GPIO_NOWAKE);
mutex_lock(&wm->codec_mutex);
reg = wm97xx_reg_read(wm, 0x56);
if (reg == -1)
printk(KERN_ERR "WM97XX: register 0x56 rd fail\n");
reg |= (1 << 2); /* GPIO2 to GPIO logic */
wm97xx_reg_write(wm, 0x56, reg);
mutex_unlock(&wm->codec_mutex);
[...]
Setting a pin with
wm97xx_set_gpio(wm, WM97XX_GPIO_1, WM97XX_GPIO_HIGH);
reads back 0x0820 from GPIO status reg, sets bit 1,writes back 0x1044 (<<1),
but a read following immediately after yields 0x0820 again, and the pin
never changes.
Am I missing something?
Also I need this patch to get wm97xx_set_gpio() to actually set a bit in the
gpio register:
--- a/drivers/input/touchscreen/wm97xx-core.c
+++ b/drivers/input/touchscreen/wm97xx-core.c
@@ -200,7 +200,7 @@ void wm97xx_set_gpio(struct wm97xx *wm, u32 gpio,
mutex_lock(&wm->codec_mutex);
reg = wm97xx_reg_read(wm, AC97_GPIO_STATUS);
- if (status & WM97XX_GPIO_HIGH)
+ if (status == WM97XX_GPIO_HIGH)
reg |= gpio;
else
reg &= ~gpio;
Thanks!
Manuel Lauss
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: WM9712 GPIO
2010-05-12 11:47 WM9712 GPIO Manuel Lauss
@ 2010-05-12 12:30 ` Mark Brown
2010-05-12 12:50 ` Manuel Lauss
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-05-12 12:30 UTC (permalink / raw)
To: Manuel Lauss; +Cc: linux-input
On Wed, May 12, 2010 at 01:47:12PM +0200, Manuel Lauss wrote:
> I'm playing with the GPIO interface on a WM9712G, specifically GPIO1
> and 2 of the chip.
> However I'm unable to get the chip to toggle any of these pins.
> Setting a pin with
> wm97xx_set_gpio(wm, WM97XX_GPIO_1, WM97XX_GPIO_HIGH);
> reads back 0x0820 from GPIO status reg, sets bit 1,writes back 0x1044 (<<1),
> but a read following immediately after yields 0x0820 again, and the pin
> never changes.
> Am I missing something?
The WM9712 does not support this feature. It only supports setting the
GPIO status by use of AC'97 slot 12 for which there's currently no
standard glue on Linux. Setting slot 12 needs to be done in the AC'97
controller.
> Also I need this patch to get wm97xx_set_gpio() to actually set a bit in the
> gpio register:
Please just submit this patch, it looks good.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: WM9712 GPIO
2010-05-12 12:30 ` Mark Brown
@ 2010-05-12 12:50 ` Manuel Lauss
2010-05-12 12:52 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Manuel Lauss @ 2010-05-12 12:50 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-input
On Wed, May 12, 2010 at 2:30 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Wed, May 12, 2010 at 01:47:12PM +0200, Manuel Lauss wrote:
>
>> I'm playing with the GPIO interface on a WM9712G, specifically GPIO1
>> and 2 of the chip.
>> However I'm unable to get the chip to toggle any of these pins.
>
>> Setting a pin with
>> wm97xx_set_gpio(wm, WM97XX_GPIO_1, WM97XX_GPIO_HIGH);
>
>> reads back 0x0820 from GPIO status reg, sets bit 1,writes back 0x1044 (<<1),
>> but a read following immediately after yields 0x0820 again, and the pin
>> never changes.
>
>> Am I missing something?
>
> The WM9712 does not support this feature. It only supports setting the
> GPIO status by use of AC'97 slot 12 for which there's currently no
> standard glue on Linux. Setting slot 12 needs to be done in the AC'97
> controller.
Wonderful. Thanks for the info.
Manuel Lauss
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: WM9712 GPIO
2010-05-12 12:50 ` Manuel Lauss
@ 2010-05-12 12:52 ` Mark Brown
2010-05-12 12:54 ` Manuel Lauss
0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2010-05-12 12:52 UTC (permalink / raw)
To: Manuel Lauss; +Cc: linux-input
On Wed, May 12, 2010 at 02:50:44PM +0200, Manuel Lauss wrote:
> On Wed, May 12, 2010 at 2:30 PM, Mark Brown
> > The WM9712 does not support this feature. It only supports setting the
> > GPIO status by use of AC'97 slot 12 for which there's currently no
> > standard glue on Linux. Setting slot 12 needs to be done in the AC'97
> > controller.
> Wonderful. Thanks for the info.
Glad to be of service :) . FWIW slot 12 is the method specified by the
AC'97 standard for setting GPIO on AC'97 CODECs so we really should have
something for it, but sadly quality of implementation and coverage in
controllers is a little variable.
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: WM9712 GPIO
2010-05-12 12:52 ` Mark Brown
@ 2010-05-12 12:54 ` Manuel Lauss
0 siblings, 0 replies; 5+ messages in thread
From: Manuel Lauss @ 2010-05-12 12:54 UTC (permalink / raw)
To: Mark Brown; +Cc: linux-input
On Wed, May 12, 2010 at 2:52 PM, Mark Brown
<broonie@opensource.wolfsonmicro.com> wrote:
> On Wed, May 12, 2010 at 02:50:44PM +0200, Manuel Lauss wrote:
>> On Wed, May 12, 2010 at 2:30 PM, Mark Brown
>
>> > The WM9712 does not support this feature. It only supports setting the
>> > GPIO status by use of AC'97 slot 12 for which there's currently no
>> > standard glue on Linux. Setting slot 12 needs to be done in the AC'97
>> > controller.
>
>> Wonderful. Thanks for the info.
>
> Glad to be of service :) . FWIW slot 12 is the method specified by the
> AC'97 standard for setting GPIO on AC'97 CODECs so we really should have
> something for it, but sadly quality of implementation and coverage in
> controllers is a little variable.
Fortunately my target CPU does have special AC97 GPIO registers. So all
is well on my end :)
Manuel
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-12 12:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-12 11:47 WM9712 GPIO Manuel Lauss
2010-05-12 12:30 ` Mark Brown
2010-05-12 12:50 ` Manuel Lauss
2010-05-12 12:52 ` Mark Brown
2010-05-12 12:54 ` Manuel Lauss
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).