* Try to detect the FIFO depth if not set by interface driver,
* the depth could be from 2 to 256 from HW spec.
*/
+ ret = i2c_dw_acquire_lock(dev);
+ if (ret)
+ return ret;
+
ret = regmap_read(dev->map, DW_IC_COMP_PARAM_1, ¶m);
+ i2c_dw_release_lock(dev);
if (ret)
return ret;
void i2c_dw_disable(struct dw_i2c_dev *dev)
{
u32 dummy;
+ int ret;
+
+ ret = i2c_dw_acquire_lock(dev);
+ if (ret)
+ return;
/* Disable controller */
__i2c_dw_disable(dev);
/* Disable all interrupts */
regmap_write(dev->map, DW_IC_INTR_MASK, 0);
regmap_read(dev->map, DW_IC_CLR_INTR, &dummy);
+
+ i2c_dw_release_lock(dev);
}
void i2c_dw_disable_int(struct dw_i2c_dev *dev)
irq_flags = IRQF_SHARED | IRQF_COND_SUSPEND;
}
+ ret = i2c_dw_acquire_lock(dev);
+ if (ret)
+ return ret;
+
i2c_dw_disable_int(dev);
+ i2c_dw_release_lock(dev);
+
ret = devm_request_irq(dev->dev, dev->irq, i2c_dw_isr, irq_flags,
dev_name(dev->dev), dev);
if (ret) {