STRUCT APDS9306_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct apds9306_data(9) πŸ’–

okay so bestie, this is a page straight out of the Kernel API Manual, and it's literally the whole personality of struct apds9306_data β€” the private data and the register definitions for the apds9306 driver. it's giving "backstage pass to the light sensor" energy. let's go πŸ¦‹


✨ NAME ✨

struct apds9306_data β€” apds9306 private data and registers definitions. that's it, that's the vibe πŸŽ€


🌸 SYNOPSIS 🌸

struct apds9306_data {
    struct device *dev;
    struct iio_gts gts;
    struct mutex mutex;
    struct regmap *regmap;
    struct apds9306_regfields rf;
    int read_data_available;
 };

look at her. six fields. icon behavior only πŸ‘‘


πŸ’… Members πŸ’…

here's the friend group, member by member 🫢

  • dev β€” Pointer to the device structure. the main character of the struct, fr fr πŸ’«
  • gts β€” IIO Gain Time Scale structure. gain and time scale living rent free in here ✨
  • mutex β€” Lock for protecting adc reads, device settings changes where some calculations are required before or after setting or getting the raw settings values from regmap writes or reads respectively. no cap, she's the bouncer πŸšͺ β€” she keeps the ADC reads and the settings changes from stepping on each other, and she's specifically holding it down whenever some calculations have to happen before or after you set or get the raw settings values from regmap writes or reads respectively.
  • regmap β€” Regmap structure pointer. just a pointer, but she's important πŸ’œ
  • rf β€” Regmap register fields structure. the register fields, all cozy in one struct 🌈
  • read_data_available β€” Flag set by IRQ handler for ADC data available. the IRQ handler flips this one to say "bestie, the ADC data is here" πŸ”₯
ngl, that mutex description is a whole paragraph and i respect it β€” iykyk 😭

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./drivers/iio/light/apds9306.c struct
  • part_id_gts_multiplier(9), struct apds9306_regfields(9)

go read those too, they're literally the supporting cast πŸ’–


and that's a wrap, bestie πŸŽ€ this little gem comes to you from ./drivers/iio/light, dated October 2026, and the page itself is struct apds9306_data(9). slay, stan, read the source πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from