mirror of
https://github.com/torvalds/linux.git
synced 2024-12-31 23:31:29 +00:00
757642f9a5
Armada 370/XP devices can 'blink' GPIO lines with a configurable on and off period. This can be modelled as a PWM. However, there are only two sets of PWM configuration registers for all the GPIO lines. This driver simply allows a single GPIO line per GPIO chip of 32 lines to be used as a PWM. Attempts to use more return EBUSY. Due to the interleaving of registers it is not simple to separate the PWM driver from the GPIO driver. Thus the GPIO driver has been extended with a PWM driver. Signed-off-by: Andrew Lunn <andrew@lunn.ch> URL: https://patchwork.ozlabs.org/patch/427287/ URL: https://patchwork.ozlabs.org/patch/427295/ [Ralph Sennhauser: * Port forward * Merge PWM portion into gpio-mvebu.c * Switch to atomic PWM API * Add new compatible string marvell,armada-370-xp-gpio * Update and merge documentation patch * Update MAINTAINERS] Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com> Tested-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Thierry Reding <thierry.reding@gmail.com> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
86 lines
2.8 KiB
Plaintext
86 lines
2.8 KiB
Plaintext
* Marvell EBU GPIO controller
|
|
|
|
Required properties:
|
|
|
|
- compatible : Should be "marvell,orion-gpio", "marvell,mv78200-gpio"
|
|
or "marvell,armadaxp-gpio". "marvell,orion-gpio" should be used for
|
|
Orion, Kirkwood, Dove, Discovery (except MV78200) and Armada
|
|
370. "marvell,mv78200-gpio" should be used for the Discovery
|
|
MV78200. "marvel,armadaxp-gpio" should be used for all Armada XP
|
|
SoCs (MV78230, MV78260, MV78460).
|
|
|
|
- reg: Address and length of the register set for the device. Only one
|
|
entry is expected, except for the "marvell,armadaxp-gpio" variant
|
|
for which two entries are expected: one for the general registers,
|
|
one for the per-cpu registers.
|
|
|
|
- interrupts: The list of interrupts that are used for all the pins
|
|
managed by this GPIO bank. There can be more than one interrupt
|
|
(example: 1 interrupt per 8 pins on Armada XP, which means 4
|
|
interrupts per bank of 32 GPIOs).
|
|
|
|
- interrupt-controller: identifies the node as an interrupt controller
|
|
|
|
- #interrupt-cells: specifies the number of cells needed to encode an
|
|
interrupt source. Should be two.
|
|
The first cell is the GPIO number.
|
|
The second cell is used to specify flags:
|
|
bits[3:0] trigger type and level flags:
|
|
1 = low-to-high edge triggered.
|
|
2 = high-to-low edge triggered.
|
|
4 = active high level-sensitive.
|
|
8 = active low level-sensitive.
|
|
|
|
- gpio-controller: marks the device node as a gpio controller
|
|
|
|
- ngpios: number of GPIOs this controller has
|
|
|
|
- #gpio-cells: Should be two. The first cell is the pin number. The
|
|
second cell is reserved for flags, unused at the moment.
|
|
|
|
Optional properties:
|
|
|
|
In order to use the GPIO lines in PWM mode, some additional optional
|
|
properties are required. Only Armada 370 and XP support these properties.
|
|
|
|
- compatible: Must contain "marvell,armada-370-xp-gpio"
|
|
|
|
- reg: an additional register set is needed, for the GPIO Blink
|
|
Counter on/off registers.
|
|
|
|
- reg-names: Must contain an entry "pwm" corresponding to the
|
|
additional register range needed for PWM operation.
|
|
|
|
- #pwm-cells: Should be two. The first cell is the GPIO line number. The
|
|
second cell is the period in nanoseconds.
|
|
|
|
- clocks: Must be a phandle to the clock for the GPIO controller.
|
|
|
|
Example:
|
|
|
|
gpio0: gpio@d0018100 {
|
|
compatible = "marvell,armadaxp-gpio";
|
|
reg = <0xd0018100 0x40>,
|
|
<0xd0018800 0x30>;
|
|
ngpios = <32>;
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
interrupt-controller;
|
|
#interrupt-cells = <2>;
|
|
interrupts = <16>, <17>, <18>, <19>;
|
|
};
|
|
|
|
gpio1: gpio@18140 {
|
|
compatible = "marvell,armada-370-xp-gpio";
|
|
reg = <0x18140 0x40>, <0x181c8 0x08>;
|
|
reg-names = "gpio", "pwm";
|
|
ngpios = <17>;
|
|
gpio-controller;
|
|
#gpio-cells = <2>;
|
|
#pwm-cells = <2>;
|
|
interrupt-controller;
|
|
#interrupt-cells = <2>;
|
|
interrupts = <87>, <88>, <89>;
|
|
clocks = <&coreclk 0>;
|
|
};
|