hwmon: (pmbus/adm1266) read blackbox
authorAlexandru Tachici <alexandru.tachici@analog.com>
Wed, 12 Aug 2020 14:20:54 +0000 (17:20 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 23 Sep 2020 16:42:41 +0000 (09:42 -0700)
commit15609d1893020436e1e8ccfd9ded774a96dd17a2
treef1692890ee2e2e07ff2d44e233dd28a5592979c2
parented1ff457e1870425ea8d3c8643d9aeb7fa54300f
hwmon: (pmbus/adm1266) read blackbox

Use the nvmem kernel api to expose the black box
chip functionality to userspace.

Using this feature, the device is capable of recording
to nonvolatile flash memory the vital data about the
system status that caused the system to perform a
black box write.

A blackbox is 64 bytes of data containing all the
status registers, last two states of the sequencer,
timestamp and counters. The mapping of this data is
described in the adm1266 datasheet.

On power-up the driver sets the unix time to
the adm1266 using the SET_RTC command. This value
is incremented by an internal clock and it is used
as timestamp for the black box feature.

Signed-off-by: Alexandru Tachici <alexandru.tachici@analog.com>
Link: https://lore.kernel.org/r/20200812142055.9213-6-alexandru.tachici@analog.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/adm1266.c