From nobody Wed Sep 10 01:57:53 2025 Received: from mail-106113.protonmail.ch (mail-106113.protonmail.ch [79.135.106.113]) (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 E662F219301; Sun, 7 Sep 2025 23:18:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=79.135.106.113 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757287108; cv=none; b=Y4qOFEK8yk6AuLSJUEB8viUgOjwayj+Sk2R8piOpXBXBPhX4nMwm+KUab2VVLC9iLZ0vAVv8HakYUH4WQDoNes8zeOAUKVkGUeNG7CgAdExxeK6UtmvMp7hSJTIraCQagB5hTegBhNbXqfIPXVMOo32CrT5YBTxnKBRY3RSAX/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757287108; c=relaxed/simple; bh=lA2QBNyFzlfroElsH/5o9X8nJsuBowAAhH88dd9l8Ps=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ijFQs1eHtppMb0p/Cu2HwXXzcMjBemlWvHp8auKcbcL4rWjFJSNecMs2G1iVLgw08ZLrCsoCVMjfFTG35O8JxRmSn5eSFq57hDUjPbf+k9kRf1YkaOUNiZeZf6khhxtRh9nwq4TXe8IoBcnogKkrdRaVNLaYvh+r6UoHCWkGxaE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vinarskis.com; spf=pass smtp.mailfrom=vinarskis.com; dkim=pass (2048-bit key) header.d=vinarskis.com header.i=@vinarskis.com header.b=GIB2EsRh; arc=none smtp.client-ip=79.135.106.113 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=vinarskis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=vinarskis.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=vinarskis.com header.i=@vinarskis.com header.b="GIB2EsRh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vinarskis.com; s=protonmail; t=1757287098; x=1757546298; bh=G5wfHuR5Ni6mkr7vlY10NwZv17+YPvp6/bhVfUx8fmY=; h=From:Date:Subject:Message-Id:References:In-Reply-To:To:Cc:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=GIB2EsRhlV8vmBMmFPTgDyzXJbBmWgiPqKkJXpGu6c2W2aqs54JFTXmbFTT4W5b/3 tkSCZEKRzYq/EP0dLimaJfO8HD0/KSm4Z1cSO7ljimL9mj/gMG3zWPBHJKpnWMcNsM x9lsW5HZfejdjJrwR4V10n2U5H1fKr8e7JIRSFimCJseh139SivutqbYhmEhBOWstk nNZn6t+TDa2eg3NNQ0DCnHcz2ejeg/5nDQ9iypsunewbJZNtuPvcngpq7VL3hlguhe Pzj/SY5Rgx5p6nl1CrK03+Ci/2A3Pb6Kz9h+2Phi5VGeYV7PIY3O/3PojxLoenG3Rd zApXiK3v5AlMA== X-Pm-Submission-Id: 4cKmGc3phGz1DF4K From: Aleksandrs Vinarskis Date: Mon, 08 Sep 2025 01:18:03 +0200 Subject: [PATCH v3 1/4] dt-bindings: leds: add generic LED consumer documentation 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: <20250908-leds-v3-1-5944dc400668@vinarskis.com> References: <20250908-leds-v3-0-5944dc400668@vinarskis.com> In-Reply-To: <20250908-leds-v3-0-5944dc400668@vinarskis.com> To: Hans de Goede , Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bryan O'Donoghue , Daniel Thompson , Jingoo Han , Mauro Carvalho Chehab , Jean-Jacques Hiblot , Jacopo Mondi , Sakari Ailus , Bjorn Andersson , Konrad Dybcio Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Thompson , dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3355; i=alex@vinarskis.com; h=from:subject:message-id; bh=lA2QBNyFzlfroElsH/5o9X8nJsuBowAAhH88dd9l8Ps=; b=kA0DAAoW7a5xog9QAxAByyZiAGi+ErWiECneuhqcwXxifTl533t9DXrlE55CDJVNQEWQfuBsg 4h1BAAWCgAdFiEEi/z1Zoqina0A1yj27a5xog9QAxAFAmi+ErUACgkQ7a5xog9QAxBMvAD9EL04 Gi4Gqq+jcFyXgmAD3rA80birf0Z3KNzNtbN5gZ0BAN4D1Whrd466mj1N+Gxvs94p42Vh0hPg7ps escQgk+IP X-Developer-Key: i=alex@vinarskis.com; a=openpgp; fpr=8E21FAE2D2967BB123303E8C684FD4BA28133815 Introduce common generic led consumer binding, where consumer defines led(s) by phandle, as opposed to trigger-source binding where the trigger source is defined in led itself. Add already used in some schemas 'leds' parameter which expects phandle-array. Additionally, introduce 'led-names' which could be used by consumers to map LED devices to their respective functions. Signed-off-by: Aleksandrs Vinarskis --- .../devicetree/bindings/leds/leds-consumer.yaml | 89 ++++++++++++++++++= ++++ 1 file changed, 89 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/leds-consumer.yaml b/Do= cumentation/devicetree/bindings/leds/leds-consumer.yaml new file mode 100644 index 0000000000000000000000000000000000000000..d50a3850f6336e9e3a52eb1374e= 36ea50de27f47 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-consumer.yaml @@ -0,0 +1,89 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/leds-consumer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Common leds consumer + +maintainers: + - Aleksandrs Vinarskis + +description: + Some LED defined in DT are required by other DT consumers, for example + v4l2 subnode may require privacy or flash LED. Unlike trigger-source + approach which is typically used as 'soft' binding, referencing LED + devices by phandle makes things simpler when 'hard' binding is desired. + + Document LED properties that its consumers may define. + +select: true + +properties: + leds: + oneOf: + - type: object + - $ref: /schemas/types.yaml#/definitions/phandle-array + description: + A list of LED device(s) required by a particular consumer. + items: + maxItems: 1 + + led-names: + description: + A list of device name(s). Used to map LED devices to their respective + functions, when consumer requires more than one LED. + +additionalProperties: true + +examples: + - | + #include + #include + + leds { + compatible =3D "gpio-leds"; + + privacy_led: privacy-led { + color =3D ; + default-state =3D "off"; + function =3D LED_FUNCTION_INDICATOR; + gpios =3D <&tlmm 110 GPIO_ACTIVE_HIGH>; + }; + }; + + i2c { + #address-cells =3D <1>; + #size-cells =3D <0>; + + camera@36 { + compatible =3D "ovti,ov02c10"; + reg =3D <0x36>; + + reset-gpios =3D <&tlmm 237 GPIO_ACTIVE_LOW>; + pinctrl-names =3D "default"; + pinctrl-0 =3D <&cam_rgb_default>; + + leds =3D <&privacy_led>; + led-names =3D "privacy-led"; + + clocks =3D <&ov02e10_clk>; + + assigned-clocks =3D <&ov02e10_clk>; + assigned-clock-rates =3D <19200000>; + + avdd-supply =3D <&vreg_l7b_2p8>; + dvdd-supply =3D <&vreg_l7b_2p8>; + dovdd-supply =3D <&vreg_cam_1p8>; + + port { + ov02e10_ep: endpoint { + data-lanes =3D <1 2>; + link-frequencies =3D /bits/ 64 <400000000>; + remote-endpoint =3D <&csiphy4_ep>; + }; + }; + }; + }; + +... --=20 2.48.1