summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorFrank Li <Frank.li@freescale.com>2010-03-10 15:20:22 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 11:20:19 +0200
commit3f59fe0ee827aa12cecd8bcf1573a66945e5b02b (patch)
tree0de344d1b124446f040167a827aea90a9f222de9 /arch
parent2631add3701e1de5d46da7ee5ec8b20ecf291395 (diff)
ENGR00121497-2 MX28 USB 100mA current draw
Add USB 100mA limitation feature for mx28 to mach usb 2.0 current requirment Signed-off-by: Frank Li <Frank.li@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx28/clock.c3
-rw-r--r--arch/arm/mach-mx28/power.c2
-rw-r--r--arch/arm/mach-mx28/usb_dr.c6
-rw-r--r--arch/arm/plat-mxs/utmixc.c23
4 files changed, 30 insertions, 4 deletions
diff --git a/arch/arm/mach-mx28/clock.c b/arch/arm/mach-mx28/clock.c
index c62867ba7b4a..9e342fd7f049 100644
--- a/arch/arm/mach-mx28/clock.c
+++ b/arch/arm/mach-mx28/clock.c
@@ -531,6 +531,7 @@ static int cpu_set_rate(struct clk *clk, unsigned long rate)
static int cpu_set_parent(struct clk *clk, struct clk *parent)
{
int ret = -EINVAL;
+
if (clk->bypass_reg) {
if (parent == clk->parent)
return 0;
@@ -540,7 +541,7 @@ static int cpu_set_parent(struct clk *clk, struct clk *parent)
ret = 0;
}
if (ret && (parent == &ref_cpu_clk)) {
- __raw_writel(0 << clk->bypass_bits,
+ __raw_writel(1 << clk->bypass_bits,
clk->bypass_reg + CLR_REGISTER);
ret = 0;
}
diff --git a/arch/arm/mach-mx28/power.c b/arch/arm/mach-mx28/power.c
index a7467fc92556..a1d2f91680ee 100644
--- a/arch/arm/mach-mx28/power.c
+++ b/arch/arm/mach-mx28/power.c
@@ -500,7 +500,7 @@ static int __init regulators_init(void)
int retval = 0;
u32 vddio = __raw_readl(REGS_POWER_BASE + HW_POWER_VDDIOCTRL) & ~0x1f;
pr_debug("regulators_init \n");
- __raw_writel(vddio | 0x14, REGS_POWER_BASE + HW_POWER_VDDIOCTRL);
+ __raw_writel(vddio | 0xA, REGS_POWER_BASE + HW_POWER_VDDIOCTRL);
vdddbo_reg.parent = &vddd_reg;
mxs_register_regulator(&vddd_reg, MXS_VDDD, &vddd_init);
mxs_register_regulator(&vdddbo_reg, MXS_VDDDBO, &vdddbo_init);
diff --git a/arch/arm/mach-mx28/usb_dr.c b/arch/arm/mach-mx28/usb_dr.c
index c9dbe3dfcd5f..0d43a65728d3 100644
--- a/arch/arm/mach-mx28/usb_dr.c
+++ b/arch/arm/mach-mx28/usb_dr.c
@@ -143,4 +143,8 @@ void fsl_phy_set_power(struct fsl_xcvr_ops *this,
{
}
-module_init(usb_dr_init);
+#ifdef CONFIG_MXS_VBUS_CURRENT_DRAW
+ fs_initcall(usb_dr_init);
+#else
+ module_init(usb_dr_init);
+#endif
diff --git a/arch/arm/plat-mxs/utmixc.c b/arch/arm/plat-mxs/utmixc.c
index a3b0175a138b..1e9015d6de3f 100644
--- a/arch/arm/plat-mxs/utmixc.c
+++ b/arch/arm/plat-mxs/utmixc.c
@@ -36,13 +36,30 @@ extern void fsl_phy_usb_utmi_init(struct fsl_xcvr_ops *this);
extern void fsl_phy_usb_utmi_uninit(struct fsl_xcvr_ops *this);
extern void fsl_phy_set_power(struct fsl_xcvr_ops *this,
struct fsl_usb2_platform_data *pdata, int on);
+#include <mach/regs-power.h>
+#include <asm/io.h>
+
+static void set_vbus_draw(struct fsl_xcvr_ops *this,
+ struct fsl_usb2_platform_data *pdata, unsigned mA)
+{
+#ifdef CONFIG_MXS_VBUS_CURRENT_DRAW
+ if ((__raw_readl(REGS_POWER_BASE + HW_POWER_5VCTRL)
+ & BM_POWER_5VCTRL_CHARGE_4P2_ILIMIT) == 0x8000) {
+ printk(KERN_INFO "USB enumeration done,current limitation release\r\n");
+ __raw_writel(__raw_readl(REGS_POWER_BASE + HW_POWER_5VCTRL) |
+ BM_POWER_5VCTRL_CHARGE_4P2_ILIMIT, REGS_POWER_BASE +
+ HW_POWER_5VCTRL);
+ }
+#endif
+}
static struct fsl_xcvr_ops utmi_ops = {
.name = "utmi",
.xcvr_type = PORTSC_PTS_UTMI,
.init = fsl_phy_usb_utmi_init,
.uninit = fsl_phy_usb_utmi_uninit,
.set_vbus_power = fsl_phy_set_power,
+ .set_vbus_draw = set_vbus_draw,
};
extern void fsl_usb_xcvr_register(struct fsl_xcvr_ops *xcvr_ops);
@@ -60,7 +77,11 @@ static void __exit utmixc_exit(void)
fsl_usb_xcvr_unregister(&utmi_ops);
}
-module_init(utmixc_init);
+#ifdef CONFIG_MXS_VBUS_CURRENT_DRAW
+ fs_initcall(utmixc_init);
+#else
+ module_init(utmixc_init);
+#endif
module_exit(utmixc_exit);
MODULE_AUTHOR("Freescale Semiconductor, Inc.");