Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp304160pxb; Wed, 27 Oct 2021 03:24:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWXEvxJ6Gok08/ZvL8N7PpElEn2O03L/mZ6Wkx2/44l2aMTjU23w2Po3B+qkCicPv6GxhZ X-Received: by 2002:a05:6a00:168c:b0:44c:dc5a:7ee0 with SMTP id k12-20020a056a00168c00b0044cdc5a7ee0mr32171706pfc.40.1635330280807; Wed, 27 Oct 2021 03:24:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635330280; cv=none; d=google.com; s=arc-20160816; b=VLOleJMXZ8/HtnMduyvFy08Qhrs0x4cSwObn1cOe4pxEHtZkttxLpnsjOB8NTq5b7f lWgvFMvWFwvhKG3HujDiCZFR0uJw7+jaCTr9XXdNZx3cmsrDnTBhp/STcHV/b/Fy4D7v 4xpqe3IrrRURLOhnrUq9Cvf1PklOTvfh2FgRvLSisaiwHqLAbhI5vfVKn2YV35nWWtBF GXgm0jlKkNvY4iwUR2KLyWiQmASQzsIDFZ6SfSYrMxjNxFDmRsD0ByaZihkIJVeWekUk 8m3WzAS26YtZHcRUkr4+YK4RxcSA6xd1u2Ba7cPDkrfZh78Aa1L0MpjfOPBb4CJMs5Fl /Qhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=sKAvIqLDA6il9jGsvQNTReGzOWFc+5qNFeKsTSA5leA=; b=s83NTaumB6T5p5O0OF7N+1VOtprFFGuviFBozMGoJ4JXw4+u1sEttvrSsy27a1kJ3A lqDTif/FW+E4bXKFx8Jhnc7DmYmfytT+KliVp7YQBykH5cv9mxCe4GOEdzTkBLSqDSvh McxP4LkjDaj76+doJMgmw/sSQmG2b7bkL1kkvqTMuiVkksoADfd7iv8u99NMJdbNNHP5 cft3MjGqhtdG5m0A8vFILBs3gKZIIjfQXizOXrcUgTnQc3Vaku/Tp1qAs+mdXH37DiDO Uftm160Wo/bItLhmC18Ft7UKjLMgEsbZQdCIdOnsasspnvcr4xvQzs7JO1P9heCrSMyq +V+g== ARC-Authentication-Results: i=1; mx.google.com; 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 a62si13297813pge.306.2021.10.27.03.24.27; Wed, 27 Oct 2021 03:24:40 -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; 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 S235665AbhJZUqj (ORCPT + 99 others); Tue, 26 Oct 2021 16:46:39 -0400 Received: from mail-oo1-f52.google.com ([209.85.161.52]:35743 "EHLO mail-oo1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235782AbhJZUqi (ORCPT ); Tue, 26 Oct 2021 16:46:38 -0400 Received: by mail-oo1-f52.google.com with SMTP id 64-20020a4a0d43000000b002b866fa13eeso168393oob.2; Tue, 26 Oct 2021 13:44:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=sKAvIqLDA6il9jGsvQNTReGzOWFc+5qNFeKsTSA5leA=; b=GQRQ1Z86SqpGe/w6rX/71Ci9Hj6/cD+XPC+x59249lHp356pzfhpK4sqwyGEEb/q2v ilmlWJ9yP/Vjonwapx80rv1MADhMoGkj2Dav9LuaspQE/1tz/96tqkAg5fmGDP3rpsso 6nRWTCGtTVXcg1DS+TK7Lb3l/uYU9weWOtGxQUXbjY8jKZBRxK5p+Fuc3kfKCDKnXgF6 fo7eHJAimkJk++fEIoW36agI4CbseDYptPqnDBvWGRnya3hNGLMj2wAkk5OC6wbEqOua KuRKaztjcCXanEV8MRLKrOE0DAyl0MIk7syDZ2/fK27nz045nSJD9DJW+jN5lYpA7J5B hQZg== X-Gm-Message-State: AOAM530O6j2jdoLP1mzgSuJm5URqTHuigFLzYHGVDqD4CtVL6I7QKChG Ux8DoZo45IAtwZAE0Yb26w== X-Received: by 2002:a4a:e4d1:: with SMTP id w17mr15503167oov.39.1635281053626; Tue, 26 Oct 2021 13:44:13 -0700 (PDT) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id l3sm2746051otu.6.2021.10.26.13.44.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Oct 2021 13:44:12 -0700 (PDT) Received: (nullmailer pid 3213230 invoked by uid 1000); Tue, 26 Oct 2021 20:44:12 -0000 Date: Tue, 26 Oct 2021 15:44:12 -0500 From: Rob Herring To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: devicetree@vger.kernel.org, linux-leds@vger.kernel.org, pavel@ucw.cz, Andrew Lunn , Jacek Anaszewski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] dt-bindings: leds: Allow for multiple colors in the `color` property Message-ID: References: <20211013204424.10961-1-kabel@kernel.org> <20211013204424.10961-3-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20211013204424.10961-3-kabel@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 10:44:24PM +0200, Marek Beh?n wrote: > 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 And: maxItems: 2 2 colors is a neat trick, but I don't see how you'd do more electrically. > + items: > + minimum: 0 > + maximum: 9 > > function-enumerator: > description: > -- > 2.32.0 > >