xref: /freebsd/sys/arm/ti/omap4/omap4_scm_padconf.h (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1 /*-
2  * Copyright (c) 2011
3  *	Ben Gray <ben.r.gray@gmail.com>.
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms, with or without
7  * modification, are permitted provided that the following conditions
8  * are met:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  * 3. The name of the company nor the name of the author may be used to
15  *    endorse or promote products derived from this software without specific
16  *    prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY BEN GRAY ``AS IS'' AND ANY EXPRESS OR
19  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21  * IN NO EVENT SHALL BEN GRAY BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
24  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
25  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
26  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
27  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 
30 #ifndef OMAP4_SCM_PADCONF_H
31 #define	OMAP4_SCM_PADCONF_H
32 
33 #define CONTROL_PADCONF_WAKEUP_EVENT     (1UL << 15)
34 #define CONTROL_PADCONF_WAKEUP_ENABLE    (1UL << 14)
35 #define CONTROL_PADCONF_OFF_PULL_UP      (1UL << 13)
36 #define CONTROL_PADCONF_OFF_PULL_ENABLE  (1UL << 12)
37 #define CONTROL_PADCONF_OFF_OUT_HIGH     (1UL << 11)
38 #define CONTROL_PADCONF_OFF_OUT_ENABLE   (1UL << 10)
39 #define CONTROL_PADCONF_OFF_ENABLE       (1UL << 9)
40 #define CONTROL_PADCONF_INPUT_ENABLE     (1UL << 8)
41 #define CONTROL_PADCONF_PULL_UP          (1UL << 4)
42 #define CONTROL_PADCONF_PULL_ENABLE      (1UL << 3)
43 #define CONTROL_PADCONF_MUXMODE_MASK     (0x7)
44 
45 #define CONTROL_PADCONF_SATE_MASK        ( CONTROL_PADCONF_WAKEUP_EVENT \
46                                          | CONTROL_PADCONF_WAKEUP_ENABLE \
47                                          | CONTROL_PADCONF_OFF_PULL_UP \
48                                          | CONTROL_PADCONF_OFF_PULL_ENABLE \
49                                          | CONTROL_PADCONF_OFF_OUT_HIGH \
50                                          | CONTROL_PADCONF_OFF_OUT_ENABLE \
51                                          | CONTROL_PADCONF_OFF_ENABLE \
52                                          | CONTROL_PADCONF_INPUT_ENABLE \
53                                          | CONTROL_PADCONF_PULL_UP \
54                                          | CONTROL_PADCONF_PULL_ENABLE )
55 
56 /* Active pin states */
57 #define PADCONF_PIN_OUTPUT              0
58 #define PADCONF_PIN_INPUT               CONTROL_PADCONF_INPUT_ENABLE
59 #define PADCONF_PIN_INPUT_PULLUP        ( CONTROL_PADCONF_INPUT_ENABLE \
60                                         | CONTROL_PADCONF_PULL_ENABLE \
61                                         | CONTROL_PADCONF_PULL_UP)
62 #define PADCONF_PIN_INPUT_PULLDOWN      ( CONTROL_PADCONF_INPUT_ENABLE \
63                                         | CONTROL_PADCONF_PULL_ENABLE )
64 
65 /* Off mode states */
66 #define PADCONF_PIN_OFF_NONE            0
67 #define PADCONF_PIN_OFF_OUTPUT_HIGH	    ( CONTROL_PADCONF_OFF_ENABLE \
68                                         | CONTROL_PADCONF_OFF_OUT_ENABLE \
69                                         | CONTROL_PADCONF_OFF_OUT_HIGH)
70 #define PADCONF_PIN_OFF_OUTPUT_LOW      ( CONTROL_PADCONF_OFF_ENABLE \
71                                         | CONTROL_PADCONF_OFF_OUT_ENABLE)
72 #define PADCONF_PIN_OFF_INPUT_PULLUP    ( CONTROL_PADCONF_OFF_ENABLE \
73                                         | CONTROL_PADCONF_OFF_PULL_ENABLE \
74                                         | CONTROL_PADCONF_OFF_PULL_UP)
75 #define PADCONF_PIN_OFF_INPUT_PULLDOWN  ( CONTROL_PADCONF_OFF_ENABLE \
76                                         | CONTROL_PADCONF_OFF_PULL_ENABLE)
77 #define PADCONF_PIN_OFF_WAKEUPENABLE	CONTROL_PADCONF_WAKEUP_ENABLE
78 
79 extern const struct ti_pinmux_device omap4_pinmux_dev;
80 
81 #endif /* OMAP4_SCM_PADCONF_H */
82