From f9a8a5549d5dbab830370f5aabce4549bb4847d0 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Tue, 22 Feb 2011 17:34:58 +0800 Subject: ENGR00141217-3 MX53 MSL part upgrade to 2.6.38 imx51_babbage: imx53_smd: add i2c device imx53_smd: add i2c board device info imx53_smd: add esdhc device support imx53_smd: Add SRTC devices imx53_smd: enable the AHCI SATA imx53_smd: Add GPIO Keypad support imx53_ard: enable ARD board bootup imx53_ard: add ethernet pin mux imx53_ard: add smsc911x device imx53_loco: add i2c device imx53_loco: change sii902x i2c device imx53_loco: register v4l2 output device imx53_loco: add srtc device imx53_loco: enable the AHCI SATA imx53_loco: Add GPIO Keypad support imx53_evk: add evk and arm2 boards io setting and set up display imx5: add ipu\vpu imx5: clock.c: remove RATE_PROPAGATES imx5: Add clock, dvfs, busfreq, sdram_autogating support. imx5: fix warnings on boot imx5: add v4l2 device imx5: add board_is_rev support imx5: Add sdma support for i.Mx53 and i.Mx51 imx5: add p1003 imx5: add ipuv3 imx5: add sata imx5: add pmic board files imx5: add pm function imx5: add iram config imx5: add gpu imx5: fix clock debug enable_count error imx53: add gpio irq support for mx53 imx53: change PWM backlight device register method to dynamic imx53: change v4l2 device register method to dynamic imx53: add vpu devices support imx53: add dvfs-core and busfreq devices register method imx53: Add usb devices imx53: add i2c pad settings imx53: add ssi support Signed-off-by: Richard Zhao Signed-off-by: Frank Li Signed-off-by: Jason Chen Signed-off-by: Zeng Zhaoming Signed-off-by: Richard Zhu Signed-off-by: Zhou Jingyu Signed-off-by: Zhang Yan --- arch/arm/plat-mxc/utmixc.c | 108 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100755 arch/arm/plat-mxc/utmixc.c (limited to 'arch/arm/plat-mxc/utmixc.c') diff --git a/arch/arm/plat-mxc/utmixc.c b/arch/arm/plat-mxc/utmixc.c new file mode 100755 index 000000000000..ad935fdfa50d --- /dev/null +++ b/arch/arm/plat-mxc/utmixc.c @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2005-2011 Freescale Semiconductor, Inc. All Rights Reserved. + */ + +/* + * The code contained herein is licensed under the GNU General Public + * License. You may obtain a copy of the GNU General Public License + * Version 2 or later at the following locations: + * + * http://www.opensource.org/licenses/gpl-license.html + * http://www.gnu.org/copyleft/gpl.html + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +static struct regulator *usbotg_regux; + +static void usb_utmi_init(struct fsl_xcvr_ops *this) +{ +#if defined(CONFIG_MXC_PMIC_MC13892_MODULE) || defined(CONFIG_MXC_PMIC_MC13892) + if (machine_is_mx51_3ds()) { + unsigned int value; + + /* VUSBIN */ + pmic_read_reg(REG_USB1, &value, 0xffffff); + value |= 0x1; + value |= (0x1 << 3); + pmic_write_reg(REG_USB1, value, 0xffffff); + } +#endif +} + +static void usb_utmi_uninit(struct fsl_xcvr_ops *this) +{ +} + +/*! + * set vbus power + * + * @param view viewport register + * @param on power on or off + */ +static void set_power(struct fsl_xcvr_ops *this, + struct fsl_usb2_platform_data *pdata, int on) +{ + struct device *dev = &pdata->pdev->dev; + + pr_debug("real %s(on=%d) pdata=0x%p\n", __func__, on, pdata); + if (machine_is_mx37_3ds()) { + if (on) { + if (!board_is_rev(IMX_BOARD_REV_2)) + usbotg_regux = regulator_get(dev, "DCDC2"); + else + usbotg_regux = regulator_get(dev, "SWBST"); + + regulator_enable(usbotg_regux); + } else { + regulator_disable(usbotg_regux); + regulator_put(usbotg_regux); + } + } + if (pdata && pdata->platform_driver_vbus) + pdata->platform_driver_vbus(on); +} + +static struct fsl_xcvr_ops utmi_ops = { + .name = "utmi", + .xcvr_type = PORTSC_PTS_UTMI, + .init = usb_utmi_init, + .uninit = usb_utmi_uninit, + .set_vbus_power = set_power, +}; + +extern void fsl_usb_xcvr_register(struct fsl_xcvr_ops *xcvr_ops); + +static int __init utmixc_init(void) +{ + fsl_usb_xcvr_register(&utmi_ops); + return 0; +} + +extern void fsl_usb_xcvr_unregister(struct fsl_xcvr_ops *xcvr_ops); + +static void __exit utmixc_exit(void) +{ + fsl_usb_xcvr_unregister(&utmi_ops); +} + +subsys_initcall(utmixc_init); +module_exit(utmixc_exit); + +MODULE_AUTHOR("Freescale Semiconductor, Inc."); +MODULE_DESCRIPTION("utmi xcvr driver"); +MODULE_LICENSE("GPL"); -- cgit v1.2.3