18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef LED_H
38c2ecf20Sopenharmony_ci#define LED_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#define	LED7		0x80		/* top (or furthest right) LED */
68c2ecf20Sopenharmony_ci#define	LED6		0x40
78c2ecf20Sopenharmony_ci#define	LED5		0x20
88c2ecf20Sopenharmony_ci#define	LED4		0x10
98c2ecf20Sopenharmony_ci#define	LED3		0x08
108c2ecf20Sopenharmony_ci#define	LED2		0x04
118c2ecf20Sopenharmony_ci#define	LED1		0x02
128c2ecf20Sopenharmony_ci#define	LED0		0x01		/* bottom (or furthest left) LED */
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define	LED_LAN_RCV	LED0		/* for LAN receive activity */
158c2ecf20Sopenharmony_ci#define	LED_LAN_TX	LED1		/* for LAN transmit activity */
168c2ecf20Sopenharmony_ci#define	LED_DISK_IO	LED2		/* for disk activity */
178c2ecf20Sopenharmony_ci#define	LED_HEARTBEAT	LED3		/* heartbeat */
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/* values for pdc_chassis_lcd_info_ret_block.model: */
208c2ecf20Sopenharmony_ci#define DISPLAY_MODEL_LCD  0		/* KittyHawk LED or LCD */
218c2ecf20Sopenharmony_ci#define DISPLAY_MODEL_NONE 1		/* no LED or LCD */
228c2ecf20Sopenharmony_ci#define DISPLAY_MODEL_LASI 2		/* LASI style 8 bit LED */
238c2ecf20Sopenharmony_ci#define DISPLAY_MODEL_OLD_ASP 0x7F	/* faked: ASP style 8 x 1 bit LED (only very old ASP versions) */
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci#define LED_CMD_REG_NONE 0		/* NULL == no addr for the cmd register */
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci/* register_led_driver() */
288c2ecf20Sopenharmony_ciint __init register_led_driver(int model, unsigned long cmd_reg, unsigned long data_reg);
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/* registers the LED regions for procfs */
318c2ecf20Sopenharmony_civoid __init register_led_regions(void);
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#ifdef CONFIG_CHASSIS_LCD_LED
348c2ecf20Sopenharmony_ci/* writes a string to the LCD display (if possible on this h/w) */
358c2ecf20Sopenharmony_ciint lcd_print(const char *str);
368c2ecf20Sopenharmony_ci#else
378c2ecf20Sopenharmony_ci#define lcd_print(str)
388c2ecf20Sopenharmony_ci#endif
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci/* main LED initialization function (uses PDC) */
418c2ecf20Sopenharmony_ciint __init led_init(void);
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci#endif /* LED_H */
44