From patchwork Fri Jan 5 14:27:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 13512218 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 97432C3DA6E for ; Fri, 5 Jan 2024 14:28:06 +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=rx5eKhRN5Yac58H4WPC4s2D7EiL+LYPTYBX391vXX30=; b=wVfKpqmThXzmSM Kf4ENFaAO2rX5aAkyx8RNLcc+dq4Ib5VupiuvUvrgYYvUDAkheG6nm6GmM6embDJW/SK5+uBn9+bY jOnkj7Qekd+2aR0u9qUI/JRB0Xq7UhW6DA36jaemOBz9Zj1EcfkylnFETaN2di36nxAC6lansgbcY i4bZdF5/N+u1VPvg+gcaI3tyzL9dPc5sYgG16xb3fJKRLyG/Y0pYzRFvST0hZlgrJCMU2tFhk1YJ7 FhFWHKDIRFg+7lu8nOlwyBLKAla28tvKawu0DyVedb89mxReGyZF8tayR7kiZX7/CkU1PEM3sHSlE 74zCM7sqBD1kojCfuAuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rLlAf-00H36P-01; Fri, 05 Jan 2024 14:27:37 +0000 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rLlAc-00H35b-19 for linux-arm-kernel@lists.infradead.org; Fri, 05 Jan 2024 14:27:35 +0000 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e3b43173eso1098475e9.1 for ; Fri, 05 Jan 2024 06:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1704464850; x=1705069650; 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=APs6M2apAcMc7l4gyNVGbiDS8kiXtv8paG4oTVl8I+M=; b=Gql0rU/+RqzlT3RgQ6aVv8U+XMCNm9u2bFBlQ/dWNKClDjiYlxurvZ+Y+OmE/z+zM0 BOYcnNR1QhL0Gawws2io4uuivfA7+nmk1UDbPGmRbLyuC5gVppaYZtaUE3NiBZ8kQRMr rLC1yiZbM/1rWVjtmKRMN7latStCv2UXEQXjmwthdp7FVs4KnEt4Io7PFTrvbBEkB/mZ 1LygfznZcqvu6emwBkdiSWFPaWEPj2AbQbQ4eOEoI/kkazSjTtCerrZntxM+k6yH3Bpk 39sg6z/M/fLRvYHAlBlhvgtgwIxO4nc7Sle8EPwp8ps2tgr5U83b5OK4bzTGVUrj6l6i NUGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704464850; x=1705069650; 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=APs6M2apAcMc7l4gyNVGbiDS8kiXtv8paG4oTVl8I+M=; b=LM/+ZCkO/EJdn8JzjIje9TaZn3NCb9/fXcLy22Qgqu32Thh+A+tAD1OjdAGu+mOCMs 6AbHKzqUDf0Ve7CsREiZFHyRTDM3ZN44P4n3+bPCjoVuXzQG8X9nWO/N7STvr5IVe3G6 4KAYV8ayuqba/JfZYWKo9SbEVxP5tPZVSmLyZl8A+5AkQzd0sJkK3lUvwp2lmmaG7pMy r4WpHc3VS/+j2S2UbynodrXRoMsLoXgAlCRIftKH11R4YJnWeR3BxnQlD1IMeHMpIMvI jkXG3/nVrEXd/bUDJSPvz8La/xUjk0zYh+Mcn9oCWVgXGNGO/G0U1kdlsq4jDLneUV1u aVUA== X-Gm-Message-State: AOJu0Ywg4o5RU79aGxZcHW4362vuPppJIA742KJN/h5VHyP+7l3Bg6uO pPsZGuy+iV8ohdbQBdEbSVY= X-Google-Smtp-Source: AGHT+IHYUKZEg3ZHc+KdILbEa3OOY5XvzVdKgu2YvZoApQ8eTegy++Sxib9JfwSlgU2ZR06SaA255A== X-Received: by 2002:a05:600c:3ac7:b0:40e:3ae4:84ef with SMTP id d7-20020a05600c3ac700b0040e3ae484efmr112839wms.73.1704464849826; Fri, 05 Jan 2024 06:27:29 -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 j10-20020a05600c190a00b0040d87100733sm1721901wmq.39.2024.01.05.06.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Jan 2024 06:27:29 -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 v9 0/5] net: phy: generic polarity + LED support for qca808x Date: Fri, 5 Jan 2024 15:27:12 +0100 Message-ID: <20240105142719.11042-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-20240105_062734_415388_2AEB6D74 X-CRM114-Status: GOOD ( 15.29 ) 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 | 16 + include/linux/phy.h | 22 ++ 10 files changed, 429 insertions(+), 19 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/qca,qca808x.yaml