diff options
Diffstat (limited to 'arch/arm/mach-pxa/mioa701.c')
-rw-r--r-- | arch/arm/mach-pxa/mioa701.c | 63 |
1 files changed, 22 insertions, 41 deletions
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 2b427e015b6f..ff8052ce0a05 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -36,18 +36,21 @@ | |||
36 | #include <linux/power_supply.h> | 36 | #include <linux/power_supply.h> |
37 | #include <linux/wm97xx_batt.h> | 37 | #include <linux/wm97xx_batt.h> |
38 | #include <linux/mtd/physmap.h> | 38 | #include <linux/mtd/physmap.h> |
39 | #include <linux/usb/gpio_vbus.h> | ||
39 | 40 | ||
40 | #include <asm/mach-types.h> | 41 | #include <asm/mach-types.h> |
41 | #include <asm/mach/arch.h> | 42 | #include <asm/mach/arch.h> |
42 | #include <mach/mfp-pxa27x.h> | 43 | |
44 | #include <mach/pxa27x.h> | ||
45 | #include <mach/regs-rtc.h> | ||
43 | #include <mach/pxa27x_keypad.h> | 46 | #include <mach/pxa27x_keypad.h> |
44 | #include <mach/pxafb.h> | 47 | #include <mach/pxafb.h> |
45 | #include <mach/pxa2xx-regs.h> | ||
46 | #include <mach/mmc.h> | 48 | #include <mach/mmc.h> |
47 | #include <mach/udc.h> | 49 | #include <mach/udc.h> |
48 | #include <mach/pxa27x-udc.h> | 50 | #include <mach/pxa27x-udc.h> |
49 | #include <mach/i2c.h> | 51 | #include <mach/i2c.h> |
50 | #include <mach/camera.h> | 52 | #include <mach/camera.h> |
53 | #include <mach/audio.h> | ||
51 | #include <media/soc_camera.h> | 54 | #include <media/soc_camera.h> |
52 | 55 | ||
53 | #include <mach/mioa701.h> | 56 | #include <mach/mioa701.h> |
@@ -411,21 +414,6 @@ static void gsm_exit(void) | |||
411 | /* | 414 | /* |
412 | * USB UDC | 415 | * USB UDC |
413 | */ | 416 | */ |
414 | static void udc_power_command(int cmd) | ||
415 | { | ||
416 | switch (cmd) { | ||
417 | case PXA2XX_UDC_CMD_DISCONNECT: | ||
418 | gpio_set_value(GPIO22_USB_ENABLE, 0); | ||
419 | break; | ||
420 | case PXA2XX_UDC_CMD_CONNECT: | ||
421 | gpio_set_value(GPIO22_USB_ENABLE, 1); | ||
422 | break; | ||
423 | default: | ||
424 | printk(KERN_INFO "udc_control: unknown command (0x%x)!\n", cmd); | ||
425 | break; | ||
426 | } | ||
427 | } | ||
428 | |||
429 | static int is_usb_connected(void) | 417 | static int is_usb_connected(void) |
430 | { | 418 | { |
431 | return !gpio_get_value(GPIO13_nUSB_DETECT); | 419 | return !gpio_get_value(GPIO13_nUSB_DETECT); |
@@ -433,24 +421,15 @@ static int is_usb_connected(void) | |||
433 | 421 | ||
434 | static struct pxa2xx_udc_mach_info mioa701_udc_info = { | 422 | static struct pxa2xx_udc_mach_info mioa701_udc_info = { |
435 | .udc_is_connected = is_usb_connected, | 423 | .udc_is_connected = is_usb_connected, |
436 | .udc_command = udc_power_command, | 424 | .gpio_pullup = GPIO22_USB_ENABLE, |
437 | }; | 425 | }; |
438 | 426 | ||
439 | struct gpio_ress udc_gpios[] = { | 427 | struct gpio_vbus_mach_info gpio_vbus_data = { |
440 | MIO_GPIO_OUT(GPIO22_USB_ENABLE, 0, "USB Vbus enable") | 428 | .gpio_vbus = GPIO13_nUSB_DETECT, |
429 | .gpio_vbus_inverted = 1, | ||
430 | .gpio_pullup = -1, | ||
441 | }; | 431 | }; |
442 | 432 | ||
443 | static int __init udc_init(void) | ||
444 | { | ||
445 | pxa_set_udc_info(&mioa701_udc_info); | ||
446 | return mio_gpio_request(ARRAY_AND_SIZE(udc_gpios)); | ||
447 | } | ||
448 | |||
449 | static void udc_exit(void) | ||
450 | { | ||
451 | mio_gpio_free(ARRAY_AND_SIZE(udc_gpios)); | ||
452 | } | ||
453 | |||
454 | /* | 433 | /* |
455 | * SDIO/MMC Card controller | 434 | * SDIO/MMC Card controller |
456 | */ | 435 | */ |
@@ -763,6 +742,10 @@ struct i2c_pxa_platform_data i2c_pdata = { | |||
763 | .fast_mode = 1, | 742 | .fast_mode = 1, |
764 | }; | 743 | }; |
765 | 744 | ||
745 | static pxa2xx_audio_ops_t mioa701_ac97_info = { | ||
746 | .reset_gpio = 95, | ||
747 | }; | ||
748 | |||
766 | /* | 749 | /* |
767 | * Mio global | 750 | * Mio global |
768 | */ | 751 | */ |
@@ -785,22 +768,20 @@ MIO_PARENT_DEV(mioa701_backlight, "pwm-backlight", &pxa27x_device_pwm0.dev, | |||
785 | &mioa701_backlight_data); | 768 | &mioa701_backlight_data); |
786 | MIO_SIMPLE_DEV(mioa701_led, "leds-gpio", &gpio_led_info) | 769 | MIO_SIMPLE_DEV(mioa701_led, "leds-gpio", &gpio_led_info) |
787 | MIO_SIMPLE_DEV(pxa2xx_pcm, "pxa2xx-pcm", NULL) | 770 | MIO_SIMPLE_DEV(pxa2xx_pcm, "pxa2xx-pcm", NULL) |
788 | MIO_SIMPLE_DEV(pxa2xx_ac97, "pxa2xx-ac97", NULL) | ||
789 | MIO_PARENT_DEV(mio_wm9713_codec, "wm9713-codec", &pxa2xx_ac97.dev, NULL) | ||
790 | MIO_SIMPLE_DEV(mioa701_sound, "mioa701-wm9713", NULL) | 771 | MIO_SIMPLE_DEV(mioa701_sound, "mioa701-wm9713", NULL) |
791 | MIO_SIMPLE_DEV(mioa701_board, "mioa701-board", NULL) | 772 | MIO_SIMPLE_DEV(mioa701_board, "mioa701-board", NULL) |
773 | MIO_SIMPLE_DEV(gpio_vbus, "gpio-vbus", &gpio_vbus_data); | ||
792 | 774 | ||
793 | static struct platform_device *devices[] __initdata = { | 775 | static struct platform_device *devices[] __initdata = { |
794 | &mioa701_gpio_keys, | 776 | &mioa701_gpio_keys, |
795 | &mioa701_backlight, | 777 | &mioa701_backlight, |
796 | &mioa701_led, | 778 | &mioa701_led, |
797 | &pxa2xx_pcm, | 779 | &pxa2xx_pcm, |
798 | &pxa2xx_ac97, | ||
799 | &mio_wm9713_codec, | ||
800 | &mioa701_sound, | 780 | &mioa701_sound, |
801 | &power_dev, | 781 | &power_dev, |
802 | &strataflash, | 782 | &strataflash, |
803 | &mioa701_board | 783 | &gpio_vbus, |
784 | &mioa701_board, | ||
804 | }; | 785 | }; |
805 | 786 | ||
806 | static void mioa701_machine_exit(void); | 787 | static void mioa701_machine_exit(void); |
@@ -808,13 +789,13 @@ static void mioa701_machine_exit(void); | |||
808 | static void mioa701_poweroff(void) | 789 | static void mioa701_poweroff(void) |
809 | { | 790 | { |
810 | mioa701_machine_exit(); | 791 | mioa701_machine_exit(); |
811 | arm_machine_restart('s'); | 792 | arm_machine_restart('s', NULL); |
812 | } | 793 | } |
813 | 794 | ||
814 | static void mioa701_restart(char c) | 795 | static void mioa701_restart(char c, const char *cmd) |
815 | { | 796 | { |
816 | mioa701_machine_exit(); | 797 | mioa701_machine_exit(); |
817 | arm_machine_restart('s'); | 798 | arm_machine_restart('s', cmd); |
818 | } | 799 | } |
819 | 800 | ||
820 | struct gpio_ress global_gpios[] = { | 801 | struct gpio_ress global_gpios[] = { |
@@ -837,7 +818,8 @@ static void __init mioa701_machine_init(void) | |||
837 | pxa_set_mci_info(&mioa701_mci_info); | 818 | pxa_set_mci_info(&mioa701_mci_info); |
838 | pxa_set_keypad_info(&mioa701_keypad_info); | 819 | pxa_set_keypad_info(&mioa701_keypad_info); |
839 | wm97xx_bat_set_pdata(&mioa701_battery_data); | 820 | wm97xx_bat_set_pdata(&mioa701_battery_data); |
840 | udc_init(); | 821 | pxa_set_udc_info(&mioa701_udc_info); |
822 | pxa_set_ac97_info(&mioa701_ac97_info); | ||
841 | pm_power_off = mioa701_poweroff; | 823 | pm_power_off = mioa701_poweroff; |
842 | arm_pm_restart = mioa701_restart; | 824 | arm_pm_restart = mioa701_restart; |
843 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 825 | platform_add_devices(devices, ARRAY_SIZE(devices)); |
@@ -850,7 +832,6 @@ static void __init mioa701_machine_init(void) | |||
850 | 832 | ||
851 | static void mioa701_machine_exit(void) | 833 | static void mioa701_machine_exit(void) |
852 | { | 834 | { |
853 | udc_exit(); | ||
854 | bootstrap_exit(); | 835 | bootstrap_exit(); |
855 | gsm_exit(); | 836 | gsm_exit(); |
856 | } | 837 | } |