aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/boards
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 14:34:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-08-08 14:34:32 -0400
commit10c8e0562057b5d64ea170feab148e1550420030 (patch)
treecfd387208c85e893c93d24e324d147eb6e9abfc9 /arch/avr32/boards
parentd4e1f5a14e17d4f0e8034c0967511884bcb12fba (diff)
parent3e528cb7bae00ba0d73def6645d0f2fa906ee3e8 (diff)
Merge tag 'drivers-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver changes from Olof Johansson: "A handful of driver-related changes. We've had a bunch of them going in through other branches as well, so it's only a part of what we really have this release. Larger pieces are: - Removal of a now unused PWM driver for atmel [ This includes AVR32 changes that have been appropriately acked ] - Performance counter support for the arm CCN interconnect - OMAP mailbox driver cleanups and consolidation - PCI and SATA PHY drivers for SPEAr 13xx platforms - Redefinition (with backwards compatibility!) of PCI DT bindings for Tegra to better model regulators/power" Note: this merge also fixes up the semantic conflict with the new calling convention for devm_phy_create(), see commit f0ed817638b5 ("phy: core: Let node ptr of PHY point to PHY and not of PHY provider") that came in through Greg's USB tree. Semantic merge patch by Stephen Rothwell <sfr@canb.auug.org.au> through the next tree. * tag 'drivers-for-3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (38 commits) bus: arm-ccn: Fix error handling at event allocation mailbox/omap: add a parent structure for every IP instance mailbox/omap: remove the private mailbox structure mailbox/omap: consolidate OMAP mailbox driver mailbox/omap: simplify the fifo assignment by using macros mailbox/omap: remove omap_mbox_type_t from mailbox ops mailbox/omap: remove OMAP1 mailbox driver mailbox/omap: use devm_* interfaces bus: ARM CCN: add PERF_EVENTS dependency bus: ARM CCN PMU driver PCI: spear: Remove spear13xx_pcie_remove() PCI: spear: Fix Section mismatch compilation warning for probe() ARM: tegra: Remove legacy PCIe power supply properties PCI: tegra: Remove deprecated power supply properties PCI: tegra: Implement accurate power supply scheme ARM: SPEAr13xx: Update defconfigs ARM: SPEAr13xx: Add pcie and miphy DT nodes ARM: SPEAr13xx: Add bindings and dt node for misc block ARM: SPEAr13xx: Fix static mapping table phy: Add drivers for PCIe and SATA phy on SPEAr13xx ...
Diffstat (limited to 'arch/avr32/boards')
-rw-r--r--arch/avr32/boards/atngw100/mrmt.c34
-rw-r--r--arch/avr32/boards/favr-32/setup.c48
-rw-r--r--arch/avr32/boards/merisc/setup.c34
3 files changed, 73 insertions, 43 deletions
diff --git a/arch/avr32/boards/atngw100/mrmt.c b/arch/avr32/boards/atngw100/mrmt.c
index 1ba09e4c02b1..91146b416cdb 100644
--- a/arch/avr32/boards/atngw100/mrmt.c
+++ b/arch/avr32/boards/atngw100/mrmt.c
@@ -17,6 +17,8 @@
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/fb.h> 18#include <linux/fb.h>
19#include <linux/leds.h> 19#include <linux/leds.h>
20#include <linux/pwm.h>
21#include <linux/leds_pwm.h>
20#include <linux/input.h> 22#include <linux/input.h>
21#include <linux/gpio_keys.h> 23#include <linux/gpio_keys.h>
22#include <linux/atmel_serial.h> 24#include <linux/atmel_serial.h>
@@ -155,21 +157,28 @@ static struct platform_device rmt_ts_device = {
155 157
156#ifdef CONFIG_BOARD_MRMT_BL_PWM 158#ifdef CONFIG_BOARD_MRMT_BL_PWM
157/* PWM LEDs: LCD Backlight, etc */ 159/* PWM LEDs: LCD Backlight, etc */
158static struct gpio_led rmt_pwm_led[] = { 160static struct pwm_lookup pwm_lookup[] = {
159 /* here the "gpio" is actually a PWM channel */ 161 PWM_LOOKUP("at91sam9rl-pwm", PWM_CH_BL, "leds_pwm", "ds1",
160 { .name = "backlight", .gpio = PWM_CH_BL, }, 162 5000, PWM_POLARITY_INVERSED),
161}; 163};
162 164
163static struct gpio_led_platform_data rmt_pwm_led_data = { 165static struct led_pwm pwm_leds[] = {
164 .num_leds = ARRAY_SIZE(rmt_pwm_led), 166 {
165 .leds = rmt_pwm_led, 167 .name = "backlight",
168 .max_brightness = 255,
169 },
170};
171
172static struct led_pwm_platform_data pwm_data = {
173 .num_leds = ARRAY_SIZE(pwm_leds),
174 .leds = pwm_leds,
166}; 175};
167 176
168static struct platform_device rmt_pwm_led_dev = { 177static struct platform_device leds_pwm = {
169 .name = "leds-atmel-pwm", 178 .name = "leds_pwm",
170 .id = -1, 179 .id = -1,
171 .dev = { 180 .dev = {
172 .platform_data = &rmt_pwm_led_data, 181 .platform_data = &pwm_data,
173 }, 182 },
174}; 183};
175#endif 184#endif
@@ -325,7 +334,8 @@ static int __init mrmt1_init(void)
325#ifdef CONFIG_BOARD_MRMT_BL_PWM 334#ifdef CONFIG_BOARD_MRMT_BL_PWM
326 /* Use PWM for Backlight controls */ 335 /* Use PWM for Backlight controls */
327 at32_add_device_pwm(1 << PWM_CH_BL); 336 at32_add_device_pwm(1 << PWM_CH_BL);
328 platform_device_register(&rmt_pwm_led_dev); 337 pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
338 platform_device_register(&leds_pwm);
329#else 339#else
330 /* Backlight always on */ 340 /* Backlight always on */
331 udelay( 1 ); 341 udelay( 1 );
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 */
37unsigned long at32_board_osc_rates[3] = { 42unsigned 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
230static struct atmel_pwm_bl_platform_data atmel_pwm_bl_pdata = { 235static 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
241static struct platform_device atmel_pwm_bl_dev = { 240static 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, 244static 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
251static struct platform_device pwm_bl_device = {
252 .name = "pwm-backlight",
253 .dev = {
254 .platform_data = &pwm_bl_data,
246 }, 255 },
247}; 256};
248 257
249static void __init favr32_setup_atmel_pwm_bl(void) 258static 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
255void __init setup_board(void) 267void __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/boards/merisc/setup.c b/arch/avr32/boards/merisc/setup.c
index ed137e335796..83d896cc2aed 100644
--- a/arch/avr32/boards/merisc/setup.c
+++ b/arch/avr32/boards/merisc/setup.c
@@ -22,6 +22,8 @@
22#include <linux/irq.h> 22#include <linux/irq.h>
23#include <linux/fb.h> 23#include <linux/fb.h>
24#include <linux/atmel-mci.h> 24#include <linux/atmel-mci.h>
25#include <linux/pwm.h>
26#include <linux/leds_pwm.h>
25 27
26#include <asm/io.h> 28#include <asm/io.h>
27#include <asm/setup.h> 29#include <asm/setup.h>
@@ -167,24 +169,29 @@ static struct i2c_board_info __initdata i2c_info[] = {
167 }, 169 },
168}; 170};
169 171
170#ifdef CONFIG_LEDS_ATMEL_PWM 172#if IS_ENABLED(CONFIG_LEDS_PWM)
171static struct gpio_led stk_pwm_led[] = { 173static struct pwm_lookup pwm_lookup[] = {
174 PWM_LOOKUP("at91sam9rl-pwm", 0, "leds_pwm", "backlight",
175 5000, PWM_POLARITY_NORMAL),
176};
177
178static struct led_pwm pwm_leds[] = {
172 { 179 {
173 .name = "backlight", 180 .name = "backlight",
174 .gpio = 0, /* PWM channel 0 (LCD backlight) */ 181 .max_brightness = 255,
175 }, 182 },
176}; 183};
177 184
178static struct gpio_led_platform_data stk_pwm_led_data = { 185static struct led_pwm_platform_data pwm_data = {
179 .num_leds = ARRAY_SIZE(stk_pwm_led), 186 .num_leds = ARRAY_SIZE(pwm_leds),
180 .leds = stk_pwm_led, 187 .leds = pwm_leds,
181}; 188};
182 189
183static struct platform_device stk_pwm_led_dev = { 190static struct platform_device leds_pwm = {
184 .name = "leds-atmel-pwm", 191 .name = "leds_pwm",
185 .id = -1, 192 .id = -1,
186 .dev = { 193 .dev = {
187 .platform_data = &stk_pwm_led_data, 194 .platform_data = &pwm_data,
188 }, 195 },
189}; 196};
190#endif 197#endif
@@ -278,9 +285,10 @@ static int __init merisc_init(void)
278 285
279 at32_add_device_mci(0, &mci0_data); 286 at32_add_device_mci(0, &mci0_data);
280 287
281#ifdef CONFIG_LEDS_ATMEL_PWM 288#if IS_ENABLED(CONFIG_LEDS_PWM)
289 pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup));
282 at32_add_device_pwm((1 << 0) | (1 << 2)); 290 at32_add_device_pwm((1 << 0) | (1 << 2));
283 platform_device_register(&stk_pwm_led_dev); 291 platform_device_register(&leds_pwm);
284#else 292#else
285 at32_add_device_pwm((1 << 2)); 293 at32_add_device_pwm((1 << 2));
286#endif 294#endif