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

Commit d169e873 authored by Mayank Rana's avatar Mayank Rana
Browse files

usb: dwc3: core: Disable internal clock gating conditionally



Currently USB DWC3 controller's internal clock gating is disabled
unconditionally. In few platform, it is possible to enable internal
clock gating with controller. Hence this change adds support to
disable this functionality conditionally using "snps,disable-clk-gating"
device tree property. With this change USB controller's internal clock
gating is enabled by default.

CRs-Fixed: 851877
Change-Id: I17d43a23d3bff0cb516b952c35c4a13af53f7777
Signed-off-by: default avatarMayank Rana <mrana@codeaurora.org>
parent 861a4ae9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ Optional properties:
 - snps,lpm-nyet-thresh: If present, will determine the value of DCTL[LPM_NYET_Thres].
	If BESL value received from the host in the LPM token is less than this value we send LPM ACK to
	the host. Otherwise the device returns LPM NYET.
 - snps,disable-clk-gating: If present, disable controller's internal clock gating. Default it is enabled.

This is usually a subnode to DWC3 glue to which it is connected.

+6 −1
Original line number Diff line number Diff line
@@ -565,7 +565,10 @@ int dwc3_core_init(struct dwc3 *dwc)
	 * stuck when entering low power modes. Revisit when there is
	 * a way to differentiate HW that no longer needs this.
	 */
	if (dwc->disable_clk_gating) {
		dev_dbg(dwc->dev, "Disabling controller clock gating.\n");
		reg |= DWC3_GCTL_DSBLCLKGTNG;
	}

	dwc3_writel(dwc->regs, DWC3_GCTL, reg);

@@ -870,6 +873,8 @@ static int dwc3_probe(struct platform_device *pdev)
		if (!ret)
			dwc->lpm_nyet_thresh = (u8)lpm_nyet_thresh;

		dwc->disable_clk_gating = of_property_read_bool(node,
					"snps,disable-clk-gating");
		if (dwc->enable_bus_suspend) {
			pm_runtime_set_autosuspend_delay(dev, 500);
			pm_runtime_use_autosuspend(dev);
+2 −0
Original line number Diff line number Diff line
@@ -927,6 +927,8 @@ struct dwc3 {
	unsigned		err_evt_seen:1;
	unsigned		usb3_u1u2_disable:1;
	unsigned		enable_bus_suspend:1;
	/* Indicate if need to disable controller internal clkgating */
	unsigned		disable_clk_gating:1;

	struct dwc3_gadget_events	dbg_gadget_events;