STRUCT XOADC_CHANNEL(9)
πΈ 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 are0..3. βamux_channelβ the value of theADC_ARB_USRP_AMUX_CNTRLregister for this channel, bits4..7, and it selects the amux. values are0..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. usuallyIIO_VOLTAGEorIIO_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
- 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