Received: by 10.223.164.202 with SMTP id h10csp2346715wrb; Mon, 27 Nov 2017 15:56:17 -0800 (PST) X-Google-Smtp-Source: AGs4zMZyLL9tsJYgUfBmcVZK8rNVk3n+TyK5ENRKwp2P7H6H4WoAoGPKQLjjFtOMavcso0JlCghV X-Received: by 10.101.75.7 with SMTP id r7mr39031919pgq.133.1511826977691; Mon, 27 Nov 2017 15:56:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511826977; cv=none; d=google.com; s=arc-20160816; b=i6onyT+36DrKOKOHUGVA1EIu00UcrISFPtJ0fonIqX8NUUyRcwHJviwEJc3G/+ui8s i78O+SUc++5L+A2HEmRCILKFO9q+ER+896lWB2UUFaerKEPvEMYt4tfpP6pUb6crjJLb txfRFxkCkMfkM98A0/czU8mXlR8e9/5HSq3CzhxIzrvZNzwSQ5zx58HgK6PByPDA0OWA QT6NI5eux0QbiPI6SstjwJ05VxGxJjbkJvnMNK1c6n7ilGy33Gl/DA3tC9JEDnu/hIec OdU/nYShwnajJU1U5whSW8sdSdldi/Us5K/MTQR9Jdy9C5KMTzRYeuwUvY6/H6cckbCG SEbA== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=5IuCfwnlPOe04bJN/DqyAlzB/Sw4XANZLEQp4/iR9oQ=; b=JpvFnZs+xx4F+3c9vn3GFu6hovOlbVnxFVgXMDuyaMX7ZyESibSVbxoVd7zcY4l4rS hY4l8icx/mcM292c3/663tzTCanwhwZ4dXm9sV10D4ffyqV0YOcl9XRo5FfTz4GMIsS0 j2OuYIHUrRSagY2RHnMtNv3IRrZW28XdGUWXKLxaSmlZjJWM0FNsxK4GeDcU7EbSPjwn j5W/kxQIjfOfxNWGo4MCew4FtEwRVwkEt3dXMJ0b1OEDzy4IQwOxp1EvSEnwrop++LMf M4gBZuxId6Ke868DZLNQhlmdg3dD53bK3a+rTY1bBxpVfwd2uOd9l1lv+JO34U3ZOgkm JNjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=tHjJywYT; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si16064462pgp.212.2017.11.27.15.56.05; Mon, 27 Nov 2017 15:56:17 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=tHjJywYT; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752759AbdK0XzX (ORCPT + 78 others); Mon, 27 Nov 2017 18:55:23 -0500 Received: from mail-ua0-f195.google.com ([209.85.217.195]:36811 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751834AbdK0XzV (ORCPT ); Mon, 27 Nov 2017 18:55:21 -0500 Received: by mail-ua0-f195.google.com with SMTP id w47so20291450uah.3 for ; Mon, 27 Nov 2017 15:55:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=5IuCfwnlPOe04bJN/DqyAlzB/Sw4XANZLEQp4/iR9oQ=; b=tHjJywYTyzsz6wNfZpdeCXVjWQIliGDUnxZD/YuVMH3mGNSy/f7qizTXq3HXKn5SGW RyPFleWgszNn8Cvf0XASIuzW5YEAbTwPi6uvMCanulit2K2L8encrs35aWDaNpAm3iWv K27OfHNsLYFgbnGU5HUzhZxNSSJe6zWpZrwOzaFBZBHqhG1bZYIxbNCbG1WgZKzfB7O6 5FaZcpNng2Hn/ZcZs2CeX3OQQ7lS35ZIir5E5Zfqrj8m0DN+bK6TOYdzwePJVGm2Rn2d 9wIps9vRG8qTpO0jcoAYgv+ukq8IKII8Kda2AswiDmhsC9EETgkyOJgvsKOK063sXZ+G 0llA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=5IuCfwnlPOe04bJN/DqyAlzB/Sw4XANZLEQp4/iR9oQ=; b=j7ov1qoCtYh27FdnO7FbSTweOeyh1vEU2nbUYtrkYvQZcIlAffKFYrZ7frYanEAQwF iEOE6YN08pmDE5JkHWrNQhv7gP5WlhY8L8CGC9ntdYajtpbYupAvosoOHAcbIQx38DEV uzihXpImzBlo1dog+i6UfSrWBQxn56+Oc3vOREd0Cdp2Pkkk+ssUjZmmGZI5bVehvzhm GgoP1qVCn4blXyRUYOyV1/qU+LmydMjo7XTJqcwsapNTWslJ0K4u3p4I/XUBSzmG4Np3 2vNcDe7BrVP6CKE5eESkAsIL2BsVS8i1STI4ZUyg8A+x01fhX7Jd8/GZvrNoTJ/mD8UA EEuA== X-Gm-Message-State: AJaThX4czCgEdmDU5mzL6DnJvo55+Tfgt2ITQJa7WCnzjvnhhreAWedc 2pXd/RUUknKSMUXTI/iRJ/SpPinCifGl/x77u7IJ7Q== X-Received: by 10.159.50.2 with SMTP id x2mr31586169uad.38.1511826920302; Mon, 27 Nov 2017 15:55:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.31.146.68 with HTTP; Mon, 27 Nov 2017 15:55:19 -0800 (PST) In-Reply-To: References: <20171116141151.21171-1-enric.balletbo@collabora.com> <20171116141151.21171-2-enric.balletbo@collabora.com> <20171120185835.r4ded43i62wnu3jo@rob-hp-laptop> From: Doug Anderson Date: Mon, 27 Nov 2017 15:55:19 -0800 Message-ID: Subject: Re: [RFC v2 1/2] backlight: pwm_bl: linear interpolation between values of brightness-levels To: Enric Balletbo Serra Cc: Rob Herring , Enric Balletbo i Serra , Daniel Thompson , Jingoo Han , Richard Purdie , Jacek Anaszewski , Pavel Machek , Brian Norris , Guenter Roeck , Lee Jones , Alexandru Stan , linux-leds@vger.kernel.org, "devicetree@vger.kernel.org" , linux-kernel 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 Hi, On Mon, Nov 27, 2017 at 3:21 AM, Enric Balletbo Serra wrote: > Hi Rob, > > 2017-11-20 19:58 GMT+01:00 Rob Herring : >> On Thu, Nov 16, 2017 at 03:11:50PM +0100, Enric Balletbo i Serra wrote: >>> Setting use-linear-interpolation in the dts will allow you to have linear >>> interpolation between values of brightness-levels. >>> >>> There are now 256 between each of the values of brightness-levels. If >>> something is requested halfway between 2 values, we'll use linear >>> interpolation. >>> >>> This way a high resolution pwm duty cycle can be used without having to >>> list out every possible value in the dts. >> >> I thought we already had a way to do that. >> >>> This system also allows for >>> gamma corrected values (eg: "brightness-levels = <0 2 4 8 16 32>;"). >>> >>> Patch based on the Alexandru M Stan work done for ChromeOS kernels. >>> >>> Signed-off-by: Enric Balletbo i Serra >>> --- >>> .../bindings/leds/backlight/pwm-backlight.txt | 2 + >>> drivers/video/backlight/pwm_bl.c | 55 +++++++++++++++++----- >>> include/linux/pwm_backlight.h | 2 + >>> 3 files changed, 47 insertions(+), 12 deletions(-) >>> >>> diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt >>> index 764db86..7c48f20 100644 >>> --- a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt >>> +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt >>> @@ -17,6 +17,8 @@ Optional properties: >>> "pwms" property (see PWM binding[0]) >>> - enable-gpios: contains a single GPIO specifier for the GPIO which enables >>> and disables the backlight (see GPIO binding[1]) >>> + - use-linear-interpolation: set this propriety to enable linear interpolation >>> + between each of the values of brightness-levels. >> >> Isn't this really just whether you allow values not listed because what >> other kind of interpolation would you do? > > Yes, the idea behind this is just allow values not listed. > >> Seems like you should just be >> able to query the resolution of the PWM and decide if it can take more >> values than listed. >> > > Without using a new DT propriety and let decide the driver when use > intepolation and when not? Shouldn't this break current behavior then? > You can have a high resolution PWM but I'm not sure if you want allow > always more values than listed. Right. The assumption is that it's _possible_ that only the exact values listed are valid duty cycles. We don't want to break old hardware by suddenly allowing other duty cycles to be used. However, it's expected that on most hardware you can simply use any duty cycle between any of the specified ones and it should be fine. Anyone specifying this property would say that's OK for their hardware. -Doug From 1585265333330375562@xxx Mon Nov 27 23:53:53 +0000 2017 X-GM-THRID: 1584248888204777660 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread