From: Jean Delvare <khali@linux-fr.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Greg KH <greg@kroah.com>, Grant Likely <grant@secretlab.ca>,
Ben Dooks <ben-linux@fluff.org>,
Dimitris Papastamos <dp@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@ti.com>, Samuel Oritz <sameo@linux.intel.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/4] regulator: Convert tps65023 to use regmap API
Date: Fri, 15 Jul 2011 14:58:48 +0200 [thread overview]
Message-ID: <20110715145848.750a85aa@endymion.delvare> (raw)
In-Reply-To: <20110715121646.GA10026@opensource.wolfsonmicro.com>
On Fri, 15 Jul 2011 21:16:50 +0900, Mark Brown wrote:
> On Fri, Jul 15, 2011 at 12:31:21PM +0200, Jean Delvare wrote:
>
> > The driver was previously using the SMBus API and could thus work with
> > SMBus (non-I2C) controllers. After your change, an I2C controller is
> > mandatory. Are you sure this is OK for all users?
>
> I'd be *utterly* astonished if it ever caused any issues, embedded
> systems like those that have regulators just don't have anything less
> than full I2C support, it's exceptionally rare to see any direct SMBus
> support in the hardware at all - the only example I can see in the tree
> is Blackfin and that is a proper I2C controller too, it just seems that
> someone overdesigned the hardware a little.
>
> Basically, for something like a regulator it's just not an issue.
OK, alright then.
> > As a general comment, this requirement will considerably limit the
> > interest of regmap for I2C devices (at least in its current form.) Many
> > systems out there only have SMBus controllers, and more importantly,
> > most I2C device drivers are meant to be portable across systems and
> > thus rely on the SMBus API. The i2c documentation encourages driver
> > authors to do this.
>
> Right, so for pretty much anything except PCs the main reason for using
> the SMBus API is that it provides the sort of data mangling to the bus
> functionality that the regmap API provides. The main thing it's missing
> for drivers like this one is that it doesn't have a read/modify/write
> operation, otherwise there would be no current value in switching to the
> regmap API. As far as I can tell this isn't really a big deal except
> for those device classes like hwmon which are frequently deployed in
> PCs, anything else just won't care.
Mostly correct. There are a few other devices which can also be found
on PCs: multiplexers and EEPROMs at least.
> This should be reasonably simple to handle in the regmap API, just teach
> the I2C module to fall back to using the SMBus operations if the
> controller is limited to that. This should be done incrementally as it
> adds complexity, and ideally would be done by someone with some access
> to hardware that can use the SMBus API (I don't have any myself) so they
> can test.
You do have access ;) The i2c core will translate SMBus to I2C as
needed, so all you have to do is temporarily alter the regmap core to
unconditionally translate to SMBus. This will be inefficient (regmap ->
SMBus -> I2C) but should be suitable for testing.
> Does that sound reasonable to you?
Yes, no objection.
> > > static int tps_65023_set_bits(struct tps_pmic *tps, u8 reg, u8 mask)
> > > {
> > > - int err, data;
>
> *Please* could people delete unneeded context from mails?
? There were more comments from me in the rest of the code, which is
why I left it.
--
Jean Delvare
next prev parent reply other threads:[~2011-07-15 13:01 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 6:22 [PATCH 0/4] regmap: Generic I2C and SPI register map library Mark Brown
2011-07-15 6:23 ` [PATCH 1/4] regmap: Add generic non-memory mapped register access API Mark Brown
2011-07-15 6:23 ` [PATCH 2/4] regmap: Add I2C bus support Mark Brown
2011-07-15 6:23 ` [PATCH 3/4] regmap: Add SPI " Mark Brown
2011-07-15 6:23 ` [PATCH 4/4] regulator: Convert tps65023 to use regmap API Mark Brown
2011-07-15 10:31 ` Jean Delvare
2011-07-15 12:16 ` Mark Brown
2011-07-15 12:58 ` Jean Delvare [this message]
2011-07-15 13:10 ` Mark Brown
2011-07-15 13:17 ` Mark Brown
2011-07-17 15:53 ` Jean Delvare
2011-07-18 0:00 ` Grant Likely
2011-07-18 9:44 ` Mark Brown
-- strict thread matches above, loose matches on Subject: below --
2011-07-18 10:04 [PATCH 0/4] regmap: Generic I2C and SPI register map library Mark Brown
2011-07-18 10:07 ` [PATCH 1/4] regmap: Add generic non-memory mapped register access API Mark Brown
2011-07-18 10:07 ` [PATCH 4/4] regulator: Convert tps65023 to use regmap API Mark Brown
2011-07-16 2:48 [PATCH 0/4] regmap: Generic I2C and SPI register map library Mark Brown
2011-07-16 2:48 ` [PATCH 1/4] regmap: Add generic non-memory mapped register access API Mark Brown
2011-07-16 2:48 ` [PATCH 4/4] regulator: Convert tps65023 to use regmap API Mark Brown
2011-07-09 4:49 [PATCH 0/4] regmap: Generic I2C and SPI register map library Mark Brown
2011-07-09 4:50 ` [PATCH 1/4] regmap: Add generic non-memory mapped register access API Mark Brown
2011-07-09 4:50 ` [PATCH 4/4] regulator: Convert tps65023 to use regmap API Mark Brown
2011-07-15 2:53 ` Grant Likely
2011-07-15 4:48 ` Mark Brown
2011-07-15 18:29 ` Grant Likely
2011-07-16 1:47 ` Mark Brown
2011-07-16 2:06 ` Grant Likely
2011-07-16 2:13 ` Mark Brown
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=20110715145848.750a85aa@endymion.delvare \
--to=khali@linux-fr.org \
--cc=ben-linux@fluff.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=dp@opensource.wolfsonmicro.com \
--cc=grant@secretlab.ca \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lrg@ti.com \
--cc=sameo@linux.intel.com \
/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
all inboxes | Powered by JetHome®