diff options
Diffstat (limited to 'arch/avr32')
-rw-r--r-- | arch/avr32/boards/favr-32/setup.c | 48 | ||||
-rw-r--r-- | arch/avr32/configs/favr-32_defconfig | 6 |
2 files changed, 33 insertions, 21 deletions
diff --git a/arch/avr32/boards/favr-32/setup.c b/arch/avr32/boards/favr-32/setup.c index 1f121497b517..234cb071c601 100644 --- a/arch/avr32/boards/favr-32/setup.c +++ b/arch/avr32/boards/favr-32/setup.c | |||
@@ -18,7 +18,10 @@ | |||
18 | #include <linux/gpio.h> | 18 | #include <linux/gpio.h> |
19 | #include <linux/leds.h> | 19 | #include <linux/leds.h> |
20 | #include <linux/atmel-mci.h> | 20 | #include <linux/atmel-mci.h> |
21 | #include <linux/atmel-pwm-bl.h> | 21 | #include <linux/pwm.h> |
22 | #include <linux/pwm_backlight.h> | ||
23 | #include <linux/regulator/fixed.h> | ||
24 | #include <linux/regulator/machine.h> | ||
22 | #include <linux/spi/spi.h> | 25 | #include <linux/spi/spi.h> |
23 | #include <linux/spi/ads7846.h> | 26 | #include <linux/spi/ads7846.h> |
24 | 27 | ||
@@ -33,6 +36,8 @@ | |||
33 | #include <mach/board.h> | 36 | #include <mach/board.h> |
34 | #include <mach/portmux.h> | 37 | #include <mach/portmux.h> |
35 | 38 | ||
39 | #define PWM_BL_CH 2 | ||
40 | |||
36 | /* Oscillator frequencies. These are board-specific */ | 41 | /* Oscillator frequencies. These are board-specific */ |
37 | unsigned long at32_board_osc_rates[3] = { | 42 | unsigned long at32_board_osc_rates[3] = { |
38 | [0] = 32768, /* 32.768 kHz on RTC osc */ | 43 | [0] = 32768, /* 32.768 kHz on RTC osc */ |
@@ -227,29 +232,36 @@ void __init favr32_setup_leds(void) | |||
227 | platform_device_register(&favr32_led_dev); | 232 | platform_device_register(&favr32_led_dev); |
228 | } | 233 | } |
229 | 234 | ||
230 | static struct atmel_pwm_bl_platform_data atmel_pwm_bl_pdata = { | 235 | static struct pwm_lookup pwm_lookup[] = { |
231 | .pwm_channel = 2, | 236 | PWM_LOOKUP("at91sam9rl-pwm", PWM_BL_CH, "pwm-backlight.0", NULL, |
232 | .pwm_frequency = 200000, | 237 | 5000, PWM_POLARITY_INVERSED), |
233 | .pwm_compare_max = 345, | ||
234 | .pwm_duty_max = 345, | ||
235 | .pwm_duty_min = 90, | ||
236 | .pwm_active_low = 1, | ||
237 | .gpio_on = GPIO_PIN_PA(28), | ||
238 | .on_active_low = 0, | ||
239 | }; | 238 | }; |
240 | 239 | ||
241 | static struct platform_device atmel_pwm_bl_dev = { | 240 | static struct regulator_consumer_supply fixed_power_consumers[] = { |
242 | .name = "atmel-pwm-bl", | 241 | REGULATOR_SUPPLY("power", "pwm-backlight.0"), |
243 | .id = 0, | 242 | }; |
244 | .dev = { | 243 | |
245 | .platform_data = &atmel_pwm_bl_pdata, | 244 | static struct platform_pwm_backlight_data pwm_bl_data = { |
245 | .enable_gpio = GPIO_PIN_PA(28), | ||
246 | .max_brightness = 255, | ||
247 | .dft_brightness = 255, | ||
248 | .lth_brightness = 50, | ||
249 | }; | ||
250 | |||
251 | static struct platform_device pwm_bl_device = { | ||
252 | .name = "pwm-backlight", | ||
253 | .dev = { | ||
254 | .platform_data = &pwm_bl_data, | ||
246 | }, | 255 | }, |
247 | }; | 256 | }; |
248 | 257 | ||
249 | static void __init favr32_setup_atmel_pwm_bl(void) | 258 | static void __init favr32_setup_atmel_pwm_bl(void) |
250 | { | 259 | { |
251 | platform_device_register(&atmel_pwm_bl_dev); | 260 | pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); |
252 | at32_select_gpio(atmel_pwm_bl_pdata.gpio_on, 0); | 261 | regulator_register_always_on(0, "fixed", fixed_power_consumers, |
262 | ARRAY_SIZE(fixed_power_consumers), 3300000); | ||
263 | platform_device_register(&pwm_bl_device); | ||
264 | at32_select_gpio(pwm_bl_data.enable_gpio, 0); | ||
253 | } | 265 | } |
254 | 266 | ||
255 | void __init setup_board(void) | 267 | void __init setup_board(void) |
@@ -339,7 +351,7 @@ static int __init favr32_init(void) | |||
339 | 351 | ||
340 | set_abdac_rate(at32_add_device_abdac(0, &abdac0_data)); | 352 | set_abdac_rate(at32_add_device_abdac(0, &abdac0_data)); |
341 | 353 | ||
342 | at32_add_device_pwm(1 << atmel_pwm_bl_pdata.pwm_channel); | 354 | at32_add_device_pwm(1 << PWM_BL_CH); |
343 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); | 355 | at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); |
344 | at32_add_device_mci(0, &mci0_data); | 356 | at32_add_device_mci(0, &mci0_data); |
345 | at32_add_device_usba(0, NULL); | 357 | at32_add_device_usba(0, NULL); |
diff --git a/arch/avr32/configs/favr-32_defconfig b/arch/avr32/configs/favr-32_defconfig index 07bed3f7eb5e..b3eb67dc05ac 100644 --- a/arch/avr32/configs/favr-32_defconfig +++ b/arch/avr32/configs/favr-32_defconfig | |||
@@ -67,7 +67,6 @@ CONFIG_MTD_PHYSMAP=y | |||
67 | CONFIG_BLK_DEV_LOOP=m | 67 | CONFIG_BLK_DEV_LOOP=m |
68 | CONFIG_BLK_DEV_NBD=m | 68 | CONFIG_BLK_DEV_NBD=m |
69 | CONFIG_BLK_DEV_RAM=m | 69 | CONFIG_BLK_DEV_RAM=m |
70 | CONFIG_ATMEL_PWM=m | ||
71 | CONFIG_ATMEL_TCLIB=y | 70 | CONFIG_ATMEL_TCLIB=y |
72 | CONFIG_ATMEL_SSC=m | 71 | CONFIG_ATMEL_SSC=m |
73 | CONFIG_NETDEVICES=y | 72 | CONFIG_NETDEVICES=y |
@@ -108,7 +107,7 @@ CONFIG_FB=y | |||
108 | CONFIG_FB_ATMEL=y | 107 | CONFIG_FB_ATMEL=y |
109 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | 108 | CONFIG_BACKLIGHT_LCD_SUPPORT=y |
110 | # CONFIG_LCD_CLASS_DEVICE is not set | 109 | # CONFIG_LCD_CLASS_DEVICE is not set |
111 | CONFIG_BACKLIGHT_ATMEL_PWM=m | 110 | CONFIG_BACKLIGHT_PWM=m |
112 | CONFIG_SOUND=m | 111 | CONFIG_SOUND=m |
113 | CONFIG_SOUND_PRIME=m | 112 | CONFIG_SOUND_PRIME=m |
114 | # CONFIG_HID_SUPPORT is not set | 113 | # CONFIG_HID_SUPPORT is not set |
@@ -123,7 +122,6 @@ CONFIG_MMC=y | |||
123 | CONFIG_MMC_ATMELMCI=y | 122 | CONFIG_MMC_ATMELMCI=y |
124 | CONFIG_NEW_LEDS=y | 123 | CONFIG_NEW_LEDS=y |
125 | CONFIG_LEDS_CLASS=y | 124 | CONFIG_LEDS_CLASS=y |
126 | CONFIG_LEDS_ATMEL_PWM=m | ||
127 | CONFIG_LEDS_GPIO=y | 125 | CONFIG_LEDS_GPIO=y |
128 | CONFIG_LEDS_TRIGGERS=y | 126 | CONFIG_LEDS_TRIGGERS=y |
129 | CONFIG_LEDS_TRIGGER_TIMER=y | 127 | CONFIG_LEDS_TRIGGER_TIMER=y |
@@ -132,6 +130,8 @@ CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | |||
132 | CONFIG_RTC_CLASS=y | 130 | CONFIG_RTC_CLASS=y |
133 | CONFIG_RTC_DRV_AT32AP700X=y | 131 | CONFIG_RTC_DRV_AT32AP700X=y |
134 | CONFIG_DMADEVICES=y | 132 | CONFIG_DMADEVICES=y |
133 | CONFIG_PWM=y | ||
134 | CONFIG_PWM_ATMEL=y | ||
135 | CONFIG_EXT2_FS=y | 135 | CONFIG_EXT2_FS=y |
136 | CONFIG_EXT3_FS=y | 136 | CONFIG_EXT3_FS=y |
137 | # CONFIG_EXT3_FS_XATTR is not set | 137 | # CONFIG_EXT3_FS_XATTR is not set |