From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932188AbcLLSfy convert rfc822-to-8bit (ORCPT ); Mon, 12 Dec 2016 13:35:54 -0500 Received: from smtprelay4.synopsys.com ([198.182.47.9]:57829 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752111AbcLLSfw (ORCPT ); Mon, 12 Dec 2016 13:35:52 -0500 From: Luis de Oliveira To: Rob Herring , Luis Oliveira 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 Thread-Topic: [PATCH v4 3/5] i2c: designware: Add slave definitions Thread-Index: AQHSULN7jS4rAW2vqEellbSAnvvnyaEEgM4AgAAl61A= Date: Mon, 12 Dec 2016 18:35:47 +0000 Message-ID: References: <5173a9456c423025d8f15baafa2499440cbe1b51.1481131072.git.lolivei@synopsys.com> <20161212170214.4cydp256jsp7srar@rob-hp-laptop> In-Reply-To: <20161212170214.4cydp256jsp7srar@rob-hp-laptop> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.107.25.136] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, 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? Luis -----Original Message----- From: Rob Herring [mailto:robh@kernel.org] Sent: Monday, December 12, 2016 17:02 To: Luis Oliveira 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 Wed, Dec 07, 2016 at 05:55:50PM +0000, Luis Oliveira wrote: > - Add slave definitions to i2c-designware-core > - Changes in Kconfig to auto-enable I2C_SLAVE when compiling the > modules > - Add mode property to designware-core.txt that enable the "slave" selection: > - "mode" is an optional property that could be "slave" or "master" > - if "mode" is not set the block is considered master by default > > Signed-off-by: Luis Oliveira > --- > Changes V3->V4: (Andy Shevchenko) > - created a common property for modes > - placed the generic dependency first > > .../devicetree/bindings/i2c/i2c-designware.txt | 4 ++++ > drivers/i2c/busses/Kconfig | 1 + > drivers/i2c/busses/i2c-designware-common.c | 6 +++++ > drivers/i2c/busses/i2c-designware-core.h | 26 ++++++++++++++++++++++ > 4 files changed, 37 insertions(+) > > diff --git a/Documentation/devicetree/bindings/i2c/i2c-designware.txt > b/Documentation/devicetree/bindings/i2c/i2c-designware.txt > index fee26dc3e858..8ed2b532cd54 100644 > --- a/Documentation/devicetree/bindings/i2c/i2c-designware.txt > +++ b/Documentation/devicetree/bindings/i2c/i2c-designware.txt > @@ -20,6 +20,9 @@ Optional properties : > - i2c-sda-falling-time-ns : should contain the SDA falling time in nanoseconds. > This value which is by default 300ns is used to compute the tHIGH period. > > + - mode : should be either: > + - "master" to setup the hardware block as a I2C master > + - "slave" to setup the hardware block as a I2C slave This should be documented in a common location. Can't it be a boolean to enable slave mode? Or don't you need to set the slave address? That could be enough to enable slave mode and there's already one example doing that. Rob