soc: ti: wkup_m3_ipc: Add support for i2c voltage scaling
authorDave Gerlach <d-gerlach@ti.com>
Tue, 26 Apr 2022 20:07:44 +0000 (13:07 -0700)
committerNishanth Menon <nm@ti.com>
Tue, 3 May 2022 13:02:09 +0000 (08:02 -0500)
commitea082040fe071d2ba1f8f73792743d7ca9fb218e
tree9eb4483dbdb0aa0bbf113dd2f825f184ac9631b5
parent1dcbae86ee669bdb0338954cd0136863f5c96c0a
soc: ti: wkup_m3_ipc: Add support for i2c voltage scaling

Allow loading of a binary containing i2c scaling sequences to be
provided to the wkup_m3 firmware in order to properly scale voltage
rails on the PMIC during low power modes like DeepSleep0. Proper binary
format is determined by the FW in use.

Code expects firmware to have 0x0C57 present as the first two bytes
followed by one byte defining offset to sleep sequence followed by one
byte defining offset to wake sequence and then lastly both sequences.
Each sequence is a series of I2C transfers in the form:

u8 length | u8 chip address | u8 byte0/reg address | u8 byte1 | u8 byteN
..

The length indicates the number of bytes to transfer, including the
register address. The length of each transfer is limited by the I2C
buffer size of 32 bytes.

Based on previous work by Russ Dill.

[dfustini: replace FW_ACTION_HOTPLUG with FW_ACTION_UEVENT]

Signed-off-by: Dave Gerlach <d-gerlach@ti.com>
Signed-off-by: Keerthy <j-keerthy@ti.com>
[dfustini: add NULL argument to rproc_da_to_va() call]
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
Link: https://lore.kernel.org/r/20220426200741.712842-3-dfustini@baylibre.com
drivers/soc/ti/wkup_m3_ipc.c
include/linux/wkup_m3_ipc.h