[i2c] [PATCH] Add polling transfer for i2c-pxa

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Nov 19 16:10:34 CET 2007


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.

> 
>  #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.

-------------------------------------------------------------------
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