From: Mark Brown <broonie@kernel.org>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
Shuge <shuge@allwinnertech.com>,
kevin@allwinnertech.com, Chen-Yu Tsai <wens@csie.org>,
Hans de Goede <hdegoede@redhat.com>,
Carlo Caione <carlo@caione.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, dev@linux-sunxi.org
Subject: Re: [RFC PATCH v2] regmap: smbus: add support for regmap over smbus
Date: Tue, 15 Apr 2014 23:38:50 +0100 [thread overview]
Message-ID: <20140415223849.GJ12304@sirena.org.uk> (raw)
In-Reply-To: <534D85F3.5050009@metafoo.de>
[-- Attachment #1: Type: text/plain, Size: 2372 bytes --]
On Tue, Apr 15, 2014 at 09:18:11PM +0200, Lars-Peter Clausen wrote:
> On 04/15/2014 06:46 PM, Mark Brown wrote:
> >Please note what I said about convenience - if lots of devices have
> >exactly the same set of constraints to set up it's possible sensible to
> >have a standard way of specifying them. It's going to be a bit easier
> >to just say it's smbus than to remember exactly what that means.
> Maybe, but the only shared constraint is reg_bits = 8 (and if it is pure
> smbus use_single_rw = true).
I thought there was some other stuff at the edge of the protocol, though
perhaps I misremember. We do also have the thing with implementing the
bulk write differently.
> It's a bit of an exotic case, there seem to be only two I2C controller
> drivers in the Linux kernel that have support for both raw I2C and native
> SMBus and neither of them don't seem to be fairly recent (i2c-powermac.c and
> i2c-pasemi.c). And on the other hand most devices are SMBus compatible have
Blackfin was another - I didn't look that far to be honest since the
first few that I found did it.
> extensions like being able to write/read multiple register in one transfer
> if raw I2C access is available, which is something we want to make use of if
> available.
Sure, if the device supports it.
> And the other thing to consider is that a client driver currently has no way
> to query whether the controller driver supports native SMBus or only
> emulated SMBus. This is surely something that can be added to the I2C core,
> but this is necessarily something that we require before any SMBus support
> is added to regmap.
Right, that'll take a couple of minutes though.
> So in conclusion I think the best way forward is to create a patch that
> checks if native I2C is available, and if not falls back to either
> SMBUS_{WRITE,READ}_BYTE or SMBUS_{WRITE,READ}_WORD operations (Depending on
> whether val_bits is 8 or 16). Such a patch, I think, has the most effect for
> the least amount of work since it is rather simple and self contained and
> allows all devices which are SMBus compatible to be used with SMBus-only
> controllers. Everything else discussed in this thread (optimizations for
> special cases, convince helpers) can then be implemented on top of that.
Indeed, like I've been saying there's several orthogonal things going on
here and that's one of them.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-04-15 22:39 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-12 8:45 [RFC PATCH] regmap: smbus: add support for regmap over SMBus Boris BREZILLON
2014-04-12 9:02 ` Boris BREZILLON
2014-04-14 13:08 ` [RFC PATCH v2] " Boris BREZILLON
2014-04-14 21:04 ` Mark Brown
2014-04-15 7:36 ` Boris BREZILLON
2014-04-15 10:09 ` Mark Brown
2014-04-15 11:54 ` Boris BREZILLON
2014-04-15 12:10 ` Mark Brown
2014-04-15 12:25 ` Lars-Peter Clausen
2014-04-15 12:40 ` Boris BREZILLON
2014-04-15 13:08 ` Lars-Peter Clausen
2014-04-15 12:56 ` [RFC PATCH v2] regmap: smbus: add support for regmap over smbus Mark Brown
2014-04-15 13:34 ` Lars-Peter Clausen
2014-04-15 16:46 ` Mark Brown
2014-04-15 19:18 ` Lars-Peter Clausen
2014-04-15 22:38 ` Mark Brown [this message]
2014-04-16 8:16 ` [PATCH] regmap: i2c: fallback to SMBus if the adapter does not support standard I2C Boris BREZILLON
2014-04-16 17:06 ` Mark Brown
2014-04-16 17:16 ` Boris BREZILLON
2014-04-16 21:00 ` 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=20140415223849.GJ12304@sirena.org.uk \
--to=broonie@kernel.org \
--cc=boris.brezillon@free-electrons.com \
--cc=carlo@caione.org \
--cc=dev@linux-sunxi.org \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=kevin@allwinnertech.com \
--cc=lars@metafoo.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.ripard@free-electrons.com \
--cc=shuge@allwinnertech.com \
--cc=wens@csie.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
all inboxes | Powered by JetHome®