CHROMIUM: usb: dwc: Fix ARM usb_phy init parameter warning
authorSimon Que <sque@chromium.org>
Thu, 31 Jan 2013 01:52:45 +0000 (17:52 -0800)
committerChromeBot <chrome-bot@google.com>
Thu, 31 Jan 2013 19:08:58 +0000 (11:08 -0800)
Adding the param "bool ext_clk" to phy_init() results in some warnings:

arch/arm/mach-exynos/mach-exynos5-dt.c:535:2: error: initialization from
incompatible pointer type [-Werror]
arch/arm/mach-exynos/mach-exynos5-dt.c:540:2: error: initialization from
incompatible pointer type [-Werror]

Instead of updating this function pointer to have the extra variable,
add a new function to set "ext_clk" as a static variable in
setup-usb-phy.c

BUG=chromium-os:5542
TEST=emerge-daisy chromeos-kernel, make sure warning is gone

Change-Id: Ic2c38acd945083b0509dafe9dadf12935868991d
Signed-off-by: Simon Que <sque@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/42367
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
arch/arm/mach-exynos/mach-exynos5-dt.c
arch/arm/mach-exynos/setup-usb-phy.c
arch/arm/plat-samsung/include/plat/ehci.h
arch/arm/plat-samsung/include/plat/usb-phy.h
drivers/usb/dwc3/dwc3-exynos.c
include/linux/platform_data/dwc3-exynos.h

index f7818db..afb76e3 100644 (file)
@@ -546,6 +546,7 @@ static struct dwc3_exynos_data smdk5250_xhci_pdata = {
        .phy_init = s5p_usb_phy_init,
        .phy_exit = s5p_usb_phy_exit,
        .phyclk_switch = exynos5_dwc_phyclk_switch,
+       .use_ext_clk = s5p_usb_phy_use_ext_clk,
 };
 
 struct exynos_gpio_cfg {
index 9b5a3fc..b3d32ee 100644 (file)
@@ -47,6 +47,7 @@ struct exynos_usb_phy {
 static atomic_t host_usage;
 static struct exynos_usb_phy usb_phy_control;
 static DEFINE_SPINLOCK(phy_lock);
+static bool ext_clk;
 
 static int exynos4_usb_host_phy_is_on(void)
 {
@@ -287,7 +288,7 @@ int exynos5_dwc_phyclk_switch(struct platform_device *pdev, bool use_ext_clk)
        return _exynos5_usb_phy30_init(pdev, use_ext_clk);
 }
 
-static int exynos5_usb_phy30_init(struct platform_device *pdev, bool ext_clk)
+static int exynos5_usb_phy30_init(struct platform_device *pdev)
 {
        int ret;
        struct clk *host_clk = NULL;
@@ -587,7 +588,13 @@ static int exynos4_usb_phy1_exit(struct platform_device *pdev)
        return 0;
 }
 
-int s5p_usb_phy_init(struct platform_device *pdev, int type, bool ext_clk)
+int s5p_usb_phy_use_ext_clk(struct platform_device *pdev, bool ext_clk_val)
+{
+       ext_clk = ext_clk_val;
+       return 0;
+}
+
+int s5p_usb_phy_init(struct platform_device *pdev, int type)
 {
        if (type == S5P_USB_PHY_HOST) {
                if (soc_is_exynos5250())
@@ -596,7 +603,7 @@ int s5p_usb_phy_init(struct platform_device *pdev, int type, bool ext_clk)
                        return exynos4_usb_phy1_init(pdev);
        } else if (type == S5P_USB_PHY_DRD) {
                if (soc_is_exynos5250())
-                       return exynos5_usb_phy30_init(pdev, ext_clk);
+                       return exynos5_usb_phy30_init(pdev);
                else
                        dev_err(&pdev->dev, "USB 3.0 DRD not present\n");
        }
index 5f28cae..4195c2b 100644 (file)
@@ -14,6 +14,7 @@
 struct s5p_ehci_platdata {
        int (*phy_init)(struct platform_device *pdev, int type);
        int (*phy_exit)(struct platform_device *pdev, int type);
+       int (*use_ext_clk)(struct platform_device *pdev, bool ext_clk);
 };
 
 extern void s5p_ehci_set_platdata(struct s5p_ehci_platdata *pd);
index d6e781b..9677b7a 100644 (file)
@@ -17,8 +17,9 @@ enum s5p_usb_phy_type {
        S5P_USB_PHY_DRD,
 };
 
-extern int s5p_usb_phy_init(struct platform_device *pdev, int type,
-                                               bool use_ext_clk);
+extern int s5p_usb_phy_use_ext_clk(struct platform_device *pdev, bool ext_clk);
+extern int s5p_usb_phy_init(struct platform_device *pdev, int type);
+extern int s5p_usb_phy_exit(struct platform_device *pdev, int type);
 extern int s5p_usb_phy_exit(struct platform_device *pdev, int type);
 extern int exynos5_dwc_phyclk_switch(struct platform_device *pdev,
                                                bool use_ext_clk);
index f26a59f..8cf841a 100644 (file)
@@ -165,9 +165,11 @@ static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
                 * if we have no gpio to control external PLL, we are using
                 * the internal clock.
                 */
+               if (pdata->use_ext_clk)
+                       pdata->use_ext_clk(pdev,
+                                          gpio_is_valid(exynos->phyclk_gpio));
                if (pdata->phy_init)
-                       pdata->phy_init(pdev, pdata->phy_type,
-                                       gpio_is_valid(exynos->phyclk_gpio));
+                       pdata->phy_init(pdev, pdata->phy_type);
        }
 
        pm_runtime_set_active(&pdev->dev);
@@ -340,9 +342,11 @@ static int dwc3_exynos_resume(struct device *dev)
        if (!pdata) {
                dev_dbg(&pdev->dev, "missing platform data\n");
        } else {
+               if (pdata->use_ext_clk)
+                       pdata->use_ext_clk(pdev,
+                                          gpio_is_valid(exynos->phyclk_gpio));
                if (pdata->phy_init)
-                       pdata->phy_init(pdev, pdata->phy_type,
-                                       gpio_is_valid(exynos->phyclk_gpio));
+                       pdata->phy_init(pdev, pdata->phy_type);
        }
 
        /* runtime set active to reflect active state. */
index e8b0f19..f501459 100644 (file)
 
 struct dwc3_exynos_data {
        int phy_type;
-       int (*phy_init)(struct platform_device *pdev, int type, bool ext_clk);
+       int (*phy_init)(struct platform_device *pdev, int type);
        int (*phy_exit)(struct platform_device *pdev, int type);
        int (*phyclk_switch)(struct platform_device *pdev, bool use_ext_clk);
+       int (*use_ext_clk)(struct platform_device *pdev, bool ext_clk);
 };
 
 #endif /* _DWC3_EXYNOS_H_ */