1 From fded70251b1b58f68de1d3757ece9965f0b75452 Mon Sep 17 00:00:00 2001
2 From: Mathieu Olivari <mathieu@codeaurora.org>
3 Date: Thu, 19 Feb 2015 20:19:30 -0800
4 Subject: [PATCH 1/3] watchdog: qcom: use timer devicetree binding
6 MSM watchdog configuration happens in the same register block as the
7 timer, so we'll use the same binding as the existing timer.
9 The qcom-wdt will now be probed when devicetree has an entry compatible
10 with "qcom,kpss-timer" or "qcom-scss-timer".
12 Signed-off-by: Mathieu Olivari <mathieu@codeaurora.org>
14 drivers/watchdog/qcom-wdt.c | 21 +++++++++++++++------
15 1 file changed, 15 insertions(+), 6 deletions(-)
17 --- a/drivers/watchdog/qcom-wdt.c
18 +++ b/drivers/watchdog/qcom-wdt.c
20 #include <linux/reboot.h>
21 #include <linux/watchdog.h>
25 -#define WDT_BITE_TIME 0x24
28 +#define WDT_BITE_TIME 0x5C
31 struct watchdog_device wdd;
32 @@ -117,6 +117,8 @@ static int qcom_wdt_probe(struct platfor
36 + struct device_node *np = pdev->dev.of_node;
40 wdt = devm_kzalloc(&pdev->dev, sizeof(*wdt), GFP_KERNEL);
41 @@ -124,6 +126,14 @@ static int qcom_wdt_probe(struct platfor
44 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
46 + /* We use CPU0's DGT for the watchdog */
47 + if (of_property_read_u32(np, "cpu-offset", &percpu_offset))
50 + res->start += percpu_offset;
51 + res->end += percpu_offset;
53 wdt->base = devm_ioremap_resource(&pdev->dev, res);
54 if (IS_ERR(wdt->base))
55 return PTR_ERR(wdt->base);
56 @@ -203,9 +213,8 @@ static int qcom_wdt_remove(struct platfo
59 static const struct of_device_id qcom_wdt_of_table[] = {
60 - { .compatible = "qcom,kpss-wdt-msm8960", },
61 - { .compatible = "qcom,kpss-wdt-apq8064", },
62 - { .compatible = "qcom,kpss-wdt-ipq8064", },
63 + { .compatible = "qcom,kpss-timer" },
64 + { .compatible = "qcom,scss-timer" },
67 MODULE_DEVICE_TABLE(of, qcom_wdt_of_table);