lkml.org 
[lkml]   [2009]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/2] cs553x-gpio: add AMD CS5535/CS5536 GPIO driver support
On Wed, 25 Feb 2009 10:38:30 +0100
Alessandro Zummo <alessandro.zummo@towertech.it> wrote:

> On Tue, 24 Feb 2009 15:19:37 -0500
> Andres Salomon <dilinger@queued.net> wrote:
>
> > Not yet. The MFGPT, DCON, and olpc stuff will use them; I'm
> > waiting to hear feedback on this patch before I write a generic
> > MFGPT driver (or skip to cleaning up and submitting the DCON
> > driver).
> >
>
> why can't they use the generic gpio api?
>

Because the DCON (for example) has this bit of code:

* According to HiMax, when powering the DCON up we should hold
* SMB_DATA high for 8 SMB_CLK cycles. This will force the DCON
* state machine to reset to a (sane) initial state. Mitch Bradley
* did some testing and discovered that holding for 16 SMB_CLK cycles
* worked a lot more reliably, so that's what we do here.
*
* According to the cs5536 spec, to set GPIO14 to SMB_CLK we must
* simultaneously set AUX1 IN/OUT to GPIO14; ditto for SMB_DATA and
* GPIO15.
*/
geode_gpio_set(OLPC_GPIO_SMB_CLK|OLPC_GPIO_SMB_DATA, GPIO_OUTPUT_VAL);
geode_gpio_set(OLPC_GPIO_SMB_CLK|OLPC_GPIO_SMB_DATA, GPIO_OUTPUT_ENABLE);
geode_gpio_clear(OLPC_GPIO_SMB_CLK|OLPC_GPIO_SMB_DATA, GPIO_OUTPUT_AUX1);
geode_gpio_clear(OLPC_GPIO_SMB_CLK|OLPC_GPIO_SMB_DATA, GPIO_OUTPUT_AUX2);
geode_gpio_clear(OLPC_GPIO_SMB_CLK|OLPC_GPIO_SMB_DATA, GPIO_INPUT_AUX1);

for (x = 0; x < 16; x++) {
udelay(5);
geode_gpio_clear(OLPC_GPIO_SMB_CLK, GPIO_OUTPUT_VAL);
udelay(5);
geode_gpio_set(OLPC_GPIO_SMB_CLK, GPIO_OUTPUT_VAL);
}
udelay(5);
geode_gpio_set(OLPC_GPIO_SMB_CLK|OLPC_GPIO_SMB_DATA, GPIO_OUTPUT_AUX1);
geode_gpio_set(OLPC_GPIO_SMB_CLK|OLPC_GPIO_SMB_DATA, GPIO_INPUT_AUX1);

The GPIO_OUTPUT_VALs can obviously use the generic GPIO API, but I have no
idea how you'd map the INPUT_AUX1/OUTPUT_AUX1/OUTPUT_AUX2 stuff.

There are plenty other examples of this sort of thing.


\
 
 \ /
  Last update: 2009-02-25 13:07    [W:0.046 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site