[PATCH v4 3/3] i2c: zx2967: add i2c controller driver for ZTE's zx2967 family
Jun Nie
jun.nie at linaro.org
Tue Feb 7 02:09:04 PST 2017
On 2017年02月06日 11:26, Baoyou Xie wrote:
> +}
> +
> +static irqreturn_t zx2967_i2c_isr(int irq, void *dev_id)
> +{
> + u32 status;
> + struct zx2967_i2c_info *zx_i2c = (struct zx2967_i2c_info *)dev_id;
> + unsigned long flags;
> +
> + spin_lock_irqsave(&zx_i2c->lock, flags);
> +
> + status = zx2967_i2c_readl(zx_i2c, REG_STAT) & I2C_INT_MASK;
> + zx2967_i2c_isr_clr(zx_i2c);
> +
> + if (status & I2C_ERROR_MASK) {
> + spin_unlock_irqrestore(&zx_i2c->lock, flags);
> + return IRQ_HANDLED;
> + }
> +
> + if (status & I2C_TRANS_DONE)
> + complete(&zx_i2c->complete);
> +
> + spin_unlock_irqrestore(&zx_i2c->lock, flags);
The spin lock appears only once here, in ISR. I am not sure what you
want to protect.
> +
> + return IRQ_HANDLED;
> +}
> +
I am fine with all other parts.
Jun
More information about the linux-arm-kernel
mailing list