aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Twiss <stwiss.opensource@diasemi.com>2016-11-14 03:22:45 -0500
committerGuenter Roeck <linux@roeck-us.net>2016-12-16 09:53:55 -0500
commit72106c1894aa4e26ab403282cc7617fcb07d3d4d (patch)
tree41335fc806f109080dabd8a97c9f628b3ba52a01
parentbb79036215e2ca9d7ef5bd1461981396989c40da (diff)
watchdog: da9062/61: watchdog driver
The of_device_id match array is added to support "dlg,da9062-watchdog" as a valid .compatible string. A MODULE_DEVICE_TABLE() macro is added. This patch assumes the use of a DA9062 fallback compatible string for the DTS to pick up the DA9062 device driver for use with the DA9061 watchdog hardware Copyright header is updated to add DA9061 in its description and the module description macro is extended to include DA9061. Kconfig is updated to reflect support for DA9061/62. Reviewed-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r--drivers/watchdog/Kconfig4
-rw-r--r--drivers/watchdog/da9062_wdt.c12
2 files changed, 12 insertions, 4 deletions
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig
index ee55dd5f4968..a05afcbec778 100644
--- a/drivers/watchdog/Kconfig
+++ b/drivers/watchdog/Kconfig
@@ -104,11 +104,11 @@ config DA9063_WATCHDOG
104 This driver can be built as a module. The module name is da9063_wdt. 104 This driver can be built as a module. The module name is da9063_wdt.
105 105
106config DA9062_WATCHDOG 106config DA9062_WATCHDOG
107 tristate "Dialog DA9062 Watchdog" 107 tristate "Dialog DA9062/61 Watchdog"
108 depends on MFD_DA9062 108 depends on MFD_DA9062
109 select WATCHDOG_CORE 109 select WATCHDOG_CORE
110 help 110 help
111 Support for the watchdog in the DA9062 PMIC. 111 Support for the watchdog in the DA9062 and DA9061 PMICs.
112 112
113 This driver can be built as a module. The module name is da9062_wdt. 113 This driver can be built as a module. The module name is da9062_wdt.
114 114
diff --git a/drivers/watchdog/da9062_wdt.c b/drivers/watchdog/da9062_wdt.c
index 7386111220d5..a02cee6820a1 100644
--- a/drivers/watchdog/da9062_wdt.c
+++ b/drivers/watchdog/da9062_wdt.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * da9062_wdt.c - WDT device driver for DA9062 2 * Watchdog device driver for DA9062 and DA9061 PMICs
3 * Copyright (C) 2015 Dialog Semiconductor Ltd. 3 * Copyright (C) 2015 Dialog Semiconductor Ltd.
4 * 4 *
5 * This program is free software; you can redistribute it and/or 5 * This program is free software; you can redistribute it and/or
@@ -188,6 +188,13 @@ static const struct watchdog_ops da9062_watchdog_ops = {
188 .set_timeout = da9062_wdt_set_timeout, 188 .set_timeout = da9062_wdt_set_timeout,
189}; 189};
190 190
191static const struct of_device_id da9062_compatible_id_table[] = {
192 { .compatible = "dlg,da9062-watchdog", },
193 { },
194};
195
196MODULE_DEVICE_TABLE(of, da9062_compatible_id_table);
197
191static int da9062_wdt_probe(struct platform_device *pdev) 198static int da9062_wdt_probe(struct platform_device *pdev)
192{ 199{
193 int ret; 200 int ret;
@@ -244,11 +251,12 @@ static struct platform_driver da9062_wdt_driver = {
244 .remove = da9062_wdt_remove, 251 .remove = da9062_wdt_remove,
245 .driver = { 252 .driver = {
246 .name = "da9062-watchdog", 253 .name = "da9062-watchdog",
254 .of_match_table = da9062_compatible_id_table,
247 }, 255 },
248}; 256};
249module_platform_driver(da9062_wdt_driver); 257module_platform_driver(da9062_wdt_driver);
250 258
251MODULE_AUTHOR("S Twiss <stwiss.opensource@diasemi.com>"); 259MODULE_AUTHOR("S Twiss <stwiss.opensource@diasemi.com>");
252MODULE_DESCRIPTION("WDT device driver for Dialog DA9062"); 260MODULE_DESCRIPTION("WDT device driver for Dialog DA9062 and DA9061");
253MODULE_LICENSE("GPL"); 261MODULE_LICENSE("GPL");
254MODULE_ALIAS("platform:da9062-watchdog"); 262MODULE_ALIAS("platform:da9062-watchdog");