Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'ib-pdx86-simatic-v6.6-2' into review-hans

Immutable branch between pdx86 simatic branch and LED due for the v6.6 merge window

ib-pdx86-simatic-v6.6-2: v6.5-rc1 + ib-pdx86-simatic-v6.6 +
more recent pdx86 simatic-ipc patches for merging into
the LED subsystem for v6.6.

+130 -86
+1
drivers/leds/simple/Kconfig
··· 2 2 config LEDS_SIEMENS_SIMATIC_IPC 3 3 tristate "LED driver for Siemens Simatic IPCs" 4 4 depends on SIEMENS_SIMATIC_IPC 5 + default y 5 6 help 6 7 This option enables support for the LEDs of several Industrial PCs 7 8 from Siemens.
+1 -58
drivers/platform/x86/Kconfig
··· 1074 1074 low level access for debug work and updating the firmware. Say 1075 1075 N unless you will be doing this on an Intel MID platform. 1076 1076 1077 - config SIEMENS_SIMATIC_IPC 1078 - tristate "Siemens Simatic IPC Class driver" 1079 - help 1080 - This Simatic IPC class driver is the central of several drivers. It 1081 - is mainly used for system identification, after which drivers in other 1082 - classes will take care of driving specifics of those machines. 1083 - i.e. LEDs and watchdog. 1084 - 1085 - To compile this driver as a module, choose M here: the module 1086 - will be called simatic-ipc. 1087 - 1088 - config SIEMENS_SIMATIC_IPC_BATT 1089 - tristate "CMOS battery driver for Siemens Simatic IPCs" 1090 - depends on HWMON 1091 - depends on SIEMENS_SIMATIC_IPC 1092 - default SIEMENS_SIMATIC_IPC 1093 - help 1094 - This option enables support for monitoring the voltage of the CMOS 1095 - batteries of several Industrial PCs from Siemens. 1096 - 1097 - To compile this driver as a module, choose M here: the module 1098 - will be called simatic-ipc-batt. 1099 - 1100 - config SIEMENS_SIMATIC_IPC_BATT_APOLLOLAKE 1101 - tristate "CMOS Battery monitoring for Simatic IPCs based on Apollo Lake GPIO" 1102 - depends on PINCTRL_BROXTON 1103 - depends on SIEMENS_SIMATIC_IPC_BATT 1104 - default SIEMENS_SIMATIC_IPC_BATT 1105 - help 1106 - This option enables CMOS battery monitoring for Simatic Industrial PCs 1107 - from Siemens based on Apollo Lake GPIO. 1108 - 1109 - To compile this driver as a module, choose M here: the module 1110 - will be called simatic-ipc-batt-apollolake. 1111 - 1112 - config SIEMENS_SIMATIC_IPC_BATT_ELKHARTLAKE 1113 - tristate "CMOS Battery monitoring for Simatic IPCs based on Elkhart Lake GPIO" 1114 - depends on PINCTRL_ELKHARTLAKE 1115 - depends on SIEMENS_SIMATIC_IPC_BATT 1116 - default SIEMENS_SIMATIC_IPC_BATT 1117 - help 1118 - This option enables CMOS battery monitoring for Simatic Industrial PCs 1119 - from Siemens based on Elkhart Lake GPIO. 1120 - 1121 - To compile this driver as a module, choose M here: the module 1122 - will be called simatic-ipc-batt-elkhartlake. 1123 - 1124 - config SIEMENS_SIMATIC_IPC_BATT_F7188X 1125 - tristate "CMOS Battery monitoring for Simatic IPCs based on Nuvoton GPIO" 1126 - depends on GPIO_F7188X 1127 - depends on SIEMENS_SIMATIC_IPC_BATT 1128 - default SIEMENS_SIMATIC_IPC_BATT 1129 - help 1130 - This option enables CMOS battery monitoring for Simatic Industrial PCs 1131 - from Siemens based on Nuvoton GPIO. 1132 - 1133 - To compile this driver as a module, choose M here: the module 1134 - will be called simatic-ipc-batt-elkhartlake. 1077 + source "drivers/platform/x86/siemens/Kconfig" 1135 1078 1136 1079 config WINMATE_FM07_KEYS 1137 1080 tristate "Winmate FM07/FM07P front-panel keys driver"
+1 -5
drivers/platform/x86/Makefile
··· 131 131 obj-$(CONFIG_X86_INTEL_LPSS) += pmc_atom.o 132 132 133 133 # Siemens Simatic Industrial PCs 134 - obj-$(CONFIG_SIEMENS_SIMATIC_IPC) += simatic-ipc.o 135 - obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT) += simatic-ipc-batt.o 136 - obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT_APOLLOLAKE) += simatic-ipc-batt-apollolake.o 137 - obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT_ELKHARTLAKE) += simatic-ipc-batt-elkhartlake.o 138 - obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT_F7188X) += simatic-ipc-batt-f7188x.o 134 + obj-$(CONFIG_SIEMENS_SIMATIC_IPC) += siemens/ 139 135 140 136 # Winmate 141 137 obj-$(CONFIG_WINMATE_FM07_KEYS) += winmate-fm07-keys.o
+64
drivers/platform/x86/siemens/Kconfig
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + # 3 + # Siemens X86 Platform Specific Drivers 4 + # 5 + 6 + config SIEMENS_SIMATIC_IPC 7 + tristate "Siemens Simatic IPC Class driver" 8 + help 9 + This Simatic IPC class driver is the central of several drivers. It 10 + is mainly used for system identification, after which drivers in other 11 + classes will take care of driving specifics of those machines. 12 + i.e. LEDs and watchdog. 13 + 14 + To compile this driver as a module, choose M here: the module 15 + will be called simatic-ipc. 16 + 17 + config SIEMENS_SIMATIC_IPC_BATT 18 + tristate "CMOS battery driver for Siemens Simatic IPCs" 19 + default SIEMENS_SIMATIC_IPC 20 + depends on HWMON 21 + depends on SIEMENS_SIMATIC_IPC 22 + help 23 + This option enables support for monitoring the voltage of the CMOS 24 + batteries of several Industrial PCs from Siemens. 25 + 26 + To compile this driver as a module, choose M here: the module 27 + will be called simatic-ipc-batt. 28 + 29 + config SIEMENS_SIMATIC_IPC_BATT_APOLLOLAKE 30 + tristate "CMOS Battery monitoring for Simatic IPCs based on Apollo Lake GPIO" 31 + default SIEMENS_SIMATIC_IPC_BATT 32 + depends on PINCTRL_BROXTON 33 + depends on SIEMENS_SIMATIC_IPC_BATT 34 + help 35 + This option enables CMOS battery monitoring for Simatic Industrial PCs 36 + from Siemens based on Apollo Lake GPIO. 37 + 38 + To compile this driver as a module, choose M here: the module 39 + will be called simatic-ipc-batt-apollolake. 40 + 41 + config SIEMENS_SIMATIC_IPC_BATT_ELKHARTLAKE 42 + tristate "CMOS Battery monitoring for Simatic IPCs based on Elkhart Lake GPIO" 43 + default SIEMENS_SIMATIC_IPC_BATT 44 + depends on PINCTRL_ELKHARTLAKE 45 + depends on SIEMENS_SIMATIC_IPC_BATT 46 + help 47 + This option enables CMOS battery monitoring for Simatic Industrial PCs 48 + from Siemens based on Elkhart Lake GPIO. 49 + 50 + To compile this driver as a module, choose M here: the module 51 + will be called simatic-ipc-batt-elkhartlake. 52 + 53 + config SIEMENS_SIMATIC_IPC_BATT_F7188X 54 + tristate "CMOS Battery monitoring for Simatic IPCs based on Nuvoton GPIO" 55 + default SIEMENS_SIMATIC_IPC_BATT 56 + depends on GPIO_F7188X 57 + depends on PINCTRL_ALDERLAKE 58 + depends on SIEMENS_SIMATIC_IPC_BATT 59 + help 60 + This option enables CMOS battery monitoring for Simatic Industrial PCs 61 + from Siemens based on Nuvoton GPIO. 62 + 63 + To compile this driver as a module, choose M here: the module 64 + will be called simatic-ipc-batt-f7188x.
+11
drivers/platform/x86/siemens/Makefile
··· 1 + # SPDX-License-Identifier: GPL-2.0 2 + # 3 + # Makefile for linux/drivers/platform/x86/siemens 4 + # Siemens x86 Platform-Specific Drivers 5 + # 6 + 7 + obj-$(CONFIG_SIEMENS_SIMATIC_IPC) += simatic-ipc.o 8 + obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT) += simatic-ipc-batt.o 9 + obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT_APOLLOLAKE) += simatic-ipc-batt-apollolake.o 10 + obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT_ELKHARTLAKE) += simatic-ipc-batt-elkhartlake.o 11 + obj-$(CONFIG_SIEMENS_SIMATIC_IPC_BATT_F7188X) += simatic-ipc-batt-f7188x.o
drivers/platform/x86/simatic-ipc-batt-apollolake.c drivers/platform/x86/siemens/simatic-ipc-batt-apollolake.c
drivers/platform/x86/simatic-ipc-batt-elkhartlake.c drivers/platform/x86/siemens/simatic-ipc-batt-elkhartlake.c
+27 -10
drivers/platform/x86/simatic-ipc-batt-f7188x.c drivers/platform/x86/siemens/simatic-ipc-batt-f7188x.c
··· 17 17 18 18 #include "simatic-ipc-batt.h" 19 19 20 + static struct gpiod_lookup_table *batt_lookup_table; 21 + 20 22 static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_227g = { 21 23 .table = { 22 24 GPIO_LOOKUP_IDX("gpio-f7188x-7", 6, NULL, 0, GPIO_ACTIVE_HIGH), ··· 36 34 }, 37 35 }; 38 36 37 + static struct gpiod_lookup_table simatic_ipc_batt_gpio_table_bx_59a = { 38 + .table = { 39 + GPIO_LOOKUP_IDX("gpio-f7188x-7", 6, NULL, 0, GPIO_ACTIVE_HIGH), 40 + GPIO_LOOKUP_IDX("gpio-f7188x-7", 5, NULL, 1, GPIO_ACTIVE_HIGH), 41 + GPIO_LOOKUP_IDX("INTC1056:00", 438, NULL, 2, GPIO_ACTIVE_HIGH), 42 + {} /* Terminating entry */ 43 + } 44 + }; 45 + 39 46 static int simatic_ipc_batt_f7188x_remove(struct platform_device *pdev) 40 47 { 41 - const struct simatic_ipc_platform *plat = pdev->dev.platform_data; 42 - 43 - if (plat->devmode == SIMATIC_IPC_DEVICE_227G) 44 - return simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_227g); 45 - 46 - return simatic_ipc_batt_remove(pdev, &simatic_ipc_batt_gpio_table_bx_39a); 48 + return simatic_ipc_batt_remove(pdev, batt_lookup_table); 47 49 } 48 50 49 51 static int simatic_ipc_batt_f7188x_probe(struct platform_device *pdev) 50 52 { 51 53 const struct simatic_ipc_platform *plat = pdev->dev.platform_data; 52 54 53 - if (plat->devmode == SIMATIC_IPC_DEVICE_227G) 54 - return simatic_ipc_batt_probe(pdev, &simatic_ipc_batt_gpio_table_227g); 55 + switch (plat->devmode) { 56 + case SIMATIC_IPC_DEVICE_227G: 57 + batt_lookup_table = &simatic_ipc_batt_gpio_table_227g; 58 + break; 59 + case SIMATIC_IPC_DEVICE_BX_39A: 60 + batt_lookup_table = &simatic_ipc_batt_gpio_table_bx_39a; 61 + break; 62 + case SIMATIC_IPC_DEVICE_BX_59A: 63 + batt_lookup_table = &simatic_ipc_batt_gpio_table_bx_59a; 64 + break; 65 + default: 66 + return -ENODEV; 67 + } 55 68 56 - return simatic_ipc_batt_probe(pdev, &simatic_ipc_batt_gpio_table_bx_39a); 69 + return simatic_ipc_batt_probe(pdev, batt_lookup_table); 57 70 } 58 71 59 72 static struct platform_driver simatic_ipc_batt_driver = { ··· 83 66 84 67 MODULE_LICENSE("GPL"); 85 68 MODULE_ALIAS("platform:" KBUILD_MODNAME); 86 - MODULE_SOFTDEP("pre: simatic-ipc-batt gpio_f7188x platform:elkhartlake-pinctrl"); 69 + MODULE_SOFTDEP("pre: simatic-ipc-batt gpio_f7188x platform:elkhartlake-pinctrl platform:alderlake-pinctrl"); 87 70 MODULE_AUTHOR("Henning Schild <henning.schild@siemens.com>");
+11 -11
drivers/platform/x86/simatic-ipc-batt.c drivers/platform/x86/siemens/simatic-ipc-batt.c
··· 92 92 93 93 next_update = priv.last_updated_jiffies + msecs_to_jiffies(BATT_DELAY_MS); 94 94 if (time_after(jiffies, next_update) || !priv.last_updated_jiffies) { 95 - switch (priv.devmode) { 96 - case SIMATIC_IPC_DEVICE_127E: 97 - case SIMATIC_IPC_DEVICE_227G: 98 - case SIMATIC_IPC_DEVICE_BX_39A: 99 - priv.current_state = simatic_ipc_batt_read_gpio(); 100 - break; 101 - case SIMATIC_IPC_DEVICE_227E: 95 + if (priv.devmode == SIMATIC_IPC_DEVICE_227E) 102 96 priv.current_state = simatic_ipc_batt_read_io(dev); 103 - break; 104 - } 97 + else 98 + priv.current_state = simatic_ipc_batt_read_gpio(); 99 + 105 100 priv.last_updated_jiffies = jiffies; 106 101 if (priv.current_state < SIMATIC_IPC_BATT_LEVEL_FULL) 107 - dev_warn(dev, "CMOS battery needs to be replaced."); 102 + dev_warn(dev, "CMOS battery needs to be replaced.\n"); 108 103 } 109 104 110 105 return priv.current_state; ··· 158 163 struct simatic_ipc_platform *plat; 159 164 struct device *dev = &pdev->dev; 160 165 struct device *hwmon_dev; 166 + unsigned long flags; 161 167 int err; 162 168 163 169 plat = pdev->dev.platform_data; ··· 169 173 case SIMATIC_IPC_DEVICE_227G: 170 174 case SIMATIC_IPC_DEVICE_BX_39A: 171 175 case SIMATIC_IPC_DEVICE_BX_21A: 176 + case SIMATIC_IPC_DEVICE_BX_59A: 172 177 table->dev_id = dev_name(dev); 173 178 gpiod_add_lookup_table(table); 174 179 break; ··· 193 196 } 194 197 195 198 if (table->table[2].key) { 196 - priv.gpios[2] = devm_gpiod_get_index(dev, "CMOSBattery meter", 2, GPIOD_OUT_HIGH); 199 + flags = GPIOD_OUT_HIGH; 200 + if (priv.devmode == SIMATIC_IPC_DEVICE_BX_21A || SIMATIC_IPC_DEVICE_BX_59A) 201 + flags = GPIOD_OUT_LOW; 202 + priv.gpios[2] = devm_gpiod_get_index(dev, "CMOSBattery meter", 2, flags); 197 203 if (IS_ERR(priv.gpios[2])) { 198 204 err = PTR_ERR(priv.gpios[1]); 199 205 priv.gpios[2] = NULL;
drivers/platform/x86/simatic-ipc-batt.h drivers/platform/x86/siemens/simatic-ipc-batt.h
+10 -2
drivers/platform/x86/simatic-ipc.c drivers/platform/x86/siemens/simatic-ipc.c
··· 78 78 {SIMATIC_IPC_IPCBX_21A, 79 79 SIMATIC_IPC_DEVICE_BX_21A, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_BX_21A, 80 80 { "emc1403", NULL }}, 81 + {SIMATIC_IPC_IPCBX_56A, 82 + SIMATIC_IPC_DEVICE_BX_59A, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_BX_59A, 83 + { "emc1403", "w83627hf_wdt" }}, 84 + {SIMATIC_IPC_IPCBX_59A, 85 + SIMATIC_IPC_DEVICE_BX_59A, SIMATIC_IPC_DEVICE_NONE, SIMATIC_IPC_DEVICE_BX_59A, 86 + { "emc1403", "w83627hf_wdt" }}, 81 87 }; 82 88 83 89 static int register_platform_devices(u32 station_id) ··· 109 103 pdevname = KBUILD_MODNAME "_batt_apollolake"; 110 104 if (battmode == SIMATIC_IPC_DEVICE_BX_21A) 111 105 pdevname = KBUILD_MODNAME "_batt_elkhartlake"; 112 - if (battmode == SIMATIC_IPC_DEVICE_227G || battmode == SIMATIC_IPC_DEVICE_BX_39A) 106 + if (battmode == SIMATIC_IPC_DEVICE_227G || 107 + battmode == SIMATIC_IPC_DEVICE_BX_39A || 108 + battmode == SIMATIC_IPC_DEVICE_BX_59A) 113 109 pdevname = KBUILD_MODNAME "_batt_f7188x"; 114 110 platform_data.devmode = battmode; 115 111 ipc_batt_platform_device = ··· 129 121 pdevname = KBUILD_MODNAME "_leds"; 130 122 if (ledmode == SIMATIC_IPC_DEVICE_127E) 131 123 pdevname = KBUILD_MODNAME "_leds_gpio_apollolake"; 132 - if (ledmode == SIMATIC_IPC_DEVICE_227G) 124 + if (ledmode == SIMATIC_IPC_DEVICE_227G || SIMATIC_IPC_DEVICE_BX_59A) 133 125 pdevname = KBUILD_MODNAME "_leds_gpio_f7188x"; 134 126 if (ledmode == SIMATIC_IPC_DEVICE_BX_21A) 135 127 pdevname = KBUILD_MODNAME "_leds_gpio_elkhartlake";
+1
drivers/watchdog/Kconfig
··· 1681 1681 config SIEMENS_SIMATIC_IPC_WDT 1682 1682 tristate "Siemens Simatic IPC Watchdog" 1683 1683 depends on SIEMENS_SIMATIC_IPC 1684 + default y 1684 1685 select WATCHDOG_CORE 1685 1686 select P2SB 1686 1687 help
+1
include/linux/platform_data/x86/simatic-ipc-base.h
··· 22 22 #define SIMATIC_IPC_DEVICE_227G 5 23 23 #define SIMATIC_IPC_DEVICE_BX_21A 6 24 24 #define SIMATIC_IPC_DEVICE_BX_39A 7 25 + #define SIMATIC_IPC_DEVICE_BX_59A 8 25 26 26 27 struct simatic_ipc_platform { 27 28 u8 devmode;
+2
include/linux/platform_data/x86/simatic-ipc.h
··· 36 36 SIMATIC_IPC_IPCBX_39A = 0x00001001, 37 37 SIMATIC_IPC_IPCPX_39A = 0x00001002, 38 38 SIMATIC_IPC_IPCBX_21A = 0x00001101, 39 + SIMATIC_IPC_IPCBX_56A = 0x00001201, 40 + SIMATIC_IPC_IPCBX_59A = 0x00001202, 39 41 }; 40 42 41 43 static inline u32 simatic_ipc_get_station_id(u8 *data, int max_len)