diff options
author | Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> | 2017-12-13 07:47:00 +0100 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2017-12-14 08:57:38 +0100 |
commit | 8ada211d0383b72878582bd312b984a9eae62b30 (patch) | |
tree | 1c415df70904c82df277bfc08909970ec95a0212 /drivers/usb/renesas_usbhs/rcar3.c | |
parent | usb: renesas_usbhs: set the mode by using extcon state for non-otg channel (diff) | |
download | linux-8ada211d0383b72878582bd312b984a9eae62b30.tar.xz linux-8ada211d0383b72878582bd312b984a9eae62b30.zip |
usb: renesas_usbhs: add extcon notifier to set mode for non-otg channel
This patch adds extcon notifier callback to set the mode of
host/peripheral by using extcon state (e.g phy-rcar-gen3-usb2) for
non-otg channel (e.g. R-Car D3).
[Fengguang Wu: fixed sparse warning]
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
usb: renesas_usbhs: usbhs_rcar3_notifier() can be static
Fixes: 3a7cce26122e ("usb: renesas_usbhs: add extcon notifier to set mode for non-otg channel")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/renesas_usbhs/rcar3.c')
-rw-r--r-- | drivers/usb/renesas_usbhs/rcar3.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/usb/renesas_usbhs/rcar3.c b/drivers/usb/renesas_usbhs/rcar3.c index b9a8453a5e68..d0ea4ff89622 100644 --- a/drivers/usb/renesas_usbhs/rcar3.c +++ b/drivers/usb/renesas_usbhs/rcar3.c @@ -112,6 +112,16 @@ static int usbhs_rcar3_get_id(struct platform_device *pdev) return USBHS_GADGET; } +static int usbhs_rcar3_notifier(struct notifier_block *nb, unsigned long event, + void *data) +{ + struct usbhs_priv *priv = container_of(nb, struct usbhs_priv, nb); + + usbhs_rcar3_set_usbsel(priv, !!event); + + return NOTIFY_DONE; +} + const struct renesas_usbhs_platform_callback usbhs_rcar3_ops = { .power_ctrl = usbhs_rcar3_power_ctrl, .get_id = usbhs_rcar3_get_id, @@ -120,4 +130,5 @@ const struct renesas_usbhs_platform_callback usbhs_rcar3_ops = { const struct renesas_usbhs_platform_callback usbhs_rcar3_with_pll_ops = { .power_ctrl = usbhs_rcar3_power_and_pll_ctrl, .get_id = usbhs_rcar3_get_id, + .notifier = usbhs_rcar3_notifier, }; |