Hi Javier,
Thanks for your post. I have followed the instructions provided by you, however still not able to get the user space sysfs interface for consumer drivers. I have checked the sysfs interface under "/sys/class/regulator/regulator.X/ & "/sys/devices/platform/soc/..".
Note: I am using IMX7d-Sabre board with Yocto build.
1. Defining the Device Tree PMIC node as it is defined in the Linux Documentation.
Entry for "pmic: pfuze3000@8 { " is available. (DT file attached below)
2. Changing the driver "/driver/regulator/userspace-consumer.c", following this patch.
Applied the patch.
3. Adding a new Device Tree node "regulator-consumer" (for example), you can follow this other patch.
---------------------
file name: arch/arm/boot/dts/imx7d-sdb.dts
&i2c1 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1>;
status = "okay";
userspace-consumer {
compatible = "reg-userspace-consumer";
regulator-name = "pfuze-consumer";
regulator-boot-on;
regulator-supplies = "sw1a", "sw1b", "sw2", "sw3",
"swbst", "vsnvs", "vrefddr", "vldo1",
"vldo2", "vccsd", "v33", "vldo3", "vldo4";
sw1a-supply = <&sw1a_reg>;
sw1b-supply = <&sw1c_reg>;
sw2-supply = <&sw2_reg>;
sw3-supply = <&sw3a_reg>;
swbst-supply = <&swbst_reg>;
vsnvs-supply = <&snvs_reg>;
vrefddr-supply = <&vref_reg>;
vldo1-supply = <&vgen1_reg>;
vldo2-supply = <&vgen2_reg>;
vccsd-supply = <&vgen3_reg>;
v33-supply = <&vgen4_reg>;
vldo3-supply = <&vgen5_reg>;
vldo4-supply = <&vgen6_reg>;
};
pmic: pfuze3000@08 {
compatible = "fsl,pfuze3000";
reg = <0x08>;
regulators {
sw1a_reg: sw1a {
regulator-min-microvolt = <700000>;
regulator-max-microvolt = <3300000>;
regulator-boot-on;
regulator-always-on;
regulator-ramp-delay = <6250>;
};
-------
4. CONFIG_REGULATOR_USERSPACE_CONSUMER is also enabled.
below is my .config file options.
CONFIG_REGULATOR=y
# CONFIG_REGULATOR_DEBUG is not set
CONFIG_REGULATOR_FIXED_VOLTAGE=y
# CONFIG_REGULATOR_VIRTUAL_CONSUMER is not set
CONFIG_REGULATOR_USERSPACE_CONSUMER=y
# CONFIG_REGULATOR_ACT8865 is not set
# CONFIG_REGULATOR_AD5398 is not set
Could you please point out, do i still missing something.
Regards, Sudhesh