ARM: tegra: pcie: Remove dock detect variable
[linux-3.10.git] / arch / arm / mach-tegra / wakeups-t3.c
1 /*
2  * Copyright (c) 2011-2013, NVIDIA CORPORATION.  All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify it
5  * under the terms and conditions of the GNU General Public License,
6  * version 2, as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
11  * more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15  */
16
17 #include <linux/kernel.h>
18 #include <linux/gpio.h>
19 #include <linux/init.h>
20 #include <linux/io.h>
21 #include <linux/irqchip/tegra.h>
22
23 #include <mach/irqs.h>
24 #include <mach/gpio-tegra.h>
25
26 #include "gpio-names.h"
27 #include "iomap.h"
28
29 static int tegra_gpio_wakes[] = {
30         TEGRA_GPIO_PO5,                         /* wake0 */
31         TEGRA_GPIO_PV1,                         /* wake1 */
32         TEGRA_GPIO_PL1,                         /* wake2 */
33         TEGRA_GPIO_PB6,                         /* wake3 */
34         TEGRA_GPIO_PN7,                         /* wake4 */
35         TEGRA_GPIO_PBB6,                        /* wake5 */
36         TEGRA_GPIO_PU5,                         /* wake6 */
37         TEGRA_GPIO_PU6,                         /* wake7 */
38         TEGRA_GPIO_PC7,                         /* wake8 */
39         TEGRA_GPIO_PS2,                         /* wake9 */
40         TEGRA_GPIO_PAA1,                        /* wake10 */
41         TEGRA_GPIO_PW3,                         /* wake11 */
42         TEGRA_GPIO_PW2,                         /* wake12 */
43         TEGRA_GPIO_PY6,                         /* wake13 */
44         TEGRA_GPIO_PDD3,                        /* wake14 */
45         TEGRA_GPIO_PJ2,                         /* wake15 */
46         -EINVAL,                                /* wake16 */
47         -EINVAL,                                /* wake17 */
48         -EINVAL,                                /* wake18 */
49         -EINVAL, /* TEGRA_USB1_VBUS, */         /* wake19 */
50         -EINVAL, /* TEGRA_USB2_VBUS, */         /* wake20 */
51         -EINVAL, /* TEGRA_USB1_ID, */           /* wake21 */
52         -EINVAL, /* TEGRA_USB2_ID, */           /* wake22 */
53         TEGRA_GPIO_PI5,                         /* wake23 */
54         TEGRA_GPIO_PV0,                         /* wake24 */
55         TEGRA_GPIO_PS4,                         /* wake25 */
56         TEGRA_GPIO_PS5,                         /* wake26 */
57         TEGRA_GPIO_PS0,                         /* wake27 */
58         TEGRA_GPIO_PS6,                         /* wake28 */
59         TEGRA_GPIO_PS7,                         /* wake29 */
60         TEGRA_GPIO_PN2,                         /* wake30 */
61         -EINVAL, /* not used */                 /* wake31 */
62         TEGRA_GPIO_PO4,                         /* wake32 */
63         TEGRA_GPIO_PJ0,                         /* wake33 */
64         TEGRA_GPIO_PK2,                         /* wake34 */
65         TEGRA_GPIO_PI6,                         /* wake35 */
66         TEGRA_GPIO_PBB1,                        /* wake36 */
67         -EINVAL, /* TEGRA_USB3_VBUS, */         /* wake37 */
68         -EINVAL, /* TEGRA_USB3_ID, */           /* wake38 */
69         -EINVAL, /* TEGRA_USB1_UTMIP, */        /* wake39 */
70         -EINVAL, /* TEGRA_USB2_UTMIP, */        /* wake40 */
71         -EINVAL, /* TEGRA_USB3_UTMIP, */        /* wake41 */
72 };
73
74 static int tegra_wake_event_irq[] = {
75         -EAGAIN,                                /* wake0 */
76         -EAGAIN,                                /* wake1 */
77         -EAGAIN,                                /* wake2 */
78         -EAGAIN,                                /* wake3 */
79         -EAGAIN,                                /* wake4 */
80         -EAGAIN,                                /* wake5 */
81         -EAGAIN,                                /* wake6 */
82         -EAGAIN,                                /* wake7 */
83         -EAGAIN,                                /* wake8 */
84         -EAGAIN,                                /* wake9 */
85         -EAGAIN,                                /* wake10 */
86         -EAGAIN,                                /* wake11 */
87         -EAGAIN,                                /* wake12 */
88         -EAGAIN,                                /* wake13 */
89         -EAGAIN,                                /* wake14 */
90         -EAGAIN,                                /* wake15 */
91         INT_RTC,                                /* wake16 */
92         INT_KBC,                                /* wake17 */
93         INT_EXTERNAL_PMU,                       /* wake18 */
94         -EINVAL, /* TEGRA_USB1_VBUS, */         /* wake19 */
95         -EINVAL, /* TEGRA_USB2_VBUS, */         /* wake20 */
96         -EINVAL, /* TEGRA_USB1_ID, */           /* wake21 */
97         -EINVAL, /* TEGRA_USB2_ID, */           /* wake22 */
98         -EAGAIN,                                /* wake23 */
99         -EAGAIN,                                /* wake24 */
100         -EAGAIN,                                /* wake25 */
101         -EAGAIN,                                /* wake26 */
102         -EAGAIN,                                /* wake27 */
103         -EAGAIN,                                /* wake28 */
104         -EAGAIN,                                /* wake29 */
105         -EAGAIN,                                /* wake30 */
106         -EINVAL, /* not used */                 /* wake31 */
107         -EAGAIN,                                /* wake32 */
108         -EAGAIN,                                /* wake33 */
109         -EAGAIN,                                /* wake34 */
110         -EAGAIN,                                /* wake35 */
111         -EAGAIN,                                /* wake36 */
112         -EINVAL, /* TEGRA_USB3_VBUS, */         /* wake37 */
113         -EINVAL, /* TEGRA_USB3_ID, */           /* wake38 */
114         INT_USB, /* TEGRA_USB1_UTMIP, */        /* wake39 */
115         INT_USB2, /* TEGRA_USB2_UTMIP, */       /* wake40 */
116         INT_USB3, /* TEGRA_USB3_UTMIP, */       /* wake41 */
117         INT_USB2, /* TEGRA_USB2_UHSIC, */       /* wake42 */
118 };
119
120 static int __init tegra3_wakeup_table_init(void)
121 {
122         tegra_gpio_wake_table = tegra_gpio_wakes;
123         tegra_irq_wake_table = tegra_wake_event_irq;
124         tegra_wake_table_len = ARRAY_SIZE(tegra_gpio_wakes);
125         return 0;
126 }
127 postcore_initcall(tegra3_wakeup_table_init);