Received: by 10.223.176.5 with SMTP id f5csp704935wra; Wed, 7 Feb 2018 06:15:54 -0800 (PST) X-Google-Smtp-Source: AH8x2268zC+HiJ4Gb2tCv8Sc4V3H9FgDd37EtXyzdC7IjHBahpG8rgYv5RLCR1u3fEF37LQGQAH6 X-Received: by 10.99.42.85 with SMTP id q82mr4898128pgq.285.1518012954558; Wed, 07 Feb 2018 06:15:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518012954; cv=none; d=google.com; s=arc-20160816; b=M5QbwCZnHaAV+IlgzVGUVyGegRtGjgEVqPVQ6PGlOtd5lALmvaLQpkWAE9nXVFSGg1 mfymixOU3KZ3VVSop84ydBaTxeYFNZLjhRoVTuWlHg1rPi/9dCJSa2nSqF1+HCqxVDef nVUfD4Jsu+c91KBzzjGSXKBYzBk1H21jvWlS2lFrjWkOpv2HoshE3iYR5zWrURfiVAf2 QQhlrbLpCekVVtysmYnNO23VFfbd60Ah9nZgwpWA7oxSnsjsWwXtMXXW5iVryMSA9Skg YXaoJ2KqWxI3KsZ/UR4qQHCpzJ65rrCjgjO+k6Lk9wow5Le0eapBC7vdEPBydYtSmnsz OUfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=xd0MV5ffi9DVzwKnFl7zCkaL2SiiE5kJyN7xdu091oA=; b=guC4NUo+t0UOwCKKOCDJmiL7hkHSNOSjDHAQXhPxvZgYBIlI5T0JFPkebclS0vOqel IkBnVLetRnPl3+YFI9NC14j/PqTud7E/KR1MoHiISQ/sK59ixJlW3YvuR2elu9deoTS/ 9a361lnxq3PnuMOMWSImx7rBmtaWb8mSsc7sE22RZzGHnuXJsyu5XWgXEvYFfoY3knJn TYoMcAUrwY/DwxMa/bjjURySDXmX0n0nFJcr3MihKeAhFly8eQXLaz2qtW1mLlO1wlyj lmIK/7T+IrPgLWFdCO+ylykq16Y4JYznzn9gPWtaoZCl6Hg0nFSlvSSDVkk7AzKPIUjg 19uQ== 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 a81si1175027pfc.258.2018.02.07.06.15.40; Wed, 07 Feb 2018 06:15:54 -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 S1754310AbeBGONu (ORCPT + 99 others); Wed, 7 Feb 2018 09:13:50 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:41494 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754258AbeBGONr (ORCPT ); Wed, 7 Feb 2018 09:13:47 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 9B401270A5D 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 0/4] backlight: pwm_bl: support linear interpolation and brightness to human eye Date: Wed, 7 Feb 2018 15:13:33 +0100 Message-Id: <20180207141337.22247-1-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear all, This series is a second patchset integrating the requested changes. The first and second patch what tries to solve is the problem of granularity for high resolution PWMs. The idea is simple interpolate between 2 brightness values so we can have a high PWM duty cycle (a 16 bits PWM is up to 65535 possible steps) without having to list out every possible value in the dts. I think that this patch is required to not break backward compability, to be more flexible and also extend the functionality to be able to use high resolution PWM with enough steps to have a good UI experience in userspace. The thirth and fourth patch is a bit more ambicious, the idea is let decide the driver the brightness-levels required in function of the PWM resolution. To do this create a brightness-levels table filled with the CIE 1931 algorithm values to convert brightness to PWM duty cycle. More detailed info is available in the commit message of every patch. Both functionalities were tested on a Samsung Chromebook Plus (that has a 16 bits PWM) and a SL50 device (with a 8 bits PWM) Waiting for your feedback. Best regards, Enric Balletbo i Serra (4): backlight: pwm_bl: linear interpolation between brightness-levels dt-bindings: pwm-backlight: add a num-interpolation-steps property. backlight: pwm_bl: compute brightness of LED linearly to human eye. dt-bindings: pwm-backlight: move brightness-levels to optional. .../bindings/leds/backlight/pwm-backlight.txt | 34 ++- drivers/video/backlight/pwm_bl.c | 235 +++++++++++++++++++-- 2 files changed, 249 insertions(+), 20 deletions(-) -- 2.15.1