From: Rob Herring <robh@kernel.org>
To: Luis de Oliveira <Luis.Oliveira@synopsys.com>
Cc: "wsa@the-dreams.de" <wsa@the-dreams.de>,
"mark.rutland@arm.com" <mark.rutland@arm.com>,
"jarkko.nikula@linux.intel.com" <jarkko.nikula@linux.intel.com>,
"andriy.shevchenko@linux.intel.com"
<andriy.shevchenko@linux.intel.com>,
"mika.westerberg@linux.intel.com"
<mika.westerberg@linux.intel.com>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Ramiro.Oliveira@synopsys.com" <Ramiro.Oliveira@synopsys.com>,
"Joao.Pinto@synopsys.com" <Joao.Pinto@synopsys.com>,
"CARLOS.PALMINHA@synopsys.com" <CARLOS.PALMINHA@synopsys.com>
Subject: Re: [PATCH v4 3/5] i2c: designware: Add slave definitions
Date: Tue, 13 Dec 2016 08:11:49 -0600 [thread overview]
Message-ID: <CAL_Jsq+DDx460jcLj34_X9MdtCqyc4izwc=3ThnFri+NjBaGUA@mail.gmail.com> (raw)
In-Reply-To: <BCF0D4927F9C694C9AEA8827D4A9C7C897CEDB@de02wembxa.internal.synopsys.com>
Again, please don't top post. And your line wrapping is messed up.
IOW, you can't use Outlook.
On Tue, Dec 13, 2016 at 4:50 AM, Luis de Oliveira
<Luis.Oliveira@synopsys.com> wrote:
> The controller for i2c-designware cannot be slave/master at the same time and it has to be enabled knowing beforehand if we want it to be slave or master by something outside of the controller itself.
>
> I as looking and I see the use of this I2C_OWN_SLAVE_ADDRESS with the "linux,slave-24c02" slave interface but I am not seeing how it will help me identify a selected i2c-designware block as a "slave" device before instantiation. I'm sorry if I'm not understanding properly.
> I use the "linux,slave-24c02" to instantiate the i2c-designware as a slave with an address so I can do write/read operations, it is how I tested it.
Something like this:
of_for_each_child_node(child) {
of_property_read_u32(child, "reg", ®);
if (reg & I2C_OWN_SLAVE_ADDRESS))
im_a_slave = true;
}
...rather than testing "mode" is equal to "slave".
Rob
>
> Luis
>
> -----Original Message-----
> From: Rob Herring [mailto:robh@kernel.org]
> Sent: Monday, December 12, 2016 23:16
> To: Luis de Oliveira <Luis.Oliveira@synopsys.com>
> Cc: wsa@the-dreams.de; mark.rutland@arm.com; jarkko.nikula@linux.intel.com; andriy.shevchenko@linux.intel.com; mika.westerberg@linux.intel.com; linux-i2c@vger.kernel.org; devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; Ramiro.Oliveira@synopsys.com; Joao.Pinto@synopsys.com; CARLOS.PALMINHA@synopsys.com
> Subject: Re: [PATCH v4 3/5] i2c: designware: Add slave definitions
>
> On Mon, Dec 12, 2016 at 12:35 PM, Luis de Oliveira <Luis.Oliveira@synopsys.com> wrote:
>> Hi all,
>
> Please don't top post.
>
>>
>> The slave address could be set by the I2C slave backend so I can't use it to setup the controller.
>> A boolean property was my initial approach then Andy and Wolfram Sang suggested the use of compatible strings and later It was suggested to use a property to select mode but I can do it again if it's the best way.
>> Can you please tell me where should it be documented?
>
> bindings/i2c/i2c.txt.
>
> Actually, looking at this some more, we already have a way to describe the controller being a slave device with the I2C_OWN_SLAVE_ADDRESS flag in the reg property. We should just need a helper to read reg property of each child and check for the bit set.
>
> Rob
next prev parent reply other threads:[~2016-12-13 14:12 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-07 17:55 [PATCH v4 0/5] i2c: designware: Add slave support Luis Oliveira
2016-12-07 17:55 ` [PATCH v4 1/5] i2c: designware: Refactoring of the i2c-designware Luis Oliveira
2016-12-07 18:58 ` Andy Shevchenko
2016-12-07 17:55 ` [PATCH v4 2/5] i2c: designware: Master mode as separated driver Luis Oliveira
2016-12-07 19:03 ` Andy Shevchenko
2016-12-07 17:55 ` [PATCH v4 3/5] i2c: designware: Add slave definitions Luis Oliveira
2016-12-07 19:11 ` Andy Shevchenko
2016-12-12 17:02 ` Rob Herring
2016-12-12 18:35 ` Luis de Oliveira
2016-12-12 23:15 ` Rob Herring
2016-12-13 10:50 ` Luis de Oliveira
2016-12-13 14:11 ` Rob Herring [this message]
2016-12-22 14:59 ` Luis Oliveira
2016-12-22 15:29 ` Andy Shevchenko
2016-12-07 17:55 ` [PATCH v4 4/5] i2c: designware: Add slave mode as separated driver Luis Oliveira
2016-12-07 19:07 ` Mark Rutland
2016-12-07 19:49 ` Andy Shevchenko
2016-12-08 4:38 ` kbuild test robot
2016-12-10 23:44 ` kbuild test robot
2016-12-07 17:55 ` [PATCH v4 5/5] i2c: designware: Cleaning comments and formatation Luis Oliveira
2016-12-07 19:52 ` Andy Shevchenko
2016-12-13 15:08 ` Jarkko Nikula
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='CAL_Jsq+DDx460jcLj34_X9MdtCqyc4izwc=3ThnFri+NjBaGUA@mail.gmail.com' \
--to=robh@kernel.org \
--cc=CARLOS.PALMINHA@synopsys.com \
--cc=Joao.Pinto@synopsys.com \
--cc=Luis.Oliveira@synopsys.com \
--cc=Ramiro.Oliveira@synopsys.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devicetree@vger.kernel.org \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mika.westerberg@linux.intel.com \
--cc=wsa@the-dreams.de \
/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).