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

Commit 3cf7dfe8 authored by Daqing Chen's avatar Daqing Chen
Browse files

input: sensors: modify the apds9930 light sensor algorithms



Modify the apds9930 light sensor algorithms to make sure the
lux value output smoothly. So this fix is just to improve light
sensor's stability.

Change-Id: I0a7a821db68f57781fed64cf1e25b47efb35eba3
Signed-off-by: default avatarDaqing Chen <chendaqing@codeaurora.org>
parent c5353f99
Loading
Loading
Loading
Loading
+3 −9
Original line number Diff line number Diff line
@@ -705,15 +705,9 @@ static int LuxCalculation(struct i2c_client *client, int ch0data, int ch1data)
		return -1; 	/* don't report first, change gain may help */
	}

	if (data->als_reduce) {
	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 {
		luxValue = ((IAC * apds993x_ga * APDS993X_DF) /100) /
			((apds993x_als_integration_tb[data->als_atime_index] /
			  100) * apds993x_als_again_tb[data->als_again_index]);
	}

	return luxValue;
}