cancel
Showing results for 
Search instead for 
Did you mean: 

How to enable/disable pwr_sw1 and pwr_sw1 via sysfs?

johnnyc
Associate III

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?

1 REPLY 1
Olivier GALLIEN
ST Employee

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

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.