var-som-mx6 pfuze100 PMIC

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

var-som-mx6 pfuze100 PMIC

982 Views
ameerhamza
Contributor III

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 https://community.nxp.com/discussion/create.jspa?question=true&containerType=14&containerID=2004&dra...  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 · G...

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,

Hamza.

0 Kudos
Reply
1 Reply

833 Views
reyes
NXP TechSupport
NXP TechSupport

Hi Hamza,

The varigit PMIC driver is correct: https://github.com/varigit/linux-2.6-imx/blob/5599520f40751737442bf30e60ac6c9871a9844e/drivers/regul...

 

In line 312 it is mentioned that the min value for SW4 output is 400000uV (0.4V), the max value is 1975000uV (1.975V) and the steps are in the size of 25000uV (25mV).

 

Once SW4[6] is set to “0”, the output is limited to the lower output voltages, from 0.400 V to 1.975 V with 25 mV increments, as determined by the SW4[5:0] bits. Likewise, once the SW4[6] bit is set to "1", the output voltage is limited to the higher output voltage range from 0.800 V to 3.300 V with 50 mV increments, as determined by the SW4[5:0] bits.

 

So, 1975000 – 400000 / 25000 = 63


Have a great day,
Jose

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply