Skip to content

Commit eccb7fe

Browse files
fabioestevamWim Van Sebroeck
authored andcommitted
watchdog: imx7ulp: Use definitions instead of magic values
Use definitions instead of magic values in order to improve readability. Since the CLK field of the WDOG CS register is composed of two bits to select the watchdog clock source, use a shift representation instead of BIT(). Signed-off-by: Fabio Estevam <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent c37e358 commit eccb7fe

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/watchdog/imx7ulp_wdt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#define WDOG_CS_CMD32EN BIT(13)
1818
#define WDOG_CS_ULK BIT(11)
1919
#define WDOG_CS_RCS BIT(10)
20+
#define LPO_CLK 0x1
21+
#define LPO_CLK_SHIFT 8
22+
#define WDOG_CS_CLK (LPO_CLK << LPO_CLK_SHIFT)
2023
#define WDOG_CS_EN BIT(7)
2124
#define WDOG_CS_UPDATE BIT(5)
2225

@@ -129,7 +132,7 @@ static void imx7ulp_wdt_init(void __iomem *base, unsigned int timeout)
129132
/* set an initial timeout value in TOVAL */
130133
writel(timeout, base + WDOG_TOVAL);
131134
/* enable 32bit command sequence and reconfigure */
132-
val = BIT(13) | BIT(8) | BIT(5);
135+
val = WDOG_CS_CMD32EN | WDOG_CS_CLK | WDOG_CS_UPDATE;
133136
writel(val, base + WDOG_CS);
134137
}
135138

0 commit comments

Comments
 (0)