[PATCH v3 5/6] i2c: Add Actions Semiconductor Owl family S900 I2C driver
From: Andy Shevchenko <hidden>
Date: 2018-07-01 09:12:02
Also in:
linux-devicetree, linux-gpio, linux-i2c, lkml
From: Andy Shevchenko <hidden>
Date: 2018-07-01 09:12:02
Also in:
linux-devicetree, linux-gpio, linux-i2c, lkml
On Sun, Jul 1, 2018 at 11:41 AM, Manivannan Sadhasivam [off-list ref] wrote:
On Sun, Jul 01, 2018 at 01:43:33PM +0530, Manivannan Sadhasivam wrote:quoted
On Sun, Jul 01, 2018 at 12:11:00AM +0300, Andy Shevchenko wrote:quoted
On Sat, Jun 30, 2018 at 4:33 PM, Manivannan Sadhasivam [off-list ref] wrote:quoted
Add Actions Semiconductor Owl family S900 I2C driver.
quoted
quoted
quoted
+static int owl_i2c_reset(struct owl_i2c_dev *i2c_dev) +{quoted
+ mdelay(1);But now, since it's not used in atomic context, we may switch to usleep_range() / msleep() instead.okay, will use msleep()Just realised, I have to use spinlock for the entire owl_i2c_master_xfer function, so can't use sleep* for delay.quoted
quoted
quoted
+ owl_i2c_update_reg(i2c_dev->base + OWL_I2C_REG_CTL, + OWL_I2C_CTL_EN, true); +quoted
+ /* Wait 50ms for FIFO reset complete */ + do {quoted
+ mdelay(1);Especially in this case it's very important.Okay.Same here, but I'm not sure about the latency. What is your suggestion?
Look at other i2c bus drivers, check with data sheet you have, try to refactor / redesign code that wouldn't need to sleep so long in atomic context. -- With Best Regards, Andy Shevchenko