AnsweredAssumed Answered

var-som-mx6 pfuze100 PMIC

Question asked by Ameer Hamza on Aug 7, 2017
Latest reply on Aug 11, 2017 by Jose Alberto Reyes Morales

Dear all,


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  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.


Best Regards,