From: Wolfram Sang <wsa@the-dreams.de>
To: Marc Dietrich <marvin24@gmx.de>
Cc: linux-i2c@vger.kernel.org, linux-sh@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Jean Delvare <jdelvare@suse.de>,
Magnus Damm <magnus.damm@gmail.com>,
Andrey Danin <danindrey@mail.ru>,
devicetree@vger.kernel.org,
Stephen Warren <swarren@wwwdotorg.org>
Subject: Re: [RFC 4/4] ARM: shmobile: r8a7790: adapt DTS for I2C slave support
Date: Fri, 12 Sep 2014 11:58:21 +0200 [thread overview]
Message-ID: <20140912095821.GB1930@katana> (raw)
In-Reply-To: <7627175.tG5quZH0VN@fb07-iapwap2>
[-- Attachment #1: Type: text/plain, Size: 2024 bytes --]
> ok, take our embedded controller driver (in staging/nvec) as an example. It's
> basicly an MFD connecting keyboard, mouse, power, gpio, and some other stuff
> to the soc. The MFD operates in master mode while the SOC is the I2C slave.
> Theoretically, these roles could also switch (but that's not defined in the
> nvec protocol).
I see these cases currently:
1) my current case
The I2C slave is not needed for board bringup, mainly for development or
playing around. It can have this or that functionality on this or that
address. -> does not belong into DT, should be done in userspace
2) Slave mode is needed for board bringup
Some other components need a specific I2C slave to be present before
userspace is available, otherwise the system is unusable. This is IMO
then a hardware description and justifies DT entries:
DT pseudocode:
i2c {
compatible = "nvidia, tegra-i2c";
ec-slave@42 {
compatible = "nvidia, ax100-ec-slave";
reg = <0x42>;
};
};
Of course, an MFD driver providing "nvidia, ax100-ec-slave" is needed
which uses the I2C slave mode of the tegra controller.
3) Master + slave mode is needed for board bringup:
Again, IMO a hardware description, so we could use:
i2c {
compatible = "nvidia, tegra-i2c";
ec@64 {
compatible = "nvidia, ax100-ec";
reg = <0x64>;
};
};
This is a standard I2C device driver (using the MFD framework) where
i2c-tegra would act as a master on the client for 0x64. However, its
probe function can fill an i2c_board_device (the driver should know the
slave device address because of the protocol), get a new client using
i2c_new_device, and register that as a I2C slave client. It then has an
address where it listens and an address where it can send to. When to do
what is protocol implementation.
Am I missing something? Board properties can be encoded within the
compatible entries ("ax100-ec", "ax200-ec"...). I'd think this means
mostly different protocols, though.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-09-12 9:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1410274470-12712-1-git-send-email-wsa@the-dreams.de>
[not found] ` <1410274470-12712-5-git-send-email-wsa@the-dreams.de>
2014-09-11 12:17 ` [RFC 4/4] ARM: shmobile: r8a7790: adapt DTS for I2C slave support Marc Dietrich
2014-09-11 14:12 ` Wolfram Sang
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 [this message]
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
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=20140912095821.GB1930@katana \
--to=wsa@the-dreams.de \
--cc=danindrey@mail.ru \
--cc=devicetree@vger.kernel.org \
--cc=jdelvare@suse.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=marvin24@gmx.de \
--cc=swarren@wwwdotorg.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).