History

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.

Arnd Bergmann committed 7 years ago

Commit 9fe15311 parent 0ae41a03 files · +26 −26Browse files

Unified · Split

3 files
  1. arch/arm/mach-omap1/board-innovator.c +19 −0
  2. drivers/usb/host/ohci-omap.c +5 −26
  3. include/linux/platform_data/usb-omap1.h +2 −0
arch/arm/mach-omap1/board-innovator.c+19−0
@@ -290,6 +290,23 @@ static void __init innovator_init_smc91x(void) · 289 unmodified lines
290}290}
291 291
292#ifdef CONFIG_ARCH_OMAP15XX292#ifdef CONFIG_ARCH_OMAP15XX
293/*
294 * Board specific gang-switched transceiver power on/off.
295 */
296static 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
293static struct omap_usb_config innovator1510_usb_config __initdata = {310static 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
305static const struct omap_lcd_config innovator1510_lcd_config __initconst = {324static const struct omap_lcd_config innovator1510_lcd_config __initconst = {
drivers/usb/host/ohci-omap.c+5−26
@@ -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 */
74static 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_OTG70#ifdef CONFIG_USB_OTG
96 71
97static void start_hnp(struct ohci_hcd *ohci)72static 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 initialized187 * any external transceiver should already be initialized
include/linux/platform_data/usb-omap1.h+2−0
@@ -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 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t