Control PFUZE3001 driver from userspace

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

Control PFUZE3001 driver from userspace

740 Views
saumil
Contributor II

Hi,

I have custom board based on i.Mx6ULL.

I want to control VLDO1 output line of PMIC(PF3001) but I came to know that the driver PFUZE3001 sysfs files are only read only and we can not control it.

 

From community search I found this solution by @pastrana which uses userspace-consumer driver which exposes sysfs control from userspace.

I have followed mentioned steps but I haven't succeeded.

- added patch which is mentioned in 

drivers/regulator/userspace-consumer.c

- enabled CONFIG_REGULATOR_USERSPACE_CONSUMER in defconfig

- added changes in dts file which is attached

Following are the files from sysfs after enabling all this

#ls -lh /sys/firmware/devicetree/base/soc/aips-bus@2100000/i2c@21a0000/pfuze3001@08/userspace-consumer

total 0
-r--r--r-- 1 root root 0 May 12 15:24 #regulator-boot-on
-r--r--r-- 1 root root 23 May 12 15:24 compatible
-r--r--r-- 1 root root 19 May 12 15:24 name
-r--r--r-- 1 root root 15 May 12 15:24 regulator-name
-r--r--r-- 1 root root 6 May 12 15:24 regulator-supplies
-r--r--r-- 1 root root 4 May 12 15:24 vldo1-supply

 

~# ls -lh /sys/class/regulator/regulator.9/
total 0
lrwxrwxrwx 1 root root 0 May 12 15:52 device -> ../../../0-0008
-r--r--r-- 1 root root 4.0K May 12 15:52 max_microvolts
-r--r--r-- 1 root root 4.0K May 12 15:52 microvolts
-r--r--r-- 1 root root 4.0K May 12 15:52 min_microvolts
-r--r--r-- 1 root root 4.0K May 12 15:52 name
-r--r--r-- 1 root root 4.0K May 12 15:52 num_users
lrwxrwxrwx 1 root root 0 May 12 15:52 of_node -> ../../../../../../../../../firmware/devicetree/base/soc/aips-bus@2100000/i2c@21a0000/pfuze3001@08/regulators/vldo1
drwxr-xr-x 2 root root 0 May 12 15:23 power
-r--r--r-- 1 root root 4.0K May 12 15:52 state
lrwxrwxrwx 1 root root 0 Sep 6 2020 subsystem -> ../../../../../../../../../class/regulator
-r--r--r-- 1 root root 4.0K May 12 15:52 suspend_disk_state
-r--r--r-- 1 root root 4.0K May 12 15:52 suspend_mem_state
-r--r--r-- 1 root root 4.0K May 12 15:52 suspend_standby_state
-r--r--r-- 1 root root 4.0K May 12 15:52 type
-rw-r--r-- 1 root root 4.0K Sep 6 2020 uevent

 

# ls -lh /sys/devices/soc0/soc/2100000.aips-bus/21a0000.i2c/i2c-0/0-0008/
total 0
lrwxrwxrwx 1 root root 0 May 12 15:50 driver -> ../../../../../../../bus/i2c/drivers/pfuze100-regulator
-r--r--r-- 1 root root 4.0K May 12 15:50 modalias
-r--r--r-- 1 root root 4.0K May 12 15:50 name
lrwxrwxrwx 1 root root 0 May 12 15:50 of_node -> ../../../../../../../firmware/devicetree/base/soc/aips-bus@2100000/i2c@21a0000/pfuze3001@08
drwxr-xr-x 2 root root 0 May 12 15:23 power
drwxr-xr-x 12 root root 0 Sep 6 2020 regulator
lrwxrwxrwx 1 root root 0 Sep 6 2020 subsystem -> ../../../../../../../bus/i2c
-rw-r--r-- 1 root root 4.0K Sep 6 2020 uevent

 

#ls -lh /sys/bus/platform/drivers/reg-userspace-consumer
total 0
--w------- 1 root root 4.0K May 12 15:45 bind
--w------- 1 root root 4.0K Sep 6 2020 uevent
--w------- 1 root root 4.0K May 12 15:45 unbind

I have attached kernel logs, I couldn't find any useful information from it.

Please suggest what is missing here.

Tags (1)
0 Kudos
2 Replies

726 Views
saumil
Contributor II

Yes, tried that but it says device/resource is busy as it is used by pfuze driver.

0 Kudos

732 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

 

Did you try to use i2ctool to read/set ?

 

BR

Zhiming

0 Kudos