Skip to content

Commit 789e527

Browse files
committed
parisc: led: Rewrite LED/LCD driver to utilizize Linux LED subsystem
Rewrite the whole driver and drop the own code to calculate load average, disk and LAN load. Switch instead to use the in-kernel LED subsystem, which gives us quite some advantages, e.g. - existing triggers for heartbeat and disk/lan activity can be used - users can configre the LEDs at will to any existing trigger via /sys/class/leds - less overhead since we don't need to run own timers - fully integrated in Linux and as such cleaner code. Note that the driver now depends on CONFIG_LEDS_CLASS which has to be built-in and not as module. Signed-off-by: Helge Deller <[email protected]>
1 parent 4db8952 commit 789e527

File tree

4 files changed

+343
-577
lines changed

4 files changed

+343
-577
lines changed

arch/parisc/include/asm/led.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@
2525
#define LED_CMD_REG_NONE 0 /* NULL == no addr for the cmd register */
2626

2727
/* register_led_driver() */
28-
int __init register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg);
28+
int register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg);
2929

3030
#ifdef CONFIG_CHASSIS_LCD_LED
3131
/* writes a string to the LCD display (if possible on this h/w) */
32-
int lcd_print(const char *str);
32+
void lcd_print(const char *str);
3333
#else
34-
#define lcd_print(str)
34+
#define lcd_print(str) do { } while (0)
3535
#endif
3636

37-
/* main LED initialization function (uses PDC) */
38-
int __init led_init(void);
39-
4037
#endif /* LED_H */

arch/parisc/kernel/setup.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,6 @@ void __init setup_arch(char **cmdline_p)
143143
parisc_cache_init();
144144
paging_init();
145145

146-
#ifdef CONFIG_CHASSIS_LCD_LED
147-
/* initialize the LCD/LED after boot_cpu_data is available ! */
148-
led_init(); /* LCD/LED initialization */
149-
#endif
150-
151146
#ifdef CONFIG_PA11
152147
dma_ops_init();
153148
#endif

drivers/parisc/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,9 @@ config SUPERIO
100100

101101
config CHASSIS_LCD_LED
102102
bool "Chassis LCD and LED support"
103+
depends on LEDS_CLASS=y
103104
default y
104-
select VM_EVENT_COUNTERS
105+
select LEDS_TRIGGERS
105106
help
106107
Say Y here if you want to enable support for the Heartbeat,
107108
Disk/Network activities LEDs on some PA-RISC machines,

0 commit comments

Comments
 (0)