ARM: at91: at91sam9g45: 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>hifive-unleashed-5.1
parent
4c834452aa
commit
e030427f51
|
@ -251,6 +251,7 @@ static struct clk_lookup periph_clocks_lookups[] = {
|
||||||
CLKDEV_CON_DEV_ID(NULL, "atmel_sha", &aestdessha_clk),
|
CLKDEV_CON_DEV_ID(NULL, "atmel_sha", &aestdessha_clk),
|
||||||
CLKDEV_CON_DEV_ID(NULL, "atmel_tdes", &aestdessha_clk),
|
CLKDEV_CON_DEV_ID(NULL, "atmel_tdes", &aestdessha_clk),
|
||||||
CLKDEV_CON_DEV_ID(NULL, "atmel_aes", &aestdessha_clk),
|
CLKDEV_CON_DEV_ID(NULL, "atmel_aes", &aestdessha_clk),
|
||||||
|
CLKDEV_CON_DEV_ID(NULL, "at91sam9rl-pwm", &pwm_clk),
|
||||||
/* more usart lookup table for DT entries */
|
/* more usart lookup table for DT entries */
|
||||||
CLKDEV_CON_DEV_ID("usart", "ffffee00.serial", &mck),
|
CLKDEV_CON_DEV_ID("usart", "ffffee00.serial", &mck),
|
||||||
CLKDEV_CON_DEV_ID("usart", "fff8c000.serial", &usart0_clk),
|
CLKDEV_CON_DEV_ID("usart", "fff8c000.serial", &usart0_clk),
|
||||||
|
|
|
@ -1334,9 +1334,7 @@ static void __init at91_add_device_watchdog(void) {}
|
||||||
* PWM
|
* PWM
|
||||||
* --------------------------------------------------------------------*/
|
* --------------------------------------------------------------------*/
|
||||||
|
|
||||||
#if defined(CONFIG_ATMEL_PWM) || defined(CONFIG_ATMEL_PWM_MODULE)
|
#if IS_ENABLED(CONFIG_PWM_ATMEL)
|
||||||
static u32 pwm_mask;
|
|
||||||
|
|
||||||
static struct resource pwm_resources[] = {
|
static struct resource pwm_resources[] = {
|
||||||
[0] = {
|
[0] = {
|
||||||
.start = AT91SAM9G45_BASE_PWMC,
|
.start = AT91SAM9G45_BASE_PWMC,
|
||||||
|
@ -1351,11 +1349,8 @@ static struct resource pwm_resources[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct platform_device at91sam9g45_pwm0_device = {
|
static struct platform_device at91sam9g45_pwm0_device = {
|
||||||
.name = "atmel_pwm",
|
.name = "at91sam9rl-pwm",
|
||||||
.id = -1,
|
.id = -1,
|
||||||
.dev = {
|
|
||||||
.platform_data = &pwm_mask,
|
|
||||||
},
|
|
||||||
.resource = pwm_resources,
|
.resource = pwm_resources,
|
||||||
.num_resources = ARRAY_SIZE(pwm_resources),
|
.num_resources = ARRAY_SIZE(pwm_resources),
|
||||||
};
|
};
|
||||||
|
@ -1374,8 +1369,6 @@ void __init at91_add_device_pwm(u32 mask)
|
||||||
if (mask & (1 << AT91_PWM3))
|
if (mask & (1 << AT91_PWM3))
|
||||||
at91_set_B_periph(AT91_PIN_PD0, 1); /* enable PWM3 */
|
at91_set_B_periph(AT91_PIN_PD0, 1); /* enable PWM3 */
|
||||||
|
|
||||||
pwm_mask = mask;
|
|
||||||
|
|
||||||
platform_device_register(&at91sam9g45_pwm0_device);
|
platform_device_register(&at91sam9g45_pwm0_device);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue