STRUCT XOADC_CHANNEL(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 struct xoadc_channel(9) 🌸

okay so bestie, welcome to the Kernel API Manual section for struct xoadc_channel(9) β€” the manual name is literally in the title, we're already iconic ✨


πŸ’– NAME πŸ’–

struct xoadc_channel β€” it encodes channel properties and defaults, that's the whole job, and it does it slayfully πŸ’…


✨ SYNOPSIS ✨

struct xoadc_channel {
    const char *datasheet_name;
    u8 pre_scale_mux:2;
    u8 amux_channel:4;
    const struct u32_fract prescale;
    enum iio_chan_type type;
    enum vadc_scale_fn_type scale_fn_type;
    u8 amux_ip_rsv:3;
 };

like, look at those bitfields. little guys. tiny little bit-widths. πŸŽ€


πŸ¦‹ Members πŸ¦‹

  • datasheet_name β€” this is the hardwarename of the channel. yes, "hardwarename," one word, that's how it's living. it's the name. of the hardware. 🫢
  • pre_scale_mux β€” the prescale (PM8058) or premux (PM8921) used for selecting this channel. and listen: both this and the amux channel are needed to uniquely identify a channel, so it's giving teamwork, it's giving duo. values are 0..3. ⭐
  • amux_channel β€” the value of the ADC_ARB_USRP_AMUX_CNTRL register for this channel, bits 4..7, and it selects the amux. values are 0..f. lowkey gorgeous πŸ”₯
  • prescale β€” the channels have hard-coded prescale ratios defined by the hardware itself (not vibes, actual hardware), and this field just tells us what that ratio is 🧚
  • type β€” the corresponding IIO channel type. usually IIO_VOLTAGE or IIO_TEMP, iykyk πŸ’œ
  • scale_fn_type β€” the liner interpolation etc. that converts the ADC code into the value IIO expects β€” so that's in uV or millicelsius etc. and ngl this scale function can be pretty elaborate if different thermistors are connected or if other hardware characteristics are deployed. it's a whole personality 😭
  • amux_ip_rsv β€” the ratiometric scale value used by the analog muxer, and this one selects the reference voltage for ratiometric scaling. main character energy for real πŸ‘‘

lowkey reminder bestie: the bit-widths above (:2, :4, :3) are exactly as declared β€” don't go changing them, they're not decorative 🩷

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/iio/adc/qcom-pm8xxx-xoadc.c
  • struct xoadc_variant(9)
  • struct pm8xxx_chan_info(9)
  • struct pm8xxx_xoadc(9)

go read the friends, they're all in the same friend group fr fr πŸ’€πŸ’–


and that's the page!! coming at you from ./drivers/iio/adc, dated October 2026, signed off as struct xoadc_channel(9) β€” mwah, drink water, read your headers, periodt πŸŽ€βœ¨πŸŒΈ

πŸ“¦ where this page comes from