3 * htcbeetles specific code for the pxa27x usb device controller.
8 #include <linux/module.h>
9 #include <linux/init.h>
10 #include <linux/platform_device.h>
11 #include <asm/arch/hardware.h>
12 #include <asm/arch/pxa-regs.h>
13 #include <asm/arch/udc.h>
14 #include <linux/soc/asic3_base.h>
15 #include <asm/arch/htcbeetles-gpio.h>
16 #include <asm/arch/htcbeetles-asic.h>
18 extern struct platform_device htcbeetles_asic3
;
20 static void htcbeetles_udc_command(int cmd
)
23 case PXA2XX_UDC_CMD_DISCONNECT
:
24 asic3_set_gpio_out_a(&htcbeetles_asic3
.dev
,
25 1<<GPIOA_USB_PUEN
, 0);
27 case PXA2XX_UDC_CMD_CONNECT
:
28 asic3_set_gpio_out_a(&htcbeetles_asic3
.dev
,
29 1<<GPIOA_USB_PUEN
, 1<<GPIOA_USB_PUEN
);
32 printk("_udc_control: unknown command!\n");
37 static int htcbeetles_udc_is_connected(void)
39 return ((asic3_get_gpio_status_a(&htcbeetles_asic3
.dev
) & (1<<GPIOB_USB_DETECT
)) != 0);
42 static struct pxa2xx_udc_mach_info htcbeetles_udc_info __initdata
= {
43 .udc_is_connected
= htcbeetles_udc_is_connected
,
44 .udc_command
= htcbeetles_udc_command
,
47 static int htcbeetles_udc_probe(struct device
* dev
)
49 pxa_set_udc_info(&htcbeetles_udc_info
);
53 static struct device_driver htcbeetles_udc_driver
= {
54 .name
= "htcbeetles_udc",
55 .bus
= &platform_bus_type
,
56 .probe
= htcbeetles_udc_probe
,
59 static int __init
htcbeetles_udc_init(void)
61 return driver_register(&htcbeetles_udc_driver
);
64 module_init(htcbeetles_udc_init
);
65 MODULE_LICENSE("GPL");