From nobody Wed Sep 10 01:58:03 2025 Received: from mail-244106.protonmail.ch (mail-244106.protonmail.ch [109.224.244.106]) (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 F33E12F99BE; Fri, 5 Sep 2025 08:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=109.224.244.106 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757059216; cv=none; b=gYhbXJfv3ytqkkbCiXQk0L7jYTG9+X2pG1Mw2fNYC2H4Bmx4Xgnz0QmCr7D29wex1gdQ3LpArSbLS5lye36Wegx8tgrZ52NhG8SGFowdElkk49uEZ6sOnhgCpxnsl8GedU8reQEjBXtbZAbLukK9fKxDH9D8wtzXEF29Ij6/Cbw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757059216; c=relaxed/simple; bh=nP9rg1wKAkVRusTZ2c0jnkA80hYnpRvR6G4GNRKcI0g=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=G0a0RevNmfPewOZvSEoaGMLlT1e7qrwSoOndIXozy7E3b+w9nhOjvgZdOktnwWfnId+gbEi2u91HmZseb5qVwjUpJbWiGCyhG6xIvi4URlPquFuZ/y0KW38XyoNdE8lsti4pakwYEqozT2duvS4wceWsq8D74lo52bDaiUF6JIM= 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=mNreFVT3; arc=none smtp.client-ip=109.224.244.106 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="mNreFVT3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vinarskis.com; s=protonmail; t=1757059204; x=1757318404; bh=uoIYEwoUOKQ8hDvtn9QS/tZ30qGWL076tFQXBcdtxzc=; 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=mNreFVT3EScWZcD9cyfAIMtnR7+shAr0lJ8IwB95orMmu8m9E6YhFFuTf2HazPK99 qtwk/eBlE6SbfTuRtscgCemE35czLfSJDQcynNjZlRX0TeJeKI928xWJUQczIh6oW6 rTRAL+2/A3RlOOnUpHBUKzTKOg/+iZ8EFZYen0x6ihgdIkYNBAF95R1j+cuHPjanrc zxED2UK3yfgislgy4DveqTi5uxA/fd/F+noBmeXnzGfOx+YV0RGDbgWBwytotr2/To O3Uz399ui3an/ZwKrkZzjFby6FvzZ0vypeYrmLwTJv4SWM8J0xbNKJLiHoYqjRjzJb waS7+tusvqdow== X-Pm-Submission-Id: 4cJ8025rK4z2ScWS From: Aleksandrs Vinarskis Date: Fri, 05 Sep 2025 09:59:29 +0200 Subject: [PATCH v2 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: <20250905-leds-v2-1-ed8f66f56da8@vinarskis.com> References: <20250905-leds-v2-0-ed8f66f56da8@vinarskis.com> In-Reply-To: <20250905-leds-v2-0-ed8f66f56da8@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, Aleksandrs Vinarskis X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=3281; i=alex@vinarskis.com; h=from:subject:message-id; bh=nP9rg1wKAkVRusTZ2c0jnkA80hYnpRvR6G4GNRKcI0g=; b=owGbwMvMwCX2dl3hIv4AZgHG02pJDBm7ZtStcyipULxqtCrez/OU8Vdx2zfGf+xe2qwsv+YTk VXGsZC5o5SFQYyLQVZMkaX7z9e0rkVz1zJc1/gGM4eVCWQIAxenAExEsIrhr+C75PnBonH3lHbZ cdz86a8XKv5Mf+IsPk/LW0c2+frkGzAyLIza4s339JpWyIMnnXuW7jWSCtz1RFT6xRQfw3lskiV +DAA= 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 | 85 ++++++++++++++++++= ++++ 1 file changed, 85 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..077dbe3ad9ff3fa15236b8dd1f4= 48c00271e4810 --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-consumer.yaml @@ -0,0 +1,85 @@ +# 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. + +properties: + leds: + $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>; + + led-names =3D "privacy-led"; + leds =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