xref: /openbmc/u-boot/board/buffalo/lsxl/lsxl.h (revision 2f3f477b)
1 /*
2  * Copyright (c) 2012 Michael Walle
3  * Michael Walle <michael@walle.cc>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #ifndef __LSXL_H
9 #define __LSXL_H
10 
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
24 
25 #define _BIT(x) (1<<(x))
26 
27 #define LSXL_OE_LOW (~(_BIT(GPIO_HDD_POWER)		    \
28 			| _BIT(GPIO_USB_VBUS)		    \
29 			| _BIT(GPIO_FAN_HIGH)		    \
30 			| _BIT(GPIO_FAN_LOW)))
31 
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)))
37 
38 #define LSXL_OE_VAL_LOW (_BIT(GPIO_HDD_POWER)		    \
39 			| _BIT(GPIO_USB_VBUS))
40 
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))
46 
47 #define LSXL_POL_VAL_LOW (_BIT(GPIO_FAN_HIGH)		    \
48 			| _BIT(GPIO_FAN_LOW))
49 
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))
58 
59 #endif /* __LSXL_H */
60