Add DT support for netxbig LEDs
Subsystems (6)
v2 cover Add DT support for netxbig LEDs
Hello,
This patch series adds DT support for the LEDs found on the Kirkwood-based LaCie boards 2Big and 5Big Network v2.
Changes since v1:
- Check timer mode value retrieved from DT.
- In netxbig_leds_get_of_pdata, don't use unsigned long variables to get timer delay values from DT with function of_property_read_u32_index. Instead, use a temporary u32 variable. This allows to silence a static checker warning.
- Make timer property optional in the binding documentation. It is now aligned with the driver code.
Simon
Simon Guinot (3):
leds: netxbig: add device tree binding
ARM: Kirkwood: add LED DT entries for netxbig boards
ARM: mvebu: remove static LED setup for netxbig boards
.../devicetree/bindings/gpio/netxbig-gpio-ext.txt | 22 ++ .../devicetree/bindings/leds/leds-netxbig.txt | 92 ++++++++ arch/arm/boot/dts/kirkwood-net5big.dts | 60 +++++ arch/arm/boot/dts/kirkwood-netxbig.dtsi | 80 +++++++ arch/arm/mach-mvebu/Kconfig | 7 - arch/arm/mach-mvebu/Makefile | 1 - arch/arm/mach-mvebu/board.h | 21 -- arch/arm/mach-mvebu/kirkwood.c | 4 - arch/arm/mach-mvebu/netxbig.c | 191 ---------------- drivers/leds/leds-netxbig.c | 250 +++++++++++++++++++-- include/dt-bindings/leds/leds-netxbig.h | 18 ++ 11 files changed, 501 insertions(+), 245 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt create mode 100644 Documentation/devicetree/bindings/leds/leds-netxbig.txt delete mode 100644 arch/arm/mach-mvebu/board.h delete mode 100644 arch/arm/mach-mvebu/netxbig.c create mode 100644 include/dt-bindings/leds/leds-netxbig.h
Signature · 1 line
2.1.4
PATCH v2 1/3 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.
---
Changes since v1:
- Check timer mode value retrieved from DT.
- In netxbig_leds_get_of_pdata, don't use unsigned long variables to get timer delay values from DT with function of_property_read_u32_index. Instead, use a temporary u32 variable. This allows to silence a static checker warning.
- Make timer property optional in the binding documentation. It is now aligned with the driver code.
.../devicetree/bindings/gpio/netxbig-gpio-ext.txt | 22 ++ .../devicetree/bindings/leds/leds-netxbig.txt | 92 ++++++++ drivers/leds/leds-netxbig.c | 250 +++++++++++++++++++-- include/dt-bindings/leds/leds-netxbig.h | 18 ++ 4 files changed, 361 insertions(+), 21 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt create mode 100644 Documentation/devicetree/bindings/leds/leds-netxbig.txt create mode 100644 include/dt-bindings/leds/leds-netxbig.h
Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt new file +22 -0
@@ -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. +- data-gpios: GPIOs representing the data register. +- enable-gpio: GPIO used to enable the new configuration (address, data). + +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>; +};
Documentation/devicetree/bindings/leds/leds-netxbig.txt new file +92 -0
92 lines not on this page · raw message
drivers/leds/leds-netxbig.c +229 -21
312 lines not on this page · raw message
include/dt-bindings/leds/leds-netxbig.h new file +18 -0
@@ -0,0 +1,18 @@ +/* +* This header provides constants for netxbig LED bindings. +* +* This file is licensed under the terms of the GNU General Public +* License version 2. This program is licensed "as is" without any +* warranty of any kind, whether express or implied. +*/ + +#ifndef _DT_BINDINGS_LEDS_NETXBIG_H +#define _DT_BINDINGS_LEDS_NETXBIG_H + +#define NETXBIG_LED_OFF 0 +#define NETXBIG_LED_ON 1 +#define NETXBIG_LED_SATA 2 +#define NETXBIG_LED_TIMER1 3 +#define NETXBIG_LED_TIMER2 4 + +#endif /* _DT_BINDINGS_LEDS_NETXBIG_H */
Signature · 1 line
2.1.4
PATCH v2 2/3 ARM: Kirkwood: add LED DT entries for netxbig boards
In reply to Simon GuinotThis patch adds DT entries for the LEDs found on the Kirkwood-based LaCie boards 2Big and 5Big Network v2.
--- arch/arm/boot/dts/kirkwood-net5big.dts | 60 +++++++++++++++++++++++++ arch/arm/boot/dts/kirkwood-netxbig.dtsi | 80 +++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+)
arch/arm/boot/dts/kirkwood-net5big.dts +60 -0
@@ -86,6 +86,66 @@ clock-frequency = <32768>; }; }; + + netxbig-leds { + blue-sata2 { + label = "netxbig:blue:sata2"; + mode-addr = <5>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 7 + NETXBIG_LED_SATA 1 + NETXBIG_LED_TIMER1 3>; + bright-addr = <2>; + bright-max = <7>; + }; + red-sata2 { + label = "netxbig:red:sata2"; + mode-addr = <5>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 2 + NETXBIG_LED_TIMER1 4>; + bright-addr = <2>; + bright-max = <7>; + }; + blue-sata3 { + label = "netxbig:blue:sata3"; + mode-addr = <6>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 7 + NETXBIG_LED_SATA 1 + NETXBIG_LED_TIMER1 3>; + bright-addr = <2>; + bright-max = <7>; + }; + red-sata3 { + label = "netxbig:red:sata3"; + mode-addr = <6>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 2 + NETXBIG_LED_TIMER1 4>; + bright-addr = <2>; + bright-max = <7>; + }; + blue-sata4 { + label = "netxbig:blue:sata4"; + mode-addr = <7>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 7 + NETXBIG_LED_SATA 1 + NETXBIG_LED_TIMER1 3>; + bright-addr = <2>; + bright-max = <7>; + }; + red-sata4 { + label = "netxbig:red:sata4"; + mode-addr = <7>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 2 + NETXBIG_LED_TIMER1 4>; + bright-addr = <2>; + bright-max = <7>; + }; + }; }; &mdio {
arch/arm/boot/dts/kirkwood-netxbig.dtsi +80 -0
92 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v2 2/3 ARM: Kirkwood: add LED DT entries for netxbig boards
Hi Simon,
Quoted 5 lines · Simon Guinot
This patch adds DT entries for the LEDs found on the Kirkwood-based LaCie boards 2Big and 5Big Network v2.
Signed-off-by Simon Guinot <[email protected]>---
Thanks,
Gregory
Quoted 174 lines
arch/arm/boot/dts/kirkwood-net5big.dts | 60 +++++++++++++++++++++++++ arch/arm/boot/dts/kirkwood-netxbig.dtsi | 80 +++++++++++++++++++++++++++++++++ 2 files changed, 140 insertions(+)arch/arm/boot/dts/kirkwood-net5big.dts +60
-0@@ -86,6 +86,66 @@ clock-frequency = <32768>; }; }; + + netxbig-leds { + blue-sata2 { + label = "netxbig:blue:sata2"; + mode-addr = <5>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 7 + NETXBIG_LED_SATA 1 + NETXBIG_LED_TIMER1 3>; + bright-addr = <2>; + bright-max = <7>; + }; + red-sata2 { + label = "netxbig:red:sata2"; + mode-addr = <5>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 2 + NETXBIG_LED_TIMER1 4>; + bright-addr = <2>; + bright-max = <7>; + }; + blue-sata3 { + label = "netxbig:blue:sata3"; + mode-addr = <6>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 7 + NETXBIG_LED_SATA 1 + NETXBIG_LED_TIMER1 3>; + bright-addr = <2>; + bright-max = <7>; + }; + red-sata3 { + label = "netxbig:red:sata3"; + mode-addr = <6>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 2 + NETXBIG_LED_TIMER1 4>; + bright-addr = <2>; + bright-max = <7>; + }; + blue-sata4 { + label = "netxbig:blue:sata4"; + mode-addr = <7>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 7 + NETXBIG_LED_SATA 1 + NETXBIG_LED_TIMER1 3>; + bright-addr = <2>; + bright-max = <7>; + }; + red-sata4 { + label = "netxbig:red:sata4"; + mode-addr = <7>; + mode-val = <NETXBIG_LED_OFF 0 + NETXBIG_LED_ON 2 + NETXBIG_LED_TIMER1 4>; + bright-addr = <2>; + bright-max = <7>; + }; + }; }; &mdio {arch/arm/boot/dts/kirkwood-netxbig.dtsi +80
-0@@ -13,6 +13,7 @@ * warranty of any kind, whether express or implied. */ +#include <dt-bindings/leds/leds-netxbig.h> #include "kirkwood.dtsi" #include "kirkwood-6281.dtsi"@@ -105,6 +106,85 @@ gpio = <&gpio0 16 GPIO_ACTIVE_HIGH>; }; }; + + 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>; + }; + + netxbig-leds { + compatible = "lacie,netxbig-leds"; + + gpio-ext = <&netxbig_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>; + bright-max = <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>; + bright-max = <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>; + bright-max = <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>; + bright-max = <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>; + bright-max = <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>; + bright-max = <7>; + }; + }; }; &mdio {
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
PATCH v2 3/3 ARM: mvebu: remove static LED setup for netxbig boards
In reply to Simon GuinotSince DT support is now available for the LEDs found on the LaCie netxbig boards (Kirkwood-based), then the old-fashion netxbig board setup file is no longer needed. This patch removes this file.
--- arch/arm/mach-mvebu/Kconfig | 7 -- arch/arm/mach-mvebu/Makefile | 1 - arch/arm/mach-mvebu/board.h | 21 ----- arch/arm/mach-mvebu/kirkwood.c | 4 - arch/arm/mach-mvebu/netxbig.c | 191 ----------------------------------------- 5 files changed, 224 deletions(-) delete mode 100644 arch/arm/mach-mvebu/board.h delete mode 100644 arch/arm/mach-mvebu/netxbig.c
arch/arm/mach-mvebu/Kconfig +0 -7
@@ -102,11 +102,4 @@ config MACH_KIRKWOOD Say 'Y' here if you want your kernel to support boards based on the Marvell Kirkwood device tree. -config MACH_NETXBIG - bool "LaCie 2Big and 5Big Network v2" - depends on MACH_KIRKWOOD - help - Say 'Y' here if you want your kernel to support the - LaCie 2Big and 5Big Network v2 - endif
arch/arm/mach-mvebu/Makefile +0 -1
@@ -13,4 +13,3 @@ endif obj-$(CONFIG_MACH_DOVE) += dove.o obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o -obj-$(CONFIG_MACH_NETXBIG) += netxbig.o
arch/arm/mach-mvebu/board.h deleted +0 -21
@@ -1,21 +0,0 @@ -/* -* Board functions for Marvell System On Chip -* -* Copyright (C) 2014 -* -* Andrew Lunn <[email protected]> -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#ifndef __ARCH_MVEBU_BOARD_H -#define __ARCH_MVEBU_BOARD_H - -#ifdef CONFIG_MACH_NETXBIG -void netxbig_init (void ); -#else -static inline void netxbig_init (void ) {}; -#endif -#endif
arch/arm/mach-mvebu/kirkwood.c +0 -4
@@ -25,7 +25,6 @@#include "kirkwood.h" #include "kirkwood-pm.h" #include "common.h" -#include "board.h" static struct resource kirkwood_cpufreq_resources[] = { [0 ] = {
@@ -180,9 +179,6 @@ static void __init kirkwood_dt_init(void)kirkwood_pm_init ();kirkwood_dt_eth_fixup (); -if (of_machine_is_compatible ("lacie,netxbig" )) -netxbig_init (); -of_platform_populate (NULL , of_default_bus_match_table, auxdata,NULL ); }
arch/arm/mach-mvebu/netxbig.c deleted +0 -191
191 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH v2 3/3 ARM: mvebu: remove static LED setup for netxbig boards
Hi Simon,
Quoted 5 lines · Simon Guinot
Since DT support is now available for the LEDs found on the LaCie netxbig boards (Kirkwood-based), then the old-fashion netxbig board setup file is no longer needed. This patch removes this file.
Signed-off-by Simon Guinot <[email protected]>
Thanks,
Gregory
Quoted 282 lines
--- arch/arm/mach-mvebu/Kconfig | 7 -- arch/arm/mach-mvebu/Makefile | 1 - arch/arm/mach-mvebu/board.h | 21 ----- arch/arm/mach-mvebu/kirkwood.c | 4 - arch/arm/mach-mvebu/netxbig.c | 191 ----------------------------------------- 5 files changed, 224 deletions(-) delete mode 100644 arch/arm/mach-mvebu/board.h delete mode 100644 arch/arm/mach-mvebu/netxbig.carch/arm/mach-mvebu/Kconfig +0
-7@@ -102,11 +102,4 @@ config MACH_KIRKWOOD Say 'Y' here if you want your kernel to support boards based on the Marvell Kirkwood device tree. -config MACH_NETXBIG - bool "LaCie 2Big and 5Big Network v2" - depends on MACH_KIRKWOOD - help - Say 'Y' here if you want your kernel to support the - LaCie 2Big and 5Big Network v2 - endifarch/arm/mach-mvebu/Makefile +0
-1@@ -13,4 +13,3 @@ endif obj-$(CONFIG_MACH_DOVE) += dove.o obj-$(CONFIG_MACH_KIRKWOOD) += kirkwood.o kirkwood-pm.o -obj-$(CONFIG_MACH_NETXBIG) += netxbig.oarch/arm/mach-mvebu/board.h deleted +0
-21@@ -1,21 +0,0 @@ -/* -* Board functions for Marvell System On Chip -* -* Copyright (C) 2014 -* -* Andrew Lunn <[email protected]> -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. -*/ - -#ifndef __ARCH_MVEBU_BOARD_H -#define __ARCH_MVEBU_BOARD_H - -#ifdef CONFIG_MACH_NETXBIG -void netxbig_init (void ); -#else -static inline void netxbig_init (void ) {}; -#endif -#endif arch/arm/mach-mvebu/kirkwood.c +0
-4@@ -25,7 +25,6 @@#include "kirkwood.h" #include "kirkwood-pm.h" #include "common.h" -#include "board.h" static struct resource kirkwood_cpufreq_resources[] = { [0 ] = {@@ -180,9 +179,6 @@ static void __init kirkwood_dt_init(void)kirkwood_pm_init ();kirkwood_dt_eth_fixup (); -if (of_machine_is_compatible ("lacie,netxbig" )) -netxbig_init (); -of_platform_populate (NULL , of_default_bus_match_table, auxdata,NULL ); }arch/arm/mach-mvebu/netxbig.c deleted +0
-191@@ -1,191 +0,0 @@ -/* -* arch/arm/mach-mvbu/board-netxbig.c -* -* LaCie 2Big and 5Big Network v2 board setup -* -* Copyright (C) 2010 Simon Guinot <[email protected]> -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -*/ - -#include <linux/kernel.h> -#include <linux/of.h> -#include <linux/platform_device.h> -#include <linux/platform_data/leds-kirkwood-netxbig.h> -#include "common.h" - -/***************************************************************************** -* GPIO extension LEDs -****************************************************************************/ - -/* -* The LEDs are controlled by a CPLD and can be configured through a GPIO -* extension bus: -* -* - address register : bit [0-2] -> GPIO [47-49] -* - data register : bit [0-2] -> GPIO [44-46] -* - enable register : GPIO 29 -*/ - -static int netxbig_v2_gpio_ext_addr[] = {47 ,48 ,49 }; -static int netxbig_v2_gpio_ext_data[] = {44 ,45 ,46 }; - -static struct netxbig_gpio_ext netxbig_v2_gpio_ext = { - .addr = netxbig_v2_gpio_ext_addr, - .num_addr =ARRAY_SIZE (netxbig_v2_gpio_ext_addr), - .data = netxbig_v2_gpio_ext_data, - .num_data =ARRAY_SIZE (netxbig_v2_gpio_ext_data), - .enable =29 , -}; - -/* -* Address register selection: -* -* addr | register -* ---------------------------- -* 0 | front LED -* 1 | front LED brightness -* 2 | SATA LED brightness -* 3 | SATA0 LED -* 4 | SATA1 LED -* 5 | SATA2 LED -* 6 | SATA3 LED -* 7 | SATA4 LED -* -* Data register configuration: -* -* data | LED brightness -* ------------------------------------------------- -* 0 | min (off) -* - | - -* 7 | max -* -* data | front LED mode -* ------------------------------------------------- -* 0 | fix off -* 1 | fix blue on -* 2 | fix red on -* 3 | blink blue on=1 sec and blue off=1 sec -* 4 | blink red on=1 sec and red off=1 sec -* 5 | blink blue on=2.5 sec and red on=0.5 sec -* 6 | blink blue on=1 sec and red on=1 sec -* 7 | blink blue on=0.5 sec and blue off=2.5 sec -* -* data | SATA LED mode -* ------------------------------------------------- -* 0 | fix off -* 1 | SATA activity blink -* 2 | fix red on -* 3 | blink blue on=1 sec and blue off=1 sec -* 4 | blink red on=1 sec and red off=1 sec -* 5 | blink blue on=2.5 sec and red on=0.5 sec -* 6 | blink blue on=1 sec and red on=1 sec -* 7 | fix blue on -*/ - -static int netxbig_v2_red_mled[NETXBIG_LED_MODE_NUM ] = { - [NETXBIG_LED_OFF ] =0 , - [NETXBIG_LED_ON ] =2 , - [NETXBIG_LED_SATA ] =NETXBIG_LED_INVALID_MODE , - [NETXBIG_LED_TIMER1 ] =4 , - [NETXBIG_LED_TIMER2 ] =NETXBIG_LED_INVALID_MODE , -}; - -static int netxbig_v2_blue_pwr_mled[NETXBIG_LED_MODE_NUM ] = { - [NETXBIG_LED_OFF ] =0 , - [NETXBIG_LED_ON ] =1 , - [NETXBIG_LED_SATA ] =NETXBIG_LED_INVALID_MODE , - [NETXBIG_LED_TIMER1 ] =3 , - [NETXBIG_LED_TIMER2 ] =7 , -}; - -static int netxbig_v2_blue_sata_mled[NETXBIG_LED_MODE_NUM ] = { - [NETXBIG_LED_OFF ] =0 , - [NETXBIG_LED_ON ] =7 , - [NETXBIG_LED_SATA ] =1 , - [NETXBIG_LED_TIMER1 ] =3 , - [NETXBIG_LED_TIMER2 ] =NETXBIG_LED_INVALID_MODE , -}; - -static struct netxbig_led_timer netxbig_v2_led_timer[] = { - [0 ] = { - .delay_on =500 , - .delay_off =500 , - .mode =NETXBIG_LED_TIMER1 , - }, - [1 ] = { - .delay_on =500 , - .delay_off =1000 , - .mode =NETXBIG_LED_TIMER2 , - }, -}; - -#define NETXBIG_LED (_name, maddr, mval, baddr) \ - { .name = _name, \ - .mode_addr = maddr, \ - .mode_val = mval, \ - .bright_addr = baddr } - -static struct netxbig_led net2big_v2_leds_ctrl[] = { -NETXBIG_LED ("net2big-v2:blue:power" ,0 , netxbig_v2_blue_pwr_mled,1 ), -NETXBIG_LED ("net2big-v2:red:power" ,0 , netxbig_v2_red_mled,1 ), -NETXBIG_LED ("net2big-v2:blue:sata0" ,3 , netxbig_v2_blue_sata_mled,2 ), -NETXBIG_LED ("net2big-v2:red:sata0" ,3 , netxbig_v2_red_mled,2 ), -NETXBIG_LED ("net2big-v2:blue:sata1" ,4 , netxbig_v2_blue_sata_mled,2 ), -NETXBIG_LED ("net2big-v2:red:sata1" ,4 , netxbig_v2_red_mled,2 ), -}; - -static struct netxbig_led_platform_data net2big_v2_leds_data = { - .gpio_ext = &netxbig_v2_gpio_ext, - .timer = netxbig_v2_led_timer, - .num_timer =ARRAY_SIZE (netxbig_v2_led_timer), - .leds = net2big_v2_leds_ctrl, - .num_leds =ARRAY_SIZE (net2big_v2_leds_ctrl), -}; - -static struct netxbig_led net5big_v2_leds_ctrl[] = { -NETXBIG_LED ("net5big-v2:blue:power" ,0 , netxbig_v2_blue_pwr_mled,1 ), -NETXBIG_LED ("net5big-v2:red:power" ,0 , netxbig_v2_red_mled,1 ), -NETXBIG_LED ("net5big-v2:blue:sata0" ,3 , netxbig_v2_blue_sata_mled,2 ), -NETXBIG_LED ("net5big-v2:red:sata0" ,3 , netxbig_v2_red_mled,2 ), -NETXBIG_LED ("net5big-v2:blue:sata1" ,4 , netxbig_v2_blue_sata_mled,2 ), -NETXBIG_LED ("net5big-v2:red:sata1" ,4 , netxbig_v2_red_mled,2 ), -NETXBIG_LED ("net5big-v2:blue:sata2" ,5 , netxbig_v2_blue_sata_mled,2 ), -NETXBIG_LED ("net5big-v2:red:sata2" ,5 , netxbig_v2_red_mled,2 ), -NETXBIG_LED ("net5big-v2:blue:sata3" ,6 , netxbig_v2_blue_sata_mled,2 ), -NETXBIG_LED ("net5big-v2:red:sata3" ,6 , netxbig_v2_red_mled,2 ), -NETXBIG_LED ("net5big-v2:blue:sata4" ,7 , netxbig_v2_blue_sata_mled,2 ), -NETXBIG_LED ("net5big-v2:red:sata4" ,7 , netxbig_v2_red_mled,2 ), -}; - -static struct netxbig_led_platform_data net5big_v2_leds_data = { - .gpio_ext = &netxbig_v2_gpio_ext, - .timer = netxbig_v2_led_timer, - .num_timer =ARRAY_SIZE (netxbig_v2_led_timer), - .leds = net5big_v2_leds_ctrl, - .num_leds =ARRAY_SIZE (net5big_v2_leds_ctrl), -}; - -static struct platform_device netxbig_v2_leds = { - .name ="leds-netxbig" , - .id =-1 , - .dev = { - .platform_data = &net2big_v2_leds_data, - }, -}; - -void __init netxbig_init (void ) -{ - -if (of_machine_is_compatible ("lacie,net5big_v2" )) - netxbig_v2_leds.dev.platform_data = &net5big_v2_leds_data; -platform_device_register (&netxbig_v2_leds); -}
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
v2 cover Add DT support for netxbig LEDs
In reply to Simon GuinotHi Simon, Bryan, Richard,
Quoted 4 lines · Simon Guinot
Hello,
This patch series adds DT support for the LEDs found on the Kirkwood-based LaCie boards 2Big and 5Big Network v2.
I saw that some led related patch on kirkwood based board have been merged. What is the status of this series?
I still have the patch 2 and 3 in my inbox waiting for being applied.
Thanks,
Gregory
Quoted 35 lines
Changes since v1:
- Check timer mode value retrieved from DT.
- Innetxbig_leds_get_of_pdata, don't use unsigned long variables to get timer delay values from DT with functionof_property_read_u32_index. Instead, use a temporary u32 variable. This allows to silence a static checker warning.
- Make timer property optional in the binding documentation. It is now aligned with the driver code.Simon
Simon Guinot (3):
leds: netxbig: add device tree binding
ARM: Kirkwood: add LED DT entries for netxbig boards
ARM: mvebu: remove static LED setup for netxbig boards.../devicetree/bindings/gpio/netxbig-gpio-ext.txt | 22 ++ .../devicetree/bindings/leds/leds-netxbig.txt | 92 ++++++++ arch/arm/boot/dts/kirkwood-net5big.dts | 60 +++++ arch/arm/boot/dts/kirkwood-netxbig.dtsi | 80 +++++++ arch/arm/mach-mvebu/Kconfig | 7 - arch/arm/mach-mvebu/Makefile | 1 - arch/arm/mach-mvebu/board.h | 21 -- arch/arm/mach-mvebu/kirkwood.c | 4 - arch/arm/mach-mvebu/netxbig.c | 191 ---------------- drivers/leds/leds-netxbig.c | 250 +++++++++++++++++++-- include/dt-bindings/leds/leds-netxbig.h | 18 ++ 11 files changed, 501 insertions(+), 245 deletions(-) create mode 100644 Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt create mode 100644 Documentation/devicetree/bindings/leds/leds-netxbig.txt delete mode 100644 arch/arm/mach-mvebu/board.h delete mode 100644 arch/arm/mach-mvebu/netxbig.c create mode 100644 include/dt-bindings/leds/leds-netxbig.h
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com
v2 cover Add DT support for netxbig LEDs
Hi Gregory,
Quoted 10 lines · Gregory CLEMENT
Hi Simon, Bryan, Richard,
Quoted 4 lines · Simon Guinot
Hello,
This patch series adds DT support for the LEDs found on the Kirkwood-based LaCie boards 2Big and 5Big Network v2.
I saw that some led related patch on kirkwood based board have been merged. What is the status of this series?
LED subsystem part has been merged to linux-next, since DTS files are not required for the compilation to succeed. We've been waiting for ARM/Marvell Kirkwood maintainer opinion to decide on how to proceed regarding patch 2/4.
Quoted 1 line
I still have the patch 2 and 3 in my inbox waiting for being applied.
Patch 3 affects only drivers/leds/leds-ns2.c, you were probably thinking of patch 1 which modifies the out of LED tree file include/linux/platform_data/leds-kirkwood-ns2.h.
IMO it would be best if the whole series went through the LED tree.
Quoted 42 lines
Thanks,
Gregory
Quoted 35 lines
Changes since v1:
- Check timer mode value retrieved from DT.
- Innetxbig_leds_get_of_pdata, don't use unsigned long variables to get timer delay values from DT with functionof_property_read_u32_index. Instead, use a temporary u32 variable. This allows to silence a static checker warning.
- Make timer property optional in the binding documentation. It is now aligned with the driver code.Simon
Simon Guinot (3):
leds: netxbig: add device tree binding
ARM: Kirkwood: add LED DT entries for netxbig boards
ARM: mvebu: remove static LED setup for netxbig boards.../devicetree/bindings/gpio/netxbig-gpio-ext.txt | 22 ++ .../devicetree/bindings/leds/leds-netxbig.txt | 92 ++++++++ arch/arm/boot/dts/kirkwood-net5big.dts | 60 +++++ arch/arm/boot/dts/kirkwood-netxbig.dtsi | 80 +++++++ arch/arm/mach-mvebu/Kconfig | 7 - arch/arm/mach-mvebu/Makefile | 1 - arch/arm/mach-mvebu/board.h | 21 -- arch/arm/mach-mvebu/kirkwood.c | 4 - arch/arm/mach-mvebu/netxbig.c | 191 ---------------- drivers/leds/leds-netxbig.c | 250 +++++++++++++++++++-- include/dt-bindings/leds/leds-netxbig.h | 18 ++ 11 files changed, 501 insertions(+), 245 deletions(-)create mode 100644
Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txtcreate mode 100644Documentation/devicetree/bindings/leds/leds-netxbig.txtdelete mode 100644arch/arm/mach-mvebu/board.h
delete mode 100644arch/arm/mach-mvebu/netxbig.c
create mode 100644include/dt-bindings/leds/leds-netxbig.h
Signature · 2 lines
Best Regards, Jacek Anaszewski
v2 cover Add DT support for netxbig LEDs
I confused two patch sets. Everything I wrote in the reply below was related to leds-ns2 [1] patch set.
When it is related to leds-netxbig driver - there was already version 3 posted [2], but it is not the final one, we are waiting for the update.
Quoted 21 lines · Jacek Anaszewski
Hi Gregory,
Quoted 5 lines · Gregory CLEMENT
Hi Simon, Bryan, Richard,
Quoted 2 lines · Simon Guinot
Hello,
Quoted 7 lines
Quoted 3 lines
This patch series adds DT support for the LEDs found on the Kirkwood-based
LaCie boards 2Big and 5Big Network v2.I saw that some led related patch on kirkwood based board have been merged.
What is the status of this series?LED subsystem part has been merged to linux-next, since DTS files are not required for the compilation to succeed. We've been waiting for ARM/Marvell Kirkwood maintainer opinion to decide on how to proceed regarding patch 2/4.
Quoted 57 lines
Quoted 1 line
I still have the patch 2 and 3 in my inbox waiting for being applied.
Patch 3 affects only
drivers/leds/leds-ns2.c, you were probably thinking of patch 1 which modifies the out of LED tree fileinclude/linux/platform_data/leds-kirkwood-ns2.h.IMO it would be best if the whole series went through the LED tree.
Quoted 47 lines
Thanks,
Gregory
Quoted 40 lines
Changes since v1:
- Check timer mode value retrieved from DT.
- Innetxbig_leds_get_of_pdata, don't use unsigned long variables to get timer delay values from DT with functionof_property_read_u32_index. Instead, use a temporary u32 variable. This allows to silence a
static
checker warning.
- Make timer property optional in the binding documentation. It is now aligned with the driver code.Simon
Simon Guinot (3):
leds: netxbig: add device tree binding
ARM: Kirkwood: add LED DT entries for netxbig boards
ARM: mvebu: remove static LED setup for netxbig boards.../devicetree/bindings/gpio/netxbig-gpio-ext.txt | 22 ++ .../devicetree/bindings/leds/leds-netxbig.txt | 92 ++++++++ arch/arm/boot/dts/kirkwood-net5big.dts | 60 +++++ arch/arm/boot/dts/kirkwood-netxbig.dtsi | 80 +++++++ arch/arm/mach-mvebu/Kconfig | 7 - arch/arm/mach-mvebu/Makefile | 1 - arch/arm/mach-mvebu/board.h | 21 -- arch/arm/mach-mvebu/kirkwood.c | 4 - arch/arm/mach-mvebu/netxbig.c | 191 ---------------- drivers/leds/leds-netxbig.c | 250 +++++++++++++++++++-- include/dt-bindings/leds/leds-netxbig.h | 18 ++ 11 files changed, 501 insertions(+), 245 deletions(-)create mode 100644
Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt
create mode 100644Documentation/devicetree/bindings/leds/leds-netxbig.txt
delete mode 100644arch/arm/mach-mvebu/board.hdelete mode 100644arch/arm/mach-mvebu/netxbig.ccreate mode 100644include/dt-bindings/leds/leds-netxbig.h
[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/353807.html
[2]
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/351486.html
Signature · 2 lines
Best Regards, Jacek Anaszewski
v2 cover Add DT support for netxbig LEDs
Hi Jacek, Simon,
Quoted 2 lines · Jacek Anaszewski
I confused two patch sets. Everything I wrote in the reply below was related to leds-ns2 [1] patch set.
About taking the dts part of this patch set in the led branch, I agree. It will solve the dependency problem I would have. Usually we (the mvebu maintainer) take all the dts related to void the merge conflict.
For these ones, I don't expect any merge problem because they are all located in dts and only in one family.
So you can also take "[PATCH v2 2/4] ARM: Kirkwood: add modes-map property to ns2-leds nodes" with my
and I will remove this one from my branches.
Thanks,
Gregory
Quoted 3 lines
When it is related to leds-netxbig driver - there was already version 3 posted [2], but it is not the final one, we are waiting for the update.
Right, I missed this third version.
Quoted 86 lines · Jacek Anaszewski
Quoted 21 lines
Hi Gregory,
Quoted 5 lines · Gregory CLEMENT
Hi Simon, Bryan, Richard,
Quoted 2 lines · Simon Guinot
Hello,
Quoted 7 lines
Quoted 3 lines
This patch series adds DT support for the LEDs found on the Kirkwood-based
LaCie boards 2Big and 5Big Network v2.I saw that some led related patch on kirkwood based board have been merged.
What is the status of this series?LED subsystem part has been merged to linux-next, since DTS files are not required for the compilation to succeed. We've been waiting for ARM/Marvell Kirkwood maintainer opinion to decide on how to proceed regarding patch 2/4.
Quoted 57 lines
Quoted 1 line
I still have the patch 2 and 3 in my inbox waiting for being applied.
Patch 3 affects only
drivers/leds/leds-ns2.c, you were probably thinking of patch 1 which modifies the out of LED tree fileinclude/linux/platform_data/leds-kirkwood-ns2.h.IMO it would be best if the whole series went through the LED tree.
Quoted 47 lines
Thanks,
Gregory
Quoted 40 lines
Changes since v1:
- Check timer mode value retrieved from DT.
- Innetxbig_leds_get_of_pdata, don't use unsigned long variables to get timer delay values from DT with functionof_property_read_u32_index. Instead, use a temporary u32 variable. This allows to silence a
static
checker warning.
- Make timer property optional in the binding documentation. It is now aligned with the driver code.Simon
Simon Guinot (3):
leds: netxbig: add device tree binding
ARM: Kirkwood: add LED DT entries for netxbig boards
ARM: mvebu: remove static LED setup for netxbig boards.../devicetree/bindings/gpio/netxbig-gpio-ext.txt | 22 ++ .../devicetree/bindings/leds/leds-netxbig.txt | 92 ++++++++ arch/arm/boot/dts/kirkwood-net5big.dts | 60 +++++ arch/arm/boot/dts/kirkwood-netxbig.dtsi | 80 +++++++ arch/arm/mach-mvebu/Kconfig | 7 - arch/arm/mach-mvebu/Makefile | 1 - arch/arm/mach-mvebu/board.h | 21 -- arch/arm/mach-mvebu/kirkwood.c | 4 - arch/arm/mach-mvebu/netxbig.c | 191 ---------------- drivers/leds/leds-netxbig.c | 250 +++++++++++++++++++-- include/dt-bindings/leds/leds-netxbig.h | 18 ++ 11 files changed, 501 insertions(+), 245 deletions(-)create mode 100644
Documentation/devicetree/bindings/gpio/netxbig-gpio-ext.txt
create mode 100644Documentation/devicetree/bindings/leds/leds-netxbig.txt
delete mode 100644arch/arm/mach-mvebu/board.hdelete mode 100644arch/arm/mach-mvebu/netxbig.ccreate mode 100644include/dt-bindings/leds/leds-netxbig.h[1]
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-July/353807.html
[2]
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-June/351486.html
Signature · 4 lines
Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com