m24lr_regmap_read(9)
β¨ m24lr_regmap_read β¨
okay so bestie, welcome to the Kernel API Manual β this one's m24lr_regmap_read(9) and it's literally the "read it and if it doesn't work, read it again" icon we all needed π
πΈ NAME πΈ
m24lr_regmap_read β read data using regmap with retry on failure π
So like, it reads stuff, through regmap, and if the read fails it justβ¦ tries again. Lowkey stubborn. Highkey reliable. β¨
π¦ SYNOPSIS π¦
ssize_t m24lr_regmap_read (struct regmap *regmap , u8 *buf , size_t size
, unsigned int offset );
That's the whole vibe check right there π
π ARGUMENTS π
regmapβ the regmap instance for the device, aka the main character's home base πbufβ buffer to store the read data, this is where the tea gets poured π΅sizeβ number of bytes to read, how much tea we're pouring, fr froffsetβ starting register address, where we start pouring from π
π§ DESCRIPTION π§
Okay so here's the plot: this function attempts to read a block of data from the device with retries and timeout. That's it, that's the whole thing π
But why, you ask? Because some M24LR chips may transiently NACK reads β like, for example, during internal write cycles π β so this function retries with a short sleep until the timeout expires. It's giving "I'll wait for you to be ready, no cap" π«Ά
π heads up bestie: those NACKs are transient, meaning the chip is just busy doing its own internal write cycles, not broken. The retry-with-short-sleep-until-timeout is the whole strategy. Don't come for it. β¨
β RETURN β
- Number of bytes read on success β slay, it worked π
-ETIMEDOUTif the read fails within the timeout window β it tried, it really did, but the clock ran out πβ°
π SEE ALSO π
- Kernel file
./drivers/nvmem/m24lr.c struct m24lr_chip(9)struct m24lr(9)m24lr_regmap_write(9)m24lr_write(9)m24lr_write_pass(9)
go read those too, iykyk ππ₯
π and that's the page!! brought to you from ./drivers/nvmem, October 2026, in the one and only Kernel API Manual β stay hydrated, keep your retries short, and don't let a transient NACK ruin your whole day πΈππ¦
π¦ 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