Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 201df0a7 authored by ChandanaKishori Chiluveru's avatar ChandanaKishori Chiluveru
Browse files

usb: msm_otg: Add LPM support for USB PHY regulators



If USB PHY is used for VBUS/ID detection, PHY internal pull-up resistors
can be used to keep USB lines pulled HIGH during disconnect. In this case
USB PHY regulators can't be turned off, but it can be put into LPM.

Currently we are supporting this capability only for PHY based control.
This patch adds the dtsi flag to allow this capability to put PHY 1P8
and 3P3 regulators in LPM during cable disconnect.

Change-Id: Ic7609a5bd5bedad5a4ca46b6ab9b9c0757e037d1
Signed-off-by: default avatarChandanaKishori Chiluveru <cchilu@codeaurora.org>
parent d70d0441
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -170,6 +170,8 @@ Optional properties :
       to/from DDR by controller.
- qcom,enable-sdp-typec-current-limit: Indicates whether type-c current for SDP CHARGER to
	be limited.
- qcom,enable-phy-id-pullup: If present, PHY can keep D+ pull-up resistor on USB ID line
	during cable disconnect.

Example HSUSB OTG controller device node :
	usb@f9690000 {
+4 −1
Original line number Diff line number Diff line
@@ -4085,6 +4085,8 @@ struct msm_otg_platform_data *msm_otg_dt_to_pdata(struct platform_device *pdev)
				"qcom,ahb-async-bridge-bypass");
	pdata->disable_retention_with_vdd_min = of_property_read_bool(node,
				"qcom,disable-retention-with-vdd-min");
	pdata->enable_phy_id_pullup = of_property_read_bool(node,
				"qcom,enable-phy-id-pullup");
	pdata->phy_dvdd_always_on = of_property_read_bool(node,
				"qcom,phy-dvdd-always-on");

@@ -4684,7 +4686,8 @@ static int msm_otg_probe(struct platform_device *pdev)
								!motg->phy_irq))
		motg->caps = ALLOW_PHY_POWER_COLLAPSE | ALLOW_PHY_RETENTION;

	if (motg->pdata->otg_control == OTG_PHY_CONTROL || motg->phy_irq)
	if (motg->pdata->otg_control == OTG_PHY_CONTROL || motg->phy_irq ||
				motg->pdata->enable_phy_id_pullup)
		motg->caps = ALLOW_PHY_RETENTION | ALLOW_PHY_REGULATORS_LPM;

	if (motg->pdata->mpm_dpshv_int || motg->pdata->mpm_dmshv_int)
+3 −0
Original line number Diff line number Diff line
@@ -258,6 +258,8 @@ enum usb_id_state {
 *		mode with controller in device mode.
 * @bool disable_retention_with_vdd_min: Indicates whether to enable
		allowing VDDmin without putting PHY into retention.
 * @bool enable_phy_id_pullup: Indicates whether phy id pullup is
		enabled or not.
 * @usb_id_gpio: Gpio used for USB ID detection.
 * @hub_reset_gpio: Gpio used for hub reset.
 * @switch_sel_gpio: Gpio used for controlling switch that
@@ -303,6 +305,7 @@ struct msm_otg_platform_data {
	int vddmin_gpio;
	bool enable_ahb2ahb_bypass;
	bool disable_retention_with_vdd_min;
	bool enable_phy_id_pullup;
	int usb_id_gpio;
	int hub_reset_gpio;
	int switch_sel_gpio;