Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3040417ybt; Mon, 29 Jun 2020 13:40:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvf0Nf7AiLQlDJMq98hqSHi/Jo/QzAYXnk6W1BCLHizPTC3yUO6mpl72bTUlMDL3E+mzXY X-Received: by 2002:a50:b964:: with SMTP id m91mr20429207ede.37.1593463213269; Mon, 29 Jun 2020 13:40:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593463213; cv=none; d=google.com; s=arc-20160816; b=RQXee8u0CPODI2B3XBA6lTayiUvomI6jtxodYN1Am2Jkdlaz6F4zFN96KLOOQlRqFH n8tWz5+1yDfl7s3ifUh+jk0W9IW+fTI3xcko4QvdeYJAV5/AkM2Q07sfXTLiyVC8uMmZ bquZpzvHW6AjhlpJVLHvE/bCUCWNvJilCPiXu88b9DXhN/q8UCmPZhGs4mBpWiTrtHro a0DWlMqvMdG7M2NzJDpAIaNk59Y58tAh1LbqBs/NkF5HljmWOaUZZrh70RX33I/1rGvG xadcS40KBtWzWbpPdD2M5sB6VzYwnNmaYw/VXEdsrJMhHOdCYyYoAszpXhgi5nWJ5NeY VNxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JrwDoymCxFglGHE+fdzQIm0zeejCjaV8wEh4iIadrjA=; b=QYMGBm26Gwj3ltLAoIKXZMFtAef5g6dw97CW0zCVE8Qus0/eYbIzSaByGjKJxnSgUL Vptng/x5/KhC4HTTeqHxlgLuNd4S/jm//csAgHgo9MdMn+DIpi5O33pR/pngyY06vNNR 19WC1DodlqekarCjb0ltO8gWMDgLMn42pwVVBp4LJgx+uYk5CWdR1P0pD8wwJ8+/1Xxg ohQyX8m27Tsd+45psVDb+b2nwhP4BnHAU7IZgUCVaPj492xnIUUp8jo04SgJsXM4m7f4 jcfpYRiGoNzN08M8xdEvgKG9vuMEdA7JuQZ5Ec8Sj2BQ/CJ/QmyalhQCMtVLu2Bx2Wmj IHyw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si427923eje.481.2020.06.29.13.39.49; Mon, 29 Jun 2020 13:40:13 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389538AbgF2UiC (ORCPT + 99 others); Mon, 29 Jun 2020 16:38:02 -0400 Received: from asavdk3.altibox.net ([109.247.116.14]:36938 "EHLO asavdk3.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726736AbgF2TSw (ORCPT ); Mon, 29 Jun 2020 15:18:52 -0400 Received: from ravnborg.org (unknown [188.228.123.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk3.altibox.net (Postfix) with ESMTPS id 5F29F20024; Mon, 29 Jun 2020 21:18:49 +0200 (CEST) Date: Mon, 29 Jun 2020 21:18:47 +0200 From: Sam Ravnborg To: Rob Herring Cc: Daniel Thompson , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , dri-devel , Jingoo Han , Lee Jones Subject: Re: [PATCH] dt-bindings: backlight: Convert common backlight bindings to DT schema Message-ID: <20200629191847.GA318506@ravnborg.org> References: <20200618224413.1115849-1-robh@kernel.org> <20200619215341.GA6857@ravnborg.org> <20200622165730.pnx7fzbq5e6q5h4l@holly.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=f+hm+t6M c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=KKAkSRfTAAAA:8 a=gEfo2CItAAAA:8 a=pGLkceISAAAA:8 a=wNlRYuuYm4J86z4hMpcA:9 a=hv1kb02ZR_FIT1_D:21 a=XilPnIEmbnQ7gt8O:21 a=CjuIK1q_8ugA:10 a=cvBusfyB2V15izCimMoJ:22 a=sptkURWiP4Gy88Gu7hUp:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 29, 2020 at 11:57:37AM -0600, Rob Herring wrote: > On Mon, Jun 22, 2020 at 10:57 AM Daniel Thompson > wrote: > > > > On Fri, Jun 19, 2020 at 11:53:41PM +0200, Sam Ravnborg wrote: > > > > diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml > > > > new file mode 100644 > > > > index 000000000000..7e1f109a38a4 > > > > --- /dev/null > > > > +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml > > > > @@ -0,0 +1,98 @@ > > > > +# SPDX-License-Identifier: GPL-2.0-only > > > > +%YAML 1.2 > > > > +--- > > > > +$id: http://devicetree.org/schemas/leds/backlight/pwm-backlight.yaml# > > > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > > > + > > > > +title: pwm-backlight bindings > > > > + > > > > +maintainers: > > > > + - Lee Jones > > > > + - Daniel Thompson > > > > + - Jingoo Han > > > > + > > > > +properties: > > > > + compatible: > > > > + const: pwm-backlight > > > > + > > > > + pwms: > > > > + maxItems: 1 > > > > + > > > > + pwm-names: true > > > > + > > > > + power-supply: > > > > + description: regulator for supply voltage > > > > + > > > > + enable-gpios: > > > > + description: Contains a single GPIO specifier for the GPIO which enables > > > > + and disables the backlight > > > > + maxItems: 1 > > > > + > > > > + post-pwm-on-delay-ms: > > > > + description: Delay in ms between setting an initial (non-zero) PWM and > > > > + enabling the backlight using GPIO. > > > > + > > > > + pwm-off-delay-ms: > > > > + description: Delay in ms between disabling the backlight using GPIO > > > > + and setting PWM value to 0. > > > > + > > > > + brightness-levels: > > > > + description: Array of distinct brightness levels. Typically these are > > > > + in the range from 0 to 255, but any range starting at 0 will do. The > > > > + actual brightness level (PWM duty cycle) will be interpolated from > > > > + these values. 0 means a 0% duty cycle (darkest/off), while the last > > > > + value in the array represents a 100% duty cycle (brightest). > > > > + $ref: /schemas/types.yaml#/definitions/uint32-array > > > > + > > > > + default-brightness-level: > > > > + description: The default brightness level (index into the array defined > > > > + by the "brightness-levels" property). > > > > + $ref: /schemas/types.yaml#/definitions/uint32 > > > Same comment as before... > > > > Sorry the "ditto" meant I didn't thing about PWM as much as I should > > have. > > > > The situation for PWM is a little different to LED. That's mostly > > because we decided not to clutter the LED code with > > "num-interpolated-steps". > > > > The PWM code implements the default-brightness-level as an index into > > the brightness array *after* it has been expanded using interpolation. > > In other words today Linux treats the default-brightness-level more > > like[1]. > > > > description: The default brightness level. When > > num-interpolated-steps is not set this is simply an index into > > the array defined by the "brightness-levels" property. If > > num-interpolated-steps is set the brightness array will be > > expanded by interpolation before we index to get a default > > level. > > > > This is the best I have come up with so far... but I concede it still > > lacks elegance. > > Happy to add this or whatever folks want if there's agreement, but I > don't want to get bogged down on re-reviewing and re-writing the > binding on what is just a conversion. There's a mountain of bindings > to convert. The original explanation is ok, as pointed out by Daniel. So I suggest moving forward with that and then others can improve the descriptions later as necessary. Sam