14
14
#include <linux/mv643xx_eth.h>
15
15
#include <linux/ethtool.h>
16
16
#include <linux/i2c.h>
17
+ #include <linux/gpio.h>
18
+ #include <linux/gpio_keys.h>
19
+ #include <linux/input.h>
17
20
#include <asm/mach-types.h>
18
21
#include <asm/mach/arch.h>
19
22
#include "mv78xx0.h"
20
23
#include "common.h"
21
24
#include "mpp.h"
22
25
23
26
27
+ #define TSWXL_AUTO_SWITCH 15
28
+ #define TSWXL_USB_POWER1 30
29
+ #define TSWXL_USB_POWER2 31
30
+
31
+
24
32
/* This arch has 2 Giga Ethernet */
25
33
26
34
static struct mv643xx_eth_platform_data db78x00_ge00_data = {
@@ -57,9 +65,9 @@ static unsigned int wxl_mpp_config[] __initdata = {
57
65
MPP10_GE1_RXD2 ,
58
66
MPP11_GE1_RXD3 ,
59
67
MPP12_GPIO ,
60
- MPP13_SYSRST_OUTn ,
61
- MPP14_SATA1_ACTn ,
62
- MPP15_SATA0_ACTn ,
68
+ MPP13_GPIO ,
69
+ MPP14_GPIO ,
70
+ MPP15_GPIO ,
63
71
MPP16_GPIO ,
64
72
MPP17_GPIO ,
65
73
MPP18_GPIO ,
@@ -73,7 +81,7 @@ static unsigned int wxl_mpp_config[] __initdata = {
73
81
MPP26_UA2_CTSn ,
74
82
MPP27_UA2_RTSn ,
75
83
MPP28_GPIO ,
76
- MPP29_SYSRST_OUTn ,
84
+ MPP29_GPIO ,
77
85
MPP30_GPIO ,
78
86
MPP31_GPIO ,
79
87
MPP32_GPIO ,
@@ -84,19 +92,41 @@ static unsigned int wxl_mpp_config[] __initdata = {
84
92
MPP37_GPIO ,
85
93
MPP38_GPIO ,
86
94
MPP39_GPIO ,
87
- MPP40_UNUSED ,
88
- MPP41_UNUSED ,
89
- MPP42_UNUSED ,
90
- MPP43_UNUSED ,
91
- MPP44_UNUSED ,
92
- MPP45_UNUSED ,
93
- MPP46_UNUSED ,
94
- MPP47_UNUSED ,
95
- MPP48_SATA1_ACTn ,
96
- MPP49_SATA0_ACTn ,
95
+ MPP40_GPIO ,
96
+ MPP41_GPIO ,
97
+ MPP42_GPIO ,
98
+ MPP43_GPIO ,
99
+ MPP44_GPIO ,
100
+ MPP45_GPIO ,
101
+ MPP46_GPIO ,
102
+ MPP47_GPIO ,
103
+ MPP48_GPIO ,
104
+ MPP49_GPIO ,
97
105
0
98
106
};
99
107
108
+ static struct gpio_keys_button tswxl_buttons [] = {
109
+ {
110
+ .code = KEY_OPTION ,
111
+ .gpio = TSWXL_AUTO_SWITCH ,
112
+ .desc = "Power-auto Switch" ,
113
+ .active_low = 1 ,
114
+ }
115
+ };
116
+
117
+ static struct gpio_keys_platform_data tswxl_button_data = {
118
+ .buttons = tswxl_buttons ,
119
+ .nbuttons = ARRAY_SIZE (tswxl_buttons ),
120
+ };
121
+
122
+ static struct platform_device tswxl_button_device = {
123
+ .name = "gpio-keys" ,
124
+ .id = -1 ,
125
+ .num_resources = 0 ,
126
+ .dev = {
127
+ .platform_data = & tswxl_button_data ,
128
+ },
129
+ };
100
130
101
131
static void __init wxl_init (void )
102
132
{
@@ -111,7 +141,6 @@ static void __init wxl_init(void)
111
141
*/
112
142
mv78xx0_ehci0_init ();
113
143
mv78xx0_ehci1_init ();
114
- mv78xx0_ehci2_init ();
115
144
mv78xx0_ge00_init (& db78x00_ge00_data );
116
145
mv78xx0_ge01_init (& db78x00_ge01_data );
117
146
mv78xx0_sata_init (& db78x00_sata_data );
@@ -123,6 +152,13 @@ static void __init wxl_init(void)
123
152
mv78xx0_crypto_init ();
124
153
mv78xx0_i2c_init ();
125
154
i2c_register_board_info (0 , & db78x00_i2c_rtc , 1 );
155
+
156
+ //enable both usb ports
157
+ gpio_direction_output (TSWXL_USB_POWER1 , 1 );
158
+ gpio_direction_output (TSWXL_USB_POWER2 , 1 );
159
+
160
+ //enable rear switch
161
+ platform_device_register (& tswxl_button_device );
126
162
}
127
163
128
164
static int __init wxl_pci_init (void )
0 commit comments