mmc_vddrange_to_ocrmask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– mmc_vddrange_to_ocrmask(9) β€” the kernel API manual, but make it make sense πŸŽ€

okay so bestie, gather round, because this one is a <pink>tiny little function</pink> that does one thing and does it flawlessly, and honestly? we stan. it lives in the kernel API manual, section 9, and it's giving "quiet genius who doesn't need to flex." πŸ’…


✨ SYNOPSIS ✨

u32 mmc_vddrange_to_ocrmask (int vdd_min , int vdd_max );

look at her. two ints in, one u32 out. <rainbow>no cap, that's the whole vibe.</rainbow> 🌈


πŸ¦‹ ARGUMENTS πŸ¦‹

  • vdd_min β€” the minimum voltage value, and yes bestie it's in mV (millivolts), don't come at me with volts, this function will not be doing that conversion for you 😭
  • vdd_max β€” the maximum voltage value, also in mV, the other end of your lil voltage range 🫢

🌸 DESCRIPTION 🌸

so what she does: she takes your vdd_min and vdd_max and returns the <hotpink>OCR mask bits</hotpink> that match that range. it's literally a glow-up for numbers β€” voltage range in, bitmask out. ✨

and if the conversion just isn't possible? she returns 0. not an error code, not a dramatic sigh, just <purple>0</purple>. a polite "no ❀️" fr fr. πŸ’€

πŸ’œ Notes wrt boundary cases πŸ’œ

this is the part where she gets extra and we love her for it: this function <mint>sets the OCR bits for all boundary voltages</mint>. so don't be out here thinking a range is just gonna pick one neat little bit β€” she covers the boundaries too.

concrete example, MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_34_35-coded, the range [3300:3400] gets translated into exactly this mask:

MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_34_35

see? three bits. boundaries eaten, no crumbs left. <yellow>she ate. periodt.</yellow> πŸ”₯πŸ‘‘


🧚 SEE ALSO 🧚

like, the whole mmc squad showed up to the group chat. <lavender>iykyk πŸ’œ</lavender> πŸ¦‹


mwah πŸ’‹ that's the page β€” brought to you by the lovely humans behind the ./drivers/mmc/core source, dated October 2026, and it's the mmc_vddrange_to_ocrmask(9) manual in all her glory. <hotpink>go convert some voltages, bestie, you've got this.</hotpink> πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from