From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olof Johansson Subject: Re: [PATCH v4] drivers: i915: Default backlight PWM frequency Date: Fri, 11 Nov 2011 14:17:20 -0800 Message-ID: <20111111221720.GA30923@quad.lixom.net> References: <1321049578-26742-1-git-send-email-sque@chromium.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-gx0-f177.google.com (mail-gx0-f177.google.com [209.85.161.177]) by gabe.freedesktop.org (Postfix) with ESMTP id B63029E792 for ; Fri, 11 Nov 2011 14:17:22 -0800 (PST) Received: by ggno1 with SMTP id o1so4706696ggn.36 for ; Fri, 11 Nov 2011 14:17:22 -0800 (PST) Content-Disposition: inline In-Reply-To: <1321049578-26742-1-git-send-email-sque@chromium.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Simon Que Cc: intel-gfx@lists.freedesktop.org, olofj@chromium.org, snanda@chromium.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Nov 11, 2011 at 02:12:58PM -0800, Simon Que 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 > formula: > > 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. > > Signed-off-by: Simon Que Acked-by: Olof Johansson Looks much better. I'm OK with this solution. Matthew? -Olof