/kernel/linux/linux-5.10/drivers/iio/light/ |
H A D | cm3232.c | 191 * cm3232_get_lux() - report current lux value 194 * Convert sensor data to lux. It depends on integration 197 * Return: Zero or positive value is lux, otherwise error code. 206 u64 lux; in cm3232_get_lux() local 213 lux = (__force u64)als_info->mlux_per_bit; in cm3232_get_lux() 214 lux *= als_info->mlux_per_bit_base_it; in cm3232_get_lux() 215 lux = div_u64(lux, als_it); in cm3232_get_lux() 224 lux *= chip->regs_als; in cm3232_get_lux() 225 lux * in cm3232_get_lux() [all...] |
H A D | tsl2583.c | 3 * Device driver for monitoring ambient light intensity (lux) 65 u16 lux; member 145 /* Default lux table. */ in tsl2583_defaults() 151 * Reads and calculates current lux value. 161 * calculate the lux. 166 u32 lux; /* raw lux calculated from device data */ in tsl2583_get_lux() local 185 ret = chip->als_cur_info.lux; /* return LAST VALUE */ in tsl2583_get_lux() 215 /* extract ALS/lux data */ in tsl2583_get_lux() 228 * calculated lux t in tsl2583_get_lux() [all...] |
H A D | cm32181.c | 299 * cm32181_get_lux() - report current lux value 302 * Convert sensor raw data to lux. It depends on integration 305 * Return: Positive value is lux, otherwise is error code. 312 u64 lux; in cm32181_get_lux() local 318 lux = cm32181->lux_per_bit; in cm32181_get_lux() 319 lux *= cm32181->lux_per_bit_base_it; in cm32181_get_lux() 320 lux = div_u64(lux, als_it); in cm32181_get_lux() 326 lux *= ret; in cm32181_get_lux() 327 lux * in cm32181_get_lux() [all...] |
H A D | cm3605.c | 76 s64 lux; in cm3605_get_lux() local 96 lux = res - 30; in cm3605_get_lux() 99 lux *= cm3605->als_max; in cm3605_get_lux() 100 lux = div64_s64(lux, CM3605_AOUT_TYP_MAX_MV); in cm3605_get_lux() 102 return lux; in cm3605_get_lux()
|
H A D | apds9300.c | 67 unsigned long lux, tmp; in apds9300_calculate_lux() local 75 lux = 3150 * ch0 - (unsigned long)DIV_ROUND_UP_ULL(ch0 in apds9300_calculate_lux() 78 lux = 2290 * ch0 - 2910 * ch1; in apds9300_calculate_lux() 80 lux = 1570 * ch0 - 1800 * ch1; in apds9300_calculate_lux() 82 lux = 338 * ch0 - 260 * ch1; in apds9300_calculate_lux() 84 lux = 0; in apds9300_calculate_lux() 87 return lux / 100000; in apds9300_calculate_lux()
|
H A D | tsl2772.c | 3 * Device driver for monitoring ambient light intensity in (lux) and proximity 147 u16 lux; member 399 * tsl2772_get_lux() - Reads and calculates current lux value. 405 * device gain. The code supports multiple lux equations through the lux table 406 * coefficients. A lux gain trim is applied to each lux equation, and then the 407 * maximum lux within the interval 0..65535 is selected. 432 ret = chip->als_cur_info.lux; /* return LAST VALUE */ in tsl2772_get_lux() 455 ret = chip->als_cur_info.lux; in tsl2772_get_lux() 463 int lux; tsl2772_get_lux() local [all...] |
H A D | opt3001.c | 157 * purposes. Use milli lux precision to avoid 32-bit integer in opt3001_find_scale() 173 int lux; in opt3001_to_iio_ret() local 175 lux = 10 * (mantissa << exponent); in opt3001_to_iio_ret() 176 *val = lux / 1000; in opt3001_to_iio_ret() 177 *val2 = (lux - (*val * 1000)) * 1000; in opt3001_to_iio_ret()
|
H A D | gp2ap002.c | 212 * This array maps current and lux. 214 * Ambient light sensing range is 3 to 55000 lux. 219 * When the ADC measures 0, return 0 lux. 231 u16 lux; in gp2ap002_get_lux() local 241 lux = gp2ap002_illuminance_table[res]; in gp2ap002_get_lux() 243 return (int)lux; in gp2ap002_get_lux()
|
/kernel/linux/linux-6.6/drivers/iio/light/ |
H A D | cm3232.c | 191 * cm3232_get_lux() - report current lux value 194 * Convert sensor data to lux. It depends on integration 197 * Return: Zero or positive value is lux, otherwise error code. 206 u64 lux; in cm3232_get_lux() local 213 lux = (__force u64)als_info->mlux_per_bit; in cm3232_get_lux() 214 lux *= als_info->mlux_per_bit_base_it; in cm3232_get_lux() 215 lux = div_u64(lux, als_it); in cm3232_get_lux() 224 lux *= chip->regs_als; in cm3232_get_lux() 225 lux * in cm3232_get_lux() [all...] |
H A D | tsl2583.c | 3 * Device driver for monitoring ambient light intensity (lux) 65 u16 lux; member 145 /* Default lux table. */ in tsl2583_defaults() 151 * Reads and calculates current lux value. 161 * calculate the lux. 166 u32 lux; /* raw lux calculated from device data */ in tsl2583_get_lux() local 185 ret = chip->als_cur_info.lux; /* return LAST VALUE */ in tsl2583_get_lux() 215 /* extract ALS/lux data */ in tsl2583_get_lux() 228 * calculated lux t in tsl2583_get_lux() [all...] |
H A D | cm32181.c | 299 * cm32181_get_lux() - report current lux value 302 * Convert sensor raw data to lux. It depends on integration 305 * Return: Positive value is lux, otherwise is error code. 312 u64 lux; in cm32181_get_lux() local 318 lux = cm32181->lux_per_bit; in cm32181_get_lux() 319 lux *= cm32181->lux_per_bit_base_it; in cm32181_get_lux() 320 lux = div_u64(lux, als_it); in cm32181_get_lux() 326 lux *= ret; in cm32181_get_lux() 327 lux * in cm32181_get_lux() [all...] |
H A D | cm3605.c | 77 s64 lux; in cm3605_get_lux() local 97 lux = res - 30; in cm3605_get_lux() 100 lux *= cm3605->als_max; in cm3605_get_lux() 101 lux = div64_s64(lux, CM3605_AOUT_TYP_MAX_MV); in cm3605_get_lux() 103 return lux; in cm3605_get_lux()
|
H A D | apds9300.c | 67 unsigned long lux, tmp; in apds9300_calculate_lux() local 75 lux = 3150 * ch0 - (unsigned long)DIV_ROUND_UP_ULL(ch0 in apds9300_calculate_lux() 78 lux = 2290 * ch0 - 2910 * ch1; in apds9300_calculate_lux() 80 lux = 1570 * ch0 - 1800 * ch1; in apds9300_calculate_lux() 82 lux = 338 * ch0 - 260 * ch1; in apds9300_calculate_lux() 84 lux = 0; in apds9300_calculate_lux() 87 return lux / 100000; in apds9300_calculate_lux()
|
H A D | tsl2772.c | 3 * Device driver for monitoring ambient light intensity in (lux) and proximity 149 u16 lux; member 401 * tsl2772_get_lux() - Reads and calculates current lux value. 407 * device gain. The code supports multiple lux equations through the lux table 408 * coefficients. A lux gain trim is applied to each lux equation, and then the 409 * maximum lux within the interval 0..65535 is selected. 434 ret = chip->als_cur_info.lux; /* return LAST VALUE */ in tsl2772_get_lux() 457 ret = chip->als_cur_info.lux; in tsl2772_get_lux() 465 int lux; tsl2772_get_lux() local [all...] |
H A D | opt3001.c | 157 * purposes. Use milli lux precision to avoid 32-bit integer in opt3001_find_scale() 173 int lux; in opt3001_to_iio_ret() local 175 lux = 10 * (mantissa << exponent); in opt3001_to_iio_ret() 176 *val = lux / 1000; in opt3001_to_iio_ret() 177 *val2 = (lux - (*val * 1000)) * 1000; in opt3001_to_iio_ret()
|
H A D | tsl2591.c | 417 * tsl2591_read_channel_data - Reads raw channel data and calculates lux 419 * Formula for lux calculation; 423 * lux = ((C0DATA - C1DATA) * (1 - (C1DATA / C0DATA))) / CPL 425 * Scale values to get more representative value of lux i.e. 426 * lux = ((C0DATA - C1DATA) * (1000 - ((C1DATA * 1000) / C0DATA))) / CPL 439 int counts_per_lux, int_time_fval, gain_multi, lux; in tsl2591_read_channel_data() local 477 /* Calculate counts per lux value */ in tsl2591_read_channel_data() 482 /* Calculate lux value */ in tsl2591_read_channel_data() 483 lux = ((als_ch0 - als_ch1) * in tsl2591_read_channel_data() 486 dev_dbg(&client->dev, "Raw lux calculatio in tsl2591_read_channel_data() [all...] |
H A D | ltrf216a.c | 75 * in calculating lux. 87 * remains constant during the measurement of lux. 237 u64 lux, div; in ltrf216a_get_lux() local 249 lux = greendata * 45 * LTRF216A_WIN_FAC * 100; in ltrf216a_get_lux() 252 return div_u64(lux, div); in ltrf216a_get_lux()
|
H A D | gp2ap002.c | 212 * This array maps current and lux. 214 * Ambient light sensing range is 3 to 55000 lux. 219 * When the ADC measures 0, return 0 lux. 231 u16 lux; in gp2ap002_get_lux() local 241 lux = gp2ap002_illuminance_table[res]; in gp2ap002_get_lux() 243 return (int)lux; in gp2ap002_get_lux()
|
/kernel/linux/linux-5.10/drivers/misc/ |
H A D | tsl2550.c | 145 unsigned int lux; in tsl2550_calculate_lux() local 161 lux = ((c0 - c1) * ratio_lut[r]) / 256; in tsl2550_calculate_lux() 163 lux = 0; in tsl2550_calculate_lux() 168 return lux > TSL2550_MAX_LUX ? TSL2550_MAX_LUX : lux; in tsl2550_calculate_lux()
|
H A D | isl29020.c | 43 unsigned long int lux; in als_lux_input_data_show() local 70 lux = ((((1 << (2 * (val & 3))))*1000) * ret_val) / 65536; in als_lux_input_data_show() 71 return sprintf(buf, "%ld\n", lux); in als_lux_input_data_show()
|
H A D | apds990x.c | 138 u32 lux; member 248 static u16 apds990x_lux_to_threshold(struct apds990x_chip *chip, u32 lux) in apds990x_lux_to_threshold() argument 254 if (lux == 0) in apds990x_lux_to_threshold() 256 else if (lux == APDS_RANGE) in apds990x_lux_to_threshold() 268 * Math: threshold = lux * cpl where in apds990x_lux_to_threshold() 270 * (count-per-lux) in apds990x_lux_to_threshold() 274 lux = lux * (APDS_CALIB_SCALER / 4) / (chip->lux_calib / 4); in apds990x_lux_to_threshold() 280 thres = lux * cpl / 64; in apds990x_lux_to_threshold() 498 chip->lux in apds990x_irq() [all...] |
/kernel/linux/linux-6.6/drivers/misc/ |
H A D | tsl2550.c | 145 unsigned int lux; in tsl2550_calculate_lux() local 161 lux = ((c0 - c1) * ratio_lut[r]) / 256; in tsl2550_calculate_lux() 163 lux = 0; in tsl2550_calculate_lux() 168 return lux > TSL2550_MAX_LUX ? TSL2550_MAX_LUX : lux; in tsl2550_calculate_lux()
|
H A D | isl29020.c | 43 unsigned long int lux; in als_lux_input_data_show() local 70 lux = ((((1 << (2 * (val & 3))))*1000) * ret_val) / 65536; in als_lux_input_data_show() 71 return sprintf(buf, "%ld\n", lux); in als_lux_input_data_show()
|
H A D | apds990x.c | 138 u32 lux; member 248 static u16 apds990x_lux_to_threshold(struct apds990x_chip *chip, u32 lux) in apds990x_lux_to_threshold() argument 254 if (lux == 0) in apds990x_lux_to_threshold() 256 else if (lux == APDS_RANGE) in apds990x_lux_to_threshold() 268 * Math: threshold = lux * cpl where in apds990x_lux_to_threshold() 270 * (count-per-lux) in apds990x_lux_to_threshold() 274 lux = lux * (APDS_CALIB_SCALER / 4) / (chip->lux_calib / 4); in apds990x_lux_to_threshold() 280 thres = lux * cpl / 64; in apds990x_lux_to_threshold() 498 chip->lux in apds990x_irq() [all...] |
/kernel/linux/linux-6.6/drivers/hid/amd-sfh-hid/sfh1_1/ |
H A D | amd_sfh_interface.h | 136 u32 lux; member
|