mmc_vddrange_to_ocrmask(9)
π 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 π§
- Kernel file
./drivers/mmc/core/core.c mmc_request_done(9)mmc_cqe_request_done(9)mmc_cqe_post_req(9)mmc_is_req_done(9)mmc_wait_for_req(9)mmc_wait_for_cmd(9)mmc_set_data_timeout(9)__mmc_claim_host(9)mmc_release_host(9)mmc_vdd_to_ocrbitnum(9)mmc_handle_undervoltage(9)mmc_detect_change(9)mmc_erase(9)mmc_hw_reset(9)
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
- 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