diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig --- linux-4.7.3/arch/avr32/boards/grasshopper/Kconfig 2016-09-21 17:42:47.405315973 +0200 +++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Kconfig 2016-09-21 18:02:11.184236423 +0200 @@ -2,4 +2,37 @@ if BOARD_GRASSHOPPER +config BOARD_GRASSHOPPER_LEDS + bool "Enable LED1 through 8" + depends on NEW_LEDS + depends on LEDS_GPIO + default y + help + Enabling this option will provide access to the LED trough + Linux LED API. + +config BOARD_GRASSHOPPER_PWM0 + bool "Enable PWM0" + depends on PWM_ATMEL + depends on BOARD_GRASSHOPPER_LEDS + default n + help + Enabling PWM channel 0 will exclude LED6 from LED API. + +config BOARD_GRASSHOPPER_PWM1 + bool "Enable PWM1" + depends on PWM_ATMEL + depends on BOARD_GRASSHOPPER_LEDS + default n + help + Enabling PWM channel 1 will exclude LED7 from LED API. + +config BOARD_GRASSHOPPER_PWM3 + bool "Enable PWM3" + depends on PWM_ATMEL + depends on BOARD_GRASSHOPPER_LEDS + default n + help + Enabling PWM channel 3 will exclude the power LED from LED API. + endif # BOARD_GRASSHOPPER diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/led.c linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/led.c --- linux-4.7.3/arch/avr32/boards/grasshopper/led.c 2016-09-21 17:42:47.405315973 +0200 +++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/led.c 2016-09-21 17:43:33.144940844 +0200 @@ -19,7 +19,7 @@ // LEDs static struct gpio_led grasshopper_led[] = { -#ifndef CONFIG_BOARD_GRASSHOPPER_PWM0 +#ifndef CONFIG_BOARD_GRASSHOPPER_PWM3 { .name = "pwrled:red", .gpio = GPIO_PIN_PA(22), @@ -78,7 +78,7 @@ }; /* PWM */ -#ifdef CONFIG_LEDS_ATMEL_PWM +#ifdef CONFIG_PWM_ATMEL static struct gpio_led pwm_led[] = { /* here the "gpio" is actually a PWM channel */ #ifdef CONFIG_BOARD_GRASSHOPPER_PWM0 @@ -93,12 +93,6 @@ .gpio = 1, }, #endif -#ifdef CONFIG_BOARD_GRASSHOPPER_PWM2 - { - .name = "pwm2", - .gpio = 2, - }, -#endif #ifdef CONFIG_BOARD_GRASSHOPPER_PWM3 { .name = "pwm3", @@ -123,13 +117,15 @@ static int __init grasshopper_setup_leds(void) { + unsigned int i; + printk("Grasshopper: Setting up %d LEDs\n", grasshopper_led_data.num_leds); - //for (i=0; i