-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
leds: netxbig: add device tree binding
This patch adds device tree support for the netxbig LEDs. This also introduces a additionnal DT binding for the GPIO extension bus (netxbig-gpio-ext) used to configure the LEDs. Since this bus could also be used to control other devices, then it seems more suitable to have it in a separate DT binding. Signed-off-by: Simon Guinot <simon.guinot@sequanux.org> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
- Loading branch information
Simon Guinot
authored and
Jacek Anaszewski
committed
Nov 3, 2015
1 parent
1c7b9d0
commit 2976b17
Showing
5 changed files
with
391 additions
and
22 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Binding for the GPIO extension bus found on some LaCie/Seagate boards | ||
(Example: 2Big/5Big Network v2, 2Big NAS). | ||
|
||
Required properties: | ||
- compatible: "lacie,netxbig-gpio-ext". | ||
- addr-gpios: GPIOs representing the address register (LSB -> MSB). | ||
- data-gpios: GPIOs representing the data register (LSB -> MSB). | ||
- enable-gpio: latches the new configuration (address, data) on raising edge. | ||
|
||
Example: | ||
|
||
netxbig_gpio_ext: netxbig-gpio-ext { | ||
compatible = "lacie,netxbig-gpio-ext"; | ||
|
||
addr-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH | ||
&gpio1 16 GPIO_ACTIVE_HIGH | ||
&gpio1 17 GPIO_ACTIVE_HIGH>; | ||
data-gpios = <&gpio1 12 GPIO_ACTIVE_HIGH | ||
&gpio1 13 GPIO_ACTIVE_HIGH | ||
&gpio1 14 GPIO_ACTIVE_HIGH>; | ||
enable-gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
Binding for the CPLD LEDs (GPIO extension bus) found on some LaCie/Seagate | ||
boards (Example: 2Big/5Big Network v2, 2Big NAS). | ||
|
||
Required properties: | ||
- compatible: "lacie,netxbig-leds". | ||
- gpio-ext: Phandle for the gpio-ext bus. | ||
|
||
Optional properties: | ||
- timers: Timer array. Each timer entry is represented by three integers: | ||
Mode (gpio-ext bus), delay_on and delay_off. | ||
|
||
Each LED is represented as a sub-node of the netxbig-leds device. | ||
|
||
Required sub-node properties: | ||
- mode-addr: Mode register address on gpio-ext bus. | ||
- mode-val: Mode to value mapping. Each entry is represented by two integers: | ||
A mode and the corresponding value on the gpio-ext bus. | ||
- bright-addr: Brightness register address on gpio-ext bus. | ||
- max-brightness: Maximum brightness value. | ||
|
||
Optional sub-node properties: | ||
- label: Name for this LED. If omitted, the label is taken from the node name. | ||
- linux,default-trigger: Trigger assigned to the LED. | ||
|
||
Example: | ||
|
||
netxbig-leds { | ||
compatible = "lacie,netxbig-leds"; | ||
|
||
gpio-ext = &gpio_ext; | ||
|
||
timers = <NETXBIG_LED_TIMER1 500 500 | ||
NETXBIG_LED_TIMER2 500 1000>; | ||
|
||
blue-power { | ||
label = "netxbig:blue:power"; | ||
mode-addr = <0>; | ||
mode-val = <NETXBIG_LED_OFF 0 | ||
NETXBIG_LED_ON 1 | ||
NETXBIG_LED_TIMER1 3 | ||
NETXBIG_LED_TIMER2 7>; | ||
bright-addr = <1>; | ||
max-brightness = <7>; | ||
}; | ||
red-power { | ||
label = "netxbig:red:power"; | ||
mode-addr = <0>; | ||
mode-val = <NETXBIG_LED_OFF 0 | ||
NETXBIG_LED_ON 2 | ||
NETXBIG_LED_TIMER1 4>; | ||
bright-addr = <1>; | ||
max-brightness = <7>; | ||
}; | ||
blue-sata0 { | ||
label = "netxbig:blue:sata0"; | ||
mode-addr = <3>; | ||
mode-val = <NETXBIG_LED_OFF 0 | ||
NETXBIG_LED_ON 7 | ||
NETXBIG_LED_SATA 1 | ||
NETXBIG_LED_TIMER1 3>; | ||
bright-addr = <2>; | ||
max-brightness = <7>; | ||
}; | ||
red-sata0 { | ||
label = "netxbig:red:sata0"; | ||
mode-addr = <3>; | ||
mode-val = <NETXBIG_LED_OFF 0 | ||
NETXBIG_LED_ON 2 | ||
NETXBIG_LED_TIMER1 4>; | ||
bright-addr = <2>; | ||
max-brightness = <7>; | ||
}; | ||
blue-sata1 { | ||
label = "netxbig:blue:sata1"; | ||
mode-addr = <4>; | ||
mode-val = <NETXBIG_LED_OFF 0 | ||
NETXBIG_LED_ON 7 | ||
NETXBIG_LED_SATA 1 | ||
NETXBIG_LED_TIMER1 3>; | ||
bright-addr = <2>; | ||
max-brightness = <7>; | ||
}; | ||
red-sata1 { | ||
label = "netxbig:red:sata1"; | ||
mode-addr = <4>; | ||
mode-val = <NETXBIG_LED_OFF 0 | ||
NETXBIG_LED_ON 2 | ||
NETXBIG_LED_TIMER1 4>; | ||
bright-addr = <2>; | ||
max-brightness = <7>; | ||
}; | ||
}; |
Oops, something went wrong.