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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 Sep 2014 04:28:41 +0000 (21:28 -0700)
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>
drivers/usb/chipidea/core.c
drivers/usb/chipidea/host.c
include/linux/usb/chipidea.h

index 619d13e29995dc9ac5010081068528b0f4932d91..41d45a16dd3085402769707b901d13e1f3f28cf1 100644 (file)
@@ -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)
index a93d950e9468bd3efebd6de93ad0c69c2ae745aa..0d6b24cb2270565f9680721504502836bd1e9c74 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 bbe779f640bed0c91869d527b67d9d797b8441b7..e14c09a45c5acd342fcf7816600b1aab9ca69e85 100644 (file)
@@ -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 */