Quote:
Quote:
Well that's easy, just turn the GPIO from input to output mode.
Thanks for the details, but I already know how to do it. ;-)
It's not for you, it's for them :)
Quote:
I'm only not sure of one thing, do I bypass the data-cache by doing this ? I assume it does but Neko, perhaps you can help me here... :-)
They're chip registers so they should not be cached if you specify your variable as __iomem, like this;.
Code:
static struct mpc52xx_gpio __iomem *mygpio;
The correct way to get the MBAR under arch/powerpc is
Code:
mbar = mpc52xx_find_and_map("mpc5200");
if (!mbar)
goto explode;
mygpio = mbar + 0xb00;
/* do crazy gpio things here */
/* also do this when done with it (module release I guess).. */
explode:
iounmap(mbar);
Quote:
I'm lost here. The method I've shown doesn't use a generic GPIO interface (it just fills registers). Do I miss something ?
2.6.21 has a hardware-independant GPIO API - it basically defines a few simple functions (gpio_read_value, gpio_direction_output, that kind of thing) and accepts a pin value (which is implementation dependant), for instance, messing with registers directly gets turned into
Code:
b = gpio_read_value(GPIO_PSC6_1);
Quote:
I can (try to) write a generic GPIO driver and why not with "bitbang" I2C support (if possible). I develop it as a loadable module for the moment, but why not merging it to the kernel source after?
Don't worry, I'm writing one now, since it's so easy even someone as braindead as me can do it :)