linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Ward <Adam.Ward.opensource@diasemi.com>
To: Lee Jones <lee.jones@linaro.org>, Mark Jonas <toertel@gmail.com>
Cc: Mark Jonas <mark.jonas@de.bosch.com>,
	Support Opensource <Support.Opensource@diasemi.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
	Adam Thomson <Adam.Thomson.Opensource@diasemi.com>,
	Steve Twiss <stwiss.opensource@diasemi.com>,
	"marek.vasut@gmail.com" <marek.vasut@gmail.com>,
	"RUAN Tingquan (BT-FIR/ENG1-Zhu)" <tingquan.ruan@cn.bosch.com>,
	"Streidl Hubert (BT-FIR/ENG1-Grb)" <hubert.streidl@de.bosch.com>,
	Wolfram Sang <wsa@kernel.org>
Subject: RE: [PATCH v4] mfd: da9063: Support SMBus and I2C mode
Date: Tue, 9 Mar 2021 22:42:46 +0000	[thread overview]
Message-ID: <VI1PR1001MB09741B1D3E04155E58D65DF9EC929@VI1PR1001MB0974.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20210309094211.GN4931@dell>

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


  reply	other threads:[~2021-03-09 22:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-08 15:27 [PATCH v4] mfd: da9063: Support SMBus and I2C mode Mark Jonas
2021-02-09 10:40 ` Wolfram Sang
2021-02-09 13:18 ` Adam Thomson
2021-02-19 16:39   ` AW: " Jonas Mark (BT-FIR/ENG1-Grb)
2021-02-20 11:07     ` Wolfram Sang
2021-02-22  9:10       ` Lee Jones
2021-03-08 14:42 ` Lee Jones
2021-03-09  8:19   ` Mark Jonas
2021-03-09  9:42     ` Lee Jones
2021-03-09 22:42       ` Adam Ward [this message]
2021-03-10  8:58         ` Lee Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR1001MB09741B1D3E04155E58D65DF9EC929@VI1PR1001MB0974.EURPRD10.PROD.OUTLOOK.COM \
    --to=adam.ward.opensource@diasemi.com \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=Support.Opensource@diasemi.com \
    --cc=hubert.streidl@de.bosch.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=mark.jonas@de.bosch.com \
    --cc=stwiss.opensource@diasemi.com \
    --cc=tingquan.ruan@cn.bosch.com \
    --cc=toertel@gmail.com \
    --cc=wsa@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).