diff options
author | Mario Haustein <mario.haustein@hrz.tu-chemnitz.de> | 2016-09-21 18:46:58 +0200 |
---|---|---|
committer | Waldemar Brodkorb <wbx@uclibc-ng.org> | 2016-09-22 17:31:08 +0200 |
commit | 64f096935947315ce6fd800aeae527f51048fa91 (patch) | |
tree | ee1a4d9f8f74460d91aa5c814b72c780bd1583ae /target/avr32/grasshopper | |
parent | 6e44f102241565a4ada14edb6ff006979b221a80 (diff) |
add LED support for AVR32 Grasshopper board
Diffstat (limited to 'target/avr32/grasshopper')
-rw-r--r-- | target/avr32/grasshopper/patches/4.7.3/0002-grasshopper-led-pwm.patch | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/target/avr32/grasshopper/patches/4.7.3/0002-grasshopper-led-pwm.patch b/target/avr32/grasshopper/patches/4.7.3/0002-grasshopper-led-pwm.patch new file mode 100644 index 000000000..977c91523 --- /dev/null +++ b/target/avr32/grasshopper/patches/4.7.3/0002-grasshopper-led-pwm.patch @@ -0,0 +1,118 @@ +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<grasshopper_led_data.num_leds; i++) +- // at32_select_gpio(grasshopper_led[i].gpio, AT32_GPIOF_OUTPUT); ++ for (i=0; i<grasshopper_led_data.num_leds; i++) ++ at32_select_gpio(grasshopper_led[i].gpio, AT32_GPIOF_OUTPUT); + + platform_device_register(&grasshopper_led_dev); + +-#ifdef CONFIG_LEDS_ATMEL_PWM ++#ifdef CONFIG_PWM_ATMEL + at32_add_device_pwm(0 + #ifdef CONFIG_BOARD_GRASSHOPPER_PWM0 + | (1 << 0) +@@ -137,9 +133,6 @@ + #ifdef CONFIG_BOARD_GRASSHOPPER_PWM1 + | (1 << 1) + #endif +-#ifdef CONFIG_BOARD_GRASSHOPPER_PWM2 +- | (1 << 2) +-#endif + #ifdef CONFIG_BOARD_GRASSHOPPER_PWM3 + | (1 << 3) + #endif +diff -Naur linux-4.7.3/arch/avr32/boards/grasshopper/Makefile linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Makefile +--- linux-4.7.3/arch/avr32/boards/grasshopper/Makefile 2016-09-21 17:42:47.405315973 +0200 ++++ linux-4.7.3.grasshopper/arch/avr32/boards/grasshopper/Makefile 2016-09-21 17:43:04.042543262 +0200 +@@ -1,5 +1,5 @@ +-obj-y += button.o +-obj-y += flash.o +-obj-y += led.o +-obj-y += mac.o +-obj-y += setup.o ++obj-y += button.o ++obj-y += flash.o ++obj-$(CONFIG_BOARD_GRASSHOPPER_LEDS) += led.o ++obj-y += mac.o ++obj-y += setup.o |