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.c...@freescale.com>
---
 drivers/usb/chipidea/core.c  |    4 ++++
 drivers/usb/chipidea/host.c  |    1 +
 include/linux/usb/chipidea.h |    1 +
 3 files changed, 6 insertions(+)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 619d13e..41d45a1 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -473,6 +473,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);
        }
 
        if (of_usb_get_maximum_speed(dev->of_node) == USB_SPEED_FULL)
diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c
index a93d950..0d6b24c 100644
--- a/drivers/usb/chipidea/host.c
+++ b/drivers/usb/chipidea/host.c
@@ -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;
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h
index bbe779f..e14c09a 100644
--- a/include/linux/usb/chipidea.h
+++ b/include/linux/usb/chipidea.h
@@ -31,6 +31,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 */
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to