platform/x86: simatic-ipc: add CMOS battery monitoring

Siemens Simatic Industrial PCs can monitor the voltage of the CMOS
battery with two bits that indicate low or empty state. This can be GPIO
or PortIO based.
Here we model that as a hwmon voltage. The core driver does the PortIO
and provides boilerplate for the GPIO versions. Which are split out to
model runtime dependencies while allowing fine-grained kernel
configuration.

Signed-off-by: Henning Schild <henning.schild@siemens.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230706154831.19100-3-henning.schild@siemens.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
Henning Schild
2023-07-06 17:48:31 +02:00
committed by Hans de Goede
parent 15fe994ee5
commit 917f543407
9 changed files with 549 additions and 15 deletions

View File

@@ -21,6 +21,7 @@
#define SIMATIC_IPC_DEVICE_227E 4
#define SIMATIC_IPC_DEVICE_227G 5
#define SIMATIC_IPC_DEVICE_BX_21A 6
#define SIMATIC_IPC_DEVICE_BX_39A 7
struct simatic_ipc_platform {
u8 devmode;