From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934282AbaCSOT6 (ORCPT ); Wed, 19 Mar 2014 10:19:58 -0400 Received: from cassarossa.samfundet.no ([193.35.52.29]:39019 "EHLO cassarossa.samfundet.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933380AbaCSOTz (ORCPT ); Wed, 19 Mar 2014 10:19:55 -0400 Date: Wed, 19 Mar 2014 15:19:24 +0100 From: Hans-Christian Egtvedt To: Alexandre Belloni Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Ferre , Jean-Christophe Plagniol-Villard , Haavard Skinnemoen , Bryan Wu , Richard Purdie , Greg Kroah-Hartman , Thierry Reding , Jingoo Han , linux-leds@vger.kernel.org, linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org Subject: Re: [PATCH 10/16] avr32: MRMT: use generic leds_pwm driver Message-ID: <20140319141924.GB20872@samfundet.no> References: <1395234209-15546-1-git-send-email-alexandre.belloni@free-electrons.com> <1395234209-15546-11-git-send-email-alexandre.belloni@free-electrons.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1395234209-15546-11-git-send-email-alexandre.belloni@free-electrons.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Around Wed 19 Mar 2014 14:03:23 +0100 or thereabout, Alexandre Belloni wrote: > Switch to the generic leds_pwm driver instead of leds-atmel-pwm. > > Signed-off-by: Alexandre Belloni Acked-by: Hans-Christian Egtvedt I do not have this add-on board either, so I can only provide compile tests myself. > --- > arch/avr32/boards/atngw100/mrmt.c | 35 +++++++++++++++++++++++------------ > 1 file changed, 23 insertions(+), 12 deletions(-) > > diff --git a/arch/avr32/boards/atngw100/mrmt.c b/arch/avr32/boards/atngw100/mrmt.c > index 1ba09e4c02b1..134e94c3d504 100644 > --- a/arch/avr32/boards/atngw100/mrmt.c > +++ b/arch/avr32/boards/atngw100/mrmt.c > @@ -17,6 +17,8 @@ > #include > #include > #include > +#include > +#include > #include > #include > #include > @@ -155,21 +157,29 @@ static struct platform_device rmt_ts_device = { > > #ifdef CONFIG_BOARD_MRMT_BL_PWM > /* PWM LEDs: LCD Backlight, etc */ > -static struct gpio_led rmt_pwm_led[] = { > - /* here the "gpio" is actually a PWM channel */ > - { .name = "backlight", .gpio = PWM_CH_BL, }, > +static struct pwm_lookup pwm_lookup[] = { > + PWM_LOOKUP("at91sam9rl-pwm", PWM_CH_BL, "leds_pwm", "ds1"), > }; > > -static struct gpio_led_platform_data rmt_pwm_led_data = { > - .num_leds = ARRAY_SIZE(rmt_pwm_led), > - .leds = rmt_pwm_led, > +static struct led_pwm pwm_leds[] = { > + { > + .name = "backlight", > + .max_brightness = 255, > + .pwm_period_ns = 5000, > + .active_low = 1, > + }, > +}; > + > +static struct led_pwm_platform_data pwm_data = { > + .num_leds = ARRAY_SIZE(pwm_leds), > + .leds = pwm_leds, > }; > > -static struct platform_device rmt_pwm_led_dev = { > - .name = "leds-atmel-pwm", > - .id = -1, > - .dev = { > - .platform_data = &rmt_pwm_led_data, > +static struct platform_device leds_pwm = { > + .name = "leds_pwm", > + .id = -1, > + .dev = { > + .platform_data = &pwm_data, > }, > }; > #endif > @@ -325,7 +335,8 @@ static int __init mrmt1_init(void) > #ifdef CONFIG_BOARD_MRMT_BL_PWM > /* Use PWM for Backlight controls */ > at32_add_device_pwm(1 << PWM_CH_BL); > - platform_device_register(&rmt_pwm_led_dev); > + pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); > + platform_device_register(&leds_pwm); > #else > /* Backlight always on */ > udelay( 1 ); -- mvh Hans-Christian Egtvedt