ARM: tegra: pcie: Remove dock detect variable
[linux-3.10.git] / arch / arm / mach-tegra / wakeups-t12x.c
1 /*
2  * Copyright (c) 2012-2013, NVIDIA CORPORATION.  All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  */
14
15 #include <linux/kernel.h>
16 #include <linux/gpio.h>
17 #include <linux/init.h>
18 #include <linux/io.h>
19 #include <linux/irqchip/tegra.h>
20
21 #include <mach/irqs.h>
22 #include <mach/gpio-tegra.h>
23
24 #include "gpio-names.h"
25 #include "iomap.h"
26
27 static int tegra_gpio_wakes[] = {
28         TEGRA_GPIO_PO5,                         /* wake0 */
29         TEGRA_GPIO_PV1,                         /* wake1 */
30         -EINVAL,                                /* wake2 */
31         TEGRA_GPIO_PB6,                         /* wake3 */
32         TEGRA_GPIO_PN7,                         /* wake4 */
33         -EINVAL,                                /* wake5 */
34         TEGRA_GPIO_PU5,                         /* wake6 */
35         TEGRA_GPIO_PU6,                         /* wake7 */
36         TEGRA_GPIO_PC7,                         /* wake8 */
37         TEGRA_GPIO_PS2,                         /* wake9 */
38         TEGRA_GPIO_PAA1,                        /* wake10 */
39         TEGRA_GPIO_PW3,                         /* wake11 */
40         TEGRA_GPIO_PW2,                         /* wake12 */
41         TEGRA_GPIO_PY6,                         /* wake13 */
42         TEGRA_GPIO_PDD3,                        /* wake14 */
43         TEGRA_GPIO_PJ2,                         /* wake15 */
44         -EINVAL,                                /* wake16 */
45         -EINVAL,                                /* wake17 */
46         -EINVAL,                                /* wake18 */
47         -EINVAL,                                /* wake19 */
48         -EINVAL,                                /* wake20 */
49         -EINVAL,                                /* wake21 */
50         -EINVAL,                                /* wake22 */
51         TEGRA_GPIO_PI5,                         /* wake23 */
52         TEGRA_GPIO_PV0,                         /* wake24 */
53         TEGRA_GPIO_PS4,                         /* wake25 */
54         TEGRA_GPIO_PS5,                         /* wake26 */
55         TEGRA_GPIO_PS0,                         /* wake27 */
56         TEGRA_GPIO_PS6,                         /* wake28 */
57         TEGRA_GPIO_PS7,                         /* wake29 */
58         TEGRA_GPIO_PN2,                         /* wake30 */
59         -EINVAL,                                /* wake31 */
60         TEGRA_GPIO_PO4,                         /* wake32 */
61         TEGRA_GPIO_PJ0,                         /* wake33 */
62         TEGRA_GPIO_PK2,                         /* wake34 */
63         TEGRA_GPIO_PI6,                         /* wake35 */
64         -EINVAL,                                /* wake36 */
65         -EINVAL,                                /* wake37 */
66         -EINVAL,                                /* wake38 */
67         -EINVAL,                                /* wake39 */
68         -EINVAL,                                /* wake40 */
69         -EINVAL,                                /* wake41 */
70         -EINVAL,                                /* wake42 */
71         -EINVAL,                                /* wake43 */
72         TEGRA_GPIO_PC5,                         /* wake44 */
73         TEGRA_GPIO_PBB6,                        /* wake45 */
74         TEGRA_GPIO_PZ7,                         /* wake46 */
75         TEGRA_GPIO_PT6,                         /* wake47 */
76         TEGRA_GPIO_PBB6,                        /* wake48 */
77         TEGRA_GPIO_PR7,                         /* wake49 */
78         TEGRA_GPIO_PR4,                         /* wake50 */
79         TEGRA_GPIO_PQ0,                         /* wake51 */
80         TEGRA_GPIO_PEE3,                        /* wake52 */
81         TEGRA_GPIO_PBB1,                        /* wake53 */
82         TEGRA_GPIO_PQ5,                         /* wake54 */
83         TEGRA_GPIO_PA1,                         /* wake55 */
84         TEGRA_GPIO_PV2,                         /* wake56 */
85         TEGRA_GPIO_PK6,                         /* wake57 */
86         -EINVAL,                                /* wake58 */
87         TEGRA_GPIO_PFF2,                        /* wake59 */
88         -EINVAL,                                /* wake60 */
89 };
90
91 static int tegra_wake_event_irq[] = {
92         -EAGAIN, /* ULPI DATA4 */               /* wake0 */
93         -EAGAIN,                                /* wake1 */
94         -EINVAL,                                /* wake2 */
95         -EAGAIN, /* SDMMC3 DAT1 */              /* wake3 */
96         -EAGAIN, /* HDMI INT */         /* wake4 */
97         -EAGAIN,                                /* wake5 */
98         -EAGAIN,                                /* wake6 */
99         -EAGAIN,                                /* wake7 */
100         -EAGAIN,                                /* wake8 */
101         -EAGAIN, /* UART3 RXD */                /* wake9 */
102         -EAGAIN, /* SDMMC4 DAT1 */              /* wake10 */
103         -EAGAIN,                                /* wake11 */
104         -EAGAIN,                                /* wake12 */
105         -EAGAIN, /* SDMMC1 DAT1 */              /* wake13 */
106         -EAGAIN, /* PEX_WAKE_N */               /* wake14 */
107         -EAGAIN, /* soc_therm_oc4_n:i, PG_OC */ /* wake15 */
108         INT_RTC,                                /* wake16 */
109         INT_KBC,                                /* wake17 */
110         INT_EXTERNAL_PMU,                       /* wake18 */
111         -EINVAL, /* INT_USB */                  /* wake19 */
112         -EINVAL,                                /* wake20 */
113         -EINVAL, /* INT_USB */                  /* wake21 */
114         -EINVAL,                                /* wake22 */
115         -EAGAIN,                                /* wake23 */
116         -EAGAIN,                                /* wake24 */
117         -EAGAIN,                                /* wake25 */
118         -EAGAIN,                                /* wake26 */
119         -EAGAIN,                                /* wake27 */
120         -EAGAIN,                                /* wake28 */
121         -EAGAIN, /* soc_therm_oc1_n:i, GPU_OC_INT */    /* wake29 */
122         -EAGAIN, /* I2S0 SDATA OUT */           /* wake30 */
123         -EINVAL,                                /* wake31 */
124         -EAGAIN, /* ULPI DATA3 */               /* wake32 */
125         -EAGAIN,                                /* wake33 */
126         -EAGAIN,                                /* wake34 */
127         -EAGAIN,                                /* wake35 */
128         -EINVAL,                                /* wake36 */
129         -EINVAL,                                /* wake37 */
130         -EINVAL,                                /* wake38 */
131         INT_USB, /* TEGRA_USB1_UTMIP, */        /* wake39 */
132         INT_USB2, /* TEGRA_USB2_UTMIP */        /* wake40 */
133         INT_USB3, /* TEGRA_USB3_UTMIP, */       /* wake41 */
134         INT_USB2, /* TEGRA_USB2_UHSIC */        /* wake42 */
135         INT_USB3, /* TEGRA_USB3_UHSIC */        /* wake43 */
136         -EAGAIN, /* I2C1 DAT */                 /* wake44 */
137         -EAGAIN,                                /* wake45 */
138         -EAGAIN, /* PWR I2C DAT */              /* wake46 */
139         -EAGAIN, /* I2C2 DAT */                 /* wake47 */
140         -EAGAIN, /* I2C3 DAT */                 /* wake48 */
141         -EAGAIN,                                /* wake49 */
142         -EAGAIN,                                /* wake50 */
143         -EAGAIN, /* KBC11 */                    /* wake51 */
144         -EAGAIN, /* HDMI CEC */                 /* wake52 */
145         -EAGAIN, /* I2C3 CLK */                 /* wake53 */
146         -EAGAIN,                                /* wake54 */
147         -EAGAIN, /* UART3 CTS */                /* wake55 */
148         -EAGAIN, /* SDMMC3 CD */                /* wake56 */
149         -EAGAIN, /* EN_VDD_HDMI, */             /* wake57 */
150         INT_XUSB_PADCTL,                        /* wake58 */
151         -EAGAIN,                                /* wake59 */
152         -EINVAL,                                /* wake60 */
153 };
154
155 static int __init tegra12x_wakeup_table_init(void)
156 {
157         tegra_gpio_wake_table = tegra_gpio_wakes;
158         tegra_irq_wake_table = tegra_wake_event_irq;
159         tegra_wake_table_len = ARRAY_SIZE(tegra_gpio_wakes);
160         return 0;
161 }
162 postcore_initcall(tegra12x_wakeup_table_init);