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

Commit 1d987495 authored by Alexander Grund's avatar Alexander Grund
Browse files

[Fix] Correct CABC and FS_CURR init of WLED

bb0ac6ee introduced a Bug which originates in the original SONY kernel likely caused by a merge conflict
This change reuses code from `qpnp_wled_fs_curr_ua_store` which was likely intended here and fixes the indentation which makes verification of correctness easier
parent 7cd9d052
Loading
Loading
Loading
Loading
+45 −45
Original line number Diff line number Diff line
@@ -2321,6 +2321,10 @@ static int qpnp_wled_config(struct qpnp_wled *wled)
			if (wled->fs_curr_ua > QPNP_WLED_FS_CURR_MAX_UA)
				wled->fs_curr_ua = QPNP_WLED_FS_CURR_MAX_UA;

			if (wled->calc_curr)
				reg = (wled->fs_curr_ua + (QPNP_WLED_FS_CURR_STEP_UA - 1)) /
						QPNP_WLED_FS_CURR_STEP_UA;
			else
				reg = wled->fs_curr_ua / QPNP_WLED_FS_CURR_STEP_UA;
			mask = QPNP_WLED_FS_CURR_MASK;
			rc = qpnp_wled_masked_write_reg(wled,
@@ -2328,10 +2332,6 @@ static int qpnp_wled_config(struct qpnp_wled *wled)
				mask, reg);
			if (rc < 0)
				return rc;
			if (wled->calc_curr)
				temp = (wled->fs_curr_ua + (QPNP_WLED_FS_CURR_STEP_UA - 1)) /
					QPNP_WLED_FS_CURR_STEP_UA;
			else

			/* CABC */
			reg = wled->en_cabc ? (1  << QPNP_WLED_CABC_SHIFT) : 0;