[Intel-gfx] [PATCH 2/2] drivers: i915: Default backlight PWM frequency
olof at lixom.net
Thu Nov 10 18:11:52 PST 2011
On Thu, Nov 10, 2011 at 5:50 PM, Simon Que <sque at chromium.org> wrote:
> If the firmware did not initialize the backlight PWM registers, set up a
> default PWM frequency of 200 Hz. This is determined using the following
> freq = refclk / (128 * pwm_max)
> The PWM register allows the max PWM value to be set. So we want to use
> the formula, where freq = 200:
> pwm_max = refclk / (128 * freq)
> This patch will, in the case of missing PWM register initialization
> values, look for the reference clock frequency. Based on that, it sets
> an appropriate max PWM value for a frequency of 200 Hz.
> If no refclk frequency is found, the max PWM will be zero, which results
> in no change to the PWM registers.
I think the general approach of finding a suitable PWM setting is
better this way, but you're attacking the problem at the wrong level.
There is already a place to hook in this in
intel_panel_get_max_backlight(): Do it there in the "XXX add code"
case, have the helper update the dev_priv fields to the calculated max
and call i915_read_blc_pwm_ctl() again to program said fields.
More information about the Intel-gfx