I am trying writing custom driver for PFUZE100 PMIC var-som-mx6 board. I found existing driver for linux in varigit linux repository. But I have some confusion about understanding their code. The regulator driver I found at link https://community.nxp.com/discussion/create.jspa?question=true&containerType=14&containerID=2004&draftID=578960 and dts file for variscite on link linux-2.6-imx/imx6q-var-som-vsc.dts at imx-rel_imx_4.1.15_1.1.0_ga-var02 · varigit/linux-2.6-imx · GitHub.
In PF100 linux driver starting from line 306, there are a lot of hardcoded values for SW1a, VGEN, etc.. I guess that would be replaced by the values mentioned in dts file starting from line 67. But I have some confusion, for example we override SW4 value which would become 3950000(max_value in dts) - 800000(min_value in dts) / 25000(not mentioned in dts) that would become 126. but .vsel_mask = 0x3f which would turn this value to 64.
Is there any mistake in my understanding, also what exactly the values of "step" is being used in linux. Thanks in advance.