kmx61_set_mode(9)
π kmx61_set_mode(9) β like, the KMX61 operating-mode setter bestie
okay so this is a page straight out of the Kernel API Manual, and it's about kmx61_set_mode, which (spoiler) sets the operating mode on a KMX61 device. it's giving "small function, big responsibilities" honestly π
β¨ NAME β¨
kmx61_set_mode β set KMX61 device operating mode. that's it, that's the whole vibe π¦
β¨ SYNOPSIS β¨
int kmx61_set_mode (struct kmx61_data *data , u8 mode , u8 device , bool update );
like yes she returns an int, and yes she takes four things. we love a signature with range π
β¨ ARGUMENTS β¨
dataβ the kmx61 device private data pointer. this is the main character, the VIP pass to everything the driver knows about itself πmodeβ a bitmask indicating the operating mode for the device. bitmask energy fr fr πdeviceβ a bitmask indicating the device for which the mode needs to be set. yes, another bitmask, it's a whole bitmask moment β¨updateβ update thestbybits stored in the device's private data. so like, do you want the driver's memory of things kept in sync or not π
β¨ DESCRIPTION β¨
okay so for each sensor β we're talking accelerometer and magnetometer, the two little icons of this chip β there are two operating modes: STANDBY and OPERATION. that's the whole menu, no secret third option, no cap π₯
and here's the key lore bestie: neither accel nor magn can be disabled independently if they are both enabled. like they're that codependent couple. if both are on, you can't just switch one off on its own, that's not how this works π
the internal sensors state gets saved in the acc_stby and mag_stby members of the driver's private data. so the driver literally keeps receipts of who's in standby and who's not π«Ά
β¨ SEE ALSO β¨
- Kernel file
./drivers/iio/imu/kmx61.cβ the source, the origin story, the mothership πΈ kmx61_set_power_state(9)kmx61_read_for_each_active_channel(9)
and that's the page!! mwah π it lives under ./drivers/iio/imu and bestie the date on it is October 2026 β yes, future vibes, we're ahead of schedule β go read the source, it's iconic, 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