leds: als: improve ALS reporting accuracy
authorPraveen Bharathi <pbharathi@motorola.com>
Wed, 24 Nov 2010 03:48:09 +0000 (21:48 -0600)
committerColin Cross <ccross@android.com>
Wed, 1 Dec 2010 00:25:27 +0000 (16:25 -0800)
Signed-off-by: Praveen Bharathi <pbharathi@motorola.com>
drivers/misc/max9635.c
include/linux/max9635.h

index 6a7d1756c9d7607606672e54018b7e5853193774..5faae259e5d28660f04add2796054264040f6254 100644 (file)
@@ -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);
index aef416691dbe6ef7d9cad7fc91f194bcfa9ebfa1..b91764910f0e47fecab4c330048ede0341e61548 100644 (file)
@@ -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__ */