Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752086AbdINQBk (ORCPT ); Thu, 14 Sep 2017 12:01:40 -0400 Received: from mail-wr0-f176.google.com ([209.85.128.176]:49083 "EHLO mail-wr0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752082AbdINQBg (ORCPT ); Thu, 14 Sep 2017 12:01:36 -0400 X-Google-Smtp-Source: ADKCNb7VBwN8TqVmDnXbbItVnLl2t7ntc/fYn9mOyeQgqbwDzDdysr/OIk33gMQi4a2x9mOGXdM+xdQBdskQddVS9QE= MIME-Version: 1.0 In-Reply-To: References: <20170904153504.27963-1-enric.balletbo@collabora.com> <239c9153-c0ea-319c-b554-3c727b75c8cd@linaro.org> <000001d32664$db62b2a0$922817e0$@gmail.com> From: Doug Anderson Date: Thu, 14 Sep 2017 09:01:33 -0700 Message-ID: Subject: Re: [RFC 0/2] backlight: pwm_bl: support linear brightness to human eye To: Enric Balletbo Serra Cc: Daniel Thompson , Jingoo Han , Enric Balletbo i Serra , Lee Jones , Richard Purdie , Jacek Anaszewski , Pavel Machek , Rob Herring , Mark Rutland , Brian Norris , Guenter Roeck , linux-leds@vger.kernel.org, "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Alexandru M Stan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1746 Lines: 39 Hi, On Thu, Sep 14, 2017 at 3:46 AM, Enric Balletbo Serra wrote: > Based on this seems reasonable maintain current implementation to not > break backward compability. Even, I think makes sense improve current > implementation by adding somekind of piecewise linear concept to the > brightness levels, similar to Doug's suggestion. So if we want, i.e, > 256 levels or more, instead of specify the full table in the DT we can > only specify some points in DT but the driver can expose to userspace > more steps (how many?) between two brightness levels. It seems sane to me. Personally I'd say that if you're using piecewise linear you just pick a number of levels to expose, perhaps 16383, or 32767, or 65535) and expose that many levels for everyone. It's possible that bumping the brightness up by "1" will not actually change a hardware register, but that seems like it would be fine, right? Probably you'd want to require some sort of dt change to enable piecewise linear since it seems plausible that you could break existing boards if you started interpolating. > Of course, this > doesn't makes the live of the future users easier but I think will > make the live of the current users of this interface more flexible > (specially when you want lots of levels) > > Then, to make the user live easier, there is the thing about human > perception, we can move brightness-levels to be optional and fall to > apply the human perception code if it's not specified. Here the thing > and point of discussion is, if the cie1931 is the right algorithm to > do the 'magic' in the driver. From what I investigated seems that is > but I might be wrong. I don't personally know, so hopefully someone else can comment. -Doug