Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3822218pxb; Wed, 13 Oct 2021 13:46:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpD7ADPQ5pGic4ngXSZvJhhMKHInz/6YIicCX0JQOzvc5zQbMAWqNh/IoMaFQUKBw1Pqzm X-Received: by 2002:a05:6402:3509:: with SMTP id b9mr2376253edd.187.1634158019248; Wed, 13 Oct 2021 13:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634158019; cv=none; d=google.com; s=arc-20160816; b=O84FcB57BEJtw2ISFm4j7YVSp1TWt+/4nLCYklYim7t6EPTDVAQk+9YDrKJyHrNDk8 PoGNDMQNxqEcGLtKIkh8tzNV4QTdSqpvh2HzLZIXct4xcUXfFutAHqaYicCwetrmbRa9 xpArXDBwAnPhOBEqwCd3GXHzS4HtDmotvkEtyZ6QZDnZAY3gQXoKB5PApZ4qZuc2mNu6 IbUzod1xeBoQw25eN4So1hbh6Gpunzw9ZXf+J8vlfoiTDDnJu3vRI1I1ZzfEN1X/UnGz nhvQAEATepbagQ6/ki/ekSDs9TXIAknHTa4QqIpCULR2Z6b3sW+lHTbrK8TwV57rIo6m G4jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WWpkn7VehH2k2+k+l9M0Qq1/hPCLZovHlJg0kXM4zOs=; b=spRVvoU5o63KFby41jfpQanuWQ+ypvynu4AxwutTsEBT4oQXe4WMLUd6pPl69CeDcx G/Tos8YbfZQKvIpEESxvIlTbqz7Br3cOHGm4ZqbgiD9NidnAAoYaAWYdCyLNoatTqyau 6VNxn6+NqpTXRaNbosKy+BJXvs65OLdyaGJwLDhHBCWnoqUd67n8+YoCO+MhjLtbKDqr swsEkHClTZ9twvGBQYzMhp7WHydNAJ2xWAqIsb4HYMHzK2u48p/Mo8eqmC3PaseHI55D dFBaMtwih7w69I+/FuIOPoo0j0p5JM+ZzyV4aVAyLSXo9HZ+f6zi8bWS7kk2lI84gLdZ vxnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UOou6/xV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x10si760663edj.14.2021.10.13.13.46.34; Wed, 13 Oct 2021 13:46:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="UOou6/xV"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229836AbhJMUqi (ORCPT + 99 others); Wed, 13 Oct 2021 16:46:38 -0400 Received: from mail.kernel.org ([198.145.29.99]:56022 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbhJMUqh (ORCPT ); Wed, 13 Oct 2021 16:46:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ABB416113E; Wed, 13 Oct 2021 20:44:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634157873; bh=Z3DQ+Z4nxCDiFf5YjNS+6ibcgkKch/WFjfU7mmSJe5o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UOou6/xVP9Bbq6KxlSMJ7usDWiCY1lhmNehP5uc/EbFKYKvSXwMP3lryuFLNGZHb6 x0ST6J8TBqrWBdleHeL9p2EjzjeHu6DR4MN8xutFJnCxmrSQAAwQj0B6E6bSTIS+Ah 0sbEeW+SKL9x89E4EslKn7xla7ZXa3Q4q/YAq0j9t52A0Bi28jHqKO6XRhYVi3qMaf LmDA7KhRsYPAhjcjEPetk4V7y24X7jVaErMkVJ0MCqvwfxSW3vGZ0hCv2bJTKOCuZV uTmZCFQY5vtPOZdVBSP1sUaE8uDl5rWQERMQ63FQUWwEzsMg1PL1kcNZklKjumnBmX P3TqZetfsQoGA== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: devicetree@vger.kernel.org, linux-leds@vger.kernel.org, pavel@ucw.cz, Andrew Lunn Cc: robh+dt@kernel.org, Jacek Anaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH 3/3] dt-bindings: leds: Allow for multiple colors in the `color` property Date: Wed, 13 Oct 2021 22:44:24 +0200 Message-Id: <20211013204424.10961-3-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211013204424.10961-1-kabel@kernel.org> References: <20211013204424.10961-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some RJ-45 connectors have one green/yellow LED wired in the following way: green +--|>|--+ | | A---+--|<|--+---B yellow But semantically this is still just one (multi-color) LED (for example it can be controlled by HW as one dual-LED). This is a case that we do not support in device tree bindings; setting color = ; or color = ; is wrong, because those are meant for when the controller can mix the "channels", while for our case only one "channel" can be active at a time. Change the `color` property to accept an (non-empty) array of colors to indicate this case. Example: ethernet-phy { led@0 { reg = <0>; color = ; function = LED_FUNCTION_ID_LAN; trigger-sources = <ð0>; }; }; Signed-off-by: Marek BehĂșn --- .../devicetree/bindings/leds/common.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml index 03759d2e125a..492dd3e7f9ac 100644 --- a/Documentation/devicetree/bindings/leds/common.yaml +++ b/Documentation/devicetree/bindings/leds/common.yaml @@ -37,13 +37,21 @@ properties: $ref: /schemas/types.yaml#/definitions/string color: - description: + description: | Color of the LED. Use one of the LED_COLOR_ID_* prefixed definitions from the header include/dt-bindings/leds/common.h. If there is no matching LED_COLOR_ID available, add a new one. - $ref: /schemas/types.yaml#/definitions/uint32 - minimum: 0 - maximum: 9 + + For multi color LEDs there are two cases: + - the LED can mix the channels (i.e. RGB LED); in this case use + LED_COLOR_ID_MULTI or LED_COLOR_ID_RGB + - the LED cannot mix the channels, only one can be active; in this case + enumerate all the possible colors + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + items: + minimum: 0 + maximum: 9 function-enumerator: description: -- 2.32.0