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

Commit 0ce18820 authored by Devin Kim's avatar Devin Kim Committed by Oliver Wang
Browse files

Sensors: Apply ALS tuning value



Change-Id: I08330a18323baf81854adceac28f18faddc28ac9
Signed-off-by: default avatarDevin Kim <dojip.kim@lge.com>
Git-commit: f440e69976144c5d5a11a23f93479e30c1c383f1
Git-repo: https://android.googlesource.com/kernel/msm.git


[mengmeng@codeaurora.org: cherry picked from mirrored branch]
Signed-off-by: default avatarOliver Wang <mengmeng@codeaurora.org>
parent 7a6c15f0
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -611,6 +611,12 @@ static int LuxCalculation(struct i2c_client *client, int ch0data, int ch1data)
	int IAC2=0;
	int IAC=0;

	if (ch0data >= apds993x_als_res_tb[data->als_atime_index] ||
	    ch1data >= apds993x_als_res_tb[data->als_atime_index]) {
		luxValue = 30*1000;
		return luxValue;
	}

	/* re-adjust COE_B to avoid 2 decimal point */
	IAC1 = (ch0data - (apds993x_coe_b * ch1data) / 100);
	/* re-adjust COE_C and COE_D to void 2 decimal point */
@@ -630,7 +636,7 @@ static int LuxCalculation(struct i2c_client *client, int ch0data, int ch1data)
	}

	if (data->als_reduce) {
		luxValue = ((IAC * apds993x_ga * APDS993X_DF) / 100) * 4 /
		luxValue = ((IAC * apds993x_ga * APDS993X_DF) / 100) * 65 / 10 /
			((apds993x_als_integration_tb[data->als_atime_index] /
			  100) * apds993x_als_again_tb[data->als_again_index]);
	} else {