diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 11:34:32 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-08-08 11:34:32 -0700 |
commit | 10c8e0562057b5d64ea170feab148e1550420030 (patch) | |
tree | cfd387208c85e893c93d24e324d147eb6e9abfc9 /arch/arm/mach-at91/board-sam9263ek.c | |
parent | d4e1f5a14e17d4f0e8034c0967511884bcb12fba (diff) | |
parent | 3e528cb7bae00ba0d73def6645d0f2fa906ee3e8 (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/arm/mach-at91/board-sam9263ek.c')
-rw-r--r-- | arch/arm/mach-at91/board-sam9263ek.c | 55 |
1 files changed, 47 insertions, 8 deletions
diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c index cd2726ee5add..fc446097f410 100644 --- a/arch/arm/mach-at91/board-sam9263ek.c +++ b/arch/arm/mach-at91/board-sam9263ek.c @@ -32,6 +32,8 @@ #include <linux/gpio_keys.h> #include <linux/input.h> #include <linux/leds.h> +#include <linux/pwm.h> +#include <linux/leds_pwm.h> #include <video/atmel_lcdc.h> @@ -369,21 +371,47 @@ static struct gpio_led ek_leds[] = { .name = "ds3", .gpio = AT91_PIN_PB7, .default_trigger = "heartbeat", + }, +#if !IS_ENABLED(CONFIG_LEDS_PWM) + { + .name = "ds1", + .gpio = AT91_PIN_PB8, + .active_low = 1, + .default_trigger = "none", } +#endif }; /* * PWM Leds */ -static struct gpio_led ek_pwm_led[] = { - /* For now only DS1 is PWM-driven (by pwm1) */ +static struct pwm_lookup pwm_lookup[] = { + PWM_LOOKUP("at91sam9rl-pwm", 1, "leds_pwm", "ds1", + 5000, PWM_POLARITY_INVERSED), +}; + +#if IS_ENABLED(CONFIG_LEDS_PWM) +static struct led_pwm pwm_leds[] = { { - .name = "ds1", - .gpio = 1, /* is PWM channel number */ - .active_low = 1, - .default_trigger = "none", - } + .name = "ds1", + .max_brightness = 255, + }, +}; + +static struct led_pwm_platform_data pwm_data = { + .num_leds = ARRAY_SIZE(pwm_leds), + .leds = pwm_leds, +}; + +static struct platform_device leds_pwm = { + .name = "leds_pwm", + .id = -1, + .dev = { + .platform_data = &pwm_data, + }, }; +#endif + /* * CAN @@ -403,6 +431,12 @@ static struct at91_can_data ek_can_data = { .transceiver_switch = sam9263ek_transceiver_switch, }; +static struct platform_device *devices[] __initdata = { +#if IS_ENABLED(CONFIG_LEDS_PWM) + &leds_pwm, +#endif +}; + static void __init ek_board_init(void) { /* Serial */ @@ -437,9 +471,14 @@ static void __init ek_board_init(void) at91_add_device_ac97(&ek_ac97_data); /* LEDs */ at91_gpio_leds(ek_leds, ARRAY_SIZE(ek_leds)); - at91_pwm_leds(ek_pwm_led, ARRAY_SIZE(ek_pwm_led)); + pwm_add_table(pwm_lookup, ARRAY_SIZE(pwm_lookup)); +#if IS_ENABLED(CONFIG_LEDS_PWM) + at91_add_device_pwm(1 << AT91_PWM1); +#endif /* CAN */ at91_add_device_can(&ek_can_data); + /* Other platform devices */ + platform_add_devices(devices, ARRAY_SIZE(devices)); } MACHINE_START(AT91SAM9263EK, "Atmel AT91SAM9263-EK") |