lkml.org 
[lkml]   [2021]   [Feb]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] mfd: da9063: Support SMBus and I2C mode

> + if (i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C)) {
> + dev_info(da9063->dev, "I2C mode");
> + busmode = 0;
> + } else {
> + dev_info(da9063->dev, "SMBus mode");
> + busmode = DA9063_TWOWIRE_TO;
> + }

In principle, this looks good and is sane to do. I'd just suggest to
leave out the dev_info calls and maybe just do:

busmode = i2c_check_functionality(i2c->adapter, I2C_FUNC_I2C) ?
0 : DA9063_TWOWIRE_TO;

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2021-02-06 05:22    [W:0.114 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site