2 * Driver for iPAQ H5400 internal USB OHCI host controller
4 * Copyright 2003 Hewlett-Packard Company.
6 * Use consistent with the GNU GPL is permitted,
7 * provided that this copyright notice is
8 * preserved in its entirety in all copies and derived works.
10 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
11 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
12 * FITNESS FOR ANY PARTICULAR PURPOSE.
14 * Author: Jamey Hicks.
18 * 2003-03-19 Jamey Hicks Created file.
22 #include <linux/module.h>
23 #include <linux/version.h>
24 #include <linux/config.h>
25 #include <linux/init.h>
26 #include <linux/device.h>
27 #include <linux/soc-old.h>
28 #include <linux/usb.h>
29 #include <linux/slab.h>
31 #include <linux/pci.h> /* pci_pool defs */
33 #include <asm/arch/hardware.h>
36 #include <asm/arch-pxa/h5400-asic.h>
38 #include <asm/hardware/samcop_base.h>
40 typedef struct ohci ohci_t
;
42 extern int hc_add_ohci(struct pci_dev
*dev
, int irq
, void *mem_base
, unsigned long flags
,
43 ohci_t
**ohci
, const char *name
, const char *slot_name
);
44 extern void hc_remove_ohci(ohci_t
*ohci
);
47 h5400_ohci_remove (struct device
*dev
)
50 #warning port to kernel 2.6
51 if (dev
->driver_data
) {
52 hc_remove_ohci (dev
->driver_data
);
53 dev
->driver_data
= NULL
;
57 samcop_set_gpio_b (dev
->parent
, SAMCOP_GPIO_GPB_RF_POWER_ON
| SAMCOP_GPIO_GPB_WLAN_POWER_ON
, 0);
61 h5400_ohci_probe (struct device
*dev
)
63 struct platform_device
*sdev
;
66 unsigned long flags
= 0;
69 sdev
= to_platform_device (dev
);
70 mem_base
= (void *)sdev
->resource
[1].start
;
71 irq
= sdev
->resource
[2].start
;
73 /* make sure the clocks are enabled */
74 samcop_clock_enable (dev
->parent
, SAMCOP_CPM_CLKCON_USBHOST_CLKEN
, 1);
75 samcop_clock_enable (dev
->parent
, SAMCOP_CPM_CLKCON_UCLK_EN
, 0);
78 samcop_set_gpio_b (dev
->parent
, SAMCOP_GPIO_GPB_RF_POWER_ON
| SAMCOP_GPIO_GPB_WLAN_POWER_ON
,
79 SAMCOP_GPIO_GPB_RF_POWER_ON
| SAMCOP_GPIO_GPB_WLAN_POWER_ON
);
82 #warning port to kernel 2.6
85 result
= hc_add_ohci (pcidev
, irq
, mem_base
, flags
, (ohci_t
**)&dev
->driver_data
, "h5400-ohci", "asic");
87 h5400_ohci_remove (dev
);
94 h5400_ohci_suspend (struct device
*dev
, u32 state
, u32 level
)
99 h5400_ohci_resume (struct device
*dev
, u32 level
)
104 static platform_device_id h5400_usb_device_ids
[] = { IPAQ_SAMCOP_USBH_DEVICE_ID
, 0 };
106 struct device_driver h5400_usb_device_driver
= {
107 .name
= "h5400 wifi",
108 .probe
= h5400_ohci_probe
,
109 .shutdown
= h5400_ohci_remove
,
110 .suspend
= h5400_ohci_suspend
,
111 .resume
= h5400_ohci_resume
115 h5400_ohci_init (void)
117 return driver_register (&h5400_usb_device_driver
);
121 h5400_ohci_exit (void)
123 driver_unregister (&h5400_usb_device_driver
);
126 module_init(h5400_ohci_init
);
127 module_exit(h5400_ohci_exit
);