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 CAD7DC43334 for ; Mon, 6 Jun 2022 06:21:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230016AbiFFGVX (ORCPT ); Mon, 6 Jun 2022 02:21:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbiFFGUd (ORCPT ); Mon, 6 Jun 2022 02:20:33 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA74022B14 for ; Sun, 5 Jun 2022 23:20:25 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id kq6so13911859ejb.11 for ; Sun, 05 Jun 2022 23:20:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=F/BITtmLWc1VtxM65EqQjDPMCYQMAuoqz8dLA7WWjls=; b=S7fiGYjkD4hCmOxEBPhVlPYrksvpFVRkVWt7637cDHckBJf5TCtLnmB9UkOmZKTIKF ZLq2E6ClOr44GI0ySPWu8fcv61ODO7R7TZkolOKRsI5miFRej3Sk0Ez3u9iUUrvcJ5sD cAe8JXXs9pMWUQrp3HLptyxSBK/Dp/Kxb5sEbCn1ddt6aBXwzyPUPn7+QvK0OpZFNJ1S 3g3yffxJw5Emt0ODfIJsXbgP0bmEDOP7Bw2xD88HDF2FIF6NYDreWrcOhAPuEekY79bd EbakCJ2/E0EsEoUb9/nLOZLwS+QfCORF4eCHplr5b7slcx0Fg9kERBNrirNO5aeJAadX ZL5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=F/BITtmLWc1VtxM65EqQjDPMCYQMAuoqz8dLA7WWjls=; b=o7V2TfWCKzgMTtJxAznGwnofB+OHX0e5bm3XwC8oZS414LyWqZ2xAZeat1b59WNkRp WqjzW4iBb35tyuy9PCurcRnSnLNpgUSo/mbSsP5ST5KqTztT/mZiW9pTICKCxInWsZXE AH7jugFoUI+6rgqQNJV1ejwrSDcBKqD2mr/Tab+UKsZWWGifjp0z+V/02/SeTwoXk6cy xB6wiKA7qKutp2Zr9/YQwYhgwp5TGicjdm+clbZHjIOEcY5zuqgf89YjcL8iOgIOp1pT wX5DFZDY0sGoZtFC7jsc2C0AOzLw2Mck4cvTT0ORLYZVegumCBHTvq/Z7BKiSGAsQmyl M2cA== X-Gm-Message-State: AOAM533Razea774WDgYESoKRsfk7wxbrQ2daROPSDjzPn+1NNhULGflc EUnUUQ0ellsj/JiPCDENMGNvkQ== X-Google-Smtp-Source: ABdhPJzAfxWKgaolZMJ1kBvo3MGRFufwf7UUXNcLCeJtJs0PDGTLYJF6eHuRcJkYjoAgJxuWKltYiw== X-Received: by 2002:a17:906:4fce:b0:6f4:f41c:3233 with SMTP id i14-20020a1709064fce00b006f4f41c3233mr19013888ejw.117.1654496423905; Sun, 05 Jun 2022 23:20:23 -0700 (PDT) Received: from [192.168.0.181] (xdsl-188-155-176-92.adslplus.ch. [188.155.176.92]) by smtp.gmail.com with ESMTPSA id n19-20020a05640205d300b0042de8155fa1sm8150758edx.0.2022.06.05.23.20.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Jun 2022 23:20:23 -0700 (PDT) Message-ID: <5af6d6ff-c5e3-f764-fa9c-a2c3d7365082@linaro.org> Date: Mon, 6 Jun 2022 08:20:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: Re: [PATCH 1/2] dt-bindings: backlight: rt4831: Add the new property for ocp level selection Content-Language: en-US To: ChiYuan Huang Cc: Rob Herring , Krzysztof Kozlowski , Lee Jones , Daniel Thompson , Jingoo Han , Pavel Machek , Helge Deller , cy_huang , lucas_tsai@richtek.com, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , dri-devel , "open list:FRAMEBUFFER LAYER" , Linux LED Subsystem , lkml References: <1653534995-30794-1-git-send-email-u0084500@gmail.com> <1653534995-30794-2-git-send-email-u0084500@gmail.com> <1c7ab94c-a736-c629-bd8c-8a974803e2b9@linaro.org> <076d53d3-6062-686f-8e45-14c5f936bbf6@linaro.org> <20220602135604.GA2194286-robh@kernel.org> <12096a2c-98c3-9e77-785f-808cc3e1a0e4@linaro.org> From: Krzysztof Kozlowski In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 06/06/2022 03:39, ChiYuan Huang wrote: > Krzysztof Kozlowski 於 2022年6月6日 週一 上午12:11寫道: >> >> On 02/06/2022 17:31, ChiYuan Huang wrote: >>> Krzysztof Kozlowski 於 2022年6月2日 週四 下午9:58寫道: >>>> >>>> On 02/06/2022 15:56, Rob Herring wrote: >>>>> On Thu, May 26, 2022 at 12:32:12PM +0200, Krzysztof Kozlowski wrote: >>>>>> On 26/05/2022 10:13, ChiYuan Huang wrote: >>>>>>> Krzysztof Kozlowski 於 2022年5月26日 週四 下午4:06寫道: >>>>>>>> >>>>>>>> On 26/05/2022 05:16, cy_huang wrote: >>>>>>>>> From: ChiYuan Huang >>>>>>>>> >>>>>>>>> Add the new property for ocp level selection. >>>>>>>>> >>>>>>>>> Signed-off-by: ChiYuan Huang >>>>>>>>> --- >>>>>>>>> .../bindings/leds/backlight/richtek,rt4831-backlight.yaml | 8 ++++++++ >>>>>>>>> include/dt-bindings/leds/rt4831-backlight.h | 5 +++++ >>>>>>>>> 2 files changed, 13 insertions(+) >>>>>>>>> >>>>>>>>> diff --git a/Documentation/devicetree/bindings/leds/backlight/richtek,rt4831-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/richtek,rt4831-backlight.yaml >>>>>>>>> index e0ac686..c1c59de 100644 >>>>>>>>> --- a/Documentation/devicetree/bindings/leds/backlight/richtek,rt4831-backlight.yaml >>>>>>>>> +++ b/Documentation/devicetree/bindings/leds/backlight/richtek,rt4831-backlight.yaml >>>>>>>>> @@ -47,6 +47,14 @@ properties: >>>>>>>>> minimum: 0 >>>>>>>>> maximum: 3 >>>>>>>>> >>>>>>>>> + richtek,bled-ocp-sel: >>>>>>>> >>>>>>>> Skip "sel" as it is a shortcut of selection. Name instead: >>>>>>>> "richtek,backlight-ocp" >>>>>>>> >>>>>>> OK, if so, do I need to rename all properties from 'bled' to 'backlight' ? >>>>>>> If only this property is naming as 'backlight'. it may conflict with >>>>>>> the others like as "richtek,bled-ovp-sel". >>>>>> >>>>>> Ah, no, no need. >>>>>> >>>>>>>> >>>>>>>>> + description: | >>>>>>>>> + Backlight OCP level selection, currently support 0.9A/1.2A/1.5A/1.8A >>>>>>>> >>>>>>>> Could you explain here what is OCP (unfold the acronym)? >>>>>>> Yes. And the full name is 'over current protection'. >>>>>> >>>>>> Thanks and this leads to second thing - you encode register value >>>>>> instead of logical value. This must be a logical value in mA, so >>>>>> "richtek,bled-ocp-microamp". >>>>> >>>>> We already have common properties for setting current of LEDs. We should >>>>> use that here I think. >>>> >>>> It might not be exactly the same. We have "led-max-microamp" which is >>>> the maximum allowed current. I guess over-current protection level is >>>> slightly higher (e.g. led-max-microamp + 1). IOW, led-max-microamp is >>>> something which still can be set and used by system/hardware. OCP should >>>> not. >>>> >>> Yap, you're right. >> >> So I am right or Rob? >> > As I know, both are incorrect. >>> From the modern backlight IC design, it uses the boost converter architecture. >>> This OCP level is to limit the inductor current when the internal MOS >>> switch turn on. >>> Details can refer to the below wiki link >>> https://en.wikipedia.org/wiki/Boost_converter >>> >>> And based on it, OVP is used to limit the inductor output voltage. >>> Each channel maximum current is based on the IC affordable limit. >>> It is more like as what you said 'led-max-microamp'. >>> >>> So boost voltage level may depend on the LED VF. >>> The different series of LED may cause different boost voltage. >>> >>> RT4831's OVP/OCP is not just the protection, more like as the limit. >> >> This suggests Rob is right, so let's use led-max-microamp property? >> > No, the meaning is different. 'led-max-microamp' always means the > channel output current. > It already can be adjusted by backlight brightness node. > > For example > low voltage side (3.3~4.4V) to generate the boost voltage to 16~17V, > even 20V for BLED Vout. > This OCP is to limit the input current of low voltage side. > > After the explanation, do you still think it's the same thing? This sounds differently so I propose to use this dedicated property with the changes I asked for. Best regards, Krzysztof