Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3004389ybt; Mon, 29 Jun 2020 12:39:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0g8bqPMh/bECHFXu7+8OAqYVaHfhWuNYZayRH7bS8vNL6H8P1lEZVak1QOGSXPZbETjM7 X-Received: by 2002:a50:a45d:: with SMTP id v29mr19164666edb.284.1593459594420; Mon, 29 Jun 2020 12:39:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593459594; cv=none; d=google.com; s=arc-20160816; b=pvmglw0cy42Rg0OIYJPFCsrsVsPNosLbKzqwQm3dWf5YVrDevvqclnbHvdrqlY6Oi3 RkneMe1KGAkxgsxQZuORss5zKQ45ECpGFY6Wl/EP8ZwCdYiEA19GOTAusamRHVDRpsRm GnnRv6hRQaDF4OHSDcBaMIRzSOlkgnBXw+lIOdM1d3zCSKbZuMlMhUu3blyDTTwkklxw rRDXzr95TU0/mWPxe44j6/1dddQu6RuhVSt/hl86BTLZFdpmeWqs1CAiIydtmYxWs6MK yOvK5HJ6h8q8zPOSndHUzRNt5gz4PHXiprTJ0rh9FY6NW4N6/84IfzcGfLNQydSyIY5n P9MQ== 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=+FCMbPe9Z5ik0tCga6jT0/4R22kLMayB2UqDlIHgUVE=; b=KtT5hLoR5xhQ+jDLWDpWQbZofQMwhmQw/ef+8LEU7z+hWWNPPm+e0bOQea5lzuTvth z8kjXHiLyNYRZFiUcTnzBljK15Hv7UOe80BNcxXQhVFpdbrrDmjIxsQ8BCmQVScpuehy ClP09rQJ9za1Rx7XDXa1SSig86pugV97HvVsX6G1w/7N6UBB/krBU1ChkRmzKYV9gcVw OUhl/D4qV0V5MaktQTKudQvvmriMkXT25InVFlLHAl3z/Zg1p31gPkKNbmoqsoqhnqRV pAXm2maIDpqMDKMigTjWE3d6L3UXvf15qIXp7sZakLMg1uCzhvgk7ZUFReROQA16G9sQ 0cqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=sb7NGoy7; 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 i21si291269edb.402.2020.06.29.12.39.31; Mon, 29 Jun 2020 12:39:54 -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=sb7NGoy7; 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 S2387494AbgF2TiF (ORCPT + 99 others); Mon, 29 Jun 2020 15:38:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:45824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387488AbgF2TiA (ORCPT ); Mon, 29 Jun 2020 15:38:00 -0400 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (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 D22EF20780; Mon, 29 Jun 2020 19:37:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593459479; bh=IxP7fkKngaycJwsg21YV+tvkJ91Wj/BE51SsDiZ/4k8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=sb7NGoy7T/HwxKy8QYvemUwy3DhQCubraado/xaW5kE1It/wO5zWa02cLwxkKlDun FNvofZFfbaECarbvSqXT5Ocyk9BDO/wT+yRsxZyh111mndxwKLBeNp2D+Nvoe98cr0 iJ+dcVMJIHFs1G137M/dvcD5voKNYOQUl9Po0L0s= Received: by mail-ot1-f52.google.com with SMTP id 18so16545539otv.6; Mon, 29 Jun 2020 12:37:59 -0700 (PDT) X-Gm-Message-State: AOAM5311vdv4r+NGlHKFVURWnKyJ6EUfYhWtNelqBt0R7t53JI+0lV2d LiTSF9tnEDw3TegA2nWZY0JHc/SegfbpDXSCcA== X-Received: by 2002:a05:6830:3104:: with SMTP id b4mr14923890ots.192.1593459479172; Mon, 29 Jun 2020 12:37:59 -0700 (PDT) MIME-Version: 1.0 References: <20200618224413.1115849-1-robh@kernel.org> <20200619215341.GA6857@ravnborg.org> In-Reply-To: <20200619215341.GA6857@ravnborg.org> From: Rob Herring Date: Mon, 29 Jun 2020 13:37:47 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] dt-bindings: backlight: Convert common backlight bindings to DT schema To: Sam Ravnborg Cc: devicetree@vger.kernel.org, dri-devel , Jingoo Han , Daniel Thompson , 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 Fri, Jun 19, 2020 at 3:53 PM Sam Ravnborg wrote: > > Hi Rob. > > Good to have these converted. A few comments in the following. One > comment is for the backlight people as you copied the original text. > > Sam > > On Thu, Jun 18, 2020 at 04:44:13PM -0600, Rob Herring wrote: > > Convert the common GPIO, LED, and PWM backlight bindings to DT schema > > format. > > > > Given there's only 2 common properties and the descriptions are slightly > > different, I opted to not create a common backlight schema. > > > > Cc: Lee Jones > > Cc: Daniel Thompson > > Cc: Jingoo Han > > Signed-off-by: Rob Herring > > --- > > .../leds/backlight/gpio-backlight.txt | 16 --- > > .../leds/backlight/gpio-backlight.yaml | 41 ++++++++ > > .../bindings/leds/backlight/led-backlight.txt | 28 ------ > > .../leds/backlight/led-backlight.yaml | 58 +++++++++++ > > .../bindings/leds/backlight/pwm-backlight.txt | 61 ------------ > > .../leds/backlight/pwm-backlight.yaml | 98 +++++++++++++++++++ > > 6 files changed, 197 insertions(+), 105 deletions(-) > > delete mode 100644 Documentation/devicetree/bindings/leds/backlight/gpio-backlight.txt > > create mode 100644 Documentation/devicetree/bindings/leds/backlight/gpio-backlight.yaml > > delete mode 100644 Documentation/devicetree/bindings/leds/backlight/led-backlight.txt > > create mode 100644 Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml > > delete mode 100644 Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt > > create mode 100644 Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml > > > > diff --git a/Documentation/devicetree/bindings/leds/backlight/gpio-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/gpio-backlight.txt > > deleted file mode 100644 > > index 321be6640533..000000000000 > > --- a/Documentation/devicetree/bindings/leds/backlight/gpio-backlight.txt > > +++ /dev/null > > @@ -1,16 +0,0 @@ > > -gpio-backlight bindings > > - > > -Required properties: > > - - compatible: "gpio-backlight" > > - - gpios: describes the gpio that is used for enabling/disabling the backlight. > > - refer to bindings/gpio/gpio.txt for more details. > > - > > -Optional properties: > > - - default-on: enable the backlight at boot. > > - > > -Example: > > - backlight { > > - compatible = "gpio-backlight"; > > - gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>; > > - default-on; > > - }; > > diff --git a/Documentation/devicetree/bindings/leds/backlight/gpio-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/gpio-backlight.yaml > > new file mode 100644 > > index 000000000000..75cc569b9c55 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/leds/backlight/gpio-backlight.yaml > > @@ -0,0 +1,41 @@ > > +# SPDX-License-Identifier: GPL-2.0-only > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/leds/backlight/gpio-backlight.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: gpio-backlight bindings > > + > > +maintainers: > > + - Lee Jones > > + - Daniel Thompson > > + - Jingoo Han > > + > > +properties: > > + compatible: > > + const: gpio-backlight > > + > > + gpios: > > + description: The gpio that is used for enabling/disabling the backlight. > > + maxItems: 1 > > + > > + default-on: > > + description: enable the backlight at boot. > > + type: boolean > > + > > +required: > > + - compatible > > + - gpios > > + > > +additionalProperties: false > > + > > +examples: > > + - | > > + #include > > + backlight { > > + compatible = "gpio-backlight"; > > + gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>; > > + default-on; > > + }; > > + > > +... > > diff --git a/Documentation/devicetree/bindings/leds/backlight/led-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/led-backlight.txt > > deleted file mode 100644 > > index 4c7dfbe7f67a..000000000000 > > --- a/Documentation/devicetree/bindings/leds/backlight/led-backlight.txt > > +++ /dev/null > > @@ -1,28 +0,0 @@ > > -led-backlight bindings > > - > > -This binding is used to describe a basic backlight device made of LEDs. > > -It can also be used to describe a backlight device controlled by the output of > > -a LED driver. > > - > > -Required properties: > > - - compatible: "led-backlight" > > - - leds: a list of LEDs > > - > > -Optional properties: > > - - brightness-levels: Array of distinct brightness levels. The levels must be > > - in the range accepted by the underlying LED devices. > > - This is used to translate a backlight brightness level > > - into a LED brightness level. If it is not provided, the > > - identity mapping is used. > > - > > - - default-brightness-level: The default brightness level. > > - > > -Example: > > - > > - backlight { > > - compatible = "led-backlight"; > > - > > - leds = <&led1>, <&led2>; > > - brightness-levels = <0 4 8 16 32 64 128 255>; > > - default-brightness-level = <6>; > > - }; > > diff --git a/Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml b/Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml > > new file mode 100644 > > index 000000000000..ae50945d2798 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml > > @@ -0,0 +1,58 @@ > > +# SPDX-License-Identifier: GPL-2.0-only > > +%YAML 1.2 > > +--- > > +$id: http://devicetree.org/schemas/leds/backlight/led-backlight.yaml# > > +$schema: http://devicetree.org/meta-schemas/core.yaml# > > + > > +title: led-backlight bindings > > + > > +maintainers: > > + - Lee Jones > > + - Daniel Thompson > > + - Jingoo Han > > + > > +description: > > + This binding is used to describe a basic backlight device made of LEDs. It > > + can also be used to describe a backlight device controlled by the output of > > + a LED driver. > > + > > +properties: > > + compatible: > > + const: led-backlight > > + > > + leds: > > + description: A list of LED nodes > > + $ref: /schemas/types.yaml#/definitions/phandle-array > > + > > + brightness-levels: > > + description: Array of distinct brightness levels. The levels must be > > + in the range accepted by the underlying LED devices. This is used > > + to translate a backlight brightness level into a LED brightness level. > > + If it is not provided, the identity mapping is used. > > + $ref: /schemas/types.yaml#/definitions/uint32-array > bike-shedding. To me it is a tad easier to read when multi-line > descriptions are on a separate line. > So "description:" on one line, and the text on following lines. > example-schema.yaml does both - so both are official acceptable. I agree, but the one issue is ruamel yaml wants it the above way unless you do '|' (or really '>' may be the correct annotation here). That's mainly an issue if doing tree wide yaml->python processing->yaml transformations. But if the line lengths don't match exactly what ruamel is set to, then it reformats it anyways, so in the end it doesn't really matter. I just have to filter out unwanted reformatting (until ruamel can really do roundtrips with no reformatting). Rob