Commit 72106c18 authored by Steve Twiss's avatar Steve Twiss Committed by Guenter Roeck

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: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarSteve Twiss <stwiss.opensource@diasemi.com>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent bb790362
...@@ -104,11 +104,11 @@ config DA9063_WATCHDOG ...@@ -104,11 +104,11 @@ config DA9063_WATCHDOG
This driver can be built as a module. The module name is da9063_wdt. This driver can be built as a module. The module name is da9063_wdt.
config DA9062_WATCHDOG config DA9062_WATCHDOG
tristate "Dialog DA9062 Watchdog" tristate "Dialog DA9062/61 Watchdog"
depends on MFD_DA9062 depends on MFD_DA9062
select WATCHDOG_CORE select WATCHDOG_CORE
help help
Support for the watchdog in the DA9062 PMIC. Support for the watchdog in the DA9062 and DA9061 PMICs.
This driver can be built as a module. The module name is da9062_wdt. This driver can be built as a module. The module name is da9062_wdt.
......
/* /*
* da9062_wdt.c - WDT device driver for DA9062 * Watchdog device driver for DA9062 and DA9061 PMICs
* Copyright (C) 2015 Dialog Semiconductor Ltd. * Copyright (C) 2015 Dialog Semiconductor Ltd.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -188,6 +188,13 @@ static const struct watchdog_ops da9062_watchdog_ops = { ...@@ -188,6 +188,13 @@ static const struct watchdog_ops da9062_watchdog_ops = {
.set_timeout = da9062_wdt_set_timeout, .set_timeout = da9062_wdt_set_timeout,
}; };
static const struct of_device_id da9062_compatible_id_table[] = {
{ .compatible = "dlg,da9062-watchdog", },
{ },
};
MODULE_DEVICE_TABLE(of, da9062_compatible_id_table);
static int da9062_wdt_probe(struct platform_device *pdev) static int da9062_wdt_probe(struct platform_device *pdev)
{ {
int ret; int ret;
...@@ -244,11 +251,12 @@ static struct platform_driver da9062_wdt_driver = { ...@@ -244,11 +251,12 @@ static struct platform_driver da9062_wdt_driver = {
.remove = da9062_wdt_remove, .remove = da9062_wdt_remove,
.driver = { .driver = {
.name = "da9062-watchdog", .name = "da9062-watchdog",
.of_match_table = da9062_compatible_id_table,
}, },
}; };
module_platform_driver(da9062_wdt_driver); module_platform_driver(da9062_wdt_driver);
MODULE_AUTHOR("S Twiss <stwiss.opensource@diasemi.com>"); MODULE_AUTHOR("S Twiss <stwiss.opensource@diasemi.com>");
MODULE_DESCRIPTION("WDT device driver for Dialog DA9062"); MODULE_DESCRIPTION("WDT device driver for Dialog DA9062 and DA9061");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:da9062-watchdog"); MODULE_ALIAS("platform:da9062-watchdog");
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