linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Mack <daniel@caiaq.de>
To: Jebediah Huang <jebediah.huang@gmail.com>
Cc: Eric Miao <eric.y.miao@gmail.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-input@vger.kernel.org
Subject: Re: Using PXA arm board with MAX7319 GPIO expander input
Date: Mon, 8 Feb 2010 08:36:13 +0100	[thread overview]
Message-ID: <20100208073612.GV28972@buzzloop.caiaq.de> (raw)
In-Reply-To: <bf0eec9a1002072302w1e81cc6bkd994c3efaab4d51d@mail.gmail.com>

On Mon, Feb 08, 2010 at 03:02:14PM +0800, Jebediah Huang wrote:
> On Mon, Feb 8, 2010 at 2:02 PM, Eric Miao <eric.y.miao@gmail.com> wrote:
> > On Mon, Feb 8, 2010 at 1:44 PM, Jebediah Huang <jebediah.huang@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.

If you didn't wire an IRQ from the max7319 to your CPU, you can't easily
use it as an input device. I2C is a polled bus, all transactions are
always initiated from the CPU side. So you would need to 'ask' the chip
constantly for its current state, which is not good.

The INT line should be connected to some GPIO on your PXA so the chip
can actively let the PXA know when any input line stated changed.
Everything else makes very little sense.

> 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

How do you enable/disable the chip? As Eric said, the error above
indicates an eletrical issue with the bus. 

> disable max732x is:
> # ./i2ctest no button pressed

What are you testing without the chip?

Daniel

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-02-08  7:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08  5:44 Using PXA arm board with MAX7319 GPIO expander input Jebediah Huang
2010-02-08  6:02 ` Eric Miao
2010-02-08  7:02   ` Jebediah Huang
2010-02-08  7:36     ` Daniel Mack [this message]
2010-02-08  7:56       ` Jebediah Huang
2010-02-08 11:08     ` Jebediah Huang
2010-02-08 11:33       ` Daniel Mack
2010-02-08 12:32         ` Marc Zyngier
2010-02-08 13:04           ` Daniel Mack
2010-02-09  1:05           ` Eric Miao
2010-02-09  7:39             ` Marc Zyngier
2010-02-09  8:19               ` Eric Miao
2010-02-09 10:22                 ` Marc Zyngier
2010-02-09  1:07 ` Eric Miao

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100208073612.GV28972@buzzloop.caiaq.de \
    --to=daniel@caiaq.de \
    --cc=eric.y.miao@gmail.com \
    --cc=jebediah.huang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).