Read PMIC8916 status


#1

Hello,

I’m trying to find a way to read PMIC status through command line (Linaro) or using c++.

Please advice if its possible.

Best Regards,
Alexey


#2

Can you elaborate a little more on what you are trying to do and which status you are trying to read?


#3

Hello Daniel,

we running embedded application, so each time the board restarts i need to read all voltages from PMIC8916 and check that the configuration fit our needs ( we also experiment with devicetree).

i need to perform this test from user space…that means from command line or write some small c++ program.

Please advice,
Best Regards,
Alexey


#4

Anyone have any idea?


#5

Hello Daniel,

we running embedded application, so each time the board restarts i need to read all voltages from PMIC8916 and check that the configuration fit our needs ( we also experiment with devicetree).

i need to perform this test from user space…that means from command line or write some small c++ program.

Please advice,
Best Regards,
Alexey


#6

Sorry for the delay.

The PMIC is hooked up to the SoC using SPMI and as far as I can tell the kernel offers no interfaces for a userspace program to interact with SPMI (see drivers/spmi/spmi.c).

If you are interested in the power status your best bet right now looks like it would be to use the user/kernel interfaces provided by the regulator drivers. As a starting point take a look at https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-regulator .


#7

Hi @AlexeyH

I noticed some user readable information under:

/sys/devices/soc/200f00.spmi/0-01/200f00.spmi:pm8916@1:regulators/regulator/

Is this enough information for your test?

Full Disclosure: I am an employee of Qualcomm Canada, any opinions I may have expressed in this or any other post may not reflect the opinions of my employer.


#8

Here is an even better solution:

sudo cat /sys/kernel/debug/regulator/regulator_summary

Full Disclosure: I am an employee of Qualcomm Canada, any opinions I may have expressed in this or any other post may not reflect the opinions of my employer.


#9

The problem with reading regulator_summary is that this lists Linux constraints on the regulators. For most regulators these values are aggregated with other subsystems (TZ, wcnss, modem, etc) by the RPM - and we’ve seen indications that the RPM in some cases add some headroom to the constraints as it aggregates the values.

So I would say the way to validate that you’re having appropriate voltage levels on your rails is to actually measure them - which probably is a good idea anyways if you don’t trust the software.

Regards,
Bjorn