From nobody Thu Oct 2 22:59:32 2025 Received: from mail-43171.protonmail.ch (mail-43171.protonmail.ch [185.70.43.171]) (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 E9E90279DC2; Wed, 10 Sep 2025 12:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.70.43.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757505689; cv=none; b=A2ijSqSqic6aBW0oPHNLrkE46S7+RwT+PEdZwWUWPoigvNkYlcezatAuk7CWR5wFYorCmu/GUkOXv7BOfEEP8kz6FciK88BIG4gNaIz3L9HEqVRi4Qn9zxBjM/uw7tmVaKCGm/t8YVv8GvpQ3agvGUYM7e86lTvVX1GIuNmL99Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757505689; c=relaxed/simple; bh=pD1AEKQjXf0zbSv1Q0FNq2EZxbMFJQOJHE/lVcm7Tpc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=g1HlV/ptgwOOdc9YQZdTwp5uuyULtHI93O6p/ELfe9HwJmtfrcru0bU2QbGHIqwzP0BS26J1TVrjoS5/0WVKX32j1k8z/4I6GIiLTrAfamAEDuLVxAk4ABcjcrkWGSB7nt1p8r7NTaCwsPz0z6UhvPZSXkeRMsu/eW4gWbLUU18= 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=bSKT7Xkb; arc=none smtp.client-ip=185.70.43.171 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="bSKT7Xkb" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vinarskis.com; s=protonmail; t=1757505684; x=1757764884; bh=wSUr6lywRkV7++24dHfSjXCXpOsK5ZNcHOfkHUT/O9o=; 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=bSKT7XkbjnG588aNLU0ZpsIHA9HWKIjf0qk652mIBZXUh59banWFiTvS0BeJUaBXi bCVJhegfgovBjo5JMgVcctgIvygwb2ZqCN5b2tHBEBfjUQBTYAfTflNEqHYNnMRMWD low5lxjjhDWrQ0jUEB+t65a3U/NkuIYaTCQvZuuaBl2O9bkdRodgWulxxs65qabXns BerWIeWUemum+zAzW1dzHpxV+7MCvWdWV7RPOSvMOeYzjryNjmoRw9S8lApzwo+G9E OuD28y0uNNX1m7EGBZM49hgBRG2BmTM645a/ecb1LiGDYqYv6gX4XSwlqm50Q/ihu9 00G0Dik9XN4kA== X-Pm-Submission-Id: 4cMK6B60Jqz2ScCx From: Aleksandrs Vinarskis Date: Wed, 10 Sep 2025 14:01:08 +0200 Subject: [PATCH v5 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: <20250910-leds-v5-1-bb90a0f897d5@vinarskis.com> References: <20250910-leds-v5-0-bb90a0f897d5@vinarskis.com> In-Reply-To: <20250910-leds-v5-0-bb90a0f897d5@vinarskis.com> To: Hans de Goede , Lee Jones , Pavel Machek , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bryan O'Donoghue , Jingoo Han , Mauro Carvalho Chehab , Jean-Jacques Hiblot , Jacopo Mondi , Sakari Ailus , Bjorn Andersson , Konrad Dybcio , Daniel Thompson Cc: linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, threeway@gmail.com, Andy Shevchenko , Aleksandrs Vinarskis X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2711; i=alex@vinarskis.com; h=from:subject:message-id; bh=pD1AEKQjXf0zbSv1Q0FNq2EZxbMFJQOJHE/lVcm7Tpc=; b=owGbwMvMwCX2dl3hIv4AZgHG02pJDBkHM/rdFadwPqyT5p1mcf3nhNX/F+9JNXp3q07TSurTF q1jT86v7yhlYRDjYpAVU2Tp/vM1rWvR3LUM1zW+wcxhZQIZwsDFKQATybBkZJjEKibkun9X9SuD t3udNsxgSXqQ+L7jgtVjLrmQxDeZPQ0M/zTFVu3V/XRyq3td4tqtIjXpE80q87l3qWxi60uPNt0 3nREA 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 Reviewed-by: Rob Herring (Arm) --- .../devicetree/bindings/leds/leds-consumer.yaml | 67 ++++++++++++++++++= ++++ 1 file changed, 67 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..fe6a0faa1d3b8ff55e05dfdc769= 7ed2246f0cede --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-consumer.yaml @@ -0,0 +1,67 @@ +# 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>; + + v4l2_node: camera@36 { + reg =3D <0x36>; + + leds =3D <&privacy_led>; + led-names =3D "privacy"; + }; + }; + +... --=20 2.48.1