Received: by 10.223.176.5 with SMTP id f5csp705815wra; Wed, 7 Feb 2018 06:16:39 -0800 (PST) X-Google-Smtp-Source: AH8x226Ji10chdOnVAqEfRaGXveLGVAKfHvMqoLFl13fm2xJpG46ArvW1gH0Po0GAkNA49HM+4dl X-Received: by 10.99.165.28 with SMTP id n28mr5166117pgf.103.1518012999811; Wed, 07 Feb 2018 06:16:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518012999; cv=none; d=google.com; s=arc-20160816; b=JoNkyp24xg8jNZmoXTAgEdY9A+Ia/PflrFtrhl177L8a3KktJ967hv6nXZ3KHoDpba v1zB00rhoo8n7I94Iy2JHVGaXm2pICs7Jujnh8zVIINOFdKQHAMAbM3n98taRrlekWXi XJqzp3Xu3PgoTHAl4AV5/Edc8Kj/+piRCd1V1YBcfyAUTLgsnG4dlXMhUJXZ3nzEnD8t g8ICfWhMujrxcuGMh5oq/SuFp00AkI8/UI744lbrPVe681SbYQ4S70yRzjwWewuwr1HV KJmeb9b4/A92u4CePWUTif4/1nR2e9EL13j4QtAlAqEcaqtS2GizV6ARmfbbnBEnAayB +rGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=rXmPDtp25ButLbXsjMAHhBREhHUOKiVDRjKOcAjiJ00=; b=dpT7v3A5n0r2hn7DnRiS/tg+rSJpxreqnzx6G9zBqgsDZjfW4+86pN5UMtmPnrlH7L Uwgdi2RaA8IUvuzd1EY6B0ZhIrHiY8XudSIBqjrHHH9zuPYyDimfEjKfbdVO3QdpiEIc ti87WuY4KD8uNnuVTiglJQHTJdESN6woe3jxGrPa3kH5FT+q+mZFkU1RK+BgNzPfq4Fh mruPDozMiv/Imm3V5Hh8qLQOSqiwKkvsIxWOwI4hl0p7V2LEzRfozWrVlKnxEo+F1oeS b0roLdgYi6tnCNh4p1EH1IDvNpzoMQtUgTdJtsqRAoLE/G+3ViP8I/EuOQaTisg0fDFE pVxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d75si1176604pfb.360.2018.02.07.06.16.26; Wed, 07 Feb 2018 06:16:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754464AbeBGOOr (ORCPT + 99 others); Wed, 7 Feb 2018 09:14:47 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:41514 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754263AbeBGONt (ORCPT ); Wed, 7 Feb 2018 09:13:49 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 5F923271EEB From: Enric Balletbo i Serra To: Daniel Thompson , Doug Anderson , Pavel Machek , Rob Herring Cc: Jingoo Han , Richard Purdie , Jacek Anaszewski , Brian Norris , Guenter Roeck , Lee Jones , Alexandru Stan , linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/4] dt-bindings: pwm-backlight: add a num-interpolation-steps property. Date: Wed, 7 Feb 2018 15:13:35 +0100 Message-Id: <20180207141337.22247-3-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180207141337.22247-1-enric.balletbo@collabora.com> References: <20180207141337.22247-1-enric.balletbo@collabora.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The num-interpolated-steps property specifies the number of interpolated steps between each value of brightness-level table. This is useful for high resolution PWMs to not have to list out every possible value in the brightness-level array. Signed-off-by: Enric Balletbo i Serra --- Changes since v1: - Add an example with a small but realistic curve. Suggested by Rob and Daniel .../bindings/leds/backlight/pwm-backlight.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt index 310810906613..ce9b5746b774 100644 --- a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt @@ -21,6 +21,11 @@ Optional properties: and enabling the backlight using GPIO. - pwm-off-delay-ms: Delay in ms between disabling the backlight using GPIO and setting PWM value to 0. + - num-interpolated-steps: 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. [0]: Documentation/devicetree/bindings/pwm/pwm.txt [1]: Documentation/devicetree/bindings/gpio/gpio.txt @@ -39,3 +44,17 @@ Example: post-pwm-on-delay-ms = <10>; pwm-off-delay-ms = <10>; }; + +Example using num-interpolation-steps: + + backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 5000000>; + + brightness-levels = <0 2048 4096 8192 16384 65535>; + num-interpolated-steps = <2048>; + default-brightness-level = <4096>; + + power-supply = <&vdd_bl_reg>; + enable-gpios = <&gpio 58 0>; + }; -- 2.15.1