Commit 19f04459 authored by Chin-Ting Kuo's avatar Chin-Ting Kuo Committed by Wim Van Sebroeck

watchdog: aspeed_wdt: Reorder output signal register configuration

If the output driving type is push-pull mode, the output
polarity should be selected in advance. Otherwise, an unexpected
value will be output at the moment of changing to push-pull mode.
Thus, output polarity, WDT18[31], must be configured before
changing driving type, WDT18[30].
Signed-off-by: default avatarChin-Ting Kuo <chin-ting_kuo@aspeedtech.com>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Tested-by: default avatarBonnie Lo <Bonnie_Lo@wiwynn.com>
Reviewed-by: default avatarJoel Stanley <joel@jms.id.au>
Link: https://lore.kernel.org/r/20220819094905.1962513-1-chin-ting_kuo@aspeedtech.comSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 891862d5
...@@ -332,18 +332,18 @@ static int aspeed_wdt_probe(struct platform_device *pdev) ...@@ -332,18 +332,18 @@ static int aspeed_wdt_probe(struct platform_device *pdev)
u32 reg = readl(wdt->base + WDT_RESET_WIDTH); u32 reg = readl(wdt->base + WDT_RESET_WIDTH);
reg &= config->ext_pulse_width_mask; reg &= config->ext_pulse_width_mask;
if (of_property_read_bool(np, "aspeed,ext-push-pull")) if (of_property_read_bool(np, "aspeed,ext-active-high"))
reg |= WDT_PUSH_PULL_MAGIC; reg |= WDT_ACTIVE_HIGH_MAGIC;
else else
reg |= WDT_OPEN_DRAIN_MAGIC; reg |= WDT_ACTIVE_LOW_MAGIC;
writel(reg, wdt->base + WDT_RESET_WIDTH); writel(reg, wdt->base + WDT_RESET_WIDTH);
reg &= config->ext_pulse_width_mask; reg &= config->ext_pulse_width_mask;
if (of_property_read_bool(np, "aspeed,ext-active-high")) if (of_property_read_bool(np, "aspeed,ext-push-pull"))
reg |= WDT_ACTIVE_HIGH_MAGIC; reg |= WDT_PUSH_PULL_MAGIC;
else else
reg |= WDT_ACTIVE_LOW_MAGIC; reg |= WDT_OPEN_DRAIN_MAGIC;
writel(reg, wdt->base + WDT_RESET_WIDTH); writel(reg, wdt->base + WDT_RESET_WIDTH);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment