summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-09-29 11:40:30 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-29 14:00:33 +0200
commit081554dca90cdc59d6ca64f83125e741078ea0d9 (patch)
tree6fb98a17ebce86a84c8b54a5baf8c409ee6f2c81 /include/linux
parent850557842f01ecb47b00ecb43b3bc3c8f1bb826f (diff)
downloadbarebox-081554dca90cdc59d6ca64f83125e741078ea0d9.tar.gz
barebox-081554dca90cdc59d6ca64f83125e741078ea0d9.tar.xz
phy: Introduce to_usbphy conversion function
The generic phy support layer has the necessary list handling and phy retrieval functions, so we should reuse them for usb phys. This adds a phy_to_usbphy() conversion function which drivers can implement which attach to the generic phy layer and are really usb phys. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/phy/phy.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h
index 0d78923358..5d96e02df4 100644
--- a/include/linux/phy/phy.h
+++ b/include/linux/phy/phy.h
@@ -33,6 +33,7 @@ struct phy_ops {
int (*exit)(struct phy *phy);
int (*power_on)(struct phy *phy);
int (*power_off)(struct phy *phy);
+ struct usb_phy *(*to_usbphy)(struct phy *phy);
};
/**
@@ -150,6 +151,7 @@ struct phy_provider *__of_phy_provider_register(struct device_d *dev,
struct phy * (*of_xlate)(struct device_d *dev,
struct of_phandle_args *args));
void of_phy_provider_unregister(struct phy_provider *phy_provider);
+struct usb_phy *phy_to_usbphy(struct phy *phy);
#else
static inline int phy_init(struct phy *phy)
{
@@ -243,6 +245,12 @@ static inline struct phy_provider *__of_phy_provider_register(
static inline void of_phy_provider_unregister(struct phy_provider *phy_provider)
{
}
+
+static inline struct usb_phy *phy_to_usbphy(struct phy *phy)
+{
+ return NULL;
+}
+
#endif
#endif /* __DRIVERS_PHY_H */