OSDN Git Service

watchdog: s3c2410: Support separate source clock
authorSam Protsenko <semen.protsenko@linaro.org>
Sun, 21 Nov 2021 16:56:45 +0000 (18:56 +0200)
committerWim Van Sebroeck <wim@linux-watchdog.org>
Tue, 28 Dec 2021 12:59:04 +0000 (13:59 +0100)
commite249d01b5e8b8263ee2fdb787c954450940a7677
treee852b3f26a4765e3e1243a547c6e1cb9e671f8e7
parentcf3fad4e62d363e2e79aed8b7af4eb5bec905df0
watchdog: s3c2410: Support separate source clock

Right now all devices supported in the driver have the single clock: it
acts simultaneously as a bus clock (providing register interface
clocking) and source clock (driving watchdog counter). Some newer Exynos
chips, like Exynos850, have two separate clocks for that. In that case
two clocks will be passed to the driver from the resource provider, e.g.
Device Tree. Provide necessary infrastructure to support that case:
  - use source clock's rate for all timer related calculations
  - use bus clock to gate/ungate the register interface

All devices that use the single clock are kept intact: if only one clock
is passed from Device Tree, it will be used for both purposes as before.

Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20211107202943.8859-11-semen.protsenko@linaro.org
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
drivers/watchdog/s3c2410_wdt.c