mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <markgross@kernel.org>, <linux-kernel@vger.kernel.org>,
	<platform-driver-x86@vger.kernel.org>
Cc: Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Jean Delvare <jdelvare@suse.com>,
	<linux-watchdog@vger.kernel.org>, <linux-hwmon@vger.kernel.org>,
	"Tobias Schaffner" <tobias.schaffner@siemens.com>,
	Gerd Haeussler <gerd.haeussler.ext@siemens.com>,
	Henning Schild <henning.schild@siemens.com>
Subject: [PATCH 1/2] watchdog: simatic-ipc-wdt: make IO region access of one model muxed
Date: Thu, 6 Jul 2023 17:48:30 +0200	[thread overview]
Message-ID: <20230706154831.19100-2-henning.schild@siemens.com> (raw)
In-Reply-To: <20230706154831.19100-1-henning.schild@siemens.com>

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>
---
 drivers/watchdog/simatic-ipc-wdt.c | 9 ++++++---
 1 file 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);
-- 
2.39.3


  reply	other threads:[~2023-07-06 15:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-06 15:48 [PATCH 0/2] platform/x86: add CMOS battery monitoring for simatic IPCs Henning Schild
2023-07-06 15:48 ` Henning Schild [this message]
2023-07-06 16:03   ` [PATCH 1/2] watchdog: simatic-ipc-wdt: make IO region access of one model muxed Guenter Roeck
2023-07-10 13:33     ` Hans de Goede
2023-07-10 13:45       ` Guenter Roeck
2023-07-10 18:54         ` Henning Schild
2023-07-06 15:48 ` [PATCH 2/2] platform/x86: add CMOS battery monitoring for simatic IPCs Henning Schild
2023-07-10 13:34   ` Hans de Goede
2023-07-12 18:02   ` Hans de Goede
2023-07-12 18:05   ` Hans de Goede
2023-07-13  8:28     ` Henning Schild
2023-07-13  8:36       ` Hans de Goede
2023-07-13 11:59     ` Henning Schild
2023-07-14  9:28 ` [PATCH 0/2] " Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230706154831.19100-2-henning.schild@siemens.com \
    --to=henning.schild@siemens.com \
    --cc=gerd.haeussler.ext@siemens.com \
    --cc=hdegoede@redhat.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tobias.schaffner@siemens.com \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®