usb: host: tegra:remove unnecessary phy api calls
Rakesh Bodla [Fri, 8 Mar 2013 17:42:14 +0000 (22:42 +0530)]
Some of the variables are passed through platform data,
no need to call phy callbacks for initialization.

Bug 1242710

Change-Id: Ic16db9c1daefb19e2ffa8cc0bd6ac4ac48fdd569
Signed-off-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/207634
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

drivers/usb/host/ehci-tegra.c

index 022c356..bef8265 100644 (file)
@@ -55,6 +55,7 @@ struct tegra_ehci_hcd {
        unsigned int irq;
        bool bus_suspended_fail;
        bool unaligned_dma_buf_supported;
+       bool has_hostpc;
 };
 
 struct dma_align_buffer {
@@ -317,7 +318,7 @@ static int tegra_ehci_setup(struct usb_hcd *hcd)
 
        /* cache this readonly data; minimize chip reads */
        ehci->hcs_params = readl(&ehci->caps->hcs_params);
-       ehci->has_hostpc = tegra_usb_phy_has_hostpc(tegra->phy) ? 1 : 0;
+       ehci->has_hostpc = tegra->has_hostpc;
        ehci->broken_hostpc_phcd = true;
 
 #ifndef CONFIG_ARCH_TEGRA_2x_SOC
@@ -535,6 +536,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
 
        pdata = dev_get_platdata(&pdev->dev);
        tegra->unaligned_dma_buf_supported = pdata->unaligned_dma_buf_supported;
+       tegra->has_hostpc = pdata->has_hostpc;
 
        tegra->phy = tegra_usb_phy_open(pdev);
        if (IS_ERR(tegra->phy)) {
@@ -573,7 +575,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
        tegra->ehci = hcd_to_ehci(hcd);
 
 #ifdef CONFIG_USB_OTG_UTILS
-       if (tegra_usb_phy_otg_supported(tegra->phy)) {
+       if (pdata->port_otg) {
                tegra->transceiver = usb_get_transceiver();
                if (tegra->transceiver)
                        otg_set_host(tegra->transceiver->otg, &hcd->self);