STRUCT SX_COMMON_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct sx_common_ops β€” function pointers needed by common code ✨

okay so bestie, welcome to struct sx_common_ops(9) from the Kernel API Manual πŸ¦‹ this is the little squad of function pointers that the common code needs to do its thing, and we're gonna go through every single one of them, no skips, no cap πŸ’…


🌸 SYNOPSIS 🌸

like, here's the whole struct, exactly as it is, don't touch:

struct sx_common_ops {
    int (*read_prox_data)(struct sx_common_data *data, const struct
iio_chan_spec *chan, __be16 *val);
    int (*check_whoami)(struct device *dev, struct iio_dev *indio_dev);
    int (*init_compensation)(struct iio_dev *indio_dev);
    int (*wait_for_sample)(struct sx_common_data *data);
    const struct sx_common_reg_default  * (*get_default_reg)(struct
device *dev, int idx, struct sx_common_reg_default *reg_def);
 };

literally the blueprint of who does what, periodt 😌


πŸŽ€ Members πŸŽ€

  • read_prox_data β€” the function that reads the raw proximity data πŸ“–βœ¨ this is the one whose whole job is grabbing that raw prox goodness.
  • check_whoami β€” sets the device name based on the whoami register πŸͺͺ iykyk, gotta know who you are before anything else.
  • init_compensation β€” the function that sets the initial compensation 🎯 getting things balanced from the jump.
  • wait_for_sample β€” when there are no physical IRQ, this is the function that waits for a sample to be ready ⏳ no hardware interrupt? no problem, this one just chills until the sample shows up.
  • get_default_reg β€” populates the initial value for a given register 🧚 filling in the defaults like the icon it is.

πŸ’– Description πŸ’–

so the whole vibe here is: this is the list of functions that the common code needs so it can gather information or configure the sensor πŸ”₯ like a roster of the specialists it calls up whenever it needs something done. that's it, that's the energy 🌈


πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./drivers/iio/proximity/sx_common.h
  • struct sx_common_chip_info(9)
  • struct sx_common_data(9)

go read those too bestie, the lore goes deep 🫢


and that's the whole page!! mwah πŸ’‹ this cutie lives in ./drivers/iio/proximity and it's dated October 2026 ⭐ so like, remember that when you're citing it in your little writeup, okay? slay πŸ’œ

πŸ“¦ where this page comes from