Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2801994ybt; Mon, 22 Jun 2020 07:24:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKG5RlsL5dXR4fMzi5wstwWSWRrOQtx3DeI2jjWyaJwEUMg1Ds7T1o2l7DceC894FdKdgE X-Received: by 2002:a17:906:e2ca:: with SMTP id gr10mr6033034ejb.81.1592835869540; Mon, 22 Jun 2020 07:24:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592835869; cv=none; d=google.com; s=arc-20160816; b=HE73UP1wYzbBG7nCaZbR/U9LVGgOe1hd4tpKGpgDDeQKafynRIikKCN/kOR8fQfoGf yuNJ5pIJDwH6HlFnbwnWn9V7PK1v1/euNU4zsPGbbKYnNNkonEOTH6kJX6Vuam5ca3oD Qmo07RdhbzGBAvgvLIyCV2P/3aKy7tMEocpjDf0e9NxTXgaFZCdLLGnqyD7V4sQheW/H p5eeDXPZEIpwUwAmecwaiUwR7wzPKd/GUzh7WUCg6I67uAlzR/T0/joax8VWIkAHFQeI D3uNyhKOi17btpGmWxHlASfdtSXryz1IPaTc2n/J4fnz0FD9LxhfVS6MhNDndrV+EX+2 SlCw== 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 :dkim-signature; bh=bJSKL8sfjoItMlLZIHvSZPyc9+WORmnIJIkfFHS/Uhc=; b=P7ZvydIww1IcSqZH4Gbs+WS1XEDB/SaOO+E1P3vsXkD6vPTdMGRq09V+e2zOW6GdoB QAjGybraQgenRCLLyMywFnMXHgpQoeWkDX+hgC/UbsjtWYPuhKzeIG0x+7AQhkO+XMMu y8wNWxnYGZ7BZdIF+zlPqBgnjaSTrTHOyH+NIUfaULBTixhkL7FpiCFmX7nD02fm8VNu tPPS0+ZUpjw8d8jZb5wkWV3Q9X4YnURHll7FBB0ZvocOAR0+UcobhxzOoF9FrHFdvhiB PELFDeqi75voC1EvCXuZNV+4vymUeMQMuStTbI8V7vMUM6hR+xWW927KlRpR6TSy8qQ7 xYwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=feZREHIM; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si913360edl.330.2020.06.22.07.24.06; Mon, 22 Jun 2020 07:24:29 -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=@linaro.org header.s=google header.b=feZREHIM; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729055AbgFVOWW (ORCPT + 99 others); Mon, 22 Jun 2020 10:22:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728441AbgFVOWV (ORCPT ); Mon, 22 Jun 2020 10:22:21 -0400 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31C18C061573 for ; Mon, 22 Jun 2020 07:22:20 -0700 (PDT) Received: by mail-wm1-x341.google.com with SMTP id 17so1351858wmo.1 for ; Mon, 22 Jun 2020 07:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bJSKL8sfjoItMlLZIHvSZPyc9+WORmnIJIkfFHS/Uhc=; b=feZREHIMAeCKCnPPAFWeIamudTiI2hndBHx8gCPufSriYMHHewVeh8yLFbdjBYhuS/ A7GFYLPR5RoZndfJUADG4GY/2u8/Uia7jurvKStBl3zH6uZRkywjEoVw01+kE0NChzOc VN05+Rp1Sm0iCKvlcmDNjItZq1FNxg3So8FZSWXsKC9bHlU417QwWol6je2VQmdoVK1u h/iuxoXJnWtiXbi76Ddc5mT8jtZKGWInHVYFSgp4KEQGCcVQNiGx01PmlHOThUnGGGWR 5ycd2gUnQ5/GOeZJkSZF4P2Xt4++bax/z9Y374W5fF6tYepk4CwEEDjmj/dB1HSPxPMS rNFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bJSKL8sfjoItMlLZIHvSZPyc9+WORmnIJIkfFHS/Uhc=; b=SiaBu5L0a937XWGmFPUxgOXrkFNoHenlhEoSb6GIQVDz8GdwMw+MEPYcAQCmH8Fi+V sq0ss16HbV0uzwQ6H3d8oV5OVW90bmrDAUQfIKnnXBm4cq9+ouZJ7XK1q9gYK3a/oYoH 7LIti9FmL4LP/6VkvPiqiQZCbIFTJ5e0M80FDN2W0Drgdzozja+XvyYsD1mZlWG6xGNG KfjkTlYbDzv3XDDwgx9SZqkQzjgRtkHlkXSDCeVFbVs7u6P3jG+pMTy3A2MbuX2RRvkY G9nATd+PAOhaM+YivDbyPXcEWeJ99yhQG7nuS0zs718yiIov8/cfd2wSmHUgCzexu+X3 +QOA== X-Gm-Message-State: AOAM530Z6c2H7COTAhJ6519hdkMkj0c/b1TSsvP7i/Vk+N9MrNFyYJ5i /J1NKvTrsRmpMrYksT5hKGZ6qw== X-Received: by 2002:a1c:e303:: with SMTP id a3mr1000199wmh.26.1592835738837; Mon, 22 Jun 2020 07:22:18 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id v24sm20804558wrd.92.2020.06.22.07.22.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2020 07:22:17 -0700 (PDT) Date: Mon, 22 Jun 2020 15:22:15 +0100 From: Daniel Thompson To: Rob Herring Cc: devicetree@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Lee Jones , Jingoo Han Subject: Re: [PATCH] dt-bindings: backlight: Convert common backlight bindings to DT schema Message-ID: <20200622142215.biy2g6sd44czky4u@holly.lan> References: <20200618224413.1115849-1-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200618224413.1115849-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ... > 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 > + > + default-brightness-level: > + description: The default brightness level (index into the array defined > + by the "brightness-levels" property). > + $ref: /schemas/types.yaml#/definitions/uint32 > + > +dependencies: > + default-brightness-level: [brightness-levels] I don't think there is a dependency here. default-brightness-level still makes sense with there is no mapping table present. Based on Sam's feedback perhaps adding ("if one is provided") to the parenthetic text. > 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 > + > + num-interpolated-steps: > + description: Number of interpolated steps between each value of brightness-levels > + table. This way a high resolution pwm duty cycle can be used without > + having to list out every possible value in the brightness-level array. > + $ref: /schemas/types.yaml#/definitions/uint32 > + > +dependencies: > + default-brightness-level: [brightness-levels] > + num-interpolated-steps: [brightness-levels] Just for the record, these dependencies are OK. Iit isn't really a good idea to map 1:1 to a PWM since we end up with a gazillion indistinguishable levels so the bindings (and the driver) to not allow such a mode. Daniel.