Lines Matching refs:settings
175 struct tsl2772_settings settings; member
477 lux = (lux * chip->settings.als_gain_trim) / 1000; in tsl2772_get_lux()
563 chip->settings.prox_power = tsl2772_led_currents[i][1]; in tsl2772_read_prox_led_current()
625 memcpy(&chip->settings, chip->pdata->platform_default_settings, in tsl2772_defaults()
628 memcpy(&chip->settings, &tsl2772_default_settings, in tsl2772_defaults()
686 ret = (chip->settings.als_cal_target * chip->settings.als_gain_trim) / in tsl2772_als_calibrate()
691 chip->settings.als_gain_trim = ret; in tsl2772_als_calibrate()
710 chip->tsl2772_config[TSL2772_ALS_TIME] = chip->settings.als_time; in tsl2772_chip_on()
711 chip->tsl2772_config[TSL2772_PRX_TIME] = chip->settings.prox_time; in tsl2772_chip_on()
712 chip->tsl2772_config[TSL2772_WAIT_TIME] = chip->settings.wait_time; in tsl2772_chip_on()
714 chip->settings.als_prox_config; in tsl2772_chip_on()
717 (chip->settings.als_thresh_low) & 0xFF; in tsl2772_chip_on()
719 (chip->settings.als_thresh_low >> 8) & 0xFF; in tsl2772_chip_on()
721 (chip->settings.als_thresh_high) & 0xFF; in tsl2772_chip_on()
723 (chip->settings.als_thresh_high >> 8) & 0xFF; in tsl2772_chip_on()
725 (chip->settings.prox_persistence & 0xFF) << 4 | in tsl2772_chip_on()
726 (chip->settings.als_persistence & 0xFF); in tsl2772_chip_on()
729 chip->settings.prox_pulse_count; in tsl2772_chip_on()
731 (chip->settings.prox_thres_low) & 0xFF; in tsl2772_chip_on()
733 (chip->settings.prox_thres_low >> 8) & 0xFF; in tsl2772_chip_on()
735 (chip->settings.prox_thres_high) & 0xFF; in tsl2772_chip_on()
737 (chip->settings.prox_thres_high >> 8) & 0xFF; in tsl2772_chip_on()
748 (chip->settings.als_gain & 0xFF) | in tsl2772_chip_on()
749 ((chip->settings.prox_gain & 0xFF) << 2) | in tsl2772_chip_on()
750 (chip->settings.prox_diode << 4) | in tsl2772_chip_on()
751 (chip->settings.prox_power << 6); in tsl2772_chip_on()
754 als_count = 256 - chip->settings.als_time; in tsl2772_chip_on()
758 tsl2772_als_gain[chip->settings.als_gain]; in tsl2772_chip_on()
791 if (chip->settings.als_interrupt_en) in tsl2772_chip_on()
793 if (chip->settings.prox_interrupt_en) in tsl2772_chip_on()
870 if (chip->settings.prox_max_samples_cal < 1 || in tsl2772_prox_cal()
871 chip->settings.prox_max_samples_cal > MAX_SAMPLES_CAL) in tsl2772_prox_cal()
874 for (i = 0; i < chip->settings.prox_max_samples_cal; i++) { in tsl2772_prox_cal()
885 for (i = 0; i < chip->settings.prox_max_samples_cal; i++) { in tsl2772_prox_cal()
889 mean = sample_sum / chip->settings.prox_max_samples_cal; in tsl2772_prox_cal()
891 chip->settings.prox_thres_high = (max << 1) - mean; in tsl2772_prox_cal()
930 return scnprintf(buf, PAGE_SIZE, "%d\n", chip->settings.als_cal_target); in in_illuminance0_target_input_show()
945 chip->settings.als_cal_target = value; in in_illuminance0_target_input_store()
1074 return chip->settings.als_interrupt_en; in tsl2772_read_interrupt_config()
1076 return chip->settings.prox_interrupt_en; in tsl2772_read_interrupt_config()
1088 chip->settings.als_interrupt_en = val ? true : false; in tsl2772_write_interrupt_config()
1090 chip->settings.prox_interrupt_en = val ? true : false; in tsl2772_write_interrupt_config()
1111 chip->settings.als_thresh_high = val; in tsl2772_write_event_value()
1115 chip->settings.als_thresh_low = val; in tsl2772_write_event_value()
1124 chip->settings.prox_thres_high = val; in tsl2772_write_event_value()
1128 chip->settings.prox_thres_low = val; in tsl2772_write_event_value()
1138 time = chip->settings.als_time; in tsl2772_write_event_value()
1140 time = chip->settings.prox_time; in tsl2772_write_event_value()
1151 chip->settings.als_persistence = persistence; in tsl2772_write_event_value()
1153 chip->settings.prox_persistence = persistence; in tsl2772_write_event_value()
1184 *val = chip->settings.als_thresh_high; in tsl2772_read_event_value()
1187 *val = chip->settings.als_thresh_low; in tsl2772_read_event_value()
1195 *val = chip->settings.prox_thres_high; in tsl2772_read_event_value()
1198 *val = chip->settings.prox_thres_low; in tsl2772_read_event_value()
1207 time = chip->settings.als_time; in tsl2772_read_event_value()
1208 persistence = chip->settings.als_persistence; in tsl2772_read_event_value()
1214 time = chip->settings.prox_time; in tsl2772_read_event_value()
1215 persistence = chip->settings.prox_persistence; in tsl2772_read_event_value()
1266 *val = tsl2772_als_gain[chip->settings.als_gain]; in tsl2772_read_raw()
1268 *val = tsl2772_prox_gain[chip->settings.prox_gain]; in tsl2772_read_raw()
1271 *val = chip->settings.als_gain_trim; in tsl2772_read_raw()
1275 *val2 = (256 - chip->settings.als_time) * in tsl2772_read_raw()
1296 chip->settings.als_gain = 0; in tsl2772_write_raw()
1299 chip->settings.als_gain = 1; in tsl2772_write_raw()
1302 chip->settings.als_gain = 2; in tsl2772_write_raw()
1305 chip->settings.als_gain = 3; in tsl2772_write_raw()
1313 chip->settings.prox_gain = 0; in tsl2772_write_raw()
1316 chip->settings.prox_gain = 1; in tsl2772_write_raw()
1319 chip->settings.prox_gain = 2; in tsl2772_write_raw()
1322 chip->settings.prox_gain = 3; in tsl2772_write_raw()
1334 chip->settings.als_gain_trim = val; in tsl2772_write_raw()
1341 chip->settings.als_time = 256 - in tsl2772_write_raw()