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

Unverified Commit 2a129f88 authored by derfelot's avatar derfelot Committed by GitHub
Browse files

Merge pull request #53 from Flamefire/patch-1

[Fix] Correct CABC and FS_CURR init of WLED
parents 8a07d5ac b70bcac3
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;