[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130128210123.GA24673@avionic-0098.mockup.avionic-design.de>
Date: Mon, 28 Jan 2013 22:01:23 +0100
From: Thierry Reding <thierry.reding@...onic-design.de>
To: Peter Ujfalusi <peter.ujfalusi@...com>
Cc: Richard Purdie <rpurdie@...ys.net>,
Grant Likely <grant.likely@...retlab.ca>,
Rob Landley <rob@...dley.net>,
Florian Tobias Schandinat <FlorianSchandinat@....de>,
Andrew Morton <akpm@...ux-foundation.org>,
devicetree-discuss@...ts.ozlabs.org, linux-doc@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-fbdev@...r.kernel.org
Subject: Re: [PATCH 1/4] pwm_backlight: Fix PWM levels support in non DT case
On Tue, Jan 22, 2013 at 02:39:53PM +0100, Peter Ujfalusi wrote:
> It is expected that board files would have:
> static unsigned int bl_levels[] = { 0, 50, 100, 150, 200, 250, };
>
> static struct platform_pwm_backlight_data bl_data = {
> .levels = bl_levels,
> .max_brightness = ARRAY_SIZE(bl_levels),
> .dft_brightness = 4,
> .pwm_period_ns = 7812500,
> };
>
> In this case the max_brightness would be out of range in the levels array.
> Decrement the received max_brightness in every case (DT or non DT) when the
> levels has been provided.
What's wrong with specifying .max_brightness = ARRAY_SIZE(bl_levels) - 1
instead?
Thierry
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists