usb: add devicetree helpers for determining dr_mode and phy_type
This adds two little devicetree helper functions for determining the dr_mode (host, peripheral, otg) and phy_type (utmi, ulpi,...) from the devicetree. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:

committed by
Greg Kroah-Hartman

parent
2e27041296
commit
1c9af65357
28
include/linux/usb/of.h
Normal file
28
include/linux/usb/of.h
Normal file
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* OF helpers for usb devices.
|
||||
*
|
||||
* This file is released under the GPLv2
|
||||
*/
|
||||
|
||||
#ifndef __LINUX_USB_OF_H
|
||||
#define __LINUX_USB_OF_H
|
||||
|
||||
#include <linux/usb/otg.h>
|
||||
#include <linux/usb/phy.h>
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np);
|
||||
enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np);
|
||||
#else
|
||||
static inline enum usb_phy_interface of_usb_get_phy_mode(struct device_node *np)
|
||||
{
|
||||
return USBPHY_INTERFACE_MODE_UNKNOWN;
|
||||
}
|
||||
|
||||
static inline enum usb_dr_mode of_usb_get_dr_mode(struct device_node *np)
|
||||
{
|
||||
return USB_DR_MODE_UNKNOWN;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LINUX_USB_OF_H */
|
Reference in New Issue
Block a user