summaryrefslogtreecommitdiff
path: root/drivers/usb/musb-new
diff options
context:
space:
mode:
authorJean-Jacques Hiblot <jjhiblot@ti.com>2018-12-04 13:30:56 +0300
committerMarek Vasut <marex@denx.de>2018-12-14 19:59:10 +0300
commit1594c75b3e285cac2ed19f958a0918ee677e4286 (patch)
tree8948687432e8061cc9a3a743629ac6e378f7b9ef /drivers/usb/musb-new
parent2f829af946fae52854bf796f307e686c1efff6aa (diff)
downloadu-boot-1594c75b3e285cac2ed19f958a0918ee677e4286.tar.xz
usb: musb-new: Allow the diver not to use the set_phy_power() callback
The set_phy_power() callback is part of struct omap_musb_board_data. This structure is part of the platform data passed to the musb-new driver. This does not really fit with the Driver Model, so allow not to use struct omap_musb_board_data to turn the phy on or off. Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'drivers/usb/musb-new')
-rw-r--r--drivers/usb/musb-new/am35x.c8
-rw-r--r--drivers/usb/musb-new/musb_dsps.c8
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/musb-new/am35x.c b/drivers/usb/musb-new/am35x.c
index 251b4e9969..bda099c63f 100644
--- a/drivers/usb/musb-new/am35x.c
+++ b/drivers/usb/musb-new/am35x.c
@@ -406,7 +406,7 @@ static int am35x_musb_init(struct musb *musb)
musb_writel(reg_base, USB_CTRL_REG, AM35X_SOFT_RESET_MASK);
/* Start the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 1);
msleep(5);
@@ -437,7 +437,7 @@ static int am35x_musb_exit(struct musb *musb)
#endif
/* Shutdown the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 0);
#ifndef __UBOOT__
@@ -628,7 +628,7 @@ static int am35x_suspend(struct device *dev)
struct omap_musb_board_data *data = plat->board_data;
/* Shutdown the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 0);
clk_disable(glue->phy_clk);
@@ -645,7 +645,7 @@ static int am35x_resume(struct device *dev)
int ret;
/* Start the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 1);
ret = clk_enable(glue->phy_clk);
diff --git a/drivers/usb/musb-new/musb_dsps.c b/drivers/usb/musb-new/musb_dsps.c
index 9b814f4cd4..0c794b310a 100644
--- a/drivers/usb/musb-new/musb_dsps.c
+++ b/drivers/usb/musb-new/musb_dsps.c
@@ -450,7 +450,7 @@ static int dsps_musb_init(struct musb *musb)
dsps_writel(reg_base, wrp->control, (1 << wrp->reset));
/* Start the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 1);
musb->isr = dsps_interrupt;
@@ -491,7 +491,7 @@ static int dsps_musb_exit(struct musb *musb)
#endif
/* Shutdown the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 0);
#ifndef __UBOOT__
@@ -691,7 +691,7 @@ static int dsps_suspend(struct device *dev)
struct omap_musb_board_data *data = plat->board_data;
/* Shutdown the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 0);
return 0;
@@ -703,7 +703,7 @@ static int dsps_resume(struct device *dev)
struct omap_musb_board_data *data = plat->board_data;
/* Start the on-chip PHY and its PLL. */
- if (data->set_phy_power)
+ if (data && data->set_phy_power)
data->set_phy_power(data->dev, 1);
return 0;