diff options
| author | Hans de Goede <hdegoede@redhat.com> | 2016-06-10 05:46:25 -0400 |
|---|---|---|
| committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-06-21 03:52:39 -0400 |
| commit | ce15ed4c5dfb3f7757e6611902aed5db253af977 (patch) | |
| tree | 1aca75d0045e608b29c3451acc09a67d64198c27 /include/linux/usb | |
| parent | 882bd9fc46321c9d4721b376039a142cbfe8a17a (diff) | |
USB: Fix of_usb_get_dr_mode_by_phy with a shared phy block
Some SoCs have a single phy-hw-block with multiple phys, this is
modelled by a single phy dts node, so we end up with multiple
controller nodes with a phys property pointing to the phy-node
of the otg-phy.
Only one of these controllers typically is an otg controller, yet we
were checking the first controller who uses a phy from the block and
then end up looking for a dr_mode property in e.g. the ehci controller.
This commit fixes this by adding an arg0 parameter to
of_usb_get_dr_mode_by_phy and make of_usb_get_dr_mode_by_phy
check that this matches the phandle args[0] value when looking for
the otg controller.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'include/linux/usb')
| -rw-r--r-- | include/linux/usb/of.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/usb/of.h b/include/linux/usb/of.h index de3237fce6b2..5ff9032ee1b4 100644 --- a/include/linux/usb/of.h +++ b/include/linux/usb/of.h | |||
| @@ -12,7 +12,7 @@ | |||
| 12 | #include <linux/usb/phy.h> | 12 | #include <linux/usb/phy.h> |
| 13 | 13 | ||
| 14 | #if IS_ENABLED(CONFIG_OF) | 14 | #if IS_ENABLED(CONFIG_OF) |
| 15 | enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *phy_np); | 15 | enum usb_dr_mode of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0); |
| 16 | bool of_usb_host_tpl_support(struct device_node *np); | 16 | bool of_usb_host_tpl_support(struct device_node *np); |
| 17 | int of_usb_update_otg_caps(struct device_node *np, | 17 | int of_usb_update_otg_caps(struct device_node *np, |
| 18 | struct usb_otg_caps *otg_caps); | 18 | struct usb_otg_caps *otg_caps); |
| @@ -20,7 +20,7 @@ struct device_node *usb_of_get_child_node(struct device_node *parent, | |||
| 20 | int portnum); | 20 | int portnum); |
| 21 | #else | 21 | #else |
| 22 | static inline enum usb_dr_mode | 22 | static inline enum usb_dr_mode |
| 23 | of_usb_get_dr_mode_by_phy(struct device_node *phy_np) | 23 | of_usb_get_dr_mode_by_phy(struct device_node *np, int arg0) |
| 24 | { | 24 | { |
| 25 | return USB_DR_MODE_UNKNOWN; | 25 | return USB_DR_MODE_UNKNOWN; |
| 26 | } | 26 | } |
