Using PXA arm board with MAX7319 GPIO expander input

Jebediah Huang jebediah.huang at gmail.com
Mon Feb 8 02:02:14 EST 2010


On Mon, Feb 8, 2010 at 2:02 PM, Eric Miao <eric.y.miao at gmail.com> wrote:
> On Mon, Feb 8, 2010 at 1:44 PM, Jebediah Huang <jebediah.huang at gmail.com> wrote:
>> static struct i2c_board_info i2c_board_info[] =
>> {
>>        {
>>                .type           = "max7319",
>>                .addr           = 0x6C,
>>                .irq            = IRQ_GPIO(105),
>
> This doesn't look correct, if max7319 is ever able to interrupt the host
> CPU, this should be something other than SDA.

Thank you. I remove irq now. It is not used.

>
> However, this isn't supposed to be the reason for the failure. The
> failure looks like an I2C communication issue to me, which means:
>
> 1. the i2c host driver isn't setup correctly
> 2. pin setup
> 3. max7319 power supply and chip select
> 4. i2c bus (incorrect pull-up/down etc)
> 5. i2c device address
>
> I'd recommend an oscilloscope/LA for the I2C protocol on the lines
> to identify the real issue.
>

I test hardware is ok. I test with this:
 {
        int fd, t;
        int i;
        char buf[512];
        fd = open("/dev/i2c-0", O_RDWR);
        printf("fd=%d\n",fd);
        t = ioctl(fd, I2C_SLAVE, 0x6c);
        printf("t=%d\n",t);
        memset(buf,0,512);
        t = read(fd,buf,512);
        printf("t=%d\n",t);
        for(i=0;i<t;i++) {
        printf("0x%x,",buf[i]);
        }
        printf("\n");
        exit(0);
}

output if max732x enabled is:
# ./i2ctest
[  184.070025] i2c: error: exhausted retries
fd=3
t=-1
[  184.074256] i2c: msg_num: 0 msg_idx: -2000 msg_ptr: 0
[  184.080428] i2c: ICR: 000007e0 ISR: 00000002
[  184.080444] i2c: log: [00000006:00000000] [00000006:00000000]
[00000006:00000000] [00000006:00000000] [00000006:00000000]
[00000006:00000000] [00000006:00
000000] [00000006:00000000] [00000006:00000000] [00000006:00000000]
[00000006:00000000] [00000007:00000000] [00000447:000007e0]
t=-1

disable max732x is:
# ./i2ctest no button pressed
fd=3
t=0
t=512
0xff,0x8,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff
,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0
,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xf
f,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x
0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x
ff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0
x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0
xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,
0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,
0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff
,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0
,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xf
f,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x
0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0x
ff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,0xff,0x0,


# ./i2ctest 2 button p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