Re: [PATCH 3/3] OLPC: ALSA: fix cs5535audio's MIC GPIO to enable input

From: David Brownell
Date: Sat Feb 27 2010 - 02:14:56 EST


On Friday 26 February 2010, Ben Gardner wrote:
> We need to read back the value written to the GPIO pin to control the
> MIC input enable.

There are two potential values associated with GPIO outputs:

- The value you wrote to it, which you should just remember.
This value should *NEVER* be returned through the GPIO calls.

- The value at the pin, which will *often* be the same as
what you wrote to it ... except for open drain signals
or other "multi-drive" cases. Or if you try to read the
value back before it gets latched. (It's common to have
the "latch value" step be clocked by something ... and to
have multiple clock domains, so latching might not sync
up with what your CPU is doing.)

>From other patches recently landing in my mailbox, I'm thinking
that your GPIO driver isn't behaving properly ... it should return
the second value.


> Use gpio_set_direction() to set the GPIO in bidirectional mode.

NAK. THere is no such call, and should never be one.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/