* Two start conditions for PCA9554
@ 2008-04-29 13:11 Hans J. Koch
2008-04-30 21:26 ` Trent Piepho
0 siblings, 1 reply; 5+ messages in thread
From: Hans J. Koch @ 2008-04-29 13:11 UTC (permalink / raw)
To: i2c-GZX6beZjE8VD60Wz+7aTrA
I have an embedded board with a PCA9554 on it. It's an 8-bit IO expander
similar to the PCF8574 in mainline. One difference is that when reading
from the inputs, you have to do the following:
- start condition
- send slave address, R/W=0
- send command (0x00 = read input register)
- issue another start condition (!)
- send slave address, R/W=1
- read data
- stop condition
Can such a protocol be handled by the i2c subsystem?
Thanks,
Hans
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Two start conditions for PCA9554
2008-04-29 13:11 Two start conditions for PCA9554 Hans J. Koch
@ 2008-04-30 21:26 ` Trent Piepho
[not found] ` <Pine.LNX.4.58.0804301422140.9894-13q4cmjDBaTP3RPoUHIrnuTW4wlIGRCZ@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Trent Piepho @ 2008-04-30 21:26 UTC (permalink / raw)
To: Hans J. Koch; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA
On Tue, 29 Apr 2008, Hans J. Koch wrote:
> I have an embedded board with a PCA9554 on it. It's an 8-bit IO expander
> similar to the PCF8574 in mainline. One difference is that when reading
> from the inputs, you have to do the following:
>
> - start condition
> - send slave address, R/W=0
> - send command (0x00 = read input register)
> - issue another start condition (!)
> - send slave address, R/W=1
> - read data
> - stop condition
>
> Can such a protocol be handled by the i2c subsystem?
Yes. That is a normal repeated start transaction, and AFAIK exactly what
all the other PCA, and virtually every other i2c chip for that matter, use.
The smbus read byte data function will do this for you.
If you want multiple stops in a single transaction, the i2c subsystem can't
do it, but I wrote a simple patch that allows it.
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Two start conditions for PCA9554
@ 2008-05-01 6:01 David Brownell
[not found] ` <200804302301.56732.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: David Brownell @ 2008-05-01 6:01 UTC (permalink / raw)
To: Hans-Jürgen Koch; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA
> I have an embedded board with a PCA9554 on it. It's an 8-bit IO expander
> similar to the PCF8574 in mainline.
More like the pca9534 or pca9538.
> Can such a protocol be handled by the i2c subsystem?
Try to tell drivers/gpio/pca953x.c that it's a pca9534;
I think they're register-compatible.
- Dave
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Two start conditions for PCA9554
[not found] ` <200804302301.56732.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
@ 2008-05-01 20:35 ` Hans J. Koch
0 siblings, 0 replies; 5+ messages in thread
From: Hans J. Koch @ 2008-05-01 20:35 UTC (permalink / raw)
To: David Brownell; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA
On Wed, Apr 30, 2008 at 11:01:56PM -0700, David Brownell wrote:
> > I have an embedded board with a PCA9554 on it. It's an 8-bit IO expander
> > similar to the PCF8574 in mainline.
>
> More like the pca9534 or pca9538.
>
>
> > Can such a protocol be handled by the i2c subsystem?
>
> Try to tell drivers/gpio/pca953x.c that it's a pca9534;
> I think they're register-compatible.
Ah, I only looked in drivers/i2c/chips. I'll give it a try.
Thanks a lot for that hint,
Hans
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Two start conditions for PCA9554
[not found] ` <Pine.LNX.4.58.0804301422140.9894-13q4cmjDBaTP3RPoUHIrnuTW4wlIGRCZ@public.gmane.org>
@ 2008-05-01 20:39 ` Hans J. Koch
0 siblings, 0 replies; 5+ messages in thread
From: Hans J. Koch @ 2008-05-01 20:39 UTC (permalink / raw)
To: Trent Piepho; +Cc: i2c-GZX6beZjE8VD60Wz+7aTrA
On Wed, Apr 30, 2008 at 02:26:22PM -0700, Trent Piepho wrote:
> On Tue, 29 Apr 2008, Hans J. Koch wrote:
> > I have an embedded board with a PCA9554 on it. It's an 8-bit IO expander
> > similar to the PCF8574 in mainline. One difference is that when reading
> > from the inputs, you have to do the following:
> >
> > - start condition
> > - send slave address, R/W=0
> > - send command (0x00 = read input register)
> > - issue another start condition (!)
> > - send slave address, R/W=1
> > - read data
> > - stop condition
> >
> > Can such a protocol be handled by the i2c subsystem?
>
> Yes. That is a normal repeated start transaction, and AFAIK exactly what
> all the other PCA, and virtually every other i2c chip for that matter, use.
> The smbus read byte data function will do this for you.
OK, thanks. I admit, I would be strange if the i2c subsystem didn't
support that.
>
> If you want multiple stops in a single transaction, the i2c subsystem can't
> do it, but I wrote a simple patch that allows it.
No need for that now, but I'll remember that...
Thanks,
Hans
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-05-01 20:39 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-29 13:11 Two start conditions for PCA9554 Hans J. Koch
2008-04-30 21:26 ` Trent Piepho
[not found] ` <Pine.LNX.4.58.0804301422140.9894-13q4cmjDBaTP3RPoUHIrnuTW4wlIGRCZ@public.gmane.org>
2008-05-01 20:39 ` Hans J. Koch
-- strict thread matches above, loose matches on Subject: below --
2008-05-01 6:01 David Brownell
[not found] ` <200804302301.56732.david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
2008-05-01 20:35 ` Hans J. Koch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox