usb: chipidea: add TPL support for targeted hosts
authorPeter Chen <peter.chen@freescale.com>
Tue, 19 Aug 2014 01:51:56 +0000 (09:51 +0800)
committerSimon Horman <horms+renesas@verge.net.au>
Fri, 5 Dec 2014 04:13:28 +0000 (13:13 +0900)
For OTG and Embedded hosts, they may need TPL (Targeted Peripheral List)
for usb certification and other vender specific requirements, the
platform can tell chipidea core driver if it supports tpl through DT
or platform data.

Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f6a9ff07832a9d30d457e976e6233b4351cd4cdf)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/usb/chipidea/core.c
drivers/usb/chipidea/host.c
include/linux/usb/chipidea.h

index 33f22bc..7203b1d 100644 (file)
@@ -410,6 +410,10 @@ static int ci_get_platdata(struct device *dev,
                                PTR_ERR(platdata->reg_vbus));
                        return PTR_ERR(platdata->reg_vbus);
                }
+               /* Get TPL support */
+               if (!platdata->tpl_support)
+                       platdata->tpl_support =
+                               of_usb_host_tpl_support(dev->of_node);
        }
 
        return 0;
index a8ac6c1..5d1cace 100644 (file)
@@ -60,6 +60,7 @@ static int host_start(struct ci_hdrc *ci)
 
        hcd->power_budget = ci->platdata->power_budget;
        hcd->phy = ci->transceiver;
+       hcd->tpl_support = ci->platdata->tpl_support;
 
        ehci = hcd_to_ehci(hcd);
        ehci->caps = ci->hw_bank.cap;
index 708bd11..a210bac 100644 (file)
@@ -30,6 +30,7 @@ struct ci_hdrc_platform_data {
 #define CI_HDRC_CONTROLLER_STOPPED_EVENT       1
        void    (*notify_event) (struct ci_hdrc *ci, unsigned event);
        struct regulator        *reg_vbus;
+       bool                    tpl_support;
 };
 
 /* Default offset of capability registers */