From patchwork Wed May 28 23:20:12 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 4258051 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 59AC59F358 for ; Wed, 28 May 2014 23:23:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 883BA20306 for ; Wed, 28 May 2014 23:23:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B0C3920320 for ; Wed, 28 May 2014 23:23:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932380AbaE1XV3 (ORCPT ); Wed, 28 May 2014 19:21:29 -0400 Received: from top.free-electrons.com ([176.31.233.9]:47858 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932364AbaE1XV0 (ORCPT ); Wed, 28 May 2014 19:21:26 -0400 Received: by mail.free-electrons.com (Postfix, from userid 106) id 22014845; Thu, 29 May 2014 01:21:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (rama.bulix.org [5.39.87.92]) by mail.free-electrons.com (Postfix) with ESMTPSA id A61DD815; Thu, 29 May 2014 01:21:23 +0200 (CEST) From: Alexandre Belloni To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Nicolas Ferre , Jean-Christophe Plagniol-Villard , Haavard Skinnemoen , Hans-Christian Egtvedt , Bryan Wu , Jingoo Han , linux-leds@vger.kernel.org, linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org, Alexandre Belloni Subject: [PATCHv2 09/15] avr32: MRMT: use generic leds_pwm driver Date: Thu, 29 May 2014 01:20:12 +0200 Message-Id: <1401319218-16772-10-git-send-email-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1401319218-16772-1-git-send-email-alexandre.belloni@free-electrons.com> References: <1401319218-16772-1-git-send-email-alexandre.belloni@free-electrons.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Switch to the generic leds_pwm driver instead of leds-atmel-pwm. Signed-off-by: Alexandre Belloni Acked-by: Hans-Christian Egtvedt --- arch/avr32/boards/atngw100/mrmt.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/arch/avr32/boards/atngw100/mrmt.c b/arch/avr32/boards/atngw100/mrmt.c index 1ba09e4c02b1..91146b416cdb 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,28 @@ 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", + 5000, PWM_POLARITY_INVERSED), }; -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, + }, +}; + +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 +334,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 );