aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/otg
AgeCommit message (Collapse)Author
2011-07-19USB:Enable GPIO configuration at connectlinaro-11.07-2.6.38Sakethram Bommisetti
GPIO alternate configuration is set when the USB is connected and reset at USB disconnect. Change-Id: I07d9c2ed5028879ecff309aa9e4ac25deac148f5 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/27203 Reviewed-by: QATOOLS Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2011-06-28USB:Software fix for usb eye diagram issue when drawing more than 100mASakethram Bommisetti
AB V2 has eye diagram issues when drawing more than 100mA from VBUS.So setting charging current to 100mA in case of standard host Change-Id: Iaa5eb5751a4b0665fbe6f6148b712ffa9f96a06b Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25958 Reviewed-by: Praveena NADAHALLY <praveen.nadahally@stericsson.com> Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2011-06-27USB:Dedicated charger connect issue on ABv3Sakethram Bommisetti
During dedicated charger disconnect, (USB PHY enable - delay - disable) sequence is no longer done for platforms using ABv3. This sequence was done for ABv2 to have multiple dedicated charger detection working. Change-Id: Id27e8f0da9ad65c9ae692048c162402453e18592 Signed-off-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Signed-off-by: dushyanth.sr <dushyanth.sr@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/25191 Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
2011-06-17arm: ux500: common dbx500 prcmu driver apiMattias Nilsson
This patch updates the PRCMU driver API to be the same (as far as possible) in U8500 and U4500. - <mach/prcmu-fw-api.h> has been renamed <mach/prcmu.h>. - The platform specific APIs have moved to <mach/prcmu-db5500.h> and <mach/prcmu-db8500.h> (but these should not be directly included). - The PRCMU QoS API has been put in <mach/prcmu-qos.h>. ST Ericsson ID: 334772 ST Ericsson FOSS-OUT ID: trivial ST Ericsson Linux next: 318371 Change-Id: I6ce117ec35ebf2e987178ccacce09afb554d2736 Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/23863 Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2011-05-13usb: otg: ab8500-usb: report vbus draw in the notifier callMian Yousaf Kaukab
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
2011-05-13usb: otg: ab8500-usb: let controller driver manage stateMian Yousaf Kaukab
Changes to the state made here conflicts with the changes made within the usb controller driver usb: otg: ab8500-usb: split phy_control into separate enable and disable functions Preparing to add clocks, regulators and qos control usb: otg: ab8500-usb: update interrupt registrations and handlers Ab8500 v1 and v2 both do not update link status unless phy is disabled. This patch adds host disconnect and peripheral disconnect interrupts for v2 as well. Interrupts handlers are thus renamed to reflect this change. Interrupts setup functions are combined into one as now there are common interrupts for v1 and v2. usb: otg: ab8500-usb: only disable previously enabled phy Keep track of the transceiver mode only disable the mode which was previously enabled. usb: otg: ab8500-usb: add transceiver clock control usb: otg: ab8500-usb: add power supply control usb: otg: ab8500-usb: add platform quality of service hooks usb: otg: ab8500-usb: update log message and add chip revision usb: otg: ab8500-usb: workaround for multiple connection detection This patch implements fix for ab8500 chip v2 bug # 31952 usb: otg: ab8500-usb: return correct error status in irq setup Rreturn correct error status if platform_get_irq_byname() fails Reported-by: Philippe Langlais <philippe.langlais@stericsson.com> usb: otg: ab8500-usb: fix unbalanced clock and regulator disable warnings To prevent clock and regulator frameworks from complaining, only disable the host or peripheral phy if they were enabled. Reported-by: Sakethram Bommisetti <sakethram.bommisetti@stericsson.com> Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
2011-05-13usb: otg: ab8500-usb: workaround for connector id detectionMian Yousaf Kaukab
Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com>
2011-03-25Merge commit '05f6894' (omap-for-linus) into linaro-2.6.38Nicolas Pitre
Conflicts: arch/arm/mach-omap2/board-omap3evm.c arch/arm/mach-omap2/clock3xxx_data.c arch/arm/mach-omap2/usb-musb.c arch/arm/plat-omap/include/plat/usb.h drivers/usb/musb/musb_core.h
2011-03-11usb: otg: Add ulpi viewport access opsBenoit Goby
Add generic access ops for controllers with a ulpi viewport register (e.g. Chipidea/ARC based controllers). Signed-off-by: Benoit Goby <benoit@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-09USB OTG Langwell: use simple IPC command to control VBus power.Hao Wu
Direct access to PMIC register is not safe and will impact battery charging. New IPC command supported in SCU FW for VBus power control. USB OTG driver will switch to such commands instead of direct access to PMIC register for safety and SCU FW will handle the actual work after got the request(IPC command). Due to this change, usb driver should wait more time for sync OTGSC with USBCFG by SCU. Update wait time from 2ms to 5ms. Signed-off-by: Hao Wu <hao.wu@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07USB: Rename "msm72k_otg.c" to "msm_otg.c"Pavankumar Kondeti
This driver is used across all MSM SoCs. Hence give a generic name. All Functions and strutures are also using "msm_otg" as prefix. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-01usb: otg: TWL4030: Update the last_event variable.Hema HK
Update the last_event variable of otg_transceiver. This will be used in the musb platform glue driver for runtime idling the device. Signed-off-by: Hema HK <hemahk@ti.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-02-18usb: otg: notifier: switch to atomic notifierFelipe Balbi
most of our notifications, will be called from IRQ context, so an atomic notifier suits the job better. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-02-18usb: otg: TWL6030 Save the last event in otg_transceiverHema HK
Save the last event in the otg_transceiver so that it can used in the musb driver and gadget driver to configure the musb and enable the vbus for host mode and OTG mode, if the device is connected during boot. Signed-off-by: Hema HK <hemahk@ti.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-02-18usb: otg: TWL6030: Introduce the twl6030_phy_suspend function.Hema HK
Introduce the twl6030_phy_suspend function and assign to otg.set_suspend function pointer. This function is used by the musb-omap2430 platform driver during suspend/resume. Signed-off-by: Hema HK <hemahk@ti.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-02-17usb: otg: Remove one unnecessary I2C read request.Hema HK
To get the ID status there was an I2C read transfer. Removed this I2C read transfer as this info can be used from existing variable(linkstat). Signed-off-by: Hema HK <hemahk@ti.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-02-17usb: otg: enable regulator only on cable/device connectHema HK
Remove the regulator enable while driver loading and enable it only when the cable/device is connected and disable it when disconnected. Remove the configuration of config_state and config_trans register configuration as these registers are programmed when regulator enable/disable is called. Signed-off-by: Hema HK <hemahk@ti.com> Cc: Tony Lindgren <tony@atomide.com> Cc: Paul Walmsley <paul@pwsan.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-02-17USB: OTG: msm: Fix bug in msm_otg_mode_writePavankumar Kondeti
The driver private data is retrieved incorrectly which results a crash when written into "mode" debugfs file. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-17USB: OTG: msm: Fix compiler warning with CONFIG_PM disabledPavankumar Kondeti
This patch fixes the below compiler warning drivers/usb/otg/msm72k_otg.c:257: warning: 'msm_otg_suspend' defined but not used Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-16Merge branches 'devel-cleanup', 'devel-board', 'devel-early-init' and ↵Tony Lindgren
'devel-ti816x' into omap-for-linus
2011-02-09wip: fix section mismatches in omap1_defconfigUwe Kleine-König
after these changes omap1_defconfig and omap2plus_defconfig don't have any section mismatches any more, making it plausible that the patches earlier in this series are OK. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Tony Lindgren <tony@atomide.com>
2011-02-04USB: Fix trout build failure with ci13xxx_msm gadgetPavankumar Kondeti
This patch fixes the below compilation errors. CC drivers/usb/gadget/ci13xxx_msm.o CC net/mac80211/led.o drivers/usb/gadget/ci13xxx_msm.c: In function 'ci13xxx_msm_notify_event': drivers/usb/gadget/ci13xxx_msm.c:42: error: 'USB_AHBBURST' undeclared (first use in this function) drivers/usb/gadget/ci13xxx_msm.c:42: error: (Each undeclared identifier is reported only once drivers/usb/gadget/ci13xxx_msm.c:42: error: for each function it appears in.) drivers/usb/gadget/ci13xxx_msm.c:43: error: 'USB_AHBMODE' undeclared (first use in this function) make[4]: *** [drivers/usb/gadget/ci13xxx_msm.o] Error 1 make[3]: *** [drivers/usb/gadget] Error 2 MSM USB driver is not supported on boards like trout (MSM7201) which has an external PHY. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22usb: otg: nop: fix oops triggered by otg_register_notifierMing Lei
This patch adds BLOCKING_INIT_NOTIFIER_HEAD in nop_usb_xceiv_probe, so that we can avoid oops caused by uninitialized nop->otg.notifier.rwsem which will be touched in otg_register_notifier path. Reported-by: Gupta, Ajay Kumar <ajay.gupta@ti.com> Tested-by: Gupta, Ajay Kumar <ajay.gupta@ti.com> Cc: Balbi, Felipe <balbi@ti.com> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Ming Lei <tom.leiming@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-22usb: otg: Make USB3319 ULPI ID genericFabio Estevam
On a system with a USB3317 ULPI transceiver the following message is shown on kernel boot: ULPI transceiver vendor/product ID 0x0424/0x0006 Found SMSC USB3319 ULPI transceiver. ULPI integrity check: passed. The reason is that USB3317 has the same vendor/product ID as USB3319. Make the ULPI ID generic for the USB331x transceivers. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-01-07Merge branch 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wqLinus Torvalds
* 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (33 commits) usb: don't use flush_scheduled_work() speedtch: don't abuse struct delayed_work media/video: don't use flush_scheduled_work() media/video: explicitly flush request_module work ioc4: use static work_struct for ioc4_load_modules() init: don't call flush_scheduled_work() from do_initcalls() s390: don't use flush_scheduled_work() rtc: don't use flush_scheduled_work() mmc: update workqueue usages mfd: update workqueue usages dvb: don't use flush_scheduled_work() leds-wm8350: don't use flush_scheduled_work() mISDN: don't use flush_scheduled_work() macintosh/ams: don't use flush_scheduled_work() vmwgfx: don't use flush_scheduled_work() tpm: don't use flush_scheduled_work() sonypi: don't use flush_scheduled_work() hvsi: don't use flush_scheduled_work() xen: don't use flush_scheduled_work() gdrom: don't use flush_scheduled_work() ... Fixed up trivial conflict in drivers/media/video/bt8xx/bttv-input.c as per Tejun.
2010-12-24usb: don't use flush_scheduled_work()Tejun Heo
flush_scheduled_work() is being deprecated. Directly flush or cancel work items instead. * u_ether, isp1301_omap, speedtch conversions are straight-forward. * ochi-hcd should only flush when quirk_nec() is true as otherwise the work wouldn't have been initialized. * In oti6858, cancel_delayed_work() + flush_scheduled_work() -> cancel_delayed_work_sync(). Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Duncan Sands <duncan.sands@free.fr> Cc: linux-usb@vger.kernel.org
2010-12-16Merge branch 'usb-next' into musb-mergeGreg Kroah-Hartman
* usb-next: (132 commits) USB: uas: Use GFP_NOIO instead of GFP_KERNEL in I/O submission path USB: uas: Ensure we only bind to a UAS interface USB: uas: Rename sense pipe and sense urb to status pipe and status urb USB: uas: Use kzalloc instead of kmalloc USB: uas: Fix up the Sense IU usb: musb: core: kill unneeded #include's DA8xx: assign name to MUSB IRQ resource usb: gadget: g_ncm added usb: gadget: f_ncm.c added usb: gadget: u_ether: prepare for NCM usb: pch_udc: Fix setup transfers with data out usb: pch_udc: Fix compile error, warnings and checkpatch warnings usb: add ab8500 usb transceiver driver USB: gadget: Implement runtime PM for MSM bus glue driver USB: gadget: Implement runtime PM for ci13xxx gadget USB: gadget: Add USB controller driver for MSM SoC USB: gadget: Introduce ci13xxx_udc_driver struct USB: gadget: Initialize ci13xxx gadget device's coherent DMA mask USB: gadget: Fix "scheduling while atomic" bugs in ci13xxx_udc USB: gadget: Separate out PCI bus code from ci13xxx_udc ...
2010-12-15Merge branch 'musb-hw' of git://gitorious.org/usb/usb into musbGreg Kroah-Hartman
* 'musb-hw' of git://gitorious.org/usb/usb: (43 commits) usb: musb: core: kill unneeded #include's DA8xx: assign name to MUSB IRQ resource arm: OMAP4430: musb: Configure musb to OTG mode usb: musb: Adding musb support for OMAP4430 usb: otg: TWL6030: Add twl6030_usb file for compilation mfd: TWL6030: OMAP4: Registering the TWL6030-usb device usb: musb: TWL6030: Selecting TWL6030_USB transceiver usb: otg: Kconfig: Add Kconfig option for TWL6030 transceiver. usb: otg: Adding twl6030-usb transceiver driver for OMAP4430 mfd: TWL6030: USBOTG VBUS event generation on usb: musb: add support for ux500 platform musb: am35x: fix compile error due to control apis arm: omap4: enable usb on 4430sdp usb: musb: drop board_set_vbus usb: musb: drop musb_platform_suspend/resume usb: musb: blackfin: usb dev_pm_ops structure usb: musb: am35x: usb dev_pm_ops structure usb: musb: omap2430: use dev_pm_ops structure usb: musb: omap2430: drop the nops usb: musb: mark musb_save/restore_context static ...
2010-12-10usb: add ab8500 usb transceiver driverMian Yousaf Kaukab
Basic driver for ab8500 usb otg transceiver TODO: -Regulators support -Host and OTG testing -Interface with PRCMU -Charging support Signed-off-by: Mian Yousaf Kaukab <mian.yousaf.kaukab@stericsson.com> Acked-by: Linus Walleij <linus.walleij@stericsson.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10USB: OTG: msm: Add support for power managementPavankumar Kondeti
Implement runtime and system pm ops to put hardware into low power mode (LPM). As part of LPM, USB clocks are turned off, PHY is put into suspend state and PHY comparators are turned off if VBUS/Id notifications are not required from PHY. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10USB: Add MSM OTG Controller driverPavankumar Kondeti
This driver implements PHY initialization, clock management, ULPI IO ops and simple OTG state machine to kick host/peripheral based on Id/VBUS line status. VBUS/Id lines are tied to a reference voltage on some boards. Hence provide debugfs interface to select host/peripheral mode. Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-10usb: otg: TWL6030: Add twl6030_usb file for compilationHema HK
Add the twl6030_usb transceiver file for compilation. Signed-off-by: Hema HK <hemahk@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-10usb: otg: Kconfig: Add Kconfig option for TWL6030 transceiver.Hema HK
Added the TWL6030-usb transceiver option in the Kconfig Signed-off-by: Hema HK <hemahk@ti.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-12-10usb: otg: Adding twl6030-usb transceiver driver for OMAP4430Hema HK
Adding the twl6030-usb transceiver support for OMAP4 musb driver. OMAP4 supports 2 types of transceiver interface. 1. UTMI: The PHY is embedded within OMAP4. The transceiver functionality is split between the twl6030 PMIC chip and OMAP4430. The VBUS, ID pin sensing and OTG SRP generation part is integrated in TWL6030 and UTMI PHY functionality is embedded within the OMAP4430. There is no direct interactions between the MUSB controller and TWL6030 chip to communicate the session-valid, session-end and ID-GND events. It has to be done through a software by setting/resetting bits in one of the control module register of OMAP4430 which in turn toggles the appropriate signals to MUSB controller. The internal transceiver has functional clocks and powerdown bits to powerdown the PHY for power saving. Since there is no option available for having 2 transceiver drivers for one USB controller, internal PHY specific APIs are passed through plaform_data function pointers to use in the twl6030-usb transceiver driver. 2. ULPI interface is provided for off-chip transceivers. Signed-off-by: Hema HK <hemahk@ti.com> Cc: Tony Lindgren <tony@atomide.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Felipe Balbi <balbi@ti.com>
2010-11-30usb: otg: twl4030-usb: Fix unbalanced regulator disables at module removalJarkko Nikula
Function twl4030_usb_remove can cause unbalanced regulator disables in twl4030_phy_power if the cable is not connected. Regulator enable/disable calls are in balance only if the twl4030_phy_resume was called prior the twl4030_usb_remove, that is, the cable was connected. Fix this by checking the 'asleep' variable in twl4030_usb_remove since that variable is used to check state in other functions. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-15USB: OTG: langwell_otg: fix up some sysfs attribute permissionsGreg Kroah-Hartman
They should not be writable by any user. Reported-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Hao Wu <hao.wu@intel.com> Cc: Alan Cox <alan@linux.intel.com> Cc: Alek Du <alek.du@intel.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-29usb: otg: twl4030-usb: switch over to defines in twl.hFelipe Balbi
use the new definitions on twl header for code consistency. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2010-10-22USB: otg/ulpi: extend id's table.Igor Grinberg
Extend id's table to have ulpi phy names in it. Report if the known phy is found. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22USB: otg/ulpi: improve ulpi phy detection.Igor Grinberg
Improve ulpi phy detection by utilizing the "scratch" register. Allow unknown ulpi phy work without the need to hard-code the id. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22usb: makefile cleanupmatt mooney
For all modules, change <module>-objs to <module>-y; remove if-statements and replace with lists using the kbuild idiom; move flags to the top of the file; and fix alignment while trying to maintain the original scheme in each file. None of the dependencies are modified. Signed-off-by: matt mooney <mfm@muteddisk.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22USB OTG Langwell: Update OTG Kconfig and driver version.Hao Wu
This patch updated Kconfig for langwell otg transceiver driver. Add ipc driver(INTEL_SCU_IPC) as a dependency. Driver version is updated too. Signed-off-by: Hao Wu <hao.wu@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-22usb: Add Intel Langwell USB OTG Transceiver DriverHao Wu
This adds support for the USB transceiver driver in the Langwell chipset used on the Intel MID platforms. It folds up the original patch set which includes basic support for the device, PHY low power mode (Please notice that there is a limitation, after we drive VBus down, 2ms delay is required from SCU FW to sync up OTGSC register with USBCFG register), software timers (the hardware timers do not work in low power mode), HNP, SRP. Signed-off-by: Hao Wu <hao.wu@intel.com> Signed-off-by: Alek Du <alek.du@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-20USB: otg: twl4030: fix phy initialization(v1)Ming Lei
Commit 461c317705eca5cac09a360f488715927fd0a927(into 2.6.36-v3) is put forward to power down phy if no usb cable is connected, but does introduce the two issues below: 1), phy is not into work state if usb cable is connected with PC during poweron, so musb device mode is not usable in such case, follows the reasons: -twl4030_phy_resume is not called, so regulators are not enabled i2c access are not enabled usb mode not configurated 2), The kernel warings[1] of regulators 'unbalanced disables' is caused if poweron without usb cable connected with PC or b-device. This patch fixes the two issues above: -power down phy only if no usb cable is connected with PC and b-device -do phy initialization(via __twl4030_phy_resume) if usb cable is connected with PC(vbus event) or another b-device(ID event) in twl4030_usb_probe. This patch also doesn't put VUSB3V1 LDO into active mode in twl4030_usb_ldo_init until VBUS/ID change detected, so we can save more power consumption than before. This patch is verified OK on Beagle board either connected with usb cable or not when poweron. [1]. warnings of 'unbalanced disables' of regulators. [root@OMAP3EVM /]# dmesg ------------[ cut here ]------------ WARNING: at drivers/regulator/core.c:1357 _regulator_disable+0x38/0x128() unbalanced disables for VUSB1V8 Modules linked in: Backtrace: [<c0030c48>] (dump_backtrace+0x0/0x110) from [<c034f5a8>] (dump_stack+0x18/0x1c) r7:c78179d8 r6:c01ed6b8 r5:c0410822 r4:0000054d [<c034f590>] (dump_stack+0x0/0x1c) from [<c0057da8>] (warn_slowpath_common+0x54/0x6c) [<c0057d54>] (warn_slowpath_common+0x0/0x6c) from [<c0057e64>] (warn_slowpath_fmt+0x38/0x40) r9:00000000 r8:00000000 r7:c78e6608 r6:00000000 r5:fffffffb r4:c78e6c00 [<c0057e2c>] (warn_slowpath_fmt+0x0/0x40) from [<c01ed6b8>] (_regulator_disable+0x38/0x128) r3:c0410e53 r2:c0410ad5 [<c01ed680>] (_regulator_disable+0x0/0x128) from [<c01ed87c>] (regulator_disable+0x24/0x38) r7:c78e6608 r6:00000000 r5:c78e6c40 r4:c78e6c00 [<c01ed858>] (regulator_disable+0x0/0x38) from [<c02382dc>] (twl4030_phy_power+0x15c/0x17c) r5:c78595c0 r4:00000000 [<c0238180>] (twl4030_phy_power+0x0/0x17c) from [<c023831c>] (twl4030_phy_suspend+0x20/0x2c) r6:00000000 r5:c78595c0 r4:c78595c0 [<c02382fc>] (twl4030_phy_suspend+0x0/0x2c) from [<c0238638>] (twl4030_usb_irq+0x11c/0x16c) r5:c78595c0 r4:00000040 [<c023851c>] (twl4030_usb_irq+0x0/0x16c) from [<c034ec18>] (twl4030_usb_probe+0x2c4/0x32c) r6:00000000 r5:00000000 r4:c78595c0 [<c034e954>] (twl4030_usb_probe+0x0/0x32c) from [<c02152a0>] (platform_drv_probe+0x20/0x24) r7:00000000 r6:c047d49c r5:c78e6608 r4:c047d49c [<c0215280>] (platform_drv_probe+0x0/0x24) from [<c0214244>] (driver_probe_device+0xd0/0x190) [<c0214174>] (driver_probe_device+0x0/0x190) from [<c02143d4>] (__device_attach+0x44/0x48) r7:00000000 r6:c78e6608 r5:c78e6608 r4:c047d49c [<c0214390>] (__device_attach+0x0/0x48) from [<c0213694>] (bus_for_each_drv+0x50/0x90) r5:c0214390 r4:00000000 [<c0213644>] (bus_for_each_drv+0x0/0x90) from [<c0214474>] (device_attach+0x70/0x94) r6:c78e663c r5:c78e6608 r4:c78e6608 [<c0214404>] (device_attach+0x0/0x94) from [<c02134fc>] (bus_probe_device+0x2c/0x48) r7:00000000 r6:00000002 r5:c78e6608 r4:c78e6600 [<c02134d0>] (bus_probe_device+0x0/0x48) from [<c0211e48>] (device_add+0x340/0x4b4) [<c0211b08>] (device_add+0x0/0x4b4) from [<c021597c>] (platform_device_add+0x110/0x16c) [<c021586c>] (platform_device_add+0x0/0x16c) from [<c0220cb0>] (add_numbered_child+0xd8/0x118) r7:00000000 r6:c045f15c r5:c78e6600 r4:00000000 [<c0220bd8>] (add_numbered_child+0x0/0x118) from [<c001c618>] (twl_probe+0x3a4/0x72c) [<c001c274>] (twl_probe+0x0/0x72c) from [<c02601ac>] (i2c_device_probe+0x7c/0xa4) [<c0260130>] (i2c_device_probe+0x0/0xa4) from [<c0214244>] (driver_probe_device+0xd0/0x190) r5:c7856e20 r4:c047c860 [<c0214174>] (driver_probe_device+0x0/0x190) from [<c02143d4>] (__device_attach+0x44/0x48) r7:c7856e04 r6:c7856e20 r5:c7856e20 r4:c047c860 [<c0214390>] (__device_attach+0x0/0x48) from [<c0213694>] (bus_for_each_drv+0x50/0x90) r5:c0214390 r4:00000000 [<c0213644>] (bus_for_each_drv+0x0/0x90) from [<c0214474>] (device_attach+0x70/0x94) r6:c7856e54 r5:c7856e20 r4:c7856e20 [<c0214404>] (device_attach+0x0/0x94) from [<c02134fc>] (bus_probe_device+0x2c/0x48) r7:c7856e04 r6:c78fd048 r5:c7856e20 r4:c7856e20 [<c02134d0>] (bus_probe_device+0x0/0x48) from [<c0211e48>] (device_add+0x340/0x4b4) [<c0211b08>] (device_add+0x0/0x4b4) from [<c0211fd8>] (device_register+0x1c/0x20) [<c0211fbc>] (device_register+0x0/0x20) from [<c0260aa8>] (i2c_new_device+0xec/0x150) r5:c7856e00 r4:c7856e20 [<c02609bc>] (i2c_new_device+0x0/0x150) from [<c0260dc0>] (i2c_register_adapter+0xa0/0x1c4) r7:00000000 r6:c78fd078 r5:c78fd048 r4:c781d5c0 [<c0260d20>] (i2c_register_adapter+0x0/0x1c4) from [<c0260f80>] (i2c_add_numbered_adapter+0x9c/0xb4) r7:00000a28 r6:c04600a8 r5:c78fd048 r4:00000000 [<c0260ee4>] (i2c_add_numbered_adapter+0x0/0xb4) from [<c034efa4>] (omap_i2c_probe+0x324/0x3e8) r5:00000000 r4:c78fd000 [<c034ec80>] (omap_i2c_probe+0x0/0x3e8) from [<c02152a0>] (platform_drv_probe+0x20/0x24) [<c0215280>] (platform_drv_probe+0x0/0x24) from [<c0214244>] (driver_probe_device+0xd0/0x190) [<c0214174>] (driver_probe_device+0x0/0x190) from [<c021436c>] (__driver_attach+0x68/0x8c) r7:c78b2140 r6:c047e214 r5:c04600e4 r4:c04600b0 [<c0214304>] (__driver_attach+0x0/0x8c) from [<c021399c>] (bus_for_each_dev+0x50/0x84) r7:c78b2140 r6:c047e214 r5:c0214304 r4:00000000 [<c021394c>] (bus_for_each_dev+0x0/0x84) from [<c0214068>] (driver_attach+0x20/0x28) r6:c047e214 r5:c047e214 r4:c00270d0 [<c0214048>] (driver_attach+0x0/0x28) from [<c0213274>] (bus_add_driver+0xa8/0x228) [<c02131cc>] (bus_add_driver+0x0/0x228) from [<c02146a4>] (driver_register+0xb0/0x13c) [<c02145f4>] (driver_register+0x0/0x13c) from [<c0215744>] (platform_driver_register+0x4c/0x60) r9:00000000 r8:c001f688 r7:00000013 r6:c005b6fc r5:c00083dc r4:c00270d0 [<c02156f8>] (platform_driver_register+0x0/0x60) from [<c001f69c>] (omap_i2c_init_driver+0x14/0x1c) [<c001f688>] (omap_i2c_init_driver+0x0/0x1c) from [<c002c460>] (do_one_initcall+0xd0/0x1a4) [<c002c390>] (do_one_initcall+0x0/0x1a4) from [<c0008478>] (kernel_init+0x9c/0x154) [<c00083dc>] (kernel_init+0x0/0x154) from [<c005b6fc>] (do_exit+0x0/0x688) r5:c00083dc r4:00000000 ---[ end trace 1b75b31a2719ed1d ]--- Signed-off-by: Ming Lei <tom.leiming@gmail.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Felipe Balbi <me@felipebalbi.com> Cc: Anand Gadiyar <gadiyar@ti.com> Cc: Mike Frysinger <vapier@gentoo.org> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-23USB: otg: twl4030: fix wrong assumption of starting stateFelipe Balbi
The reset state of twl4030-usb is not sleeping, it starts up awaken and we need to disable it if we have booted with a disconnected cable to avoid over consumption on the default state. To avoid problems later, we read the current state of the transceiver from the PHY_PWR_CTRL register. The bootloader can, anyways, put the device to sleep before us. Tested on a custom OMAP board. Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-10USB: otg/ulpi: extend the generic ulpi driver.Igor Grinberg
1) Introduce ulpi specific flags for control of the ulpi phy 2) Extend the generic ulpi driver with support for Function and Interface control of upli phy 3) Update the platforms using the generic ulpi driver with new ulpi flags 4) Remove the otg control flags not in use Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-10USB: otg/ulpi: add support for SMSC USB3319 ulpi phyIgor Grinberg
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-10USB: otg/ulpi: remove unused macroIgor Grinberg
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-10USB: otg/ulpi.c : fix register writeEric Bénard
ulpi_set_vbus and ulpi_set_flags are using ULPI_SET(register) to write to the PHY's registers, which means we can only set bits in the PHY's register and not clear them. By directly using the address of the register without any offset, we now get the expected behaviour for these functions. Signed-off-by: Eric Bénard <eric@eukrea.com> Cc: Daniel Mack <daniel@caiaq.de> Cc: linux-arm-kernel@lists.infradead.org Cc: Sascha Hauer <kernel@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-30USB: otg/ulpi: bail out on read errorsWolfram Sang
otg_read may return errnos, so bail out correctly to prevent bogus ID-numbers. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Daniel Mack <daniel@caiaq.de> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20USB: omap: switch to subsys_initcall for isp1301 transceiverViral Mehta
isp1301 transceiver driver init should be done before we do ohci omap init Signed-off-by: Viral Mehta <viral.mehta@lntinfotech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>