From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F18CC54EAA for ; Fri, 27 Jan 2023 08:27:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232129AbjA0I1O (ORCPT ); Fri, 27 Jan 2023 03:27:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232134AbjA0I1M (ORCPT ); Fri, 27 Jan 2023 03:27:12 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA111757BE for ; Fri, 27 Jan 2023 00:27:09 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id l41-20020a05600c1d2900b003daf986faaeso2846131wms.3 for ; Fri, 27 Jan 2023 00:27:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=DdfiCXvxE3+wXETvP9iNhM7stAIscaaJ/d3hkQdjD+0=; b=B/RuS1NL29Yrb76eGHNw/76TdWb4k2B7kme4TaLgHYSrSLwmjABNDw2Dhagn/rnWpn pNotOIkOVgeg+wRR2soNop4lqhB6w3PzoKYGRgSB6LKbHYIETB8ygoZwnD54jkXnGwc3 lZ19lCIY6dL9kvzLqDr14qQ3aBQhGPheWX/Wy4HdcIent4fBN2vr9jkLOd8uZP1L7phE CqeQGY9cSrlU71PS4W1+tGTceGG4bUjehcDcoytFpxsWjd4IsPL7eYQQ4hqch9misqPn in4Qw2yFFkiPegKQ/JSUfuSVOga0A/MdISZPWXiDYA1E8WSX+PgFQ0cJZRwwtfrw+gEK A/YQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DdfiCXvxE3+wXETvP9iNhM7stAIscaaJ/d3hkQdjD+0=; b=R1MSFyo2AJQa4lu9cA+2s5JEm4I7/ww6Y+qWswiJmSu8iQRZViScKeDKLPUgQa82nh ZUGW1uvqfCZ1zWsFYu3/MhdDVIr1GgFIGEzjdqkqKZnJlAFf53Rw1PS93esKWUYhwpne GMoHg0Qu6k7QWeimaFJ0bbZdNfzbfqA35pfZhiz4JtXmkVyHCtCrWyJi+B9um5aIjEWW kCJQRfQxCK+CxYYM+aqn3I9R8MjKa4WAZJpGK5PVKAMqk37UTvWqF/ScfgpZduew5jrI Klb2fpiHYaVW8JgWiFffCG2hUiaf4HMXGAdrfFWzLfOPwTx8nkXVWAMjF3dFnCkk2yFc 5xLA== X-Gm-Message-State: AO0yUKXi12cTnX1NeoSURA2KQv/6odzFJEjN5+6UyWtZJDD8B0/+KOXc waK7n/iBjNgRYWa8kZNDTKMRcPxjSdLJBApJ X-Google-Smtp-Source: AK7set83wpkelfN7j+E1uxuUMRJdC66UYA7JuiqRtNdQUL0FEULzXsRPzprLT/NQQZrpkURjk+U6WQ== X-Received: by 2002:a05:600c:354a:b0:3dc:357a:f4ab with SMTP id i10-20020a05600c354a00b003dc357af4abmr1641253wmq.15.1674808028475; Fri, 27 Jan 2023 00:27:08 -0800 (PST) Received: from [192.168.1.109] ([178.197.216.144]) by smtp.gmail.com with ESMTPSA id u12-20020a05600c19cc00b003db0ee277b2sm7719863wmq.5.2023.01.27.00.27.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Jan 2023 00:27:07 -0800 (PST) Message-ID: <291ad4d3-6c8b-507d-08ff-997e0c4bd482@linaro.org> Date: Fri, 27 Jan 2023 09:27:06 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH 5/5] ARM: dts: qcom: msm8974-oneplus-bacon: Add notification LED To: Luca Weiss , ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230122-msm8974-bacon-features-v1-0-4049f565c24c@z3ntu.xyz> <4455893.LvFx2qVVIh@g550jk> <1840339.tdWV9SEqCh@g550jk> Content-Language: en-US From: Krzysztof Kozlowski In-Reply-To: <1840339.tdWV9SEqCh@g550jk> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 26/01/2023 21:41, Luca Weiss wrote: > On Donnerstag, 26. Jänner 2023 10:41:24 CET Krzysztof Kozlowski wrote: >> On 25/01/2023 21:51, Luca Weiss wrote: >>> On Montag, 23. Jänner 2023 18:18:16 CET Krzysztof Kozlowski wrote: >>>> On 22/01/2023 17:48, Luca Weiss wrote: >>>>> Add the node describing the sn3193 that's used to provide notification >>>>> LED. >>>>> >>>>> Unfortunately the driver currently supports neither multicolor API nor >>>>> using the properties function & color, so we use label instead. >>>>> >>>>> Signed-off-by: Luca Weiss >>>>> --- >>>>> >>>>> .../arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts | 28 >>>>> ++++++++++++++++++++++ 1 file changed, 28 insertions(+) >>>>> >>>>> diff --git a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts >>>>> b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts index >>>>> ffb486ceb6a6..a672c45d7070 100644 >>>>> --- a/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts >>>>> +++ b/arch/arm/boot/dts/qcom-msm8974pro-oneplus-bacon.dts >>>>> @@ -114,6 +114,34 @@ led@0 { >>>>> >>>>> default-brightness = <80>; >>>>> >>>>> }; >>>>> >>>>> }; >>>>> >>>>> + >>>>> + led-controller@68 { >>>>> + compatible = "si-en,sn3193"; >>>>> + reg = <0x68>; >>>>> + >>>>> + shutdown-gpios = <&tlmm 45 GPIO_ACTIVE_HIGH>; >>>>> + >>>>> + #address-cells = <1>; >>>>> + #size-cells = <0>; >>>>> + >>>>> + led@1 { >>>>> + reg = <1>; >>>>> + label = "red:status"; >>>> >>>> These should be colors and functions. >>> >>> Hi Krzysztof, >>> >>> please check the commit message for this. I tried using it but it didn't >>> work, the driver in general might need an overhaul at some point... >>> >>>> Unfortunately the driver currently supports neither multicolor API nor >>>> using the properties function & color, so we use label instead. >>> >>> Or maybe I messed up but pretty sure this was the case when I wrote the >>> dts. >> I don't understand how driver is related here - it's not the driver's >> property, but LED core. If the driver "supports" label, then it supports >> color and status. > > The leds-is31fl319x.c driver uses devm_led_classdev_register but the function > where 'function' and 'color' is parsed is led_parse_fwnode_props which is > called from led_compose_name which is called from led_classdev_register_ext > (or with the devm_ prefix), and not called from the register method without > _ext suffix. No, devm_led_classdev_register calls devm_led_classdev_register_ext which calls led_classdev_register_ext which calls led_compose_name (if initdata is set). The point is that we lack initdata, so indeed color and function cannot be used. > > So in other words, the led driver would need changes to use the new > registration API to be able to use 'function' and 'color' instead of 'label'. > > Regards > Luca > >> >> Best regards, >> Krzysztof > > > > Best regards, Krzysztof