Using PXA arm board with MAX7319 GPIO expander input

Jebediah Huang jebediah.huang at gmail.com
Mon Feb 8 06:08:06 EST 2010


On Mon, Feb 8, 2010 at 3:02 PM, Jebediah Huang <jebediah.huang at gmail.com> wrote:
>
> # ./i2ctest 2 button pressed
> fd=3
> t=0
> t=512
> 0x7f,0x80,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7
> f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x
> 0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x
> 7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0
> x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0
> x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x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x7f,0x0,0x7f,0x0,0x
> 7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0
> x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0
> x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,0x7f,0x0,
>
> I think problem is my setup max732x failure.
>

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.

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
               .platform_data  = &max7319_data[0],
       },
};

static unsigned long peony_pin_config[] __initdata = {
       /* i2c bus */
       GPIO105_CI2C_SDA,
       GPIO106_CI2C_SCL,
} <= this correct because i2c-dev can work.

Is my understanding wrong?



More information about the linux-arm-kernel mailing list