From: Wolfram Sang <wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
To: Marc Dietrich <marvin24-Mmb7MZpHnFY@public.gmane.org>
Cc: linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Jean Delvare <jdelvare-l3A5Bk7waGM@public.gmane.org>,
Magnus Damm <magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Andrey Danin <danindrey-JGs/UdohzUI@public.gmane.org>,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
Subject: Re: [RFC 4/4] ARM: shmobile: r8a7790: adapt DTS for I2C slave support
Date: Thu, 11 Sep 2014 16:12:58 +0200 [thread overview]
Message-ID: <20140911141257.GC5149@katana> (raw)
In-Reply-To: <16809905.2REViph6WO@fb07-iapwap2>
[-- Attachment #1: Type: text/plain, Size: 2343 bytes --]
On Thu, Sep 11, 2014 at 02:17:16PM +0200, Marc Dietrich wrote:
> cc'ing: devicetree
Thanks, I forgot that!
> > -&iic1 {
> > +&i2c1 {
> > status = "ok";
> > - pinctrl-0 = <&iic1_pins>;
> > + pinctrl-0 = <&i2c1_pins>;
> > pinctrl-names = "default";
> > +
> > + eeprom@64 {
> > + compatible = "slave-24c02";
>
> a "real" compatible value should have vendor,device syntax.
I know. This is maybe a grey line between "configuration" and "hardware
description". If we want an I2C slave, we need to things:
a) HW support in the I2C master driver
b) SW support by giving the slave callback some functionality (like my
eeprom simulator)
a) should be compiled in with the master driver and does not need any DT
binding, so this is easy.
b) could be seen as a configuration thing since the functionality
backend could be changed at runtime even. Think of being a usb-gadget
here. However, since I2C is multi-master and not hot-pluggable, some
other master might be depending on what I2C slave is actually used.
So, it could be seen as hardware description, too? Not entirely sure.
The drawback you also noticed is that there is no vendor for these
functionalities. Maybe "wsa" since I did the functionality driver :)
To be honest, the above DT snipplet was done to get easily started. If
DT maintainers think this is more configuration, not much is lost. The
only difference is that the userspace instantiation method should be
used then:
# echo slave-24c02 0x64 > /sys/bus/i2c/devices/i2c-0/new_device
>
> > + reg = <0x64>;
>
> we had some discussions in the past how to represent i2c master devices in
> device tree. The outcome was to use to a special representation to distinguish
> them from slave devices, e.g. something like reg = <0x1 0x64>, where the 0x1
> would mean "master" device (0x0 -> slave). If nothing is added, then it's also
> slave. The adapter address cell would also need to be changed if this
> extension is used.
Please don't change the reg-layout which is around since forever.
It will break all existing devicetrees. NAK.
> An alternative would be to use a special property (e.g. slave address), but
> that would encode the same value twice (or even three times).
As said, if all breaks we handle it at runtime.
Thanks,
Wolfram
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-09-11 14:12 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 14:54 [RFC 0/4] i2c: slave support framework for Linux devices Wolfram Sang
2014-09-09 14:54 ` [RFC 1/4] i2c: core changes for slave support Wolfram Sang
2014-09-09 14:54 ` [RFC 2/4] i2c: slave: add eeprom simulator driver Wolfram Sang
2014-09-09 16:34 ` Wolfram Sang
2014-09-09 14:54 ` [RFC 3/4] i2c: rcar: add slave support Wolfram Sang
2014-09-09 14:54 ` [RFC 4/4] ARM: shmobile: r8a7790: adapt DTS for I2C " Wolfram Sang
2014-09-11 12:17 ` Marc Dietrich
2014-09-11 14:12 ` Wolfram Sang [this message]
2014-09-11 14:40 ` Wolfram Sang
2014-09-11 14:52 ` Marc Dietrich
2014-09-11 14:54 ` Wolfram Sang
2014-09-12 7:51 ` Marc Dietrich
2014-09-12 8:08 ` Geert Uytterhoeven
2014-09-12 8:33 ` Wolfram Sang
2014-09-12 9:06 ` Marc Dietrich
2014-09-12 9:58 ` Wolfram Sang
2014-09-12 10:10 ` Geert Uytterhoeven
2014-09-12 10:26 ` Wolfram Sang
2014-09-12 11:42 ` Marc Dietrich
2014-09-12 12:15 ` Wolfram Sang
2014-09-11 14:49 ` Marc Dietrich
2014-09-11 12:06 ` [RFC 0/4] i2c: slave support framework for Linux devices Marc Dietrich
[not found] ` <1410274470-12712-1-git-send-email-wsa-z923LK4zBo2bacvFa/9K2g@public.gmane.org>
2014-09-12 8:58 ` Uwe Kleine-König
2014-09-12 9:12 ` Wolfram Sang
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=20140911141257.GC5149@katana \
--to=wsa-z923lk4zbo2bacvfa/9k2g@public.gmane.org \
--cc=danindrey-JGs/UdohzUI@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=jdelvare-l3A5Bk7waGM@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sh-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=magnus.damm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=marvin24-Mmb7MZpHnFY@public.gmane.org \
--cc=swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.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).