xref: /netbsd/sys/arch/hpcarm/dev/wzero3_reg.h (revision 0a5ccc74)
1 /*	$NetBSD: wzero3_reg.h,v 1.7 2012/01/21 19:44:29 nonaka Exp $	*/
2 
3 /*-
4  * Copyright (C) 2008, 2009, 2010 NONAKA Kimihiro <nonaka@netbsd.org>
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  */
27 
28 #ifndef	_HPCARM_DEV_WZERO3_REG_H_
29 #define	_HPCARM_DEV_WZERO3_REG_H_
30 
31 /* GPIO --------------------------------------------------------------------- */
32 
33 /*
34  * WS003SH/WS004SH specific parameter
35  */
36 #define	GPIO_WS003SH_SD_DETECT		9	/* In */
37 #define	GPIO_WS003SH_TOUCH_PANEL	11	/* In */
38 #define	GPIO_WS003SH_SLIDE		12	/* In */
39 #define	GPIO_WS003SH_FULLKEY_LED	17	/* Out: H:ON, L:OFF */
40 #define	GPIO_WS003SH_ANTENNA_LED	37	/* Out: H:ON, L:OFF */
41 #define	GPIO_WS003SH_MAX1233_CS		48	/* Out */
42 #define	GPIO_WS003SH_RESET		89	/* Out */
43 #define	GPIO_WS003SH_POWER_BUTTON	95	/* In */
44 #define	GPIO_WS003SH_VIB		97	/* Out */
45 #define	GPIO_WS003SH_USB_CLIENT_DETECT	103	/* In */
46 #define	GPIO_WS003SH_SD_POWER		107	/* Out: H:ON, L:OFF */
47 #define	GPIO_WS003SH_CHARGE		114	/* Out: H:ON, L:OFF */
48 #define	GPIO_WS003SH_AC_DETECT		115	/* In */
49 
50 /* WS003SH: GPIO OUT pin
51  * CLR: 10,16,18,19,20,21,23,33,40,56,87,90,91,104,119,120
52  * SET: 39,54,57
53  */
54 
55 /*
56  * WS007SH specific parameter
57  */
58 #define	GPIO_WS007SH_RESET_BUTTON	1	/* In: L: press, H: release */
59 #define	GPIO_WS007SH_POWER_BUTTON	9	/* In */
60 #define	GPIO_WS007SH_TOUCH_PANEL	21	/* In */
61 #define	GPIO_WS007SH_ADS7846_CS		33	/* Out */
62 #define	GPIO_WS007SH_USB_CLIENT_DETECT	35	/* In */
63 #define	GPIO_WS007SH_USB_HOST_POWER	37	/* Out */
64 #define	GPIO_WS007SH_USB_HOST_DETECT	41	/* In */
65 #define	GPIO_WS007SH_SD_DETECT		48	/* In */
66 #define	GPIO_WS007SH_HSYNC		75	/* In */
67 #define	GPIO_WS007SH_SLIDE		104	/* In */
68 #define	GPIO_WS007SH_SD_POWER		107	/* Out: H:ON, L:OFF */
69 
70 /*
71  * WS011SH specific parameter
72  */
73 /*
74 port	I/O(Active)	name 	desc
75 1	I(?)		RESET_BTN button detect: reset (on: release, off:press)
76 9	I(?)		PWR_BTN button detect: power-on (on: press, off:release)
77 21	I(?)		TPANEL touch panel (on: release, off: press)
78 37	O		USBH_PWR USB Host power (H: enable, L: disable)
79 41	I(L)		USBH_DET USB Host cable detect (on: remove, off: insert)
80 48	I(L)		SD_DET microSD card detect (on: remove, off: insert)
81 51	I(?)		SLIDE LCD slider (on: open, off: close)
82 52	I(?)		KEYLOCK key lock slider (on: unlock, off:lock)
83 57	I(?)		EXCRWAL_DET
84 81	I(L)		EPDET earphone adapter detect (on: remove, off: insert)
85 91	I(?)		FULLKEYBOARD?
86 96	I(?)		JACKET_DET jacket detect (on: close, off: open)
87 ?105	I(?)		WSIM_DET W-SIM detect (on: insert, off: remove)
88 ?106	I(?)		WSIM? (same as GPIO#105?)
89 107	O(?)		SD_PWR: SD Card power (on: on, off: off)
90 115	I(H)		ACDET AC adapter detect (on: insert, off: remove)
91 116	I(?)		USBC_DET USB Client cable detect (on: insert, off: remove)
92  */
93 #define	GPIO_WS011SH_RESET_BUTTON	1	/* In */
94 #define	GPIO_WS011SH_POWER_BUTTON	9	/* In */
95 #define	GPIO_WS011SH_KEYPAD		14	/* In */
96 #define	GPIO_WS011SH_TOUCH_PANEL	21	/* In */
97 #define	GPIO_WS011SH_AK4184_CS		33	/* Out */
98 #define	GPIO_WS011SH_USB_HOST_POWER	37	/* Out */
99 #define	GPIO_WS011SH_USB_HOST_DETECT	41	/* In */
100 #define	GPIO_WS011SH_SD_DETECT		48	/* In */
101 #define	GPIO_WS011SH_SLIDE		51	/* In */
102 #define	GPIO_WS011SH_KEY_LOCK		52	/* In */
103 #define	GPIO_WS011SH_HSYNC		75	/* In */
104 #define	GPIO_WS011SH_SD_POWER		107	/* Out */
105 #define	GPIO_WS011SH_USB_CLIENT_DETECT	116	/* In */
106 
107 /*
108  * WS020SH specific parameter
109  */
110 #define	GPIO_WS020SH_RESET_BUTTON	1	/* In */
111 #define	GPIO_WS020SH_TOUCH_PANEL	21	/* In */
112 #define	GPIO_WS020SH_USB_HOST_DETECT	41	/* In */
113 #define	GPIO_WS020SH_SD_DETECT		48	/* In */
114 #define	GPIO_WS020SH_SLIDE		51	/* In */
115 #define	GPIO_WS020SH_KEY_LOCK		52	/* In */
116 #define	GPIO_WS020SH_POWER_BUTTON	55	/* In */
117 #define	GPIO_WS020SH_SD_POWER		107	/* Out */
118 #define	GPIO_WS020SH_USB_CLIENT_DETECT	116	/* In */
119 
120 #endif	/* _HPCARM_DEV_WZERO3_REG_H_ */
121