diff options
Diffstat (limited to 'recipes/linux/linux-2.6.31/pcm043/0097-fsl-udc-driver-add-mx35-support.patch')
-rw-r--r-- | recipes/linux/linux-2.6.31/pcm043/0097-fsl-udc-driver-add-mx35-support.patch | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/recipes/linux/linux-2.6.31/pcm043/0097-fsl-udc-driver-add-mx35-support.patch b/recipes/linux/linux-2.6.31/pcm043/0097-fsl-udc-driver-add-mx35-support.patch new file mode 100644 index 0000000000..3467895ba8 --- /dev/null +++ b/recipes/linux/linux-2.6.31/pcm043/0097-fsl-udc-driver-add-mx35-support.patch @@ -0,0 +1,83 @@ +From 56e08cdd4fde350a1e43c69b084fa618df1e2af7 Mon Sep 17 00:00:00 2001 +From: Sascha Hauer <s.hauer@pengutronix.de> +Date: Tue, 21 Apr 2009 14:52:45 +0200 +Subject: [PATCH 097/101] fsl udc driver: add mx35 support + +Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> +--- + drivers/usb/gadget/fsl_mx3_udc.c | 31 ++++++++++++++++++++----------- + 1 files changed, 20 insertions(+), 11 deletions(-) + +diff --git a/drivers/usb/gadget/fsl_mx3_udc.c b/drivers/usb/gadget/fsl_mx3_udc.c +index 4bc2bf3..20a802e 100644 +--- a/drivers/usb/gadget/fsl_mx3_udc.c ++++ b/drivers/usb/gadget/fsl_mx3_udc.c +@@ -17,6 +17,8 @@ + #include <linux/fsl_devices.h> + #include <linux/platform_device.h> + ++#include <mach/hardware.h> ++ + static struct clk *mxc_ahb_clk; + static struct clk *mxc_usb_clk; + +@@ -28,14 +30,16 @@ int fsl_udc_clk_init(struct platform_device *pdev) + + pdata = pdev->dev.platform_data; + +- mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb"); +- if (IS_ERR(mxc_ahb_clk)) +- return PTR_ERR(mxc_ahb_clk); ++ if (!cpu_is_mx35()) { ++ mxc_ahb_clk = clk_get(&pdev->dev, "usb_ahb"); ++ if (IS_ERR(mxc_ahb_clk)) ++ return PTR_ERR(mxc_ahb_clk); + +- ret = clk_enable(mxc_ahb_clk); +- if (ret < 0) { +- dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n"); +- goto eenahb; ++ ret = clk_enable(mxc_ahb_clk); ++ if (ret < 0) { ++ dev_err(&pdev->dev, "clk_enable(\"usb_ahb\") failed\n"); ++ goto eenahb; ++ } + } + + /* make sure USB_CLK is running at 60 MHz +/- 1000 Hz */ +@@ -50,6 +54,7 @@ int fsl_udc_clk_init(struct platform_device *pdev) + if (pdata->phy_mode != FSL_USB2_PHY_ULPI && + (freq < 59999000 || freq > 60001000)) { + dev_err(&pdev->dev, "USB_CLK=%lu, should be 60MHz\n", freq); ++ ret = -EINVAL; + goto eclkrate; + } + +@@ -66,9 +71,11 @@ eclkrate: + clk_put(mxc_usb_clk); + mxc_usb_clk = NULL; + egusb: +- clk_disable(mxc_ahb_clk); ++ if (!cpu_is_mx35()) ++ clk_disable(mxc_ahb_clk); + eenahb: +- clk_put(mxc_ahb_clk); ++ if (!cpu_is_mx35()) ++ clk_put(mxc_ahb_clk); + return ret; + } + +@@ -90,6 +97,8 @@ void fsl_udc_clk_release(void) + clk_disable(mxc_usb_clk); + clk_put(mxc_usb_clk); + } +- clk_disable(mxc_ahb_clk); +- clk_put(mxc_ahb_clk); ++ if (!cpu_is_mx35()) { ++ clk_disable(mxc_ahb_clk); ++ clk_put(mxc_ahb_clk); ++ } + } +-- +1.6.2.1 + |