]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitcd04f34d20ca4e1e46cfe4f466f37bb484009849
treef1692890ee2e2e07ff2d44e233dd28a5592979c2
parentb247a9480bb4b40d7d4707adbfbf427b0a6ddb52
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