Received: by 10.223.176.5 with SMTP id f5csp1787951wra; Thu, 8 Feb 2018 03:32:48 -0800 (PST) X-Google-Smtp-Source: AH8x225fQlyyP4zvUEcH4dJNNgDHnZXT+kOHHjXd2CWFDL3GfYU/RZr1OcKNEZtu2SrrJ5W2EBsY X-Received: by 10.99.133.193 with SMTP id u184mr268573pgd.401.1518089568612; Thu, 08 Feb 2018 03:32:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518089568; cv=none; d=google.com; s=arc-20160816; b=vTIK+cT6mnxIHKH/tekvVCTPiNgPSv21HvTywH20YG/3NWTsPJrQsf0ju4grtjA0W4 G1SoMGQI9N3cpAcYoyYV0aiOoRNrg+ktVH0OvjFwE9+Of/cOLoG4ezR+CZEra360jjAN o8F5xwqq13dYumSHKGxJqrFE1/0xNB4uuzhS3X9whDE3Wg8YYnaxbzcG0zki7gZO//2/ GqQQEEUXgTj6QK5IcbnWS8MjzSG7A5EVuTwTuFmmJCep2CeDbq7SS434GA1qpcv5rrUx azI330jL0wRxD0GybCQaUp9VgCwsfHJDA6CKjSmXI1Dfw++2n4HuGyNGWol07qZLdliU EzvQ== 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=f/WH+iKVKulRCFAocT95F1WaroYcvTerE0UhYJ/T174=; b=acNza6hhbxIMDT3YNe0kAz+FjpAaE7YQVVzb1AOGyH+OKGvdH3XXXYOUd5+FhWuK0t X1batZd8JRdZeu+ALsjSNjGW/DBjrErm2Beh9KAnOkvKRvyBk2S2m1kS2tuxwDQMMBLy g2HLZ8GWQ8+9YTdKyw30pHKLWn33UnfyEiO0Li3lZaYARhi7Y9QUFjE5U6VH5QJjOJSg qxaas7jlaYG+DIjyD22EtbiGQb1uPDPHbDNqKo5p6KLTGZFerYQxrZcN8mdwi+2ZqIJa If4Wg3hiVcra8RkKpjB84Fe7T8PyYvUS2NasIujiR4kvT4FsPAVbg4WS6OpatknUsSjP xtNQ== 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.32.35; Thu, 08 Feb 2018 03:32:48 -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 S1752154AbeBHLam (ORCPT + 99 others); Thu, 8 Feb 2018 06:30:42 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46236 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877AbeBHLak (ORCPT ); Thu, 8 Feb 2018 06:30:40 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id CDB7B264C58 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 0/4] backlight: pwm_bl: support linear interpolation and brightness to human eye Date: Thu, 8 Feb 2018 12:30:28 +0100 Message-Id: <20180208113032.27810-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 third 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 | 232 +++++++++++++++++++-- 2 files changed, 246 insertions(+), 20 deletions(-) -- 2.15.1