aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>2014-05-28 19:20:08 -0400
committerNicolas Ferre <nicolas.ferre@atmel.com>2014-07-09 09:13:30 -0400
commit60c07f5e7f0e110665bccb11d6f05efeac111fc5 (patch)
tree45947cced9bd5747c1c4474d7ee90bf93add7e47
parentf2e5b269362cd4952a4fa788a8d4dd635ddda804 (diff)
ARM: at91: at91sam9rl: switch to generic PWM framework
Switch to the pwm/pwm-atmel driver instead of misc/atmel_pwm Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
-rw-r--r--arch/arm/mach-at91/at91sam9rl.c1
-rw-r--r--arch/arm/mach-at91/at91sam9rl_devices.c11
2 files changed, 3 insertions, 9 deletions
diff --git a/arch/arm/mach-at91/at91sam9rl.c b/arch/arm/mach-at91/at91sam9rl.c
index a79960f57e6a..878d5015daab 100644
--- a/arch/arm/mach-at91/at91sam9rl.c
+++ b/arch/arm/mach-at91/at91sam9rl.c
@@ -200,6 +200,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
200 CLKDEV_CON_DEV_ID("pclk", "fffc4000.ssc", &ssc1_clk), 200 CLKDEV_CON_DEV_ID("pclk", "fffc4000.ssc", &ssc1_clk),
201 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi0_clk), 201 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.0", &twi0_clk),
202 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.1", &twi1_clk), 202 CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9g20.1", &twi1_clk),
203 CLKDEV_CON_DEV_ID(NULL, "at91sam9rl-pwm", &pwm_clk),
203 CLKDEV_CON_ID("pioA", &pioA_clk), 204 CLKDEV_CON_ID("pioA", &pioA_clk),
204 CLKDEV_CON_ID("pioB", &pioB_clk), 205 CLKDEV_CON_ID("pioB", &pioB_clk),
205 CLKDEV_CON_ID("pioC", &pioC_clk), 206 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 0b1d71a7d9bf..37d1c9ed4562 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -799,9 +799,7 @@ static void __init at91_add_device_watchdog(void) {}
799 * PWM 799 * PWM
800 * --------------------------------------------------------------------*/ 800 * --------------------------------------------------------------------*/
801 801
802#if defined(CONFIG_ATMEL_PWM) 802#if IS_ENABLED(CONFIG_PWM_ATMEL)
803static u32 pwm_mask;
804
805static struct resource pwm_resources[] = { 803static struct resource pwm_resources[] = {
806 [0] = { 804 [0] = {
807 .start = AT91SAM9RL_BASE_PWMC, 805 .start = AT91SAM9RL_BASE_PWMC,
@@ -816,11 +814,8 @@ static struct resource pwm_resources[] = {
816}; 814};
817 815
818static struct platform_device at91sam9rl_pwm0_device = { 816static struct platform_device at91sam9rl_pwm0_device = {
819 .name = "atmel_pwm", 817 .name = "at91sam9rl-pwm",
820 .id = -1, 818 .id = -1,
821 .dev = {
822 .platform_data = &pwm_mask,
823 },
824 .resource = pwm_resources, 819 .resource = pwm_resources,
825 .num_resources = ARRAY_SIZE(pwm_resources), 820 .num_resources = ARRAY_SIZE(pwm_resources),
826}; 821};
@@ -839,8 +834,6 @@ void __init at91_add_device_pwm(u32 mask)
839 if (mask & (1 << AT91_PWM3)) 834 if (mask & (1 << AT91_PWM3))
840 at91_set_B_periph(AT91_PIN_PD8, 1); /* enable PWM3 */ 835 at91_set_B_periph(AT91_PIN_PD8, 1); /* enable PWM3 */
841 836
842 pwm_mask = mask;
843
844 platform_device_register(&at91sam9rl_pwm0_device); 837 platform_device_register(&at91sam9rl_pwm0_device);
845} 838}
846#else 839#else