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

Commit 7147b81b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "ARM: msm: dts: Enable sdp check timer for sdm429"

parents eeea908a 3ce5ef7d
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -295,6 +295,8 @@ Optional properties :
- qcom,usbeth-reset-gpio: If present then an external usb-to-eth is connected to
	the USB host controller and its RESET_N signal is connected to this
	usbeth-reset-gpio GPIO. It should be driven LOW to RESET the usb-to-eth.
- qcom,enumeration-check-for-sdp: If present, start timer for SDP charger to check enumeration
	happen or not.

Example HSUSB OTG controller device node :
	usb@f9690000 {
+1 −0
Original line number Diff line number Diff line
@@ -463,6 +463,7 @@
		qcom,boost-sysclk-with-streaming;
		qcom,axi-prefetch-enable;
		qcom,hsusb-otg-delay-lpm;
		qcom,enumeration-check-for-sdp;

		qcom,msm-bus,name = "usb2";
		qcom,msm-bus,num-cases = <3>;
+2 −0
Original line number Diff line number Diff line
@@ -400,7 +400,9 @@ static int hw_device_state(u32 dma)
		hw_cwrite(CAP_USBINTR, ~0,
			     USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
		hw_cwrite(CAP_USBCMD, USBCMD_RS, USBCMD_RS);
		udc->transceiver->flags |= PHY_SOFT_CONNECT;
	} else {
		udc->transceiver->flags &= ~PHY_SOFT_CONNECT;
		hw_cwrite(CAP_USBCMD, USBCMD_RS, 0);
		hw_cwrite(CAP_USBINTR, ~0, 0);
		/* Clear BIT(31) to disable AHB2AHB Bypass functionality */
+21 −11
Original line number Diff line number Diff line
@@ -209,6 +209,7 @@ struct msm_otg_platform_data {
};

#define SDP_CHECK_DELAY_MS 10000 /* in ms */
#define SDP_CHECK_BOOT_DELAY_MS 30000 /* in ms */

#define MSM_USB_BASE	(motg->regs)
#define MSM_USB_PHY_CSR_BASE (motg->phy_csr_regs)
@@ -1910,13 +1911,14 @@ static void msm_otg_notify_charger(struct msm_otg *motg, unsigned int mA)
							motg->chg_type);

	psy_type = get_psy_type(motg);
	if (psy_type == POWER_SUPPLY_TYPE_USB_FLOAT) {
		if (!mA)
	if (psy_type == POWER_SUPPLY_TYPE_USB_FLOAT ||
		(psy_type == POWER_SUPPLY_TYPE_USB &&
			motg->enable_sdp_check_timer)) {
		if (!mA) {
			pval.intval = -ETIMEDOUT;
		else
			pval.intval = 1000 * mA;
			goto set_prop;
		}
	}

	if (motg->cur_power == mA)
		return;
@@ -2766,7 +2768,7 @@ static void check_for_sdp_connection(struct work_struct *w)
	struct msm_otg *motg = container_of(w, struct msm_otg, sdp_check.work);

	/* Cable disconnected or device enumerated as SDP */
	if (!motg->vbus_state || motg->phy.otg->gadget->state >=
	if (!motg->vbus_state || motg->phy.otg->gadget->state >
							USB_STATE_DEFAULT)
		return;

@@ -2847,13 +2849,18 @@ static void msm_otg_sm_work(struct work_struct *w)
				break;
			}

			if (get_psy_type(motg) == POWER_SUPPLY_TYPE_USB_FLOAT)
				queue_delayed_work(motg->otg_wq,
				  &motg->sdp_check,
				  msecs_to_jiffies(SDP_CHECK_DELAY_MS));

			pm_runtime_get_sync(otg->usb_phy->dev);
			msm_otg_start_peripheral(otg, 1);
			if (get_psy_type(motg) == POWER_SUPPLY_TYPE_USB_FLOAT ||
				(get_psy_type(motg) == POWER_SUPPLY_TYPE_USB &&
				motg->enable_sdp_check_timer)) {
				queue_delayed_work(motg->otg_wq,
					&motg->sdp_check,
					msecs_to_jiffies(
					(phy->flags & PHY_SOFT_CONNECT) ?
					SDP_CHECK_DELAY_MS :
					SDP_CHECK_BOOT_DELAY_MS));
			}
			otg->state = OTG_STATE_B_PERIPHERAL;
		} else {
			pr_debug("Cable disconnected\n");
@@ -4107,6 +4114,9 @@ static int msm_otg_probe(struct platform_device *pdev)
	of_property_read_u32(pdev->dev.of_node, "qcom,pm-qos-latency",
				&motg->pm_qos_latency);

	motg->enable_sdp_check_timer = of_property_read_bool(pdev->dev.of_node,
				"qcom,enumeration-check-for-sdp");

	pdata = msm_otg_dt_to_pdata(pdev);
	if (!pdata) {
		ret = -ENOMEM;
+1 −0
Original line number Diff line number Diff line
@@ -330,6 +330,7 @@ struct msm_otg {
	struct work_struct notify_charger_work;
	struct work_struct extcon_register_work;
	struct notifier_block psy_nb;
	bool enable_sdp_check_timer;
};

struct ci13xxx_platform_data {
Loading