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