USB: tegra: otg: Enable host by default
Krishna Yarlagadda [Wed, 13 Jun 2012 12:50:16 +0000 (17:50 +0530)]
Host support should be disabled only when there is platform
data specifying proper setting.

Bug 998001

Change-Id: I99ff534074dd7ebbf12b53dcf53d6286925965d2
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/108760
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

drivers/usb/otg/tegra-otg.c

index 9aa155c..8442fcf 100644 (file)
@@ -152,8 +152,6 @@ static void tegra_start_host(struct tegra_otg_data *tegra)
        memcpy(platform_data, pdata->ehci_pdata,
                                        sizeof(struct tegra_usb_platform_data));
        pdev->dev.platform_data = platform_data;
-       tegra->builtin_host = !pdata->ehci_pdata->builtin_host_disabled;
-
        val = platform_device_add(pdev);
        if (val)
                goto error_add;
@@ -398,6 +396,7 @@ static int tegra_otg_probe(struct platform_device *pdev)
 {
        struct tegra_otg_data *tegra;
        struct resource *res;
+       struct tegra_usb_otg_data *pdata = dev_get_platdata(&pdev->dev);
        int err;
 
        tegra = kzalloc(sizeof(struct tegra_otg_data), GFP_KERNEL);
@@ -413,6 +412,10 @@ static int tegra_otg_probe(struct platform_device *pdev)
        tegra->otg.set_power = tegra_otg_set_power;
        spin_lock_init(&tegra->lock);
 
+       if (pdata) {
+               tegra->builtin_host = !pdata->ehci_pdata->builtin_host_disabled;
+       }
+
        platform_set_drvdata(pdev, tegra);
        tegra_clone = tegra;
        tegra->interrupt_mode = true;