From patchwork Wed Mar 19 13:03:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 3859001 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E0996BF540 for ; Wed, 19 Mar 2014 18:13:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1056220117 for ; Wed, 19 Mar 2014 18:13:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 28EAB20173 for ; Wed, 19 Mar 2014 18:13:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933937AbaCSNGs (ORCPT ); Wed, 19 Mar 2014 09:06:48 -0400 Received: from top.free-electrons.com ([176.31.233.9]:42155 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933771AbaCSNEH (ORCPT ); Wed, 19 Mar 2014 09:04:07 -0400 Received: by mail.free-electrons.com (Postfix, from userid 106) id C516D1A01; Wed, 19 Mar 2014 14:04:08 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from localhost (128-79-216-6.hfc.dyn.abo.bbox.fr [128.79.216.6]) by mail.free-electrons.com (Postfix) with ESMTPSA id 57E91816; Wed, 19 Mar 2014 14:04:08 +0100 (CET) From: Alexandre Belloni To: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, Nicolas Ferre , Jean-Christophe Plagniol-Villard , Haavard Skinnemoen , Hans-Christian Egtvedt , 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, Alexandre Belloni Subject: [PATCH 11/16] avr32: merisc: use generic leds_pwm driver Date: Wed, 19 Mar 2014 14:03:24 +0100 Message-Id: <1395234209-15546-12-git-send-email-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1395234209-15546-1-git-send-email-alexandre.belloni@free-electrons.com> References: <1395234209-15546-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/merisc/setup.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/arch/avr32/boards/merisc/setup.c b/arch/avr32/boards/merisc/setup.c index ed137e335796..b0980c1946a7 100644 --- a/arch/avr32/boards/merisc/setup.c +++ b/arch/avr32/boards/merisc/setup.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include @@ -167,24 +169,29 @@ static struct i2c_board_info __initdata i2c_info[] = { }, }; -#ifdef CONFIG_LEDS_ATMEL_PWM -static struct gpio_led stk_pwm_led[] = { +#if IS_ENABLED(CONFIG_LEDS_PWM) +static struct pwm_lookup pwm_lookup[] = { + PWM_LOOKUP("at91sam9rl-pwm", 0, "leds_pwm", "backlight"), +}; + +static struct led_pwm pwm_leds[] = { { .name = "backlight", - .gpio = 0, /* PWM channel 0 (LCD backlight) */ + .max_brightness = 255, + .pwm_period_ns = 5000, }, }; -static struct gpio_led_platform_data stk_pwm_led_data = { - .num_leds = ARRAY_SIZE(stk_pwm_led), - .leds = stk_pwm_led, +static struct led_pwm_platform_data pwm_data = { + .num_leds = ARRAY_SIZE(pwm_leds), + .leds = pwm_leds, }; -static struct platform_device stk_pwm_led_dev = { - .name = "leds-atmel-pwm", - .id = -1, - .dev = { - .platform_data = &stk_pwm_led_data, +static struct platform_device leds_pwm = { + .name = "leds_pwm", + .id = -1, + .dev = { + .platform_data = &pwm_data, }, }; #endif @@ -278,9 +285,10 @@ static int __init merisc_init(void) at32_add_device_mci(0, &mci0_data); -#ifdef CONFIG_LEDS_ATMEL_PWM +#if IS_ENABLED(CONFIG_LEDS_PWM) + pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); at32_add_device_pwm((1 << 0) | (1 << 2)); - platform_device_register(&stk_pwm_led_dev); + platform_device_register(&leds_pwm); #else at32_add_device_pwm((1 << 2)); #endif