Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3086662ybt; Mon, 29 Jun 2020 15:01:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5eC0btiaGn73ENTcoYb0iLvKJ7KeGCj4LpHfFGqb56lRGE3h/QcU3xI5cyFDcTvWbiHgo X-Received: by 2002:a05:6402:1a42:: with SMTP id bf2mr13485201edb.292.1593468086464; Mon, 29 Jun 2020 15:01:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593468086; cv=none; d=google.com; s=arc-20160816; b=V3H1RxiDlC+a6UQwMw2njKdvvrdFsuVVx2iEZy608F1+L82Ahr0KvN5UI9iLXHU05f VbbiA2WPg5jmIXpS5Mt0dzBB2UC3cO7tyOYxoO18xnk6N/r4ZtBy44YOqkHp8TTJ1XTW Ig1mLNIz5f4+l94uPfl6psQ/3Op4Eu4+8lNo+I/yki+3n0JcTCOHysN0ca4uNtX11XCA GbeC+2jXBDDYmo6SvzNFTP2cmluOFI7VCEYc2S1Shh+5OkXDvaMxYK7haL6IPwjFr7D5 QI73dFZ4Y//frlnMbFOLkWptL6c5jSz8DHfDNUvcmObmxmCiXWtluL96lhp6/doxYKb3 rfXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=bU1aXjjK3y0ktgmbAaB5H+Ulwph496SHtN4llrDkmeA=; b=VSzh6j3WY+x+iaZ+a9XUwtirc949imtwXKs+N0kNy34WkJVakdqaxBmRZDjsMvjF8y PIn+Ya+2tJqO0dq7GOfn4tqvVETXq6l11S9Q3Ep0E3LlbLYlCr5Ppthe9w99SaSzkCdx 38FPU7P7RfXF+/olYTWRHQblizuJE9eq1IlBaOKL5D4+I1o3wnkXYWLHFxY7hIRRKyzv fgNMqWyiNTGLWQ/5qDynduOat8HTqP0nJoF5+Xt0n2Tj/0D+KnRGytOhdpAZR73+iUhN HSoKTK43SST3VwtCsBrYRhUk0LHESvIOdvg2DS8VpTQx4iB6dpuk3kh1smgpKy1k2U5I Ogqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2kKS+wDh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx20si455087edb.568.2020.06.29.15.01.03; Mon, 29 Jun 2020 15:01:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=2kKS+wDh; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391718AbgF2V7z (ORCPT + 99 others); Mon, 29 Jun 2020 17:59:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:56764 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726392AbgF2SfZ (ORCPT ); Mon, 29 Jun 2020 14:35:25 -0400 Received: from mail-ot1-f51.google.com (mail-ot1-f51.google.com [209.85.210.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DFCA3255C7; Mon, 29 Jun 2020 17:57:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593453470; bh=ZtASUsHSUH9iBmQouSmlHBp0adBRXfaTVKN3IEKwB2A=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=2kKS+wDhkOuxpH9plHm9j0XcBd1NOUkJJmJEvlxcmanpfHqlzhfaHZvWTWdWKm1fj wSf07FVi3Vc5BoJg00SsFz9stOKYZjSXPZ0CZnwRUr9xGG9SK7jE+dnTuQahmLknAV QdfXGtfSQm+QApl5nSJa5URHEmOz9dzGsODL98zw= Received: by mail-ot1-f51.google.com with SMTP id q21so8790879otc.7; Mon, 29 Jun 2020 10:57:49 -0700 (PDT) X-Gm-Message-State: AOAM530ZH+ymx1LRhBUi64LdyKz+BbmrCg9xFIijTPklFGRFQdXbXrT8 a0c6j2G3NQXXwQ5O1ORx4/1uP7KmUySXwk2IGA== X-Received: by 2002:a05:6830:3104:: with SMTP id b4mr14554766ots.192.1593453469212; Mon, 29 Jun 2020 10:57:49 -0700 (PDT) MIME-Version: 1.0 References: <20200618224413.1115849-1-robh@kernel.org> <20200619215341.GA6857@ravnborg.org> <20200622165730.pnx7fzbq5e6q5h4l@holly.lan> In-Reply-To: <20200622165730.pnx7fzbq5e6q5h4l@holly.lan> From: Rob Herring Date: Mon, 29 Jun 2020 11:57:37 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: backlight: Convert common backlight bindings to DT schema To: Daniel Thompson Cc: Sam Ravnborg , devicetree@vger.kernel.org, dri-devel , Jingoo Han , Lee Jones , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Rob