From e5d5ffa48a6eadb67949590ca78c594836e2ae28 Mon Sep 17 00:00:00 2001 From: Yang Yingliang Date: Wed, 9 Aug 2023 16:12:27 +0800 Subject: platform/x86/siemens: simatic-ipc-batt: fix wrong pointer pass to PTR_ERR() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix wrong pointer pass to PTR_ERR() if devm_gpiod_get_index() fails. Fixes: 917f54340794 ("platform/x86: simatic-ipc: add CMOS battery monitoring") Signed-off-by: Yang Yingliang Reviewed-by: Ilpo Järvinen Link: https://lore.kernel.org/r/20230809081227.1221267-1-yangyingliang@huawei.com Signed-off-by: Hans de Goede --- drivers/platform/x86/siemens/simatic-ipc-batt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt.c b/drivers/platform/x86/siemens/simatic-ipc-batt.c index d66b9969234b..15c08c4900b8 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt.c @@ -198,7 +198,7 @@ int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_tab flags = GPIOD_OUT_LOW; priv.gpios[2] = devm_gpiod_get_index(dev, "CMOSBattery meter", 2, flags); if (IS_ERR(priv.gpios[2])) { - err = PTR_ERR(priv.gpios[1]); + err = PTR_ERR(priv.gpios[2]); priv.gpios[2] = NULL; goto out; } -- cgit From b01c1e022f7f0c327ecc7544dc44d5f80a2d2bd9 Mon Sep 17 00:00:00 2001 From: "xingtong.wu" Date: Thu, 3 Aug 2023 01:35:15 +0800 Subject: platform/x86/siemens: simatic-ipc: fix logical error for BX-59A MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable "ledmode" is missing from if statement that leads to a logical error. Add the missing variable to the if condition. Fixes: b8af77951941 ("platform/x86/siemens: simatic-ipc: add new models BX-56A/BX-59A") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202307312322.Aa8upHWK-lkp@intel.com/ Reviewed-by: Ilpo Järvinen Signed-off-by: xingtong.wu Link: https://lore.kernel.org/r/20430802173515.2363-2-xingtong_wu@163.com Signed-off-by: Hans de Goede --- drivers/platform/x86/siemens/simatic-ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/siemens/simatic-ipc.c b/drivers/platform/x86/siemens/simatic-ipc.c index 02c540cf4070..8ca6e277fa03 100644 --- a/drivers/platform/x86/siemens/simatic-ipc.c +++ b/drivers/platform/x86/siemens/simatic-ipc.c @@ -129,7 +129,7 @@ static int register_platform_devices(u32 station_id) pdevname = KBUILD_MODNAME "_leds"; if (ledmode == SIMATIC_IPC_DEVICE_127E) pdevname = KBUILD_MODNAME "_leds_gpio_apollolake"; - if (ledmode == SIMATIC_IPC_DEVICE_227G || SIMATIC_IPC_DEVICE_BX_59A) + if (ledmode == SIMATIC_IPC_DEVICE_227G || ledmode == SIMATIC_IPC_DEVICE_BX_59A) pdevname = KBUILD_MODNAME "_leds_gpio_f7188x"; if (ledmode == SIMATIC_IPC_DEVICE_BX_21A) pdevname = KBUILD_MODNAME "_leds_gpio_elkhartlake"; -- cgit From 7abf253afa5c72c0c7eb21f67da1d443f036737a Mon Sep 17 00:00:00 2001 From: "xingtong.wu" Date: Thu, 3 Aug 2023 01:35:15 +0800 Subject: platform/x86/siemens: simatic-ipc-batt: fix logical error for BX-59A MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The variable "priv.devmode" is missing from if statement that leads to a logical error. Add the missing variable to the if condition. Fixes: c56beff20375 ("platform/x86/siemens: simatic-ipc-batt: add support for module BX-59A") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202308010001.BGYCSQrl-lkp@intel.com/ Reviewed-by: Ilpo Järvinen Signed-off-by: xingtong.wu Link: https://lore.kernel.org/r/20430802173844.2483-1-xingtong_wu@163.com Signed-off-by: Hans de Goede --- drivers/platform/x86/siemens/simatic-ipc-batt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/platform/x86/siemens/simatic-ipc-batt.c b/drivers/platform/x86/siemens/simatic-ipc-batt.c index 15c08c4900b8..ef28c806b383 100644 --- a/drivers/platform/x86/siemens/simatic-ipc-batt.c +++ b/drivers/platform/x86/siemens/simatic-ipc-batt.c @@ -194,7 +194,8 @@ int simatic_ipc_batt_probe(struct platform_device *pdev, struct gpiod_lookup_tab if (table->table[2].key) { flags = GPIOD_OUT_HIGH; - if (priv.devmode == SIMATIC_IPC_DEVICE_BX_21A || SIMATIC_IPC_DEVICE_BX_59A) + if (priv.devmode == SIMATIC_IPC_DEVICE_BX_21A || + priv.devmode == SIMATIC_IPC_DEVICE_BX_59A) flags = GPIOD_OUT_LOW; priv.gpios[2] = devm_gpiod_get_index(dev, "CMOSBattery meter", 2, flags); if (IS_ERR(priv.gpios[2])) { -- cgit From 62d25cb19bb25a443e467a6c042846e3ac401113 Mon Sep 17 00:00:00 2001 From: Gerd Haeussler Date: Mon, 14 Aug 2023 09:31:14 +0200 Subject: MAINTAINERS: Add entries for Siemens IPC modules There are different IPC driver modules in the kernel that are actively maintained by Siemens but not yet listed in the MAINTAINERS file. Add the missing entries. Signed-off-by: Gerd Haeussler Acked-by: Guenter Roeck Link: https://lore.kernel.org/r/20230814073114.2885-1-haeussler.gerd@gmail.com Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede --- MAINTAINERS | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 3be1bdfe8ecc..3c70de4b4f8c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19390,6 +19390,32 @@ F: drivers/media/mmc/siano/ F: drivers/media/usb/siano/ F: drivers/media/usb/siano/ +SIEMENS IPC LED DRIVERS +M: Gerd Haeussler +M: Xing Tong Wu +M: Tobias Schaffner +L: linux-leds@vger.kernel.org +S: Maintained +F: drivers/leds/simple/ + +SIEMENS IPC PLATFORM DRIVERS +M: Gerd Haeussler +M: Xing Tong Wu +M: Tobias Schaffner +L: platform-driver-x86@vger.kernel.org +S: Maintained +F: drivers/platform/x86/siemens/ +F: include/linux/platform_data/x86/simatic-ipc-base.h +F: include/linux/platform_data/x86/simatic-ipc.h + +SIEMENS IPC WATCHDOG DRIVERS +M: Gerd Haeussler +M: Xing Tong Wu +M: Tobias Schaffner +L: linux-watchdog@vger.kernel.org +S: Maintained +F: drivers/watchdog/simatic-ipc-wdt.c + SIFIVE DRIVERS M: Palmer Dabbelt M: Paul Walmsley -- cgit From f0ced885f5da250abb439e3a82b7dc9fc272aace Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Mon, 14 Aug 2023 09:38:50 +0200 Subject: watchdog: simatic: add PCI dependency The simatic-ipc driver no longer depends on PCI, but its watchdog portion still needs it, otherwise P2SB runs into a build failure: WARNING: unmet direct dependencies detected for P2SB Depends on [n]: PCI [=n] && X86 [=y] Selected by [m]: - SIEMENS_SIMATIC_IPC_WDT [=m] && WATCHDOG [=y] && SIEMENS_SIMATIC_IPC [=y] drivers/platform/x86/p2sb.c:121:3: error: call to undeclared function 'pci_bus_write_config_dword'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] pci_bus_write_config_dword(bus, devfn_p2sb, P2SBC, 0); Add back the minimum dependendency to make it build in random configurations again. Fixes: b72da71ce24b ("platform/x86: simatic-ipc: drop PCI runtime depends and header") Signed-off-by: Arnd Bergmann Reviewed-by: Hans de Goede Reviewed-by: Guenter Roeck Link: https://lore.kernel.org/r/20230814073924.1066390-1-arnd@kernel.org Signed-off-by: Hans de Goede --- drivers/watchdog/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 04e9b40cf7d5..09452384221a 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -1680,7 +1680,7 @@ config NIC7018_WDT config SIEMENS_SIMATIC_IPC_WDT tristate "Siemens Simatic IPC Watchdog" - depends on SIEMENS_SIMATIC_IPC + depends on SIEMENS_SIMATIC_IPC && PCI default y select WATCHDOG_CORE select P2SB -- cgit