[i2c] [PATCH] Add polling transfer for i2c-pxa
Mike Rapoport
mike at compulab.co.il
Mon Nov 19 16:24:23 CET 2007
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.
>> #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.
--
Sincerely yours,
Mike.
-------------------------------------------------------------------
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