25 #include <linux/i2c.h>
28 #include <linux/input.h>
33 #include <mach/board.h>
42 static void __init gsia18s_init_early(
void)
75 static struct gpio_led gpio_leds[] = {
77 .name =
"gpo:spi1reset",
80 .default_trigger =
"none",
84 .name =
"gpo:trig_net_out",
87 .default_trigger =
"none",
91 .name =
"gpo:trig_net_dir",
94 .default_trigger =
"none",
98 .name =
"gpo:charge_dis",
101 .default_trigger =
"none",
108 .default_trigger =
"none",
115 .default_trigger =
"none",
122 .default_trigger =
"none",
136 .platform_data = &gpio_led_info,
140 static void __init gsia18s_leds_init(
void)
146 static struct gpio_led pcf_gpio_leds1[] = {
148 .name =
"gpo:hdc_power",
151 .default_trigger =
"none",
155 .name =
"gpo:wifi_setup",
158 .default_trigger =
"none",
162 .name =
"gpo:wifi_enable",
165 .default_trigger =
"none",
169 .name =
"gpo:wifi_reset",
172 .default_trigger =
"none",
177 .name =
"gpo:gps_setup",
180 .default_trigger =
"none",
184 .name =
"gpo:gps_standby",
187 .default_trigger =
"none",
191 .name =
"gpo:gps_power",
194 .default_trigger =
"none",
200 .leds = pcf_gpio_leds1,
208 .platform_data = &pcf_gpio_led_info1,
213 static struct gpio_led pcf_gpio_leds2[] = {
215 .name =
"gpo:alarm_1",
218 .default_trigger =
"none",
222 .name =
"gpo:alarm_2",
225 .default_trigger =
"none",
229 .name =
"gpo:alarm_3",
232 .default_trigger =
"none",
236 .name =
"gpo:alarm_4",
239 .default_trigger =
"none",
244 .name =
"gpo:alarm_v_relay_on",
247 .default_trigger =
"none",
253 .leds = pcf_gpio_leds2,
261 .platform_data = &pcf_gpio_led_info2,
266 static struct gpio_led pcf_gpio_leds3[] = {
268 .name =
"gpo:modem_power",
271 .default_trigger =
"none",
276 .name =
"gpo:modem_reset",
279 .default_trigger =
"none",
284 .name =
"gpo:trx_reset",
287 .default_trigger =
"none",
293 .leds = pcf_gpio_leds3,
301 .platform_data = &pcf_gpio_led_info3,
305 static void __init gsia18s_pcf_leds_init(
void)
317 .modalias =
"spidev",
320 .max_speed_hz = 580000,
324 .modalias =
"spidev",
327 .max_speed_hz = 5600000,
331 .modalias =
"spidev",
334 .max_speed_hz = 5600000,
338 .modalias =
"spidev",
341 .max_speed_hz = 5600000,
345 .modalias =
"spidev",
348 .max_speed_hz = 5600000,
360 .desc =
"TRIG_NET_IN",
368 .desc =
"Card umount 0",
376 .desc =
"Card umount 1",
384 .desc =
"Power Off Button",
401 .platform_data = &button_data,
405 static void __init gsia18s_add_device_buttons(
void)
423 unsigned int ngpio,
void *
context)
429 pr_err(
"error: can't request GPIO%d\n",
435 pr_err(
"error: can't setup GPIO%d as input\n",
441 pr_err(
"error: can't export GPIO%d\n",
447 pr_err(
"error: gpio_sysfs_set active_low(GPIO%d, 1)\n",
455 static int pcf8574x_0x20_teardown(
struct i2c_client *client,
int gpio,
456 unsigned ngpio,
void *context)
465 .
setup = pcf8574x_0x20_setup,
480 .platform_data = &pcf20_pdata,
484 .platform_data = &pcf22_pdata,
488 .platform_data = &pcf24_pdata,
511 static void gsia18s_power_off(
void)
513 pr_notice(
"Power supply will be switched off automatically now or after 60 seconds without ArmDAS.\n");
520 static int __init gsia18s_power_off_init(
void)
528 static void __init gsia18s_board_init(
void)
566 gsia18s_pcf_leds_init();
567 gsia18s_add_device_buttons();
573 gsia18s_power_off_init();
580 .init_early = gsia18s_init_early,
582 .init_machine = gsia18s_board_init,