linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lee Jones <lee.jones@linaro.org>
To: Adam Ward <Adam.Ward.opensource@diasemi.com>
Cc: Mark Jonas <toertel@gmail.com>,
	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: Wed, 10 Mar 2021 08:58:09 +0000	[thread overview]
Message-ID: <20210310085809.GE4931@dell> (raw)
In-Reply-To: <VI1PR1001MB09741B1D3E04155E58D65DF9EC929@VI1PR1001MB0974.EURPRD10.PROD.OUTLOOK.COM>

On Tue, 09 Mar 2021, Adam Ward wrote:

> 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);

Thanks for checking this.  You're right.

The example was provided as a back-of-a-fag-packet design, not a
fully tested (or even compiled) solution.  It took me 2 mins to type
out.

> > 		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.

A default value is a default value. :)

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

      reply	other threads:[~2021-03-10  8:59 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
2021-03-10  8:58         ` Lee Jones [this message]

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=20210310085809.GE4931@dell \
    --to=lee.jones@linaro.org \
    --cc=Adam.Thomson.Opensource@diasemi.com \
    --cc=Adam.Ward.opensource@diasemi.com \
    --cc=Support.Opensource@diasemi.com \
    --cc=hubert.streidl@de.bosch.com \
    --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).