summaryrefslogtreecommitdiff
path: root/include/linux/usb/phy.h (follow)
Commit message (Collapse)AuthorAge
* usb: dwc3: Support float charger detectionSriharsha Allenki2019-06-04
| | | | | | | | | | | | | | Chargers on some platforms do not support FLOAT charger detection. On these platforms, the float charger can be detected depending on the state of the DP and DM lines as detected by the PHY. So, on these platforms check for the DP DM line state and if found floating, do not start the peripheral mode and notify PMIC -ETIMEDOUT implying the connected charger is of type float. Change-Id: I6bf54b0d5c143a849ce9ea7bc515d62204ed2f33 Signed-off-by: Sriharsha Allenki <sallenki@codeaurora.org>
* usb: Remove DPDM pulsing functionalityMayank Rana2016-03-23
| | | | | | | This change removes DP DM pulsing functionality related support from QUSB PHY driver as it is not required. Signed-off-by: Mayank Rana <mrana@codeaurora.org>
* USB: phy: Add support to invoke DP and DM sourcing and pulsingMayank Rana2016-03-22
| | | | | | | | | | | | | | This change adds support for sourcing and pulsig with DP/DM using QUSB PHY. This change uses POWER_SUPPLY_PROP_DP_DM power supply property with different values to achieve the same. This change is a cherry-pick of msm-3.18 commit 55b93e2506d5399b1b0ee4a1b173168fb8026548 ("USB: Add support to invoke DP and DM sourcing and pulsing") with only the change from include/linux/usb/phy.h Signed-off-by: Mayank Rana <mrana@codeaurora.org> Signed-off-by: Jack Pham <jackp@codeaurora.org>
* usb: phy: Add new OTG state OTG_STATE_B_SUSPENDEDHemant Kumar2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This state is used to handle:- - Bus suspend followed by cable disconnect: pm usage count is incremented upon cable connect. Upon bus suspend, suspend interrupt kicks in otg state machine which moves device state to OTG_STATE_B_SUSPENDED from OTG_STATE_B_PERIPHERAL and decrements pm usage count. Upon cable unplug additional decrement of pm usage count is prevented. This state also takes care the handling of cable unplug followed by bus suspend interrupt. - Host initiated resume after bus suspend: Being in OTG_STATE_B_SUSPENDED after bus suspend, upon host initiated resume, wakeup interrupt kicks in otg state machine which moves device to OTG_STATE_B_PERIPHERAL state by incrementing pm usage count. - PC reboot with cable plugged in: After PC shutdown device goes to OTG_STATE_B_SUSPENDED state. After PC start power event irq thread kicks in otg state machine to move device to OTG_STATE_B_PERIPHERAL state and increments pm usage count. - Composition switch after bus suspend: dwc3_gadget_pullup() kicks in otg state machine to move device state from OTG_STATE_B_SUSPENDED to OTG_STATE_B_PERIPHERAL and increments pm usage count to prevent runtime suspend during device enumeration. Also, remove pm_runtime_set_active() which sets the PM runtime stauts as active to avoid pm_runtime_get_sync() failures which explicitly checks for runtime pm status. For example, if status is active, pm_runtime_get_sync() will just increments the counter without actually resuming the device. Change-Id: Id33b81911ef3894a00802b3e553840b9447f6269 Signed-off-by: Hemant Kumar <hemantk@codeaurora.org> [jackp@codeaurora.org: cherry-pick only phy.h and common.c] Signed-off-by: Jack Pham <jackp@codeaurora.org>
* usb: phy: Expose new PHY callback for performing PHY resetMaya Erez2016-03-22
| | | | | | | | | | Add a new PHY callback for performing PHY reset, which is required by some targets during their initialization sequence. As usb_phy_reset name was already in use by local msm PHY APIs, change the previous usb_phy_reset to msm_usb_phy_reset. Change-Id: Ieb5099d12e107c123d8889058aa564d0b091d6f9 Signed-off-by: Maya Erez <merez@codeaurora.org>
* usb: phy: change some commentsPeter Chen2015-09-27
| | | | | | | | - Replace all "transceiver" with "phy" - Replace one "OTG controller" with "phy" Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: add static inline wrapper for devm_usb_get_phy_by_nodeArnd Bergmann2015-05-28
| | | | | | | | | | | | | | | | | | The newly introduced devm_usb_get_phy_by_node function only has an extern declaration, but no alternative for the case that CONFIG_USB_PHY is disabled, which leads to a build error when it is used anyway: drivers/power/twl4030_charger.c: In function 'twl4030_bci_probe': drivers/power/twl4030_charger.c:648:23: error: implicit declaration of function 'devm_usb_get_phy_by_node' [-Werror=implicit-function-declaration] bci->transceiver = devm_usb_get_phy_by_node( This adds the wrapper in the same way that we have one for all other usb-phy API functions. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: e842b84c8e7 ("usb: phy: Add interface to get phy give of device_node.") Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: Add interface to get phy give of device_node.NeilBrown2015-05-26
| | | | | | | | | | | | | | | | | | | Split the "get phy from device_node" functionality out of "get phy by phandle" so it can be used directly. This is useful when a battery-charger is intimately associated with a particular phy but handled by a separate driver. The charger can find the device_node based on sibling relationships without the need for a redundant declaration in the devicetree description. As a peripheral that gets a phy will often want to register a notifier block, and de-register it later, that functionality is included so the de-registration is automatic. Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: NeilBrown <neilb@suse.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: change some commentsPeter Chen2015-01-12
| | | | | | | | - Delete the OTG stuffs - .set_suspend is for controller, not for A-device or B-device. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: introduce usb_phy_set_event interfaceKiran Raparthy2014-11-21
| | | | | | | | | | | | | | | | | | | | | PHY drivers require a generic interface to handle per-PHY events. usb_phy_set_event interface sets event to phy event. PHY drivers call this interface for each phy event. Cc: Felipe Balbi <balbi@ti.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-kernel@vger.kernel.org Cc: linux-usb@vger.kernel.org Cc: Android Kernel Team <kernel-team@android.com> Cc: John Stultz <john.stultz@linaro.org> Cc: Sumit Semwal <sumit.semwal@linaro.org> Cc: Arve Hj�nnev�g <arve@android.com> Cc: Benoit Goby <benoit@android.com> [Original patch in Android from Todd] Cc: Todd Poynor <toddpoynor@google.com> Signed-off-by: Kiran Raparthy <kiran.kumar@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: move the OTG state from the USB PHY to the OTG structureAntoine Tenart2014-11-03
| | | | | | | | | | | | | | | | Before using the PHY framework instead of the USB PHY one, we need to move the OTG state into another place, since it won't be available when USB PHY isn't used. This patch moves the OTG state into the OTG structure, and makes all the needed modifications in the drivers using the OTG state. [ balbi@ti.com : fix build regressions with phy-tahvo.c, musb_dsps.c, phy-isp1301-omap, and chipidea's debug.c ] Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: Add set_wakeup APIPeter Chen2014-03-05
| | | | | | | | | This API is used to set wakeup enable at PHY registers, in that case, the PHY can be waken up from suspend due to external events, like vbus change, dp/dm change and id change. Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: protect against NULL phy pointersFelipe Balbi2013-07-29
| | | | | | | | In order to decrease the amount of work done by PHY users, allow NULL phy pointers to be passed. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: add devicetree helpers for determining dr_mode and phy_typeMichael Grzeschik2013-06-17
| | | | | | | | | | | | | This adds two little devicetree helper functions for determining the dr_mode (host, peripheral, otg) and phy_type (utmi, ulpi,...) from the devicetree. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: phy: return -ENXIO when PHY layer isn't enabledFelipe Balbi2013-03-18
| | | | | | | | | | | | | | | | in cases where PHY layer isn't enabled, we want to still return an error code (actually an error pointer) so that our users don't need to cope with either error pointer of NULL. This will simplify users as below: - return IS_ERR(phy) ? PTR_ERR(phy) : -ENODEV; + return PTR_ERR(phy); Acked-by: Kishon Vijay Abraham I <kishon@ti.com> Reported-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: introduce ->set_vbus() methodFelipe Balbi2013-03-18
| | | | | | | | | | | | | | | | | | | | | this method will be used to enable or disable the charge pump. Whenever we have DRD devices, we need to be able to turn VBUS on or off whenever we want. Note that in the ideal case, this would be controlled by the ID-pin Interrupt, but not all devices have ID-pin properly routed since manufacturers can choose to save that trace if they're building a host-only product out of a DRD IP. This is also useful during debugging where we might not have the proper cable hanging around. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: make it a menuconfigFelipe Balbi2013-03-18
| | | | | | | | | | | | | | We already have a considerable amount of USB PHY drivers, making it a menuconfig just prevents us from adding too much churn to USB's menuconfig. While at that, also select USB_OTG_UTILS from this new menuconfig just to keep backwards compatibility until we manage to remove that symbol. Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: otg: add device tree support to otg libraryKishon Vijay Abraham I2013-01-25
| | | | | | | | | | | Added an API devm_usb_get_phy_by_phandle(), to get usb phy by passing a device node phandle value. This function will return a pointer to the phy on success, -EPROBE_DEFER if there is a device_node for the phandle, but the phy has not been added, or a ERR_PTR() otherwise. Cc: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: otg: utils: add facilities in phy lib to support multiple PHYs of same typeKishon Vijay Abraham I2013-01-25
| | | | | | | | | | | | | | | | In order to add support for multipe PHY's of the same type, new API's for adding PHY and getting PHY has been added. Now the binding information for the PHY and controller should be done in platform file using usb_bind_phy API. And for getting a PHY, the device pointer of the USB controller and an index should be passed. Based on the binding information that is added in the platform file, usb_get_phy_dev will return the appropriate PHY. Already existing API's to add and get phy by type is not removed. These API's are deprecated and will be removed once all the platforms start to use the new API. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: otg: add an api to bind the usb controller and phyKishon Vijay Abraham I2013-01-25
| | | | | | | | | | | In order to support platforms which has multiple PHY's (of same type) and which has multiple USB controllers, a new design is adopted wherin the binding information (between the PHY and the USB controller) should be passed to the PHY library from platform specific file (board file). So added a new API to pass the binding information. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: phy: change phy notify connect/disconnect APIPeter Chen2012-11-15
| | | | | | | | | | | | | The old parameter "port" is useless for phy notify, as one usb phy is only for one usb port. New parameter "speed" stands for the device's speed which is on the port, this "speed" parameter is needed at some platforms which will do some phy operations according to device's speed. Signed-off-by: Peter Chen <peter.chen@freescale.com> Tested-by: Mike Thompson <mpthompson@gmail.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* usb: phy: fix build breakVenu Byravarasu2012-09-06
| | | | | | | | | | | | | During phy interface separation from otg.h, as the enum "usb_otg_state" was having multiple otg states info and removal of member 'state' of this enum type from usb_phy struct did not generate any compilation issues, I removed member state from struct usb_phy. As this is causing build break in musb code, adding member 'state' to usb_phy structure. Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
* usb: otg: Move phy interface to separate file.Venu Byravarasu2012-09-05
As otg.h is containing lots of phy interface related stuff, moving all phy interface related stuff to new file named phy.h Signed-off-by: Venu Byravarasu <vbyravarasu@nvidia.com> Signed-off-by: Felipe Balbi <balbi@ti.com>