Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3747979rdb; Thu, 14 Sep 2023 01:01:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFB7r4nzgXPykgvvppkhcBrN/8eFxMmXHwuhK9+tEuVMvzxce8vq4gD7k8qcifPa6TPCkA8 X-Received: by 2002:a17:902:ea01:b0:1c3:a1a8:969a with SMTP id s1-20020a170902ea0100b001c3a1a8969amr5960160plg.8.1694678505180; Thu, 14 Sep 2023 01:01:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694678505; cv=none; d=google.com; s=arc-20160816; b=iYt1epMcR6pyyuz+YCxBRFY9V1V6yRQiRVI5lxklhdtdinhpcf4QL10C3pZWjWhMB9 UnddwrLG/mHUf8hvPOZRE9aVuULRu8x4uD2/LGgpI/E/r05RXmoCNQDVV9GDFZqQnZCG fTtCL2LrpxLf0XczI2gxLSBTi6by9mGJ/lxU3ffa8CaLvqGAzBDhywnXfqTECHJIPnyY 3xLOEJORjidMI/q8+wKVD+g/mdsKjZCXm/Gw1Oy4/lyIYgDVbUfm8I7mZn4QelTCrr0R 9s0cvnEOQS3e+xH2i8Dz3vvdIYUUMLqad9TkAYesZ3QaZfBZ3eiPfzuOPu13HMsvIb29 d5fQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=gnHCeESBrVb2rWY/6TyuSmKK70qSSNPvrbBSWsbxm0k=; fh=J4gjwt0mePoRaYCjaHLm28JnUFi5LyPM6ZZbSRFLAL0=; b=xmUCnKQnAzfQj+ne4RWQuj1E120sUPGQCpc66f1m0FXw3yS3V/oD9hMU6LD65CsPxX oyiupgw8qxeNkGOfjN00jl3mE5M7XbUhJCSQAWM1eN3yVorDOnzBtOeEDOAiRhVv+OQB ypJ05zx1QE3e78/a9pIm4KR/rB4vKhDz8HSLdYkA0FIsRO/J8GGT60miXXwHP9KqPa2L VoDgmLfpdQERMGWiApzM+RE7ZHZWb4DCkfO5z+QoZzgozTYDCK5ECbxPh9B90iUOjAmb IQUTrn7trNlZiv1nKHoxa5ouCwLQNu17SFeINiZkIoyetxBLmqUq/K9/XhLLs3eaRcaj VS5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id i1-20020a170902cf0100b001a6f0eab385si1203651plg.55.2023.09.14.01.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 01:01:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 99AC2832D713; Thu, 14 Sep 2023 00:51:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231274AbjINHvd (ORCPT + 99 others); Thu, 14 Sep 2023 03:51:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52428 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229890AbjINHvc (ORCPT ); Thu, 14 Sep 2023 03:51:32 -0400 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 96F071BF6 for ; Thu, 14 Sep 2023 00:51:28 -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 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 14 Sep 2023 00:51:31 -0700 (PDT) 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(-) -- 2.39.2