From patchwork Thu Sep 14 07:51:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 13384764 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (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 1942C62C for ; Thu, 14 Sep 2023 07:51:30 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40C361BF6 for ; Thu, 14 Sep 2023 00:51:30 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qgh82-0001Gu-Be; Thu, 14 Sep 2023 09:51:10 +0200 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qgh80-006Fd8-Ld; Thu, 14 Sep 2023 09:51:08 +0200 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1qgh80-009P3t-1n; Thu, 14 Sep 2023 09:51:08 +0200 From: Oleksij Rempel To: "David S. Miller" , Andrew Lunn , Eric Dumazet , Florian Fainelli , Jakub Kicinski , Paolo Abeni , Vladimir Oltean , Woojung Huh , Arun Ramadoss , Conor Dooley , Krzysztof Kozlowski , Rob Herring Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com, "Russell King (Oracle)" , devicetree@vger.kernel.org Subject: [PATCH net-next v5 0/2] net: dsa: microchip: add drive strength support Date: Thu, 14 Sep 2023 09:51:05 +0200 Message-Id: <20230914075107.2239886-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org changes v5: - rename milliamp to microamp - do not expect negative error code on snprintf - set coma after last struct element - rename found to have_any_prop changes v4: - integrate microchip feedback to the ksz9477_drive_strengths comment. - add Reviewed-by: Rob Herring changes v3: - yaml: use enum instead of min/max - do not use snprintf() on overlapping buffer. - unify ksz_drive_strength_to_reg() and ksz_drive_strength_error(). Make it usable for KSZ9477 and KSZ8830 variants. - use ksz_rmw8() in ksz9477_drive_strength_write() changes v2: - make it work on all know KSZ* variants except of undocumented LAN* switches - add io-drive-strength compatible for ksz88xx chips - test exact drive strength instead of nearest closest. - add comment and refactor the code Oleksij Rempel (2): dt-bindings: net: dsa: microchip: Update ksz device tree bindings for drive strength net: dsa: microchip: Add drive strength configuration .../bindings/net/dsa/microchip,ksz.yaml | 20 ++ drivers/net/dsa/microchip/ksz8795_reg.h | 14 - drivers/net/dsa/microchip/ksz9477_reg.h | 13 - drivers/net/dsa/microchip/ksz_common.c | 309 ++++++++++++++++++ drivers/net/dsa/microchip/ksz_common.h | 20 ++ 5 files changed, 349 insertions(+), 27 deletions(-)