From patchwork Fri Mar 26 05:28:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hermes Zhang X-Patchwork-Id: 409807 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73C95C433E3 for ; Fri, 26 Mar 2021 05:29:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1EC0B61A5F for ; Fri, 26 Mar 2021 05:29:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbhCZF25 (ORCPT ); Fri, 26 Mar 2021 01:28:57 -0400 Received: from smtp1.axis.com ([195.60.68.17]:33596 "EHLO smtp1.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbhCZF2u (ORCPT ); Fri, 26 Mar 2021 01:28:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1616736530; x=1648272530; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=12+QAqTdS5qEp89208RDidsj2Q1eud0YTGtFQmVg0vo=; b=JcZMiBPmA9/qy007eOFDfD0y9dirLnQh+es/BeUW4BSToRB23rHkjkFe 91AjoMBsaUBTTEOeQNvDZMC+mQxIKtI0rAbTv/QFlWZKEcPO7x5EOuGVX QJxO35PRAaJ8R9fVfo33Om8ZAYdJuX/x8R1uWwVnYw/Zgo4OXGfOokBUI gJVVGLv2Nu3pyMxI/cQY628mZmUL7JUrqtx4yv7WIQkNndvHzcJcNqLQC VU4ruOsZJK67k+ojyBkk761mC4nizwnmFfUOJXfdorgYiFN4+GMISd9os R40mw6upGfNAQr/fwmroVcHX2cV8fSqthEsFA2Q/WHKMx/OiIbZaYn+iK g==; From: Hermes Zhang To: , , CC: , , , , , Subject: [PATCH v2 1/2] dt-binding: leds: Document leds-multi-gpio bindings Date: Fri, 26 Mar 2021 13:28:00 +0800 Message-ID: <20210326052801.17666-2-chenhui.zhang@axis.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210326052801.17666-1-chenhui.zhang@axis.com> References: <20210326052801.17666-1-chenhui.zhang@axis.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org From: Hermes Zhang This binding represents LED devices which are controller with multiple GPIO lines in order to achieve more than two brightness states. Signed-off-by: Hermes Zhang --- .../bindings/leds/leds-multi-gpio.yaml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml diff --git a/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml b/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml new file mode 100644 index 000000000000..1549f21e8d6e --- /dev/null +++ b/Documentation/devicetree/bindings/leds/leds-multi-gpio.yaml @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/leds/leds-multi-gpio.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Multiple GPIOs LED driver + +maintainers: + - Hermes Zhang + +description: + This will support some LED made of multiple GPIOs and the brightness of the + LED could map to different states of the GPIOs. + +properties: + compatible: + const: multi-gpio-led + + led-gpios: + description: Array of one or more GPIOs pins used to control the LED. + minItems: 1 + maxItems: 8 # Should be enough + + led-states: + description: | + The array list the supported states here which will map to brightness + from 0 to maximum. Each item in the array will present all the GPIOs + value by bit. + $ref: /schemas/types.yaml#/definitions/uint8-array + minItems: 1 + maxItems: 256 # Should be enough + +required: + - compatible + - led-gpios + - led-states + +additionalProperties: false + +examples: + - | + gpios-led { + compatible = "multi-gpio-led"; + + led-gpios = <&gpio0 23 0x1>, + <&gpio0 24 0x1>; + led-states = /bits/ 8 <0x00 0x01 0x02 0x03>; + }; +...