Skip to content

Commit c789649

Browse files
linuswpavelmachek
authored andcommitted
leds: ns2: Absorb platform data
Nothing in the kernel includes the external header <linux/platform_data/leds-kirkwood-ns2.h> so just push the contents into the ns2 leds driver. If someone wants to use platform data or board files to describe this device they should be able to do so using GPIO machine descriptors but in any case device tree should be the way forward for these systems in all cases I can think of, and the driver already supports that. Cc: Simon Guinot <[email protected]> Cc: Vincent Donnefort <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Tested-by: Simon Guinot <[email protected]> Signed-off-by: Pavel Machek <[email protected]>
1 parent 11a48a5 commit c789649

File tree

2 files changed

+27
-41
lines changed

2 files changed

+27
-41
lines changed

drivers/leds/leds-ns2.c

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,38 @@
1212
#include <linux/kernel.h>
1313
#include <linux/platform_device.h>
1414
#include <linux/slab.h>
15-
#include <linux/gpio.h>
15+
#include <linux/gpio/consumer.h>
1616
#include <linux/leds.h>
1717
#include <linux/module.h>
18-
#include <linux/platform_data/leds-kirkwood-ns2.h>
1918
#include <linux/of.h>
20-
#include <linux/of_gpio.h>
2119
#include "leds.h"
2220

21+
enum ns2_led_modes {
22+
NS_V2_LED_OFF,
23+
NS_V2_LED_ON,
24+
NS_V2_LED_SATA,
25+
};
26+
27+
struct ns2_led_modval {
28+
enum ns2_led_modes mode;
29+
int cmd_level;
30+
int slow_level;
31+
};
32+
33+
struct ns2_led {
34+
const char *name;
35+
const char *default_trigger;
36+
unsigned cmd;
37+
unsigned slow;
38+
int num_modes;
39+
struct ns2_led_modval *modval;
40+
};
41+
42+
struct ns2_led_platform_data {
43+
int num_leds;
44+
struct ns2_led *leds;
45+
};
46+
2347
/*
2448
* The Network Space v2 dual-GPIO LED is wired to a CPLD. Three different LED
2549
* modes are available: off, on and SATA activity blinking. The LED modes are

include/linux/platform_data/leds-kirkwood-ns2.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)