5 * htcuniversal specific code for the pxa27x usb device controller.
7 * Use consistent with the GNU GPL is permitted.
11 #include <linux/module.h>
12 #include <linux/init.h>
13 #include <linux/platform_device.h>
14 #include <asm/arch/hardware.h>
15 #include <asm/arch/pxa-regs.h>
16 #include <asm/arch/udc.h>
17 #include <linux/soc/asic3_base.h>
18 #include <asm/arch/htcuniversal-gpio.h>
19 #include <asm/arch/htcuniversal-asic.h>
21 static void htcuniversal_udc_command(int cmd
)
24 case PXA2XX_UDC_CMD_DISCONNECT
:
25 asic3_set_gpio_out_b(&htcuniversal_asic3
.dev
,
26 1<<GPIOB_USB_PUEN
, 0);
27 // SET_HTCUNIVERSAL_GPIO(USB_PUEN,0);
29 case PXA2XX_UDC_CMD_CONNECT
:
30 asic3_set_gpio_out_b(&htcuniversal_asic3
.dev
,
31 1<<GPIOB_USB_PUEN
, 1<<GPIOB_USB_PUEN
);
32 // SET_HTCUNIVERSAL_GPIO(USB_PUEN,1);
35 printk("_udc_control: unknown command!\n");
40 static int htcuniversal_udc_is_connected(void)
42 return (GET_HTCUNIVERSAL_GPIO(USB_DET
) != 0);
45 static struct pxa2xx_udc_mach_info htcuniversal_udc_info __initdata
= {
46 .udc_is_connected
= htcuniversal_udc_is_connected
,
47 .udc_command
= htcuniversal_udc_command
,
50 static int htcuniversal_udc_probe(struct platform_device
* dev
)
52 pxa_set_udc_info(&htcuniversal_udc_info
);
56 static struct platform_driver htcuniversal_udc_driver
= {
58 .name
= "htcuniversal_udc",
60 .probe
= htcuniversal_udc_probe
,
63 static int __init
htcuniversal_udc_init(void)
65 return platform_driver_register(&htcuniversal_udc_driver
);
68 module_init(htcuniversal_udc_init
);
69 MODULE_LICENSE("GPL");