.. | .. |
---|
29 | 29 | |
---|
30 | 30 | #include "ohci.h" |
---|
31 | 31 | |
---|
32 | | -#include <mach/hardware.h> |
---|
33 | | - |
---|
34 | 32 | #define USB_CONFIG_BASE 0x31020000 |
---|
35 | | -#define USB_OTG_STAT_CONTROL IO_ADDRESS(USB_CONFIG_BASE + 0x110) |
---|
36 | 33 | |
---|
37 | 34 | /* USB_OTG_STAT_CONTROL bit defines */ |
---|
38 | 35 | #define TRANSPARENT_I2C_EN (1 << 7) |
---|
.. | .. |
---|
122 | 119 | |
---|
123 | 120 | static void ohci_nxp_start_hc(void) |
---|
124 | 121 | { |
---|
125 | | - unsigned long tmp = __raw_readl(USB_OTG_STAT_CONTROL) | HOST_EN; |
---|
| 122 | + void __iomem *usb_otg_stat_control = ioremap(USB_CONFIG_BASE + 0x110, 4); |
---|
| 123 | + unsigned long tmp; |
---|
126 | 124 | |
---|
127 | | - __raw_writel(tmp, USB_OTG_STAT_CONTROL); |
---|
| 125 | + if (WARN_ON(!usb_otg_stat_control)) |
---|
| 126 | + return; |
---|
| 127 | + |
---|
| 128 | + tmp = __raw_readl(usb_otg_stat_control) | HOST_EN; |
---|
| 129 | + |
---|
| 130 | + __raw_writel(tmp, usb_otg_stat_control); |
---|
128 | 131 | isp1301_vbus_on(); |
---|
| 132 | + |
---|
| 133 | + iounmap(usb_otg_stat_control); |
---|
129 | 134 | } |
---|
130 | 135 | |
---|
131 | 136 | static void ohci_nxp_stop_hc(void) |
---|
132 | 137 | { |
---|
| 138 | + void __iomem *usb_otg_stat_control = ioremap(USB_CONFIG_BASE + 0x110, 4); |
---|
133 | 139 | unsigned long tmp; |
---|
134 | 140 | |
---|
| 141 | + if (WARN_ON(!usb_otg_stat_control)) |
---|
| 142 | + return; |
---|
| 143 | + |
---|
135 | 144 | isp1301_vbus_off(); |
---|
136 | | - tmp = __raw_readl(USB_OTG_STAT_CONTROL) & ~HOST_EN; |
---|
137 | | - __raw_writel(tmp, USB_OTG_STAT_CONTROL); |
---|
| 145 | + tmp = __raw_readl(usb_otg_stat_control) & ~HOST_EN; |
---|
| 146 | + __raw_writel(tmp, usb_otg_stat_control); |
---|
| 147 | + |
---|
| 148 | + iounmap(usb_otg_stat_control); |
---|
138 | 149 | } |
---|
139 | 150 | |
---|
140 | 151 | static int ohci_hcd_nxp_probe(struct platform_device *pdev) |
---|
141 | 152 | { |
---|
142 | | - struct usb_hcd *hcd = 0; |
---|
| 153 | + struct usb_hcd *hcd = NULL; |
---|
143 | 154 | const struct hc_driver *driver = &ohci_nxp_hc_driver; |
---|
144 | 155 | struct resource *res; |
---|
145 | 156 | int ret = 0, irq; |
---|
.. | .. |
---|
153 | 164 | } |
---|
154 | 165 | |
---|
155 | 166 | isp1301_i2c_client = isp1301_get_client(isp1301_node); |
---|
| 167 | + of_node_put(isp1301_node); |
---|
156 | 168 | if (!isp1301_i2c_client) |
---|
157 | 169 | return -EPROBE_DEFER; |
---|
158 | 170 | |
---|