22 #include <linux/kernel.h>
26 #include <linux/input.h>
30 #include <linux/rtc.h>
41 #include <linux/slab.h>
48 #include <mach/regs-rtc.h>
64 static unsigned long mioa701_pin_config[] = {
185 .max_brightness = 100,
186 .dft_brightness = 50,
187 .pwm_period_ns = 4000 * 1024,
216 .modes = &mioa701_ltm0305a776c,
219 .pxafb_lcd_power = mioa701_lcd_power,
225 static unsigned int mioa701_matrix_keys[] = {
237 .matrix_key_rows = 3,
238 .matrix_key_cols = 3,
239 .matrix_key_map = mioa701_matrix_keys,
240 .matrix_key_map_size =
ARRAY_SIZE(mioa701_matrix_keys),
246 #define MIO_KEY(key, _gpio, _desc, _wakeup) \
247 { .code = (key), .gpio = (_gpio), .active_low = 0, \
248 .desc = (_desc), .type = EV_KEY, .wakeup = (_wakeup) }
257 .buttons = mioa701_button_table,
264 #define ONE_LED(_gpio, _name) \
265 { .gpio = (_gpio), .name = (_name), .active_low = true }
266 static struct gpio_led gpio_leds[] = {
292 static int is_gsm_on(
void)
303 is_gsm_on() ?
"on" :
"off");
307 static struct gpio gsm_gpios[] = {
312 static int __init gsm_init(
void)
321 "GSM XS200 Power Irq",
NULL);
336 static void gsm_exit(
void)
363 static int is_usb_connected(
void)
369 .udc_is_connected = is_usb_connected,
375 .gpio_vbus_inverted = 1,
387 .detect_delay_ms = 250,
395 static struct resource docg3_resource = {
404 .resource = &docg3_resource,
407 .platform_data =
NULL,
424 #define RESUME_ENABLE_ADDR 0xa020b000
425 #define RESUME_ENABLE_VAL 0x0f0f0f0f
426 #define RESUME_BT_ADDR 0xa020b020
427 #define RESUME_UNKNOWN_ADDR 0xa020b024
428 #define RESUME_VECTOR_ADDR 0xa0100000
429 #define BOOTSTRAP_WORDS mioa701_bootstrap_lg/4
431 static u32 *save_buffer;
433 static void install_bootstrap(
void)
440 rom_bootstrap[i] = src[i];
444 static int mioa701_sys_suspend(
void)
458 save_buffer[i] = mem_resume_vector[i];
459 save_buffer[i++] = *mem_resume_enabler;
460 save_buffer[i++] = *mem_resume_bt;
461 save_buffer[i++] = *mem_resume_unknown;
464 *mem_resume_bt = is_bt_on;
470 static void mioa701_sys_resume(
void)
479 mem_resume_vector[i] = save_buffer[i];
480 *mem_resume_enabler = save_buffer[i++];
481 *mem_resume_bt = save_buffer[i++];
482 *mem_resume_unknown = save_buffer[i++];
486 .suspend = mioa701_sys_suspend,
487 .resume = mioa701_sys_resume,
490 static int __init bootstrap_init(
void)
504 static void bootstrap_exit(
void)
516 static char *supplicants[] = {
520 static int is_ac_connected(
void)
525 static void mioa701_set_charge(
int flags)
531 .is_ac_online = is_ac_connected,
532 .is_usb_online = is_usb_connected,
533 .set_charge = mioa701_set_charge,
534 .supplied_to = supplicants,
538 static struct resource power_resources[] = {
558 .resource = power_resources,
561 .platform_data = &power_pdata,
569 .min_voltage = 0xc00,
570 .max_voltage = 0xfc0,
574 .batt_name =
"mioa701_battery",
578 .batt_pdata = &mioa701_battery_data,
590 .name =
"vcc_core range",
596 .num_consumer_supplies =
ARRAY_SIZE(max1586_consumers),
597 .consumer_supplies = max1586_consumers,
602 .platform_data = &max1586_v3_info },
606 .subdevs = max1586_subdevs,
623 .platform_data = &max1586_info,
636 .board_info = &mioa701_i2c_devices[0],
646 .codec_pdata = { &mioa701_wm97xx_pdata, },
654 #define MIO_PARENT_DEV(var, strname, tparent, pdata) \
655 static struct platform_device var = { \
659 .platform_data = pdata, \
663 #define MIO_SIMPLE_DEV(var, strname, pdata) \
664 MIO_PARENT_DEV(var, strname, NULL, pdata)
666 MIO_SIMPLE_DEV(mioa701_gpio_keys,
"gpio-keys", &mioa701_gpio_keys_data)
668 &mioa701_backlight_data);
689 static void mioa701_machine_exit(
void);
691 static void mioa701_poweroff(
void)
693 mioa701_machine_exit();
697 static void mioa701_restart(
char c,
const char *
cmd)
699 mioa701_machine_exit();
703 static struct gpio global_gpios[] = {
710 static void __init mioa701_machine_init(
void)
734 pr_err(
"MioA701: Failed to request GPIOs: %d", rc);
751 static void mioa701_machine_exit(
void)
758 .atag_offset = 0x100,
764 .init_machine = mioa701_machine_init,
766 .restart = mioa701_restart,