The innovator board needs a special case for its phy control. Move the corresponding code into the board file and out of the common code by adding another callback.
Unified · Split
| @@ -290,6 +290,23 @@ static void __init innovator_init_smc91x(void) · 289 unmodified lines | |||
| 290 | } | 290 | } |
| 291 | 291 | ||
| 292 | #ifdef CONFIG_ARCH_OMAP15XX | 292 | #ifdef CONFIG_ARCH_OMAP15XX |
| 293 | /* | ||
| 294 | * Board specific gang-switched transceiver power on/off. | ||
| 295 | */ | ||
| 296 | static int innovator_omap_ohci_transceiver_power(int on) | ||
| 297 | { | ||
| 298 | if (on) | ||
| 299 | __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) | ||
| 300 | | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), | ||
| 301 | INNOVATOR_FPGA_CAM_USB_CONTROL); | ||
| 302 | else | ||
| 303 | __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) | ||
| 304 | & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), | ||
| 305 | INNOVATOR_FPGA_CAM_USB_CONTROL); | ||
| 306 | |||
| 307 | return 0; | ||
| 308 | } | ||
| 309 | |||
| 293 | static struct omap_usb_config innovator1510_usb_config __initdata = { | 310 | static struct omap_usb_config innovator1510_usb_config __initdata = { |
| 294 | /* for bundled non-standard host and peripheral cables */ | 311 | /* for bundled non-standard host and peripheral cables */ |
| 295 | .hmc_mode = 4, | 312 | .hmc_mode = 4, |
| @@ -300,6 +317,8 @@ static struct omap_usb_config innovator1510_usb_config __initdata = { · 4 unmodified lines | |||
| 300 | 317 | ||
| 301 | .register_dev = 1, | 318 | .register_dev = 1, |
| 302 | .pins[0] = 2, | 319 | .pins[0] = 2, |
| 320 | |||
| 321 | .transceiver_power = innovator_omap_ohci_transceiver_power, | ||
| 303 | }; | 322 | }; |
| 304 | 323 | ||
| 305 | static const struct omap_lcd_config innovator1510_lcd_config __initconst = { | 324 | static const struct omap_lcd_config innovator1510_lcd_config __initconst = { |
| @@ -67,31 +67,6 @@ static void omap_ohci_clock_power(struct ohci_omap_priv *priv, int on) · 66 unmodified lines | |||
| 67 | } | 67 | } |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | /* | ||
| 71 | * Board specific gang-switched transceiver power on/off. | ||
| 72 | * NOTE: OSK supplies power from DC, not battery. | ||
| 73 | */ | ||
| 74 | static int omap_ohci_transceiver_power(struct ohci_omap_priv *priv, int on) | ||
| 75 | { | ||
| 76 | if (on) { | ||
| 77 | if (machine_is_omap_innovator() && cpu_is_omap1510()) | ||
| 78 | __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) | ||
| 79 | | ((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), | ||
| 80 | INNOVATOR_FPGA_CAM_USB_CONTROL); | ||
| 81 | else if (priv->power) | ||
| 82 | gpiod_set_value_cansleep(priv->power, 0); | ||
| 83 | } else { | ||
| 84 | if (machine_is_omap_innovator() && cpu_is_omap1510()) | ||
| 85 | __raw_writeb(__raw_readb(INNOVATOR_FPGA_CAM_USB_CONTROL) | ||
| 86 | & ~((1 << 5/*usb1*/) | (1 << 3/*usb2*/)), | ||
| 87 | INNOVATOR_FPGA_CAM_USB_CONTROL); | ||
| 88 | else if (priv->power) | ||
| 89 | gpiod_set_value_cansleep(priv->power, 1); | ||
| 90 | } | ||
| 91 | |||
| 92 | return 0; | ||
| 93 | } | ||
| 94 | |||
| 95 | #ifdef CONFIG_USB_OTG | 70 | #ifdef CONFIG_USB_OTG |
| 96 | 71 | ||
| 97 | static void start_hnp(struct ohci_hcd *ohci) | 72 | static void start_hnp(struct ohci_hcd *ohci) |
| @@ -202,7 +177,11 @@ static int ohci_omap_reset(struct usb_hcd *hcd) · 104 unmodified lines | |||
| 202 | } | 177 | } |
| 203 | 178 | ||
| 204 | /* FIXME hub_wq hub requests should manage power switching */ | 179 | /* FIXME hub_wq hub requests should manage power switching */ |
| 205 | omap_ohci_transceiver_power(priv, 1); | 180 | if (config->transceiver_power) |
| 181 | return config->transceiver_power(1); | ||
| 182 | |||
| 183 | if (priv->power) | ||
| 184 | gpiod_set_value_cansleep(priv->power, 0); | ||
| 206 | 185 | ||
| 207 | /* board init will have already handled HMC and mux setup. | 186 | /* board init will have already handled HMC and mux setup. |
| 208 | * any external transceiver should already be initialized | 187 | * any external transceiver should already be initialized |
| @@ -50,6 +50,8 @@ struct omap_usb_config { · 49 unmodified lines | |||
| 50 | int (*ocpi_enable)(void); | 50 | int (*ocpi_enable)(void); |
| 51 | 51 | ||
| 52 | void (*lb_reset)(void); | 52 | void (*lb_reset)(void); |
| 53 | |||
| 54 | int (*transceiver_power)(int on); | ||
| 53 | }; | 55 | }; |
| 54 | 56 | ||
| 55 | #endif /* __LINUX_USB_OMAP1_H */ | 57 | #endif /* __LINUX_USB_OMAP1_H */ |