2023-01-18 02:50 AM
We need to enable/disable pwr_sw1 and pwr_sw1 preferably via sysfs:
vdd_usb_sw: pwr_sw1 {
regulator-name = "vdd_usb_sw";
};
vdd_sd_sw: pwr_sw2 {
regulator-name = "vdd_sd_sw";
regulator-always-on;
regulator-boot-on;
regulator-active-discharge = <1>;
};
How can we achieve this?
2023-01-25 12:35 AM
Hi @johnnyc
Please refer to Regulator overview - stm32mpu
It's clearly state :
"The regulator framework offers a sysfs interface that can be used for monitoring. It is not possible to control a regulator via the sysfs."
Best practice is to use "consumers" mechanism of the regulator.
As soon as regulator is not used it's turn-off. ( as soon as you remove regulator-always-on policy )
I guess this could be achieve by using some dedicated kernel drivers.
If you detail further to what pwr_sw1 and pwr_sw2 are connected in your design and what you want to do. I can come back with further guidelines.
Olivier