Received: by 10.223.176.5 with SMTP id f5csp1786908wra; Thu, 8 Feb 2018 03:31:39 -0800 (PST) X-Google-Smtp-Source: AH8x226JfcZz8WJ5et/z2chjzn7UgMXiZwa4KtwxLEKoUkeUxv4Q/IxeD4WB/mBPmr1P3K9u0x6P X-Received: by 10.101.101.143 with SMTP id u15mr270592pgv.265.1518089499490; Thu, 08 Feb 2018 03:31:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518089499; cv=none; d=google.com; s=arc-20160816; b=WT9APtSUkegH90mTBeg4BE0iDh0ciYn8ImUITOctVRPF8o+RJNS6/JmaREOAkamCBn jU/0cgT1AAuFGR4IEt3tDUAprLzqGgrXUWeePPlGFgb9c+p0uFHcKmScCvG+/j9qct4n ZK0oHr85Gj380fJygaBhwLHuP7uly/NlTRp3aXx21+bWDZ+T+yKuppu1z7qLJT+gx3fq j7SF7sH/bn9vzAzKT9+5BbARN1qztSxe9PYO0qPZ+7DBUiQzTpW7Hi7erZ9Pp+le/ZTg 6JaDXix30tzL8ioa+XJGfvLj7zdHAet5TPCo5yrUARew67Rfxuvha9DEM+8NUSj+9Q2B FTMg== 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=R/ih1Pu/JiaeIe9cCD3egxydx0SFC29PWA+fgDIlI/s=; b=J5zfvPVn5dXSjjY77OvK2lRwvWxzhkt7DZqm+Nrmn824pyW4hLXc1c0yDcY/LJUY6f loaQa0I3OtpeHqN6NwUmIpovidLNHucjLT25KQ6N8zuO73gkWqI3Rz+nEacEkTnceblH OjUI/zg+B/aa/wnnqeAqB0Ii+lPT15AmNScq5YYjFq99jSrgNWt9LaI3ex5qNzpP1WQq dRINUdQF0dy3FBwOKeANyazENbwP1aE5kuuT4osT/cGY1nfvOtgTZsxVEe06eSKp1XqI XOq7jblOHHUMEH7CstIjvYnwKfaqn/PjGpq3syZhfY5ljOB7nKqML3dE+HiEF58n6VhW l3iw== 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 c11-v6si1218127pll.95.2018.02.08.03.31.25; Thu, 08 Feb 2018 03:31: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 S1752258AbeBHLap (ORCPT + 99 others); Thu, 8 Feb 2018 06:30:45 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46266 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751014AbeBHLam (ORCPT ); Thu, 8 Feb 2018 06:30:42 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id A0A16275834 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, kernel@collabora.com Subject: [PATCH v3 2/4] dt-bindings: pwm-backlight: add a num-interpolation-steps property. Date: Thu, 8 Feb 2018 12:30:30 +0100 Message-Id: <20180208113032.27810-3-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180208113032.27810-1-enric.balletbo@collabora.com> References: <20180208113032.27810-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 Acked-by: Daniel Thompson --- Changes since v2: - Add Acked-by: Daniel Thompson 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