diff options
author | Li Jun <jun.li@freescale.com> | 2015-07-09 03:18:45 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2015-07-29 10:59:21 -0400 |
commit | 79742351c89b76ebcf82b73103aed50f98ac2ee4 (patch) | |
tree | 1e73312122dafe00fbc6703d3ce186efc9b44163 /drivers/usb/chipidea/core.c | |
parent | 929412d94f2b75fe2a662afa2977bfb6a233c1c3 (diff) |
usb: chipidea: set usb otg capabilities
Init and update otg capabilities by DT, set gadget's otg capabilities
accordingly.
Acked-by: Peter Chen <peter.chen@freescale.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Li Jun <jun.li@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/chipidea/core.c')
-rw-r--r-- | drivers/usb/chipidea/core.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 74fea4fa41b1..1e6d5f0c18f2 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c | |||
@@ -560,6 +560,8 @@ static irqreturn_t ci_irq(int irq, void *data) | |||
560 | static int ci_get_platdata(struct device *dev, | 560 | static int ci_get_platdata(struct device *dev, |
561 | struct ci_hdrc_platform_data *platdata) | 561 | struct ci_hdrc_platform_data *platdata) |
562 | { | 562 | { |
563 | int ret; | ||
564 | |||
563 | if (!platdata->phy_mode) | 565 | if (!platdata->phy_mode) |
564 | platdata->phy_mode = of_usb_get_phy_mode(dev->of_node); | 566 | platdata->phy_mode = of_usb_get_phy_mode(dev->of_node); |
565 | 567 | ||
@@ -588,6 +590,19 @@ static int ci_get_platdata(struct device *dev, | |||
588 | of_usb_host_tpl_support(dev->of_node); | 590 | of_usb_host_tpl_support(dev->of_node); |
589 | } | 591 | } |
590 | 592 | ||
593 | if (platdata->dr_mode == USB_DR_MODE_OTG) { | ||
594 | /* We can support HNP and SRP of OTG 2.0 */ | ||
595 | platdata->ci_otg_caps.otg_rev = 0x0200; | ||
596 | platdata->ci_otg_caps.hnp_support = true; | ||
597 | platdata->ci_otg_caps.srp_support = true; | ||
598 | |||
599 | /* Update otg capabilities by DT properties */ | ||
600 | ret = of_usb_update_otg_caps(dev->of_node, | ||
601 | &platdata->ci_otg_caps); | ||
602 | if (ret) | ||
603 | return ret; | ||
604 | } | ||
605 | |||
591 | if (of_usb_get_maximum_speed(dev->of_node) == USB_SPEED_FULL) | 606 | if (of_usb_get_maximum_speed(dev->of_node) == USB_SPEED_FULL) |
592 | platdata->flags |= CI_HDRC_FORCE_FULLSPEED; | 607 | platdata->flags |= CI_HDRC_FORCE_FULLSPEED; |
593 | 608 | ||