Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1541098
| From | Rob Herring <robh@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 3/5] i2c: designware: Add slave definitions |
| Date | 2016-12-13 15:20 +0100 |
| Message-ID | <sNW5X-2d2-1@gated-at.bofh.it> (permalink) |
| References | (1 earlier) <sLOFA-3bg-17@gated-at.bofh.it> <sNCgV-72u-15@gated-at.bofh.it> <sNDG1-7LQ-19@gated-at.bofh.it> <sNI2Z-22p-13@gated-at.bofh.it> <sNT85-tf-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: [PATCH v4 3/5] i2c: designware: Add slave definitions Rob Herring <robh@kernel.org> - 2016-12-12 18:10 +0100
RE: [PATCH v4 3/5] i2c: designware: Add slave definitions Luis de Oliveira <Luis.Oliveira@synopsys.com> - 2016-12-12 19:40 +0100
Re: [PATCH v4 3/5] i2c: designware: Add slave definitions Rob Herring <robh@kernel.org> - 2016-12-13 00:20 +0100
RE: [PATCH v4 3/5] i2c: designware: Add slave definitions Luis de Oliveira <Luis.Oliveira@synopsys.com> - 2016-12-13 12:10 +0100
Re: [PATCH v4 3/5] i2c: designware: Add slave definitions Rob Herring <robh@kernel.org> - 2016-12-13 15:20 +0100
Re: [PATCH v4 3/5] i2c: designware: Add slave definitions Luis Oliveira <Luis.Oliveira@synopsys.com> - 2016-12-22 16:10 +0100
Re: [PATCH v4 3/5] i2c: designware: Add slave definitions Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2016-12-22 16:40 +0100
csiph-web