From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Garrett Subject: Re: [PATCH v4] drivers: i915: Default backlight PWM frequency Date: Fri, 11 Nov 2011 22:30:56 +0000 Message-ID: <20111111223056.GA21537@srcf.ucam.org> References: <1321049578-26742-1-git-send-email-sque@chromium.org> <20111111221720.GA30923@quad.lixom.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cavan.codon.org.uk (cavan.codon.org.uk [93.93.128.6]) by gabe.freedesktop.org (Postfix) with ESMTP id A2096A0F7C for ; Fri, 11 Nov 2011 15:15:21 -0800 (PST) Content-Disposition: inline In-Reply-To: <20111111221720.GA30923@quad.lixom.net> 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: Olof Johansson Cc: intel-gfx@lists.freedesktop.org, olofj@chromium.org, Simon Que , snanda@chromium.org List-Id: intel-gfx@lists.freedesktop.org On Fri, Nov 11, 2011 at 02:17:20PM -0800, Olof Johansson wrote: > 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? I'd still prefer this to come from the firmware in some way, but in the absence of the awesome let's go with the good. Acked-by: Matthew Garrett -- Matthew Garrett | mjg59@srcf.ucam.org