diff options
author | Henning Schild <henning.schild@siemens.com> | 2023-07-06 17:48:30 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2023-07-14 12:45:01 +0200 |
commit | 15fe994ee53a0093f4f7771100cd4ca9c1597748 (patch) | |
tree | 2e8082f6903e162b6a6da7873b9789cea0aa762e /drivers/watchdog | |
parent | 1b3aa9701bd2975f7e08aac6f13fbd75d1df8eac (diff) |
watchdog: simatic-ipc-wdt: make IO region access of one model muxed
The IO region used for the watchdog also hold CMOS battery monitoring
information. Make the access muxed so that a hwmon driver can use the
region as well.
Signed-off-by: Henning Schild <henning.schild@siemens.com>
Acked-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20230706154831.19100-2-henning.schild@siemens.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/watchdog')
-rw-r--r-- | drivers/watchdog/simatic-ipc-wdt.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/watchdog/simatic-ipc-wdt.c b/drivers/watchdog/simatic-ipc-wdt.c index 6599695dc672..cdc1a2e15180 100644 --- a/drivers/watchdog/simatic-ipc-wdt.c +++ b/drivers/watchdog/simatic-ipc-wdt.c @@ -155,9 +155,8 @@ static int simatic_ipc_wdt_probe(struct platform_device *pdev) switch (plat->devmode) { case SIMATIC_IPC_DEVICE_227E: - if (!devm_request_region(dev, gp_status_reg_227e_res.start, - resource_size(&gp_status_reg_227e_res), - KBUILD_MODNAME)) { + res = &gp_status_reg_227e_res; + if (!request_muxed_region(res->start, resource_size(res), res->name)) { dev_err(dev, "Unable to register IO resource at %pR\n", &gp_status_reg_227e_res); @@ -210,6 +209,10 @@ static int simatic_ipc_wdt_probe(struct platform_device *pdev) if (wdd_data.bootstatus) dev_warn(dev, "last reboot caused by watchdog reset\n"); + if (plat->devmode == SIMATIC_IPC_DEVICE_227E) + release_region(gp_status_reg_227e_res.start, + resource_size(&gp_status_reg_227e_res)); + watchdog_set_nowayout(&wdd_data, nowayout); watchdog_stop_on_reboot(&wdd_data); return devm_watchdog_register_device(dev, &wdd_data); |