From: Praveen Bharathi Date: Wed, 24 Nov 2010 03:48:09 +0000 (-0600) Subject: leds: als: improve ALS reporting accuracy X-Git-Tag: firefly_0821_release~9834^2~306 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=88f695fd3145e224607a08ddd1debd7132bc0685;p=firefly-linux-kernel-4.4.55.git leds: als: improve ALS reporting accuracy Signed-off-by: Praveen Bharathi --- diff --git a/drivers/misc/max9635.c b/drivers/misc/max9635.c index 6a7d1756c9d7..5faae259e5d2 100644 --- a/drivers/misc/max9635.c +++ b/drivers/misc/max9635.c @@ -235,12 +235,7 @@ static int max9635_read_adj_als(struct max9635_data *als_data) pr_info("exp = 0x%X, mant = 0x%X, lux = %d\n", exponent, mantissa, lux); - /* TODO: temporary lens coefficient adjustment, final - calculation pending on shipping lens profile. */ - if (lux < 200) - lux = lux * als_data->als_pdata->lens_coeff_l; - else - lux = lux * als_data->als_pdata->lens_coeff_h; + lux = lux * (exponent + als_data->als_pdata->lens_coeff); if (max9635_debug & 1) pr_info("%s:Reporting LUX %d\n", __func__, lux); diff --git a/include/linux/max9635.h b/include/linux/max9635.h index aef416691dbe..b91764910f0e 100644 --- a/include/linux/max9635.h +++ b/include/linux/max9635.h @@ -28,8 +28,7 @@ struct max9635_platform_data { u8 threshold_timer; u8 def_low_threshold; u8 def_high_threshold; - u8 lens_coeff_l; - u8 lens_coeff_h; + u8 lens_coeff; }; #endif /* __KERNEL__ */