From nobody Thu Oct 2 09:21:06 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2431D2EE5F0 for ; Thu, 18 Sep 2025 08:34:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758184448; cv=none; b=iKu9xb3tu7ZxgfP6GzmMMtUHm1TLLjwv/DejCfGrBxcUmaAAIXq2y7mbKYijl1FHRLupqKnKdSrwLOZJoxF9I9O1G6pvi6H99iTGRvtg29ZZo5ykG1IUxcUd35Du5reRqB04fgPbujpscGhHBD4w+gqay29HxeGYts7+05NrIBo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758184448; c=relaxed/simple; bh=z8zyOghTq87xeDNWe0HqJD0JZ/az2SAEfK9ACdH8vHQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=fErpDx/sTgK/POWd7S8e+iHg6WLy9C8WHKTN9hZHOvGpMIYiaTnBoFlGvOTWit00q3kbcMSvddYO4Po9IIq4LU7WOb5tzRZz/36xqV6tYUEnZlMfxGbd78HkGO5KxcZoFIi09mt7wkvLf7iqdflB+zpyR9lipo/58VElrcdvC+I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=SojZz9q4; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="SojZz9q4" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 8BA664E40D0C; Thu, 18 Sep 2025 08:34:04 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 610006062C; Thu, 18 Sep 2025 08:34:04 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 033F1102F1CA3; Thu, 18 Sep 2025 10:34:01 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1758184443; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=tU2EkQI+mFY7LHIakOZurCgSDiSSuoFWyy5L0zuDbaU=; b=SojZz9q4446Z+mbslL+S2mRwCCW3NN0Un89Z3cQ0So5EX505VMbKfSvaoIOKVhF+rXu4OE HUXsfSpjo4R0v83sviAOPkO7Q08mCgPE6RflIpKJNC1L6cKboKhayl/snpuBFjSnkzRtEC 6kxCJm70X2CGIOszhgA6g0oZvWYPSPk+4By3Gul0hw1WvaCPCevnX21Sv5JtZGKmSOfyMC Y1Flhunq+0M9deyETjOgiNo4YlfIFx2+T5tHKmrB4Ut6ZjvimCj+n2qBoHkdTARDxLhquR v5OLwOKzBShbbjKIFcHCLzMlhknAbxYnkPQMxYuaG1KyKZDNewdqBWdqUlAl3Q== From: "Bastien Curutchet (Schneider Electric)" Date: Thu, 18 Sep 2025 10:33:50 +0200 Subject: [PATCH net-next v3 1/3] dt-bindings: net: dsa: microchip: Group if clause under allOf tag Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250918-ksz-strap-pins-v3-1-16662e881728@bootlin.com> References: <20250918-ksz-strap-pins-v3-0-16662e881728@bootlin.com> In-Reply-To: <20250918-ksz-strap-pins-v3-0-16662e881728@bootlin.com> To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut Cc: Thomas Petazzoni , =?utf-8?q?Miqu=C3=A8l_Raynal?= , Pascal Eberhard , Woojung Huh , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Bastien Curutchet (Schneider Electric)" X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 Upcoming patch adds a new if/then clause. It requires to be grouped with the already existing if/then clause under an 'allOf:' tag. Move the if/then clause under the already existing 'allOf:' tag to prepare next patch. Acked-by: Rob Herring (Arm) Signed-off-by: Bastien Curutchet (Schneider Electric) --- .../devicetree/bindings/net/dsa/microchip,ksz.yaml | 68 +++++++++++-------= ---- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b= /Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml index eb4607460db7f32a4dffd416e44b61c2674f731e..db8175b4ced6d136ba97c371b68= ba993637e444a 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml @@ -10,9 +10,6 @@ maintainers: - Marek Vasut - Woojung Huh =20 -allOf: - - $ref: /schemas/spi/spi-peripheral-props.yaml# - properties: # See Documentation/devicetree/bindings/net/dsa/dsa.yaml for a list of a= dditional # required and optional properties. @@ -107,38 +104,41 @@ required: - compatible - reg =20 -if: - not: - properties: - compatible: - enum: - - microchip,ksz8863 - - microchip,ksz8873 -then: - $ref: dsa.yaml#/$defs/ethernet-ports -else: - patternProperties: - "^(ethernet-)?ports$": +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + + - if: + not: + properties: + compatible: + enum: + - microchip,ksz8863 + - microchip,ksz8873 + then: + $ref: dsa.yaml#/$defs/ethernet-ports + else: patternProperties: - "^(ethernet-)?port@[0-2]$": - $ref: dsa-port.yaml# - unevaluatedProperties: false - properties: - microchip,rmii-clk-internal: - $ref: /schemas/types.yaml#/definitions/flag - description: - When ksz88x3 is acting as clock provier (via REFCLKO) it - can select between internal and external RMII reference - clock. Internal reference clock means that the clock for - the RMII of ksz88x3 is provided by the ksz88x3 internally - and the REFCLKI pin is unconnected. For the external - reference clock, the clock needs to be fed back to ksz88x3 - via REFCLKI. - If microchip,rmii-clk-internal is set, ksz88x3 will provide - rmii reference clock internally, otherwise reference clock - should be provided externally. - dependencies: - microchip,rmii-clk-internal: [ethernet] + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-2]$": + $ref: dsa-port.yaml# + unevaluatedProperties: false + properties: + microchip,rmii-clk-internal: + $ref: /schemas/types.yaml#/definitions/flag + description: + When ksz88x3 is acting as clock provier (via REFCLKO) = it + can select between internal and external RMII reference + clock. Internal reference clock means that the clock f= or + the RMII of ksz88x3 is provided by the ksz88x3 interna= lly + and the REFCLKI pin is unconnected. For the external + reference clock, the clock needs to be fed back to ksz= 88x3 + via REFCLKI. + If microchip,rmii-clk-internal is set, ksz88x3 will pr= ovide + rmii reference clock internally, otherwise reference c= lock + should be provided externally. + dependencies: + microchip,rmii-clk-internal: [ethernet] =20 unevaluatedProperties: false =20 --=20 2.51.0 From nobody Thu Oct 2 09:21:06 2025 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C97362F549D; Thu, 18 Sep 2025 08:34:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.171.202.116 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758184449; cv=none; b=cXDvbnLw/7SEZcRiW1Ca0xTDtuPbaUDy8Cs3dJfiOJQkkXlCFYLbBNLT+FR6yYMgaYYYG4AmC51ZrxsjsQkgXzGMtBtWO7tYBKMuduuZa/422OyYHrJMWNeJVTqlXsAJt72ajsvu45+vGF+abdM75MMYlBzyVNMz8kf2VjH52uk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758184449; c=relaxed/simple; bh=0LE5CMKztylMWzf5OmUCksRfrSOx6vertoNG0dXiE0s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pXOrrRbTovdk3IEC/6nF6ZPhgZ08cCSSs/ivYijdl6z5pLB/Fb65G39uBMq//Pe88ja6XrE/fphUi64cdZJgeqYZk31TF9dfUO5UZiSJjjCTM0bu6tgdj+80DmFNoi/vYRh6xt0YpQeA/MaDtNWeSziEoThOu3QGYQ+355J/4W4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=P2G932N/; arc=none smtp.client-ip=185.171.202.116 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="P2G932N/" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id B206BC00091; Thu, 18 Sep 2025 08:33:49 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 4B4A16062C; Thu, 18 Sep 2025 08:34:06 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id CB3C6102F1CA4; Thu, 18 Sep 2025 10:34:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1758184445; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=wco5og6PxoPGaVfMfkjz/oyPR7pgqy7wjoXlpbqsw1Q=; b=P2G932N/rQYBdoDcyTNONL7ZHlP19QVB8sxA15G1Ccs3IUE8v8O7x9bPyNSUL2VomMFJoP AKnQ6BB6eEWWnYf4hGMZC1zx8TcDWxbjxOZxHH5IgfGL1scnJJekZJw9LWXB4RIigGC2lM Uffo9nZjisBL/Ixmb0q5ic7CD9SGd0uzeJ9TLjpmGNUGnM4NRvpj+1kpUf4IeN99SWLFEp hIlmCeRKuzk5oqqMAde/k8HxUiKLFZWM3Y21WfdlBHVvxLpBqyCMyQVgk1MJvatQB11CY6 bXu6zh90MMW4OBdTVjpe7D1+BEhF97GxzReqiF+QqD2Vb5y/dPGICBCYI86BKg== From: "Bastien Curutchet (Schneider Electric)" Date: Thu, 18 Sep 2025 10:33:51 +0200 Subject: [PATCH net-next v3 2/3] dt-bindings: net: dsa: microchip: Add strap description to set SPI mode Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250918-ksz-strap-pins-v3-2-16662e881728@bootlin.com> References: <20250918-ksz-strap-pins-v3-0-16662e881728@bootlin.com> In-Reply-To: <20250918-ksz-strap-pins-v3-0-16662e881728@bootlin.com> To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut Cc: Thomas Petazzoni , =?utf-8?q?Miqu=C3=A8l_Raynal?= , Pascal Eberhard , Woojung Huh , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Bastien Curutchet (Schneider Electric)" X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 At reset, KSZ8463 uses a strap-based configuration to set SPI as interface bus. If the required pull-ups/pull-downs are missing (by mistake or by design to save power) the pins may float and the configuration can go wrong preventing any communication with the switch. Add a 'reset' pinmux state Add a KSZ8463 specific strap description that can be used by the driver to drive the strap pins during reset. Two GPIOs are used. Users must describe either both of them or none of them. Signed-off-by: Bastien Curutchet (Schneider Electric) Reviewed-by: Rob Herring (Arm) --- .../devicetree/bindings/net/dsa/microchip,ksz.yaml | 19 +++++++++++++++= ++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b= /Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml index db8175b4ced6d136ba97c371b68ba993637e444a..a8c8009414ae00b1a60aad715e1= 5c23343e241ff 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml @@ -34,6 +34,13 @@ properties: - microchip,ksz8567 - microchip,lan9646 =20 + pinctrl-names: + items: + - const: default + - const: reset + description: + Used during reset for strap configuration. + reset-gpios: description: Should be a gpio specifier for a reset line. @@ -139,6 +146,18 @@ allOf: should be provided externally. dependencies: microchip,rmii-clk-internal: [ethernet] + - if: + properties: + compatible: + contains: + const: microchip,ksz8463 + then: + properties: + straps-rxd-gpios: + description: + RXD0 and RXD1 pins, used to select SPI as bus interface. + minItems: 2 + maxItems: 2 =20 unevaluatedProperties: false =20 --=20 2.51.0 From nobody Thu Oct 2 09:21:06 2025 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0DCEB2F9C32; Thu, 18 Sep 2025 08:34:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758184452; cv=none; b=kecL2fUaRiPftmx2N7bUTVHO2q6ja2MyoDgBMp0rIXdRcxmpWPDA1iNGi5Po/tALRTu3/LvuD5yikVf1k+gg3HMQdCIKOu1yG5vL7uJdSv3Gfpt7ypg/jafgpJmkMUC7BGtPKgsY7wXKGuoM+BfOxpH6/HbWTGidUFiBdP+8R8M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758184452; c=relaxed/simple; bh=+Ahr5oNqxXsasI3EQWXo7mCLrNIvdckTiHF6ZxjDajA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=I4YjsgS4LVrXMJRFm4E1Bpd+4q/xeYkXE8cUVN3D/2SchlCTTyu5qFknLxM7xmeyc9wVhfNE1DuqC/1AOM/7IGPAl02XPPmUjASveAt4TTRs9yhmYhGCSQS3Q1F1hWoYdoMmg8EZuDN7H+ESQxqJLWOy78BnYqL+S9hYhK4+Hfs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=ACt1tF6s; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ACt1tF6s" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id BFA864E40D09; Thu, 18 Sep 2025 08:34:08 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 969506062C; Thu, 18 Sep 2025 08:34:08 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id A9F17102F1CBF; Thu, 18 Sep 2025 10:34:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1758184447; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=EY6yVymLZMeFS52uP2yzPDRoqRTf9+mNLzBhVGM2Bzs=; b=ACt1tF6s5DtutmaB8W/6DxpovK/rpF/26Te+HqVmJULQzZ2S7K3LWQDMeQ+NJpSrVucIZG 5fOVi9vjbsBuoqIYvWUnBZCO5j1JFQlUqTSW+0D5ZngqmWGctN11H3YqWoeWSQohv1zuLj 7Z/qEeNIMwkmqD+QwLYdEdekFcAsKHY78adlEjwg8+Wrx2Dw0OUTAeOY2wRdcqKJx5uVTV 8XBS0Q8xglxsnSp6/t2FsWc41SYs7NlY53o3DopcUV8SXI4q4YP+MiJb7PXQBvaBre6IRd nQnrCZ8KxrBIONpaMbvurn/yUd1iFZTaPtPlyu/B53HxmAQn0HKRZKLT3J71Kg== From: Bastien Curutchet Date: Thu, 18 Sep 2025 10:33:52 +0200 Subject: [PATCH net-next v3 3/3] net: dsa: microchip: Set SPI as bus interface during reset for KSZ8463 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250918-ksz-strap-pins-v3-3-16662e881728@bootlin.com> References: <20250918-ksz-strap-pins-v3-0-16662e881728@bootlin.com> In-Reply-To: <20250918-ksz-strap-pins-v3-0-16662e881728@bootlin.com> To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Marek Vasut Cc: Thomas Petazzoni , =?utf-8?q?Miqu=C3=A8l_Raynal?= , Pascal Eberhard , Woojung Huh , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, "Bastien Curutchet (Schneider Electric)" X-Mailer: b4 0.14.2 X-Last-TLS-Session-Version: TLSv1.3 At reset, the KSZ8463 uses a strap-based configuration to set SPI as bus interface. SPI is the only bus supported by the driver. If the required pull-ups/pull-downs are missing (by mistake or by design to save power) the pins may float and the configuration can go wrong preventing any communication with the switch. Introduce a ksz8463_configure_straps_spi() function called during the device reset. It relies on the 'straps-rxd-gpios' OF property and the 'reset' pinmux configuration to enforce SPI as bus interface. Reviewed-by: Andrew Lunn Signed-off-by: Bastien Curutchet (Schneider Electric) --- drivers/net/dsa/microchip/ksz_common.c | 45 ++++++++++++++++++++++++++++++= ++++ 1 file changed, 45 insertions(+) diff --git a/drivers/net/dsa/microchip/ksz_common.c b/drivers/net/dsa/micro= chip/ksz_common.c index 7292bfe2f7cac3a0d88bb51339cc287f56ca1d1f..3bfa894d62eecc08dc45b25225e= 1122fe30b8f99 100644 --- a/drivers/net/dsa/microchip/ksz_common.c +++ b/drivers/net/dsa/microchip/ksz_common.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -5338,6 +5339,38 @@ static int ksz_parse_drive_strength(struct ksz_devic= e *dev) return 0; } =20 +static int ksz8463_configure_straps_spi(struct ksz_device *dev) +{ + struct pinctrl *pinctrl; + struct gpio_desc *rxd0; + struct gpio_desc *rxd1; + + rxd0 =3D devm_gpiod_get_index_optional(dev->dev, "straps-rxd", 0, GPIOD_O= UT_LOW); + if (IS_ERR(rxd0)) + return PTR_ERR(rxd0); + + rxd1 =3D devm_gpiod_get_index_optional(dev->dev, "straps-rxd", 1, GPIOD_O= UT_HIGH); + if (IS_ERR(rxd1)) + return PTR_ERR(rxd1); + + if (!rxd0 && !rxd1) + return 0; + + if ((rxd0 && !rxd1) || (rxd1 && !rxd0)) + return -EINVAL; + + pinctrl =3D devm_pinctrl_get_select(dev->dev, "reset"); + if (IS_ERR(pinctrl)) + return PTR_ERR(pinctrl); + + return 0; +} + +static int ksz8463_release_straps_spi(struct ksz_device *dev) +{ + return pinctrl_select_default_state(dev->dev); +} + int ksz_switch_register(struct ksz_device *dev) { const struct ksz_chip_data *info; @@ -5353,10 +5386,22 @@ int ksz_switch_register(struct ksz_device *dev) return PTR_ERR(dev->reset_gpio); =20 if (dev->reset_gpio) { + if (of_device_is_compatible(dev->dev->of_node, "microchip,ksz8463")) { + ret =3D ksz8463_configure_straps_spi(dev); + if (ret) + return ret; + } + gpiod_set_value_cansleep(dev->reset_gpio, 1); usleep_range(10000, 12000); gpiod_set_value_cansleep(dev->reset_gpio, 0); msleep(100); + + if (of_device_is_compatible(dev->dev->of_node, "microchip,ksz8463")) { + ret =3D ksz8463_release_straps_spi(dev); + if (ret) + return ret; + } } =20 mutex_init(&dev->dev_mutex); --=20 2.51.0