1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2012 Michael Walle
4 * Michael Walle <michael@walle.cc>
10 #define GPIO_HDD_POWER 10
11 #define GPIO_USB_VBUS 11
12 #define GPIO_FAN_HIGH 18
13 #define GPIO_FAN_LOW 19
14 #define GPIO_FUNC_LED 36
15 #define GPIO_ALARM_LED 37
16 #define GPIO_INFO_LED 38
17 #define GPIO_POWER_LED 39
18 #define GPIO_FAN_LOCK 40
19 #define GPIO_FUNC_BUTTON 41
20 #define GPIO_POWER_SWITCH 42
21 #define GPIO_POWER_AUTO_SWITCH 43
22 #define GPIO_FUNC_RED_LED 48
24 #define _BIT(x) (1<<(x))
26 #define LSXL_OE_LOW (~(_BIT(GPIO_HDD_POWER) \
27 | _BIT(GPIO_USB_VBUS) \
28 | _BIT(GPIO_FAN_HIGH) \
29 | _BIT(GPIO_FAN_LOW)))
31 #define LSXL_OE_HIGH (~(_BIT(GPIO_FUNC_LED - 32) \
32 | _BIT(GPIO_ALARM_LED - 32) \
33 | _BIT(GPIO_INFO_LED - 32) \
34 | _BIT(GPIO_POWER_LED - 32) \
35 | _BIT(GPIO_FUNC_RED_LED - 32)))
37 #define LSXL_OE_VAL_LOW (_BIT(GPIO_HDD_POWER) \
38 | _BIT(GPIO_USB_VBUS))
40 #define LSXL_OE_VAL_HIGH (_BIT(GPIO_FUNC_LED - 32) \
41 | _BIT(GPIO_ALARM_LED - 32) \
42 | _BIT(GPIO_INFO_LED - 32) \
43 | _BIT(GPIO_POWER_LED - 32) \
44 | _BIT(GPIO_FUNC_RED_LED - 32))
46 #define LSXL_POL_VAL_LOW (_BIT(GPIO_FAN_HIGH) \
49 #define LSXL_POL_VAL_HIGH (_BIT(GPIO_FUNC_LED - 32) \
50 | _BIT(GPIO_ALARM_LED - 32) \
51 | _BIT(GPIO_INFO_LED - 32) \
52 | _BIT(GPIO_POWER_LED - 32) \
53 | _BIT(GPIO_FUNC_BUTTON - 32) \
54 | _BIT(GPIO_POWER_SWITCH - 32) \
55 | _BIT(GPIO_POWER_AUTO_SWITCH - 32) \
56 | _BIT(GPIO_FUNC_RED_LED - 32))