ARM: tegra: pcie: Remove dock detect variable
[linux-3.10.git] / arch / arm / mach-tegra / wakeups-t14x.c
1 /*
2  * Copyright (c) 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 #include "board.h"
26 #include "tegra-board-id.h"
27 #include "gpio-names.h"
28 #include "iomap.h"
29
30 static int tegra_gpio_wakes[] = {
31         TEGRA_GPIO_PL0,                         /* wake0 */
32         TEGRA_GPIO_PL2,                         /* wake1 */
33         TEGRA_GPIO_PM2,                         /* wake2 */
34         TEGRA_GPIO_PB4,                         /* wake3 */
35         TEGRA_GPIO_PM4,                         /* wake4 */
36         TEGRA_GPIO_PM7,                         /* wake5 */
37         TEGRA_GPIO_PN1,                         /* wake6 */
38         TEGRA_GPIO_PO0,                         /* wake7 */
39         TEGRA_GPIO_PO1,                         /* wake8 */
40         TEGRA_GPIO_PO2,                         /* wake9 */
41         TEGRA_GPIO_PC3,                         /* wake10 */
42         TEGRA_GPIO_PO3,                         /* wake11 */
43         TEGRA_GPIO_PO4,                         /* wake12 */
44         TEGRA_GPIO_PA4,                         /* wake13 */
45         TEGRA_GPIO_PO5,                         /* wake14 */
46         TEGRA_GPIO_PO6,                         /* wake15 */
47         -EINVAL,                                /* wake16 */
48         -EINVAL,                                /* wake17 */
49         -EINVAL,                                /* wake18 */
50         -EINVAL,                                /* wake19 */
51         -EINVAL,                                /* wake20 */
52         -EINVAL,                                /* wake21 */
53         -EINVAL,                                /* wake22 */
54         TEGRA_GPIO_PJ5,                         /* wake23 */
55         TEGRA_GPIO_PJ6,                         /* wake24 */
56         TEGRA_GPIO_PJ1,                         /* wake25 */
57         TEGRA_GPIO_PJ2,                         /* wake26 */
58         TEGRA_GPIO_PJ3,                         /* wake27 */
59         TEGRA_GPIO_PJ4,                         /* wake28 */
60         TEGRA_GPIO_PJ0,                         /* wake29 */
61         -EINVAL,                                /* wake30 */
62         -EINVAL,                                /* wake31 */
63         -EINVAL,                                /* wake32 */
64         TEGRA_GPIO_PJ0,                         /* wake33 */
65         TEGRA_GPIO_PK2,                         /* wake34 */
66         TEGRA_GPIO_PI6,                         /* wake35 */
67         -EINVAL,                                /* wake36 */
68         -EINVAL,                                /* wake37 */
69         -EINVAL,                                /* wake38 */
70         -EINVAL,                                /* wake39 */
71         -EINVAL,                                /* wake40 */
72         -EINVAL,                                /* wake41 */
73         -EINVAL,                                /* wake42 */
74         -EINVAL,                                /* wake43 */
75         -EINVAL,                                /* wake44 */
76         TEGRA_GPIO_PBB6,                        /* wake45 */
77         -EINVAL,                                /* wake46 */
78         TEGRA_GPIO_PL6,                         /* wake47 */
79         -EINVAL,                                /* wake48 */
80         TEGRA_GPIO_PR7,                         /* wake49 */
81         TEGRA_GPIO_PR4,                         /* wake50 */
82         -EINVAL,                                /* wake51 */
83         TEGRA_GPIO_PN5,                         /* wake52 */
84         -EINVAL,                                /* wake53 */
85         TEGRA_GPIO_PQ5,                         /* wake54 */
86         TEGRA_GPIO_PK3,                         /* wake55 */
87         -EINVAL,                                /* wake56 */
88         -EINVAL,                                /* wake57 */
89         -EINVAL,                                /* wake58 */
90         -EINVAL,                                /* wake59 */
91         -EINVAL,                                /* wake60 */
92         -EINVAL,                                /* wake61 */
93         -EINVAL,                                /* wake62 */
94         -EINVAL,                                /* wake63 */
95 };
96
97 static int tegra_wake_event_irq[] = {
98         -EAGAIN, /* SPI3_MOSI */                /* wake0 */
99         -EAGAIN, /* SPI3_SCK */                 /* wake1 */
100         -EAGAIN, /* BT_WAKE_AP */               /* wake2 */
101         -EAGAIN, /* SDMMC3 DAT1 */              /* wake3 */
102         -EAGAIN, /* NFC_INT_L */                /* wake4 */
103         -EAGAIN, /* MOTION_INT_L */             /* wake5 */
104         -EAGAIN, /* TOUCH_INT_L */              /* wake6 */
105         -EAGAIN,                                /* wake7 */
106         -EAGAIN,                                /* wake8 */
107         -EAGAIN, /* UART3 RXD */                /* wake9 */
108         -EAGAIN, /* SDMMC4 DAT1 */              /* wake10 */
109         -EAGAIN,                                /* wake11 */
110         -EAGAIN,                                /* wake12 */
111         -EAGAIN, /* SDMMC1 DAT1 */              /* wake13 */
112         -EAGAIN,                                /* wake14 */
113         -EAGAIN, /* INT_EDP */                  /* wake15 */
114         -EINVAL, /* Tegra RTC */                /* wake16 */
115         -EINVAL, /* Tegra KBC */                /* wake17 */
116         INT_EXTERNAL_PMU,                       /* wake18 */
117         -EINVAL, /* removed USB1 VBUS wake */   /* wake19 */
118         -EINVAL, /* removed USB2 VBUS wake */   /* wake20 */
119         -EINVAL, /* removed USB1 ID wake */     /* wake21 */
120         -EINVAL, /* removed USB2 ID wake */     /* wake22 */
121         -EAGAIN,                                /* wake23 */
122         -EAGAIN,                                /* wake24 */
123         -EAGAIN, /* KB_ROW0 */                  /* wake25 */
124         -EAGAIN, /* KB_ROW1 */                  /* wake26 */
125         -EAGAIN, /* KB_ROW2 */                  /* wake27 */
126         -EAGAIN, /* KB_COL0 */                  /* wake28 */
127         -EINVAL, /* INT_MIPI_BIF - BCL */       /* wake29 */
128         -EINVAL, /* I2S0 SDATA OUT */           /* wake30 */
129         -EINVAL,                                /* wake31 */
130         -EINVAL, /* ULPI DATA3 */               /* wake32 */
131         -EAGAIN,                                /* wake33 */
132         -EAGAIN,                                /* wake34 */
133         -EAGAIN,                                /* wake35 */
134         -EINVAL,                                /* wake36 */
135         -EINVAL, /* removed USB3 VBUS wake */   /* wake37 */
136         -EINVAL, /* removed USB3 ID wake */     /* wake38 */
137         INT_USB, /* USB1 UTMIP */               /* wake39 */
138         -EINVAL, /* removed USB2 UTMIP wake */  /* wake40 */
139         -EINVAL, /* removed USB3 UTMIP wake */  /* wake41 */
140         INT_USB2, /* USB2 UHSIC PHY */          /* wake42 */
141         -EINVAL, /* removed USB3 UHSIC PHY wake */      /* wake43 */
142         -EINVAL, /* I2C1 DAT */                 /* wake44 */
143         -EAGAIN,                                /* wake45 */
144         -EINVAL, /* PWR I2C DAT */              /* wake46 */
145         -EAGAIN, /* I2C2 DAT */                 /* wake47 */
146         -EINVAL, /* I2C3 DAT */                 /* wake48 */
147         -EAGAIN,                                /* wake49 */
148         -EAGAIN,                                /* wake50 */
149         -EINVAL, /* KBC11 */                    /* wake51 */
150         -EAGAIN, /* HDMI CEC */                 /* wake52 */
151         -EINVAL, /* I2C3 CLK */                 /* wake53 */
152         -EAGAIN,                                /* wake54 */
153         -EAGAIN, /* UART3 CTS */                /* wake55 */
154         -EINVAL,                                /* wake56 */
155         -EINVAL,                                /* wake57 */
156         -EINVAL,                                /* wake58 */
157         INT_BB2AP_INT0,                         /* wake59 */
158         -EINVAL,                                /* wake60 */
159         -EINVAL,                                /* wake61 */
160         -EINVAL,                                /* wake62 */
161         -EINVAL,                                /* wake63 */
162 };
163
164 static int __init tegra14x_wakeup_table_init(void)
165 {
166         tegra_gpio_wake_table = tegra_gpio_wakes;
167         tegra_irq_wake_table = tegra_wake_event_irq;
168         tegra_wake_table_len = ARRAY_SIZE(tegra_gpio_wakes);
169         return 0;
170 }
171 postcore_initcall(tegra14x_wakeup_table_init);