Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1546421

Re: [PATCH v4 3/5] i2c: designware: Add slave definitions

From Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 3/5] i2c: designware: Add slave definitions
Date 2016-12-22 16:40 +0100
Message-ID <sRdDk-2MH-17@gated-at.bofh.it> (permalink)
References (3 earlier) <sNDG1-7LQ-19@gated-at.bofh.it> <sNI2Z-22p-13@gated-at.bofh.it> <sNT85-tf-3@gated-at.bofh.it> <sNW5X-2d2-1@gated-at.bofh.it> <sRdai-2C1-31@gated-at.bofh.it>
Organization Intel Finland Oy

Show all headers | View raw


On Thu, 2016-12-22 at 14:59 +0000, Luis Oliveira wrote:
> On 13-Dec-16 14:11, Rob Herring wrote:

> > Something like this:
> > 
> > of_for_each_child_node(child) {
> >   of_property_read_u32(child, "reg", &reg);
> >   if (reg & I2C_OWN_SLAVE_ADDRESS))
> >     im_a_slave = true;
> > }
> > 
> > ...rather than testing "mode" is equal to "slave".
> > 
> > Rob
> > 
> 
> Hi Rob, Andy,
> 
> I'm struggling to implement your suggestion @Rob. I checked the
> tegra124-jetson-tk1.dts that uses that approach but I have some
> doubts.
> 
> My DT is as follows
> 
> 	i2c@0x2000 {
>                         compatible = "snps,designware-i2c";
>                         reg = <0x2000 0x100>;
>                         clock-frequency = <400000>;
>                         clocks = <&i2cclk>;
>                         interrupts = <0>;
> 
> I could add something like this:
> 
> 			eeprom@64 {
> 				compatible = "linux,slave-24c02";
> 				reg = <(I2C_OWN_SLAVE_ADDRESS | 0x64)>;
> 			}
> 
> But I think this is different form what I was doing before. I have two
> questions:
> 
> - This way the I2C controller is identified as a slave controller or
> just the
> subnode eeprom?
> - This way looks like my slave address will be fixed
> 
> In the previous Patch v3 submission @Andy suggested a property that
> selects mode
> that I did and it's working. And you @Rob suggested to do it a common
> property.
> It is implemented in the DT like:
> 
> 			mode = "slave";
> 
> So before I do this changes can you please agree both if you still
> think this is
> the best approach?

I'm a bit lost in the discussion (and TBH busy by something else), so I
would agree on whatever you and Rob make an agreement on.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


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