ARM: at91: at91sam9263: switch to generic PWM framework
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Wed, 28 May 2014 23:20:06 +0000 (01:20 +0200)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Wed, 9 Jul 2014 13:13:28 +0000 (15:13 +0200)
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>
arch/arm/mach-at91/at91sam9263.c
arch/arm/mach-at91/at91sam9263_devices.c

index f30290572293273e94b9523ce0072f43cf607fc6..f6663d6c01ecfb9b82dd849d00ebe2b771eaee66 100644 (file)
@@ -199,6 +199,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
        CLKDEV_CON_DEV_ID("spi_clk", "atmel_spi.1", &spi1_clk),
        CLKDEV_CON_DEV_ID("t0_clk", "atmel_tcb.0", &tcb_clk),
        CLKDEV_CON_DEV_ID(NULL, "i2c-at91sam9260.0", &twi_clk),
+       CLKDEV_CON_DEV_ID(NULL, "at91sam9rl-pwm", &pwm_clk),
        /* fake hclk clock */
        CLKDEV_CON_DEV_ID("hclk", "at91_ohci", &ohci_clk),
        CLKDEV_CON_ID("pioA", &pioA_clk),
index 309390d8e2f8cebe71c09d5876d4dc89a20724f5..cef0e2f57068ac92b84767df4d4153d72d9ab36a 100644 (file)
@@ -1131,9 +1131,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  = AT91SAM9263_BASE_PWMC,
@@ -1148,11 +1146,8 @@ static struct resource pwm_resources[] = {
 };
 
 static struct platform_device at91sam9263_pwm0_device = {
-       .name   = "atmel_pwm",
+       .name   = "at91sam9rl-pwm",
        .id     = -1,
-       .dev    = {
-               .platform_data          = &pwm_mask,
-       },
        .resource       = pwm_resources,
        .num_resources  = ARRAY_SIZE(pwm_resources),
 };
@@ -1171,8 +1166,6 @@ void __init at91_add_device_pwm(u32 mask)
        if (mask & (1 << AT91_PWM3))
                at91_set_B_periph(AT91_PIN_PB29, 1);    /* enable PWM3 */
 
-       pwm_mask = mask;
-
        platform_device_register(&at91sam9263_pwm0_device);
 }
 #else