Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp463274pxb; Wed, 3 Feb 2021 09:25:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFWZ+0pi7wvq+h5JxOK3X3T86quq5qjdSpWIMWV7K9d4Gvsj9G8CSCo/gc2LCSb/CoaCmo X-Received: by 2002:a17:906:388b:: with SMTP id q11mr4246296ejd.421.1612373158568; Wed, 03 Feb 2021 09:25:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612373158; cv=none; d=google.com; s=arc-20160816; b=dN/cb8cnn+LBXTqcPFND72nhFPiyQbkQtUOBY44MGIbVpvVAL+57uj5HItv8EJPsHQ AL13+Wh15spgaUNSgvUIbb7YF4cqaetvmfwBt8uhHWRF4u+v9exz5tDnd50Hu5b83MJo TwXRy4I+WP0FQzp7CkocAcsB+NRvBATNh70NSB4TOIFw9qckENJWfh7tn1rSN06kzXp2 QHMB4lF1Mm+RbzPUXabKC9WKvhr9dZtJExs0PK3kn2AW+25MWTSYVdm8bjMBvwaJlP1C bt1/vrhFOLK8PWH4AG5o8Z+l8oo/F9AYpCYzQFUreoOQiqAgGHE2ZfDXLFFY0vtp6k31 2kPQ== 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:subject:cc:to:from:date; bh=IERDi4O/KpfBNgi0D6x/T1+gU1FLYZk3p1b1ZY+3JKg=; b=YY9Pi1YhZgcUDFuQ/IzKJerVqSuLJYCgdyCq4g6uPSgGyPQ5eFy2dLHa4YKBK8wrdK Xg52g+CyJI112Lh2G2i7643Y3yFBgWQ0MdboZ2ZsZGKt20JQw2MWsOCxDCzAnQ+PaeLj aQOmTOVekMxOxEakJfJwxLGoZydrejCycR0Vd8eK4AnpLT/KpTf8KXiHUDS7tDiDEYex Wk4tLvty9PewVYse82wU9Guvv4x8B7arOIVGp+tSUTMoWIGxDMkj22TPOFzk6KbQASRA O1bMH4cc5xFr9BW901Yg6I3woYiDtZf7Te15muqO8zOxkVYTruYXnaSPeDH7AcTREbKt XO7w== 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=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p24si1741402edw.248.2021.02.03.09.25.33; Wed, 03 Feb 2021 09:25:58 -0800 (PST) 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=fail (p=NONE sp=NONE dis=NONE) header.from=nic.cz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232313AbhBCRYB (ORCPT + 99 others); Wed, 3 Feb 2021 12:24:01 -0500 Received: from mail.nic.cz ([217.31.204.67]:43150 "EHLO mail.nic.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232087AbhBCRWV (ORCPT ); Wed, 3 Feb 2021 12:22:21 -0500 Received: from localhost (unknown [IPv6:2a0e:b107:ae1:0:3e97:eff:fe61:c680]) by mail.nic.cz (Postfix) with ESMTPSA id C0EA01420D5; Wed, 3 Feb 2021 18:21:37 +0100 (CET) Date: Wed, 3 Feb 2021 18:21:37 +0100 From: Marek Behun To: Pavel Machek Cc: Sven Schuchmann , Dan Murphy , Rob Herring , "linux-leds@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v1] leds: lp50xx: add setting of default intensity from DT Message-ID: <20210203182137.339f8470@nic.cz> In-Reply-To: <20210203163555.GA23019@duo.ucw.cz> References: <20210119105312.2636-1-schuchmann@schleissheimer.de> <20210203142940.GB12369@duo.ucw.cz> <20210203163555.GA23019@duo.ucw.cz> X-Mailer: Claws Mail 3.17.7 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-100.0 required=5.9 tests=SHORTCIRCUIT, USER_IN_WELCOMELIST,USER_IN_WHITELIST shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.nic.cz X-Virus-Scanned: clamav-milter 0.102.2 at mail X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Feb 2021 17:35:55 +0100 Pavel Machek wrote: > On Wed 2021-02-03 15:39:59, Sven Schuchmann wrote: > > Hello Pavel, > > > > > > In order to use a multicolor-led together with a trigger > > > > from DT the led needs to have an intensity set to see something. > > > > The trigger changes the brightness of the led but if there > > > > is no intensity we actually see nothing. > > > > > > > > This patch adds the ability to set the default intensity > > > > of each led so that it is turned on from DT. > > > > > > Do we need this to be configurable from device tree? Can we just set > > > it to max or something? > > > > > > Aha, this basically sets the initial color for LEDs the monochromatic > > > triggers, right? > > > > Let me try to explain in other words: I have one RGB-LED > > which consists of 3 Colors. Each of the three colors (Red, Green, Blue) you have > > to define in the DT. For example this is my setup for one RGB-LED which I wanted > > to show the heartbeat in Red (half intensity): > > > > multi-led@3 { > > #address-cells = <1>; > > #size-cells = <0>; > > reg = <0x3>; > > color = ; > > > > linux,default-trigger = "heartbeat"; > > function = LED_FUNCTION_HEARTBEAT; > > > > led-9 { > > color = ; > > default-intensity = <100>; > > }; > > > > led-10 { > > color = ; > > }; > > > > led-11 { > > color = ; > > }; > > }; > > > > If I would not have the default-intensity I would actually see nothing, > > since the intensity (which goes from 0-255) of each led is initialized with 0. > > > > I hope I could clarify this a little more? > > Yes, sounds reasonable. Could we get default intensity of 100% on all > channels if nothing else is specified? > > Or maybe simply "if intensity is not specified, start with 100%, and > use explicit =0 if other color is expected". > > Best regards, > Pavel Is the property default-intensity documented in DT bindings? Wouldn't it be better if the property was used in the multi-led node instead of the channel node? I.e. multi-led@3 { color = ; default-intensity = <100 0 0>; };