From patchwork Wed Mar 19 13:03:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 331719 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AF0562C00A6 for ; Thu, 20 Mar 2014 00:19:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933896AbaCSNSz (ORCPT ); Wed, 19 Mar 2014 09:18:55 -0400 Received: from top.free-electrons.com ([176.31.233.9]:42094 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933881AbaCSNEB (ORCPT ); Wed, 19 Mar 2014 09:04:01 -0400 Received: by mail.free-electrons.com (Postfix, from userid 106) id 5E6F711D3; Wed, 19 Mar 2014 14:04:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.3.2 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 1B5617B8; Wed, 19 Mar 2014 14:04:03 +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 05/16] ARM: at91: at91sam9rl: switch to generic PWM framework Date: Wed, 19 Mar 2014 14:03:18 +0100 Message-Id: <1395234209-15546-6-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-pwm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pwm@vger.kernel.org Switch to the pwm/pwm-atmel driver instead of misc/atmel_pwm Signed-off-by: Alexandre Belloni --- arch/arm/mach-at91/at91sam9rl.c | 1 + arch/arm/mach-at91/at91sam9rl_devices.c | 11 ++--------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c index 4d2006351d1d..bc035a9ff53c 100644 --- a/arch/arm/mach-at91/at91sam9rl.c +++ b/arch/arm/mach-at91/at91sam9rl.c @@ -199,6 +199,7 @@ static struct clk_lookup periph_clocks_lookups[] = { CLKDEV_CON_DEV_ID("pclk", "fffc4000.ssc", &ssc1_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi0_clk), CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.1", &twi1_clk), + CLKDEV_CON_DEV_ID(NULL, "at91sam9rl-pwm", &pwm_clk), CLKDEV_CON_ID("pioA", &pioA_clk), CLKDEV_CON_ID("pioB", &pioB_clk), CLKDEV_CON_ID("pioC", &pioC_clk), diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c index 9ccae034119c..a396d6d56ffe 100644 --- a/arch/arm/mach-at91/at91sam9rl_devices.c +++ b/arch/arm/mach-at91/at91sam9rl_devices.c @@ -797,9 +797,7 @@ static void __init at91_add_device_watchdog(void) {} * PWM * --------------------------------------------------------------------*/ -#if defined(CONFIG_ATMEL_PWM) -static u32 pwm_mask; - +#if IS_ENABLED(CONFIG_PWM_ATMEL) static struct resource pwm_resources[] = { [0] = { .start = AT91SAM9RL_BASE_PWMC, @@ -814,11 +812,8 @@ static struct resource pwm_resources[] = { }; static struct platform_device at91sam9rl_pwm0_device = { - .name = "atmel_pwm", + .name = "at91sam9rl-pwm", .id = -1, - .dev = { - .platform_data = &pwm_mask, - }, .resource = pwm_resources, .num_resources = ARRAY_SIZE(pwm_resources), }; @@ -837,8 +832,6 @@ void __init at91_add_device_pwm(u32 mask) if (mask & (1 << AT91_PWM3)) at91_set_B_periph(AT91_PIN_PD8, 1); /* enable PWM3 */ - pwm_mask = mask; - platform_device_register(&at91sam9rl_pwm0_device); } #else