Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031694AbdDTRi4 (ORCPT ); Thu, 20 Apr 2017 13:38:56 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:36136 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S945350AbdDTRiw (ORCPT ); Thu, 20 Apr 2017 13:38:52 -0400 Subject: Re: [PATCH v6 3/4] net: dsa: LAN9303: add I2C managed mode support To: Juergen Borleis , netdev@vger.kernel.org References: <20170418084827.19613-1-jbe@pengutronix.de> <20170418084827.19613-4-jbe@pengutronix.de> Cc: linux-kernel@vger.kernel.org, kernel@pengutronix.de, andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, davem@davemloft.net, devicetree@vger.kernel.org, robh+dt@kernel.org, mark.rutland@arm.com From: Florian Fainelli Message-ID: Date: Thu, 20 Apr 2017 10:38:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170418084827.19613-4-jbe@pengutronix.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4165 Lines: 133 On 04/18/2017 01:48 AM, Juergen Borleis wrote: > In this mode the switch device and the internal phys will be managed via > I2C interface. The MDIO interface is still supported, but for the > (emulated) CPU port only. > > Signed-off-by: Juergen Borleis > CC: devicetree@vger.kernel.org > CC: robh+dt@kernel.org > CC: mark.rutland@arm.com > --- > .../devicetree/bindings/net/dsa/lan9303.txt | 62 +++++++++++ > drivers/net/dsa/Kconfig | 16 +++ > drivers/net/dsa/Makefile | 2 + > drivers/net/dsa/lan9303_i2c.c | 113 +++++++++++++++++++++ > 4 files changed, 193 insertions(+) > create mode 100644 Documentation/devicetree/bindings/net/dsa/lan9303.txt > create mode 100644 drivers/net/dsa/lan9303_i2c.c > > diff --git a/Documentation/devicetree/bindings/net/dsa/lan9303.txt b/Documentation/devicetree/bindings/net/dsa/lan9303.txt > new file mode 100644 > index 0000000000000..2edc2561467a7 > --- /dev/null > +++ b/Documentation/devicetree/bindings/net/dsa/lan9303.txt > @@ -0,0 +1,62 @@ > +SMSC/MicroChip LAN9303 three port ethernet switch > +------------------------------------------------- > + > +Required properties: > + > +- compatible: should be "smsc,lan9303-i2c" > + > +Optional properties: > + > +- reset-gpios: GPIO to be used to reset the whole device > +- reset-duration: reset duration in milliseconds, defaults to 200 ms > + > +Subnodes: > + > +The integrated switch subnode should be specified according to the binding > +described in dsa/dsa.txt. The CPU port of this switch is always port 0. > + > +Note: always use 'reg = <0/1/2>;' for the three DSA ports, even if the device is > +configured to use 1/2/3 instead. This hardware configuration will be > +auto-detected and mapped accordingly. > + > +Example: > + > +I2C managed mode: > + > + master: masterdevice@X { > + status = "okay"; > + > + fixed-link { /* RMII fixed link to LAN9303 */ > + speed = <100>; > + full-duplex; > + }; > + }; > + > + switch: switch@a { > + compatible = "smsc,lan9303-i2c"; > + reg = <0xa>; > + status = "okay"; > + reset-gpios = <&gpio7 6 GPIO_ACTIVE_LOW>; > + reset-duration = <200>; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; > + > + port@0 { /* RMII fixed link to master */ > + reg = <0>; > + label = "cpu"; > + ethernet = <&master>; > + }; > + > + port@1 { /* external port 1 */ > + reg = <1>; > + label = "lan1; > + }; > + > + port@2 { /* external port 2 */ > + reg = <2>; > + label = "lan2"; > + }; > + }; > + }; > diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig > index 31a2b229106dd..c56533bffc8ce 100644 > --- a/drivers/net/dsa/Kconfig > +++ b/drivers/net/dsa/Kconfig > @@ -50,4 +50,20 @@ config NET_DSA_MT7530 > This enables support for the Mediatek MT7530 Ethernet switch > chip. > > +config NET_DSA_SMSC_LAN9303 > + tristate > + select NET_DSA_TAG_LAN9303 > + ---help--- > + This enables support for the SMSC/Microchip LAN9303 3 port ethernet > + switch chips. > + Should not this hunk ^^^ be part of the previous patch (patch #2)? It's not a big deal, but it would have been more natural and would allow building the driver right away even in the absence of bus "glue" modules. > +config NET_DSA_SMSC_LAN9303_I2C > + tristate "SMSC/Microchip LAN9303 3-ports 10/100 ethernet switch in I2C managed mode" > + depends on NET_DSA > + select NET_DSA_SMSC_LAN9303 > + select REGMAP_I2C > + ---help--- > + Enable access functions if the SMSC/Microchip LAN9303 is configured > + for I2C managed mode. > + > endmenu > diff --git a/drivers/net/dsa/Makefile b/drivers/net/dsa/Makefile > index 2ae07f4fbf635..c1981ba18963f 100644 > --- a/drivers/net/dsa/Makefile > +++ b/drivers/net/dsa/Makefile > @@ -3,6 +3,8 @@ obj-$(CONFIG_NET_DSA_BCM_SF2) += bcm-sf2.o > bcm-sf2-objs := bcm_sf2.o bcm_sf2_cfp.o > obj-$(CONFIG_NET_DSA_QCA8K) += qca8k.o > obj-$(CONFIG_NET_DSA_MT7530) += mt7530.o > +obj-$(CONFIG_NET_DSA_SMSC_LAN9303) += lan9303-core.o Same thing here. Other than that: Reviewed-by: Florian Fainelli -- Florian