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

Commit 9aa24e9b authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran
Browse files

drm/msm: control regulator through s/w based on disp_rsc availability



Enable the regulator only for the first time through software
when the target is RSCC enabled. After that, RSCC hardware will
take care of toggling the regulator appropriately during suspend/
resume or idle pc cases. When display rsc is not available/enabled,
gdsc regulator is fully controlled through the software.

Change-Id: Icca05b8969d0f9589c00ab51fd790658b23f42d3
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent c6d522c5
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -841,7 +841,15 @@ int sde_power_resource_enable(struct sde_power_handle *phandle,
			goto data_bus_hdl_err;
		}

		if (!phandle->rsc_client_init) {
		/*
		 * - When the target is RSCC enabled, regulator should
		 *   be enabled by the s/w only for the first time during
		 *   bootup. After that, RSCC hardware takes care of enabling/
		 *   disabling it.
		 * - When the target is not RSCC enabled, regulator should
		 *   be totally handled by the software.
		 */
		if (!phandle->rsc_client) {
			rc = msm_dss_enable_vreg(mp->vreg_config, mp->num_vreg,
									enable);
			if (rc) {
@@ -883,7 +891,7 @@ int sde_power_resource_enable(struct sde_power_handle *phandle,
		sde_power_reg_bus_update(phandle->reg_bus_hdl,
							max_usecase_ndx);

		if (!phandle->rsc_client_init)
		if (!phandle->rsc_client)
			msm_dss_enable_vreg(mp->vreg_config, mp->num_vreg,
									enable);
		sde_power_data_bus_update(&phandle->data_bus_handle, enable);
@@ -901,7 +909,7 @@ int sde_power_resource_enable(struct sde_power_handle *phandle,
rsc_err:
	sde_power_reg_bus_update(phandle->reg_bus_hdl, prev_usecase_ndx);
reg_bus_hdl_err:
	if (!phandle->rsc_client_init)
	if (!phandle->rsc_client)
		msm_dss_enable_vreg(mp->vreg_config, mp->num_vreg, 0);
vreg_err:
	sde_power_data_bus_update(&phandle->data_bus_handle, 0);