mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
To: <patrick@stwcx.xyz>, <joel@jms.id.au>,
	<andrew@codeconstruct.com.au>, <wim@linux-watchdog.org>,
	<linux@roeck-us.net>, <linux-arm-kernel@lists.infradead.org>,
	<linux-aspeed@lists.ozlabs.org>, <linux-kernel@vger.kernel.org>,
	<linux-watchdog@vger.kernel.org>
Cc: <Peter.Yin@quantatw.com>, <Patrick_NC_Lin@wiwynn.com>,
	<Bonnie_Lo@wiwynn.com>, <DELPHINE_CHIU@wiwynn.com>,
	<bmc-sw@aspeedtech.com>, <chnguyen@amperecomputing.com>
Subject: [PATCH v4 2/3] watchdog: aspeed: Change aspeed_wdt_config struct name to aspeed_wdt_data
Date: Fri, 1 Nov 2024 20:12:00 +0800	[thread overview]
Message-ID: <20241101121201.2464091-3-chin-ting_kuo@aspeedtech.com> (raw)
In-Reply-To: <20241101121201.2464091-1-chin-ting_kuo@aspeedtech.com>

aspeed_wdt_config struct is used to store some HW configuration
information. Changing its naming to a more generic one,
aspeed_wdt_data, in order to contain more platform specific
inforamtion or SW callback functions.

Signed-off-by: Chin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
---
 drivers/watchdog/aspeed_wdt.c | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/watchdog/aspeed_wdt.c b/drivers/watchdog/aspeed_wdt.c
index 4ad6335ff25b..63b5ff9e2751 100644
--- a/drivers/watchdog/aspeed_wdt.c
+++ b/drivers/watchdog/aspeed_wdt.c
@@ -31,7 +31,7 @@ struct aspeed_wdt_scu {
 	u32 wdt_reset_mask_shift;
 };
 
