From patchwork Thu Jan 4 11:01:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13511009 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF11CC47073 for ; Thu, 4 Jan 2024 11:02:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=O0P+QIldjRBDY4WCJuQVi8g0g0Vomprt1xbXGLYt2is=; b=K6PcUQhMMxn0QW IJWltV3EyBbdLtqUshm4O+PnuLnedelfBz7euDddCmgc5S40h1XDPp1WpiCEuFL679H1N/YyKBtXS q21xVRSp1ZAiI6qUb2ikTX55OQHIKpoovX3GtWN0hwY4I1P2bfjT6YbgPoVNLRsxdByWmRV+hmBOX ipQhKhvMqK4Jo3YxUyYKVjpKO27LHU0VJfXNm+TRmdtMa0KlYn0p3DMSpFIXU0W2qA+1+spBSwVkb t/PB2GlNoa1meAe2XKbaLMQuJq9x2JvEFBBexcXnua0cGpyu63cPFu0sH0e2THEfdRPaf3Lbd2Dcw pIbGSMTFq7EdBaVnqJfA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rLLTe-00DcRo-0S; Thu, 04 Jan 2024 11:01:30 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rLLTb-00DcQp-08 for linux-arm-kernel@lists.infradead.org; Thu, 04 Jan 2024 11:01:28 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-50e835800adso367026e87.0 for ; Thu, 04 Jan 2024 03:01:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704366084; x=1704970884; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=f/MRWpJxpo5WpqOvOF6T61bALH/1fkde2/3TE3AX0Dg=; b=B4zPsjTjvDnVDjxyDF/6LvcyA8IkzaZqmMekvM0DuLCFN1OE/WawE/jgnPfSfji/P0 ehWDGx/p6AE9gngDgrtEqkF5lM60nox7HqiIOsyT+ZkQPkHUNowaXhYmVPaEUqowT1Xu +ZjKCn65fl1CsiPM3n/o+RJxvYC+zrK4tM5xsJS0kd/Z2bJi5Bf32VpLBqoVKaNMv3Ox 0UyTZloRCrVtvlbuvwpKYEpTkBwUYyX4iA312sMW8USF7RnEpALRiAzChjhuhc9oaALq 5wa00/WkHQFJpfOpTfF4UvlE7qM484eVdFq5llrtsFjZx7UK3jmOWR1Bv5nbkxQvAwIw isIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704366084; x=1704970884; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=f/MRWpJxpo5WpqOvOF6T61bALH/1fkde2/3TE3AX0Dg=; b=m2/B8Mn732zjmJUHVFgAZSWDhbUIDFsC29FbfXdJxu5Lw/JybtObDRTiWWZfDarGOp FiGYutjt+l6ciNj+geRkEWXfBXMIvL4zvklBq6gtahNKGARMOQ9n4JXky/ybDqp3NkKf dOWrV2GLousxntt6mAVpniHBlA/6emSEWpSmK7/b6/Si0830rtoAFHDI5ZwfuUsX8t1P V0ga+0SXuUwaFI1N9U/LigOgr13+/PLUyQ3K49gAMg4q4eAGSso629EymVih6qf2lacD 1ShiRUsLSLy6roEULaNXbp8/t2K3FEuooXZRhn4r/9mn7btIoHVqaXmjZzOvNr4mYtez 8XJA== X-Gm-Message-State: AOJu0YwMAQdChsItUCS0VcU0FBUxDFVjT7xgkrq7p/adsCq327fxwmUE mERRxkEazTus0S2mtzoAFxM= X-Google-Smtp-Source: AGHT+IG2U8U3DyLWmid2os85oSzrlmqvMXgeKxltKwT31ud3i1MamX8APpCOCIdMkwLsQlvEvwFm3g== X-Received: by 2002:a05:6512:3121:b0:50e:5a8d:1428 with SMTP id p1-20020a056512312100b0050e5a8d1428mr162305lfd.141.1704366084208; Thu, 04 Jan 2024 03:01:24 -0800 (PST) Received: from localhost.localdomain (host-80-116-159-187.retail.telecomitalia.it. [80.116.159.187]) by smtp.googlemail.com with ESMTPSA id b14-20020adff90e000000b003373fe3d345sm9550242wrr.65.2024.01.04.03.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 03:01:23 -0800 (PST) From: Christian Marangi To: Pavel Machek , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , William Zhang , Anand Gore , Kursad Oney , Florian Fainelli , =?utf-8?b?UmFmYcWCIE1p?= =?utf-8?b?xYJlY2tp?= , Broadcom internal kernel review list , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Russell King , Jacek Anaszewski , =?utf-8?q?Fern=C3=A1ndez_Roj?= =?utf-8?q?as?= , Sven Schwermer , Christian Marangi , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org Subject: [net-next PATCH v8 0/5] net: phy: generic polarity + LED support for qca808x Date: Thu, 4 Jan 2024 12:01:07 +0100 Message-ID: <20240104110114.2020-1-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240104_030127_077116_11A93AC3 X-CRM114-Status: GOOD ( 15.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This small series add LEDs support for qca808x. QCA808x apply on PHY reset a strange polarity settings and require some tweak to apply a more common configuration found on devices. On adding support for it, it was pointed out that a similar feature is also being implemented for a marvell PHY where LED polarity is set per LED (and not global) and also have a special mode where the LED is tristated. The first 3 patch are to generalize this as we expect more PHY in the future to have a similar configuration. The implementation is extensible to support additional special mode in the future with minimal changes and don't create regression on already implemented PHY drivers. (changelog present in single patch) Christian Marangi (5): dt-bindings: net: phy: Make LED active-low property common dt-bindings: net: phy: Document LED inactive high impedance mode net: phy: add support for PHY LEDs polarity modes dt-bindings: net: Document QCA808x PHYs net: phy: at803x: add LED support for qca808x .../devicetree/bindings/leds/common.yaml | 12 + .../bindings/leds/leds-bcm63138.yaml | 4 - .../bindings/leds/leds-bcm6328.yaml | 4 - .../devicetree/bindings/leds/leds-bcm6358.txt | 2 - .../bindings/leds/leds-pwm-multicolor.yaml | 4 - .../devicetree/bindings/leds/leds-pwm.yaml | 5 - .../devicetree/bindings/net/qca,qca808x.yaml | 54 +++ drivers/net/phy/at803x.c | 325 ++++++++++++++++++ drivers/net/phy/phy_device.c | 12 + include/linux/phy.h | 22 ++ 10 files changed, 425 insertions(+), 19 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/qca,qca808x.yaml