diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2013-07-30 21:43:45 +0200 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2013-08-09 16:34:15 +0200 |
commit | 3bb869c8b3f1a11f1854cd74ebdeb60753614cf8 (patch) | |
tree | 124ca4bdf85a58f980e9f00913063191103c6070 /drivers/usb/phy/am35x-phy-control.h | |
parent | usb: phy: phy-generic: export init functions (diff) | |
download | linux-3bb869c8b3f1a11f1854cd74ebdeb60753614cf8.tar.xz linux-3bb869c8b3f1a11f1854cd74ebdeb60753614cf8.zip |
usb: phy: Add AM335x PHY driver
This driver is a redo of my earlier attempt. It uses parts of the
generic PHY driver and uses the new control driver for the register
the phy needs to power on/off the phy. It also enables easy access for
the wakeup register which is not yet implemented.
The difference between the omap attempt is:
- no static holding variable
- one global visible function which exports a struct with callbacks to
access the "control" registers.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/am35x-phy-control.h')
-rw-r--r-- | drivers/usb/phy/am35x-phy-control.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/phy/am35x-phy-control.h b/drivers/usb/phy/am35x-phy-control.h new file mode 100644 index 000000000000..b96594d1962c --- /dev/null +++ b/drivers/usb/phy/am35x-phy-control.h @@ -0,0 +1,21 @@ +#ifndef _AM335x_PHY_CONTROL_H_ +#define _AM335x_PHY_CONTROL_H_ + +struct phy_control { + void (*phy_power)(struct phy_control *phy_ctrl, u32 id, bool on); + void (*phy_wkup)(struct phy_control *phy_ctrl, u32 id, bool on); +}; + +static inline void phy_ctrl_power(struct phy_control *phy_ctrl, u32 id, bool on) +{ + phy_ctrl->phy_power(phy_ctrl, id, on); +} + +static inline void phy_ctrl_wkup(struct phy_control *phy_ctrl, u32 id, bool on) +{ + phy_ctrl->phy_wkup(phy_ctrl, id, on); +} + +struct phy_control *am335x_get_phy_control(struct device *dev); + +#endif |