When you want to change the brightness using a PWM signal, one thing youneed to consider is how human perceive the brightness. Human perceive thebrightness change non-linearly, we have better sensitivity at lowluminance than high luminance, so to achieve perceived linear dimming, thebrightness must be matches to the way our eyes behave. The CIE 1931lightness formula is what actually describes how we perceive light.

This patch adds support to compute the brightness levels dinamically basedon this algorithm. For example, the definition of the following propertyin your device tree,

It does not make much sense use the new property for few levels ofgranularity, as you can really use the brightness-levels property with thetable hardcoded, but, if we have more than 256-levels of granularity youmight prefer use the new property instead of put a huge table in yourdevice tree.