PMIC low voltage detect

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

dchristiancp
Posts: 5
Joined: Thu Oct 24, 2019 6:33 pm

PMIC low voltage detect

Wed Nov 06, 2019 8:19 pm

I want to be able to protect the filesystems and do a semi-graceful shutdown if the voltage is dropping.

I have a custom sama5d2 board with an ACT8865. Linux has a driver for this in drivers/regulator/act8865-regulator.c. The PMIC can trigger a line if the voltage drops below a threshold SYSLEV.

However, I can't see a way to either program SYSLEV for the right threshold or configure/handle the interrupt in. I also looked at the act8945a driver (which is used on the sama5d2_xplained board) and it doesn't have it either. It looks like Wenyou Yang at Atmel wrote both drivers.

Has anyone implemented low voltage detect in Linux? Via a ACT88xx would be ideal, but any example code would be useful.

Thanks,
Dan
blue_z
Location: USA
Posts: 1988
Joined: Thu Apr 19, 2007 10:15 pm

Re: PMIC low voltage detect

Wed Nov 06, 2019 11:30 pm

dchristiancp wrote: However, I can't see a way to either program SYSLEV for the right threshold or configure/handle the interrupt in.
Did you study the ACT8865 datasheet and the Microchip App Note?

As this voltage does down, how much time do you expect to have compared to Linux interrupt latency?
See "Detecting Loss of Power" and
"I2C broken in demo images?".
If your ACT8865 shares the I2C bus with other devices, then you probably cannot reliably use it with Linux.

The use of a journaled filesystem is the primary method of "protect(ing) the filesystem".

Regards
dchristiancp
Posts: 5
Joined: Thu Oct 24, 2019 6:33 pm

Re: PMIC low voltage detect

Thu Nov 07, 2019 9:58 pm

I hadn't seen the app note, but it does match our implementation. Section 3.1.4 talks about the hardware side of low voltage detect, but there is no mention of the software side.

As for the other issues you brought up: yes, it's on it's own I2C bus. A journalling file system is, of course, more resistant to loss; but I still want to know if the power is dropping.

As far as the holdup time, that is a critical question for our application. I would think the act8945a would support this for battery applications, but I don't see any support in the driver.

Dan

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 2 guests