iio_multiply_value(9)
π iio_multiply_value(9) β the Kernel API Manual page you didn't know you needed
okay so this is iio_multiply_value(9), from the Kernel API Manual, and bestie it is so much simpler than the name makes it sound. it multiplies an IIO value. that's the whole vibe. let's get into it π
β¨ NAME β¨
iio_multiply_value β Multiply an IIO value. literally it's in the name, i'm obsessed π¦
πΈ SYNOPSIS πΈ
int iio_multiply_value (int *result , s64 multiplier , unsigned int type
, int val , int val2 );
π ARGUMENTS π
resultβ the destination pointer where the multiplication result gets dropped off. main character of the argument list honestly π«Άmultiplierβ the multiplier. ans64, so it's got range, no cap.typeβ one of theIIO_VAL_*constants, and this is the icon that decides howvalandval2get interpreted. respect the type, she's in charge πvalβ the value being multiplied.val2β also the value being multiplied, but how much she matters totally depends ontype. it's giving "i'm here but i'm situational" π
π¦ DESCRIPTION π¦
so you take an IIO value, you multiply it by an s64 multiplier, and you store the result as IIO_VAL_INT. that's it, that's the function, and honestly? iconic.
typically this is used for scaling β like when your raw sensor number needs a glow-up into something actually meaningful β¨
π₯ RETURN π₯
returns IIO_VAL_INT on success π or a negative error-number on failure π. so like, check your return value, bestie, fr fr.
π SEE ALSO π
okay this list is long long, so buckle up, we're going on a tour of the entire IIO channel API π
this all lives in the kernel file ./include/linux/iio/consumer.h and the struct to go peep is struct iio_channel(9):
iio_channel_get(9)iio_channel_release(9)devm_iio_channel_get(9)iio_channel_get_all(9)iio_channel_release_all(9)devm_iio_channel_get_all(9)fwnode_iio_channel_get_by_name(9)devm_fwnode_iio_channel_get_by_name(9)iio_channel_get_all_cb(9)iio_channel_cb_set_buffer_watermark(9)iio_channel_release_all_cb(9)iio_channel_start_all_cb(9)iio_channel_stop_all_cb(9)iio_channel_cb_get_channels(9)iio_channel_cb_get_iio_dev(9)iio_read_channel_raw(9)iio_read_channel_average_raw(9)iio_read_channel_processed(9)iio_read_channel_processed_scale(9)iio_write_channel_attribute(9)iio_read_channel_attribute(9)iio_write_channel_raw(9)iio_read_max_channel_raw(9)iio_read_min_channel_raw(9)iio_read_avail_channel_raw(9)iio_read_avail_channel_attribute(9)iio_get_channel_type(9)iio_read_channel_offset(9)iio_read_channel_scale(9)iio_convert_raw_to_processed(9)iio_get_channel_ext_info_count(9)iio_read_channel_ext_info(9)iio_write_channel_ext_info(9)iio_read_channel_label(9)
like i said. long long. but every single one of them slays in her own way π
ngl if you only remember one thing:typecontrols howvalandval2are read. do not fumble the type. that's the whole tea. β
and that's the page, bestie! π§ this whole thing is filed under ./include/linux/iio, stamped October 2026, and signed iio_multiply_value(9) β so if anyone asks where you learned it, you tell them exactly that. 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