/* Notes wrt boundary cases: This function sets the OCR bits for all boundary voltages, for example  range is translated to MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_34_35 mask.  */
u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
/* Notes wrt boundary cases: This function sets the OCR bits for all boundary voltages, for example  range is translated to MMC_VDD_32_33 | MMC_VDD_33_34 | MMC_VDD_34_35 mask.  */
u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max)
{
	u32 mask = 0;
	if (vdd_max < vdd_min)
		return 0;
	vdd_max = mmc_vdd_to_ocrbitnum(vdd_max, false);
	if (vdd_max < 0)
		return 0;
	vdd_min = mmc_vdd_to_ocrbitnum(vdd_min, true);
	if (vdd_min < 0)
		return 0;
	while (vdd_max >= vdd_min)
		mask |= 1 << vdd_max--;
	return mask;
}