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
290290 }
291291
292292 #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+
293310 static struct omap_usb_config innovator1510_usb_config __initdata = {
294311 /* for bundled non-standard host and peripheral cables */
295312 .hmc_mode = 4,
@@ -300,6 +317,8 @@ static struct omap_usb_config innovator1510_usb_config __initdata = { · 4 unmodified lines
300317
301318 .register_dev = 1,
302319 .pins[0] = 2,
320+
321+ .transceiver_power = innovator_omap_ohci_transceiver_power,
303322 };
304323
305324 static 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
6767 }
6868 }
6969
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−
9570 #ifdef CONFIG_USB_OTG
9671
9772 static void start_hnp(struct ohci_hcd *ohci)
@@ -202,7 +177,11 @@ static int ohci_omap_reset(struct usb_hcd *hcd) · 104 unmodified lines
202177 }
203178
204179 /* 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);
206185
207186 /* board init will have already handled HMC and mux setup.
208187 * 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
5050 int (*ocpi_enable)(void);
5151
5252 void (*lb_reset)(void);
53+
54+ int (*transceiver_power)(int on);
5355 };
5456
5557 #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