STRUCT TSL2772_SETTINGS(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– 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 in 2.73 ms increments. The total integration time works out to (256 - als_time) * 2.73. Math is mathing, slay ๐Ÿงฎ
  • als_gain โ€” an index into the tsl2772_als_gain array. 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, in 2.73 periods. Yes, 2.73 periods, that's literally what it says.
  • prox_time โ€” integration time of the proximity ADC in 2.73 ms increments. Total integration time is (256 - prx_time) * 2.73. Note that the variable in that formula is written prx_time and fr fr I'm just telling you exactly what the page says ๐Ÿ™ˆ
  • prox_gain โ€” an index into the tsl2772_prx_gain array. 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. (u8 again ๐Ÿ’œ)
  • 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.h and struct 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