[i2c] [PATCH] Add polling transfer for i2c-pxa
Russell King - ARM Linux
linux at arm.linux.org.uk
Mon Nov 19 18:36:20 CET 2007
On Mon, Nov 19, 2007 at 05:24:23PM +0200, Mike Rapoport wrote:
> Russell King - ARM Linux wrote:
> > A couple of other points...
> >
> > On Wed, Nov 14, 2007 at 09:21:59AM +0200, Mike Rapoport wrote:
> >> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> >> index 1a4e8dc..37e3cd9 100644
> >> --- a/drivers/i2c/i2c-core.c
> >> +++ b/drivers/i2c/i2c-core.c
> >> @@ -33,6 +33,7 @@
> >> #include <linux/platform_device.h>
> >> #include <linux/mutex.h>
> >> #include <linux/completion.h>
> >> +#include <linux/delay.h>
> >> #include <asm/uaccess.h>
> >
> > Not sure why this is being added.
>
> It's leftover from a some previous tests. I'll remove it.
Thanks.
> >> #include "i2c-core.h"
> >> @@ -870,7 +871,24 @@ int i2c_transfer(struct i2c_adapter * adap, struct i2c_msg *msgs, int num)
> >> {
> >> int ret;
> >>
> >> - if (adap->algo->master_xfer) {
> >> + if (in_atomic() || irqs_disabled()) {
> >
> > I wonder if it'd make more sense for this to be a per-adapter flag?
> > Eg, so you could switch the bus with the PMIC on to always use PIO
> > transfers.
>
> I'm not sure that making the bus with the PMIC on to always use PIO
> transfers is good idea. As Eric pointed there may be other devices
> on the same bus.
That's exactly why I'm suggesting it - so that the bus is driven in the
same way all the time.
Normal devices shouldn't care that it's being driven in PIO mode - they
don't know that it is.
-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
More information about the i2c
mailing list