STRUCT TSL2772_SETTINGS(9)
๐ NAME ๐
struct tsl2772_settings โ the settings struct for the tsl2772 driver, aka the little control panel where you tell the light/proximity sensor how to behave ๐
We're in the Kernel API Manual bestie, this is serious kernel business and also I'm obsessed.
โจ SYNOPSIS โจ
struct tsl2772_settings {
int als_time;
int als_gain;
int als_gain_trim;
int wait_time;
int prox_time;
int prox_gain;
int als_prox_config;
int als_cal_target;
u8 als_persistence;
bool als_interrupt_en;
int als_thresh_low;
int als_thresh_high;
u8 prox_persistence;
bool prox_interrupt_en;
int prox_thres_low;
int prox_thres_high;
int prox_pulse_count;
int prox_max_samples_cal;
int prox_diode;
int prox_power;
};
Twenty members, all typed out, no cap. Copy-paste responsibly โจ
๐ฆ MEMBERS ๐ฆ
Okay so here's the whole cast, main character by main character ๐
als_timeโ the integration time of the ALS channel ADCs, measured in2.73 msincrements. The total integration time works out to(256 - als_time) * 2.73. Math is mathing, slay ๐งฎals_gainโ an index into thetsl2772_als_gainarray. Not a gain itself, just the index, iykyk.als_gain_trimโ the default gain trim, there to account for aperture effects. Aperture said "make it look cute" and this is the correction ๐wait_timeโ the time between proximity and ALS cycles, in2.73periods. Yes,2.73periods, that's literally what it says.prox_timeโ integration time of the proximity ADC in2.73 msincrements. Total integration time is(256 - prx_time) * 2.73. Note that the variable in that formula is writtenprx_timeand fr fr I'm just telling you exactly what the page says ๐prox_gainโ an index into thetsl2772_prx_gainarray. Index squad ๐ซถals_prox_configโ the value of the ALS / Proximity configuration register. Raw register value, straight up, no filter.als_cal_targetโ the known external ALS reading used for calibration. A reference point, a benchmark, a vibe check for your calibration ๐ธals_persistenceโ H/W filters: the number of 'out of limits' ALS readings. (u8, bestie, so mind that width.)als_interrupt_enโ enable/disable ALS interrupts. (bool!)als_thresh_lowโ the CH0 'low' count that triggers the interrupt.als_thresh_highโ the CH0 'high' count that triggers the interrupt.prox_persistenceโ H/W filters: the number of 'out of limits' proximity readings. (u8again ๐)prox_interrupt_enโ enable/disable proximity interrupts. (bool.)prox_thres_lowโ low threshold proximity detection.prox_thres_highโ high threshold proximity detection. Matching set with the low one, we love a duo โจprox_pulse_countโ number of proximity emitter pulses. The header literally says "Number if proximity emitter pulses" โ typo era, but the meaning is the count of proximity emitter pulses ๐prox_max_samples_calโ the number of samples taken when performing a proximity calibration.prox_diodeโ which diode(s) get used for driving the external LED(s) for proximity sensing. Diode selection, iconic.prox_powerโ the amount of power used for the external LED(s). Turn it up (or down, your call, it's just a setting) ๐ฅ
Real talk: every single field above has a stated purpose and I'm not inventing any extra behaviour. If a field's meaning isn't spelled out here, it isn't spelled out here. Periodt.
๐ SEE ALSO ๐
- Kernel file
./include/linux/platform_data/tsl2772.handstruct tsl2772_platform_data(9)โ go read those next, bestie ๐ฆ
And that's the whole page, bestie!! ๐ซถ This absolute gem lives in ./include/linux/platform_data, it's from the Kernel API Manual, and it's dated October 2026 โ so it's technically from the future, which honestly tracks ๐
Stay curious, stay calibrated, mwah ๐โญ
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms