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

Commit bd4cb1fd authored by Bingzhe Cai's avatar Bingzhe Cai
Browse files

input: sensors: calibrate the cm36283 als sensor for 8x10 MTP



The cm36283 als sensor reported inaccurate illumination value
due to not calibrated on 8x10 MTP devices.

CRs-Fixed: 579407
Change-Id: Ie7239f11944579e3d107b3fe739844ceb764998b
Signed-off-by: default avatarOliver Wang <mengmeng@codeaurora.org>
Signed-off-by: default avatarBingzhe Cai <bingzhec@codeaurora.org>
parent 442d7807
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -1539,7 +1539,7 @@ static int cm36283_probe(struct i2c_client *client,
		__func__, lpi->ls_cmd);
	
	if (pdata->ls_cmd == 0) {
		lpi->ls_cmd  = CM36283_ALS_IT_160ms | CM36283_ALS_GAIN_2;
		lpi->ls_cmd  = CM36283_ALS_IT_80ms | CM36283_ALS_GAIN_2;
	}

	lp_info = lpi;
@@ -1556,17 +1556,17 @@ static int cm36283_probe(struct i2c_client *client,
	mutex_init(&ps_get_adc_mutex);


  //SET LUX STEP FACTOR HERE
  // if adc raw value one step = 5/100 = 1/20 = 0.05 lux
  // the following will set the factor 0.05 = 1/20
  // and lpi->golden_adc = 1;  
  // set als_kadc = (ALS_CALIBRATED <<16) | 20;

  als_kadc = (ALS_CALIBRATED <<16) | 20;
  lpi->golden_adc = 1;
	/*
	 * SET LUX STEP FACTOR HERE
	 * if adc raw value one step = 5/100 = 1/20 = 0.05 lux
	 * the following will set the factor 0.05 = 1/20
	 * and lpi->golden_adc = 1;
	 * set als_kadc = (ALS_CALIBRATED << 16) | 20;
	 */

  //ls calibrate always set to 1 
  lpi->ls_calibrate = 1;
	als_kadc = (ALS_CALIBRATED << 16) | 10;
	lpi->golden_adc = 100;
	lpi->ls_calibrate = 0;

	lightsensor_set_kvalue(lpi);
	ret = lightsensor_update_table(lpi);