platform/x86: simatic-ipc: add new model 427G
authorHenning Schild <henning.schild@siemens.com>
Thu, 25 Aug 2022 10:44:22 +0000 (12:44 +0200)
committerHans de Goede <hdegoede@redhat.com>
Thu, 1 Sep 2022 14:15:03 +0000 (16:15 +0200)
This adds support for the Siemens Simatic IPC427G. A board which
basically works like the 227G added in a previous patch. So all there is
to do is to add the station_id and make it take all the 227G branches.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
Link: https://lore.kernel.org/r/20220825104422.14156-8-henning.schild@siemens.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/simatic-ipc.c
include/linux/platform_data/x86/simatic-ipc.h

index 8dd686d..ca76076 100644 (file)
@@ -41,11 +41,12 @@ static struct {
        {SIMATIC_IPC_IPC127E, SIMATIC_IPC_DEVICE_127E, SIMATIC_IPC_DEVICE_NONE},
        {SIMATIC_IPC_IPC227D, SIMATIC_IPC_DEVICE_227D, SIMATIC_IPC_DEVICE_NONE},
        {SIMATIC_IPC_IPC227E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_227E},
-       {SIMATIC_IPC_IPC227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_NONE},
+       {SIMATIC_IPC_IPC227G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G},
        {SIMATIC_IPC_IPC277E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_227E},
        {SIMATIC_IPC_IPC427D, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_NONE},
        {SIMATIC_IPC_IPC427E, SIMATIC_IPC_DEVICE_427E, SIMATIC_IPC_DEVICE_427E},
        {SIMATIC_IPC_IPC477E, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_427E},
+       {SIMATIC_IPC_IPC427G, SIMATIC_IPC_DEVICE_227G, SIMATIC_IPC_DEVICE_227G},
 };
 
 static int register_platform_devices(u32 station_id)
@@ -82,6 +83,11 @@ static int register_platform_devices(u32 station_id)
                         ipc_led_platform_device->name);
        }
 
+       if (wdtmode == SIMATIC_IPC_DEVICE_227G) {
+               request_module("w83627hf_wdt");
+               return 0;
+       }
+
        if (wdtmode != SIMATIC_IPC_DEVICE_NONE) {
                platform_data.devmode = wdtmode;
                ipc_wdt_platform_device =
@@ -96,9 +102,6 @@ static int register_platform_devices(u32 station_id)
                         ipc_wdt_platform_device->name);
        }
 
-       if (station_id == SIMATIC_IPC_IPC227G)
-               request_module("w83627hf_wdt");
-
        if (ledmode == SIMATIC_IPC_DEVICE_NONE &&
            wdtmode == SIMATIC_IPC_DEVICE_NONE) {
                pr_warn("unsupported IPC detected, station id=%08x\n",
index 7a2e79f..632320e 100644 (file)
@@ -32,6 +32,7 @@ enum simatic_ipc_station_ids {
        SIMATIC_IPC_IPC477E = 0x00000A02,
        SIMATIC_IPC_IPC127E = 0x00000D01,
        SIMATIC_IPC_IPC227G = 0x00000F01,
+       SIMATIC_IPC_IPC427G = 0x00001001,
 };
 
 static inline u32 simatic_ipc_get_station_id(u8 *data, int max_len)