-struct aspeed_wdt_config {
+struct aspeed_wdt_data {
 	u32 ext_pulse_width_mask;
 	u32 irq_shift;
 	u32 irq_mask;
@@ -42,10 +42,10 @@ struct aspeed_wdt {
 	struct watchdog_device	wdd;
 	void __iomem		*base;
 	u32			ctrl;
-	const struct aspeed_wdt_config *cfg;
+	const struct aspeed_wdt_data *data;
 };
 
-static const struct aspeed_wdt_config ast2400_config = {
+static const struct aspeed_wdt_data ast2400_data = {
 	.ext_pulse_width_mask = 0xff,
 	.irq_shift = 0,
 	.irq_mask = 0,
@@ -58,7 +58,7 @@ static const struct aspeed_wdt_config ast2400_config = {
 	},
 };
 
-static const struct aspeed_wdt_config ast2500_config = {
+static const struct aspeed_wdt_data ast2500_data = {
 	.ext_pulse_width_mask = 0xfffff,
 	.irq_shift = 12,
 	.irq_mask = GENMASK(31, 12),
@@ -71,7 +71,7 @@ static const struct aspeed_wdt_config ast2500_config = {
 	},
 };
 
-static const struct aspeed_wdt_config ast2600_config = {
+static const struct aspeed_wdt_data ast2600_data = {
 	.ext_pulse_width_mask = 0xfffff,
 	.irq_shift = 0,
 	.irq_mask = GENMASK(31, 10),
@@ -85,9 +85,9 @@ static const struct aspeed_wdt_config ast2600_config = {
 };
 
 static const struct of_device_id aspeed_wdt_of_table[] = {
-	{ .compatible = "aspeed,ast2400-wdt", .data = &ast2400_config },
-	{ .compatible = "aspeed,ast2500-wdt", .data = &ast2500_config },
-	{ .compatible = "aspeed,ast2600-wdt", .data = &ast2600_config },
+	{ .compatible = "aspeed,ast2400-wdt", .data = &ast2400_data },
+	{ .compatible = "aspeed,ast2500-wdt", .data = &ast2500_data },
+	{ .compatible = "aspeed,ast2600-wdt", .data = &ast2600_data },
 	{ },
 };
 MODULE_DEVICE_TABLE(of, aspeed_wdt_of_table);
@@ -216,8 +216,8 @@ static int aspeed_wdt_set_pretimeout(struct watchdog_device *wdd,
 {
 	struct aspeed_wdt *wdt = to_aspeed_wdt(wdd);
 	u32 actual = pretimeout * WDT_RATE_1MHZ;
-	u32 s = wdt->cfg->irq_shift;
-	u32 m = wdt->cfg->irq_mask;
+	u32 s = wdt->data->irq_shift;
+	u32 m = wdt->data->irq_mask;
 
 	wdd->pretimeout = pretimeout;
 	wdt->ctrl &= ~m;
@@ -248,7 +248,7 @@ static int aspeed_wdt_update_bootstatus(struct platform_device *pdev,
 					struct aspeed_wdt *wdt)
 {
 	struct resource *res;
-	struct aspeed_wdt_scu scu = wdt->cfg->scu;
+	struct aspeed_wdt_scu scu = wdt->data->scu;
 	struct regmap *scu_base;
 	u32 reset_mask_width;
 	u32 reset_mask_shift;
@@ -401,7 +401,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
 	ofdid = of_match_node(aspeed_wdt_of_table, np);
 	if (!ofdid)
 		return -EINVAL;
-	wdt->cfg = ofdid->data;
+	wdt->data = ofdid->data;
 
 	wdt->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(wdt->base))
@@ -409,7 +409,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
 
 	wdt->wdd.info = &aspeed_wdt_info;
 
-	if (wdt->cfg->irq_mask) {
+	if (wdt->data->irq_mask) {
 		int irq = platform_get_irq_optional(pdev, 0);
 
 		if (irq > 0) {
@@ -485,7 +485,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
 		size_t nrstmask = of_device_is_compatible(np, "aspeed,ast2600-wdt") ? 2 : 1;
 		u32 reg = readl(wdt->base + WDT_RESET_WIDTH);
 
-		reg &= wdt->cfg->ext_pulse_width_mask;
+		reg &= wdt->data->ext_pulse_width_mask;
 		if (of_property_read_bool(np, "aspeed,ext-active-high"))
 			reg |= WDT_ACTIVE_HIGH_MAGIC;
 		else
@@ -493,7 +493,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
 
 		writel(reg, wdt->base + WDT_RESET_WIDTH);
 
-		reg &= wdt->cfg->ext_pulse_width_mask;
+		reg &= wdt->data->ext_pulse_width_mask;
 		if (of_property_read_bool(np, "aspeed,ext-push-pull"))
 			reg |= WDT_PUSH_PULL_MAGIC;
 		else
@@ -510,7 +510,7 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
 	}
 
 	if (!of_property_read_u32(np, "aspeed,ext-pulse-duration", &duration)) {
-		u32 max_duration = wdt->cfg->ext_pulse_width_mask + 1;
+		u32 max_duration = wdt->data->ext_pulse_width_mask + 1;
 
 		if (duration == 0 || duration > max_duration) {
 			dev_err(dev, "Invalid pulse duration: %uus\n",
-- 
2.34.1


  parent reply	other threads:[~2024-11-01 12:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-01 12:11 [PATCH v4 0/3] Update ASPEED WDT bootstatus Chin-Ting Kuo
2024-11-01 12:11 ` [PATCH v4 1/3] watchdog: aspeed: Update bootstatus handling Chin-Ting Kuo
2024-11-01 18:21   ` Patrick Williams
2024-11-04  0:01     ` Andrew Jeffery
2024-11-07  5:35       ` Chin-Ting Kuo
2024-11-07 23:49         ` Andrew Jeffery
2024-11-08  5:42           ` Chin-Ting Kuo
2024-11-08 14:07             ` Guenter Roeck
2024-11-18 12:46               ` Chin-Ting Kuo
2024-11-18 20:50                 ` Guenter Roeck
2024-11-18 23:00                   ` Andrew Jeffery
2024-11-19  1:27                     ` Guenter Roeck
2024-11-20  4:54                       ` Andrew Jeffery
2024-12-17  2:15                         ` Chin-Ting Kuo
2024-11-07  5:34     ` Chin-Ting Kuo
2024-11-01 22:16   ` Guenter Roeck
2024-11-07  5:35     ` Chin-Ting Kuo
2024-11-01 12:12 ` Chin-Ting Kuo [this message]
2024-11-01 22:19   ` [PATCH v4 2/3] watchdog: aspeed: Change aspeed_wdt_config struct name to aspeed_wdt_data Guenter Roeck
2024-11-01 12:12 ` [PATCH v4 3/3] watchdog: aspeed: Update restart implementations Chin-Ting Kuo

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=20241101121201.2464091-3-chin-ting_kuo@aspeedtech.com \
    --to=chin-ting_kuo@aspeedtech.com \
    --cc=Bonnie_Lo@wiwynn.com \
    --cc=DELPHINE_CHIU@wiwynn.com \
    --cc=Patrick_NC_Lin@wiwynn.com \
    --cc=Peter.Yin@quantatw.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=bmc-sw@aspeedtech.com \
    --cc=chnguyen@amperecomputing.com \
    --cc=joel@jms.id.au \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=patrick@stwcx.xyz \
    --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®