Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: omap1: innovator: move ohci phy power handling to board file

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.

Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+26 -26
+19
arch/arm/mach-omap1/board-innovator.c
··· 290 290 } 291 291 292 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 310 static struct omap_usb_config innovator1510_usb_config __initdata = { 294 311 /* for bundled non-standard host and peripheral cables */ 295 312 .hmc_mode = 4, ··· 317 300 318 301 .register_dev = 1, 319 302 .pins[0] = 2, 303 + 304 + .transceiver_power = innovator_omap_ohci_transceiver_power, 320 305 }; 321 306 322 307 static const struct omap_lcd_config innovator1510_lcd_config __initconst = {
+5 -26
drivers/usb/host/ohci-omap.c
··· 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 70 #ifdef CONFIG_USB_OTG 96 71 97 72 static void start_hnp(struct ohci_hcd *ohci) ··· 177 202 } 178 203 179 204 /* FIXME hub_wq hub requests should manage power switching */ 180 - omap_ohci_transceiver_power(priv, 1); 205 + if (config->transceiver_power) 206 + return config->transceiver_power(1); 207 + 208 + if (priv->power) 209 + gpiod_set_value_cansleep(priv->power, 0); 181 210 182 211 /* board init will have already handled HMC and mux setup. 183 212 * any external transceiver should already be initialized
+2
include/linux/platform_data/usb-omap1.h
··· 50 50 int (*ocpi_enable)(void); 51 51 52 52 void (*lb_reset)(void); 53 + 54 + int (*transceiver_power)(int on); 53 55 }; 54 56 55 57 #endif /* __LINUX_USB_OMAP1_H */