From patchwork Wed Oct 13 20:44:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1540614 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=ncqph26D; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HV4Jw1QCHz9sNH for ; Thu, 14 Oct 2021 07:44:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229526AbhJMUqd (ORCPT ); Wed, 13 Oct 2021 16:46:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:55888 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbhJMUqd (ORCPT ); Wed, 13 Oct 2021 16:46:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B19296054F; Wed, 13 Oct 2021 20:44:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634157869; bh=FobP0/OixENx5K/bYUpWQ5xRS2moBX9d1tNWW9Pvkkc=; h=From:To:Cc:Subject:Date:From; b=ncqph26D6vMQPdX9bHfVwKq012hJ21APNVeYX63jDVRLwuokA4Fpb5oTE1bae1va0 WlLRvoJglTjQgyIoXsrReeMrKCqVP+lmuHaVs7a7PKCy3iYAd/tTAN+7VZewHZY5u8 nBZlnvRmBLcfk2KNug/bbpbEocw7de+/1hQ4Lxdc1rAy45EzjKByizWGv1BaeR8uta NgRpd1Pw+vUrISm9rh/f67ELezrhqNLQjkF2Kddu55Guyz0lGZ7fjccq3Efuljzkl2 ZMYjyivp22wUlPE+hH7KTtqL349o2o/croQ3mMwu1FN6S7FR3VARYuqv31FVsVeCGd b7wiahky7X3gQ== From: =?utf-8?q?Marek_Beh=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_Beh?= =?utf-8?q?=C3=BAn?= Subject: [PATCH 1/3] dt-bindings: leds: Deprecate `linux,default-trigger` property Date: Wed, 13 Oct 2021 22:44:22 +0200 Message-Id: <20211013204424.10961-1-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This property is deprecated in favor of the `function` property. Signed-off-by: Marek Behún Acked-by: Rob Herring --- Documentation/devicetree/bindings/leds/common.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml index 697102707703..a19acc781e89 100644 --- a/Documentation/devicetree/bindings/leds/common.yaml +++ b/Documentation/devicetree/bindings/leds/common.yaml @@ -78,6 +78,7 @@ properties: This parameter, if present, is a string defining the trigger assigned to the LED. $ref: /schemas/types.yaml#/definitions/string + deprecated: true enum: # LED will act as a back-light, controlled by the framebuffer system From patchwork Wed Oct 13 20:44:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1540615 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=c9d3dO8k; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HV4Jw72pjz9sNH for ; Thu, 14 Oct 2021 07:44:32 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbhJMUqf (ORCPT ); Wed, 13 Oct 2021 16:46:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:55936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbhJMUqf (ORCPT ); Wed, 13 Oct 2021 16:46:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B052461100; Wed, 13 Oct 2021 20:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1634157871; bh=+nyIx/R6AQMNziqWAKrYxDgrkE93NytBCbo06ykWGBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c9d3dO8k7IiOiaQbcX0quv5rCIRxwco4AqXgsZBLR81lElcBef+iwOFb/9tW2HN+7 1viPYszJDYokoefB3WVx099DA0vtVkrnNx9sEpbF+h7WE7I+MgfH9uqiatHhHouVFE 2xLidHcchoF3ECIgBObt0xlbMCyJ1ClTs449IlIOwAdfnocfapVra65hBzU6yt+qDf WiiB8GTnI7iZyCSrs+5iTOY/fPUS9XvRY//qVuHD8HKUBB4mo7pMemvsoqEVFdh8Cp ACTcNXjuS/BDFC7ZNYbQKRjhdc92k9NtrCWfH/14+mFPam/m71ux2EERBKYk1z4DJC HEK5jmqHxO0fw== From: =?utf-8?q?Marek_Beh=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_Beh?= =?utf-8?q?=C3=BAn?= Subject: [PATCH 2/3] dt-bindings: leds: Add `excludes` property Date: Wed, 13 Oct 2021 22:44:23 +0200 Message-Id: <20211013204424.10961-2-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 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Some RJ-45 connectors have LEDs wired in the following way: LED1 +--|>|--+ | | A---+--|<|--+---B LED2 With + on A and - on B, LED1 is ON and LED2 is OFF. Inverting the polarity turns LED1 OFF and LED2 ON. So these LEDs exclude each other. Add new `excludes` property to the LED binding. The property is a phandle-array to all the other LEDs that are excluded by this LED. Signed-off-by: Marek Behún --- Documentation/devicetree/bindings/leds/common.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/common.yaml b/Documentation/devicetree/bindings/leds/common.yaml index a19acc781e89..03759d2e125a 100644 --- a/Documentation/devicetree/bindings/leds/common.yaml +++ b/Documentation/devicetree/bindings/leds/common.yaml @@ -59,6 +59,14 @@ properties: deprecated - use 'function' and 'color' properties instead. function-enumerator has no effect when this property is present. + excludes: + description: + List of LEDs that are excluded by this LED: if this LED is ON, the others + must be OFF. This is mostly the case when there are two LEDs connected in + parallel, but inversely: inverting the polarity of the source turns one + LED ON while the other OFF. There are RJ-45 connectors with such wiring. + $ref: /schemas/types.yaml#/definitions/phandle-array + default-state: description: The initial state of the LED. If the LED is already on or off and the From patchwork Wed Oct 13 20:44:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1540616 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=UOou6/xV; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4HV4Jz6cMVz9sNH for ; Thu, 14 Oct 2021 07:44:35 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229822AbhJMUqh (ORCPT ); Wed, 13 Oct 2021 16:46:37 -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_Beh=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_Beh?= =?utf-8?q?=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 Precedence: bulk List-ID: X-Mailing-List: devicetree@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: