Using PXA arm board with MAX7319 GPIO expander input
Daniel Mack
daniel at caiaq.de
Mon Feb 8 06:33:06 EST 2010
On Mon, Feb 08, 2010 at 07:08:06PM +0800, Jebediah Huang wrote:
> Is it correct that max732x driver will take i2c configuration from my
> setup info and make each max7319 input signel into a gpio?
>
> Hardware work correctly because without max732x driver, above i2c-dev
> code can read max7319 input signel. Configuration is correct.
>
> gpio_base is starting where max732x driver will add new gpio number
> for max7319 signel.
Yes, that should be right. After the driver is probed successfully, you
should be able to access the GPIOs with generic functions as described
in include/linux/gpio.h. Can you try if that works?
And if you can, you should really hook up an I2C analyzer to your bus
and see what is happening electrically and which messages pass the bus.
> static struct max732x_platform_data max7319_data[] = {
> [0] = {
> .gpio_base = NR_BUILTIN_GPIO,
> },
> };
>
> static struct i2c_board_info i2c_board_info[] =
> {
> {
> .type = "max7319",
> .addr = 0x6C,
> .irq = IRQ_GPIO(125), <= this is my irq pin
> for max7319 INT_N
I just saw that there is indeed no support for irq line handling in this
driver. In order to use these lines as input for something like the
gpio_keys driver, support for that should be added. I never used this
driver and can't say whether it is under active development.
> Is my understanding wrong?
One thing you should also know is that once the kernel driver is active,
it blocks the address it is configured to, so you can't access the same
address via the userspace API. That might be confusing if you're not
aware of that.
Daniel
More information about the linux-arm-kernel
mailing list