lkml.org 
[lkml]   [2021]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v4] mfd: da9063: Support SMBus and I2C mode
Date
Hi Lee,

Tidy, but I've noticed the logic got inverted along the way:

> On Tue 09 Mar 2021, Lee Jones wrote:
> On Tue, 09 Mar 2021, Mark Jonas wrote:
> This is my suggestion:
>
> /* If SMBus Mode is not available, enter Two-Wire Mode */
> if (!i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) {

Determine bus *is* I2C, so assume SMBus timings not supported...
if (i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) {

> ret = regmap_update_bits(da9063->regmap, DA9063_REG_CONFIG_J,
> DA9063_TWOWIRE_TO, DA9063_TWOWIRE_TO);

...and *clear* the (currently set by default) timeout bit:
DA9063_TWOWIRE_TO, 0);

> if (ret < 0) {
> dev_err(da9063->dev, "Failed to set Two-Wire Bus
> Mode\n");
> return -EIO;
> }
> }

I think you're right to exclude a case; vendor motivation to override the TO default seems inherently trustworthy.

Best regards,
Adam

\
 
 \ /
  Last update: 2021-03-09 23:44    [W:0.078 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site