aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Twiss <stwiss.opensource@diasemi.com>2015-01-20 08:54:25 -0500
committerLee Jones <lee.jones@linaro.org>2015-01-22 11:04:04 -0500
commit71e03de46d73b87aab5f80fa55449a9e40c55d17 (patch)
treed5dd28bf25f22fddd2fbd20f49c2616ea8a84fa5
parent803926825fa4db007437f76654e3e63bafb9b906 (diff)
mfd: da9063: Add device tree support
Add device tree support for DA9063 regulators; Real-Time Clock and Watchdog. Signed-off-by: Steve Twiss <stwiss.opensource@diasemi.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/mfd/da9063-core.c2
-rw-r--r--drivers/mfd/da9063-i2c.c9
-rw-r--r--include/linux/mfd/da9063/core.h1
3 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mfd/da9063-core.c b/drivers/mfd/da9063-core.c
index f38bc98a3c57..facd3610ac77 100644
--- a/drivers/mfd/da9063-core.c
+++ b/drivers/mfd/da9063-core.c
@@ -86,6 +86,7 @@ static const struct mfd_cell da9063_devs[] = {
86 }, 86 },
87 { 87 {
88 .name = DA9063_DRVNAME_WATCHDOG, 88 .name = DA9063_DRVNAME_WATCHDOG,
89 .of_compatible = "dlg,da9063-watchdog",
89 }, 90 },
90 { 91 {
91 .name = DA9063_DRVNAME_HWMON, 92 .name = DA9063_DRVNAME_HWMON,
@@ -101,6 +102,7 @@ static const struct mfd_cell da9063_devs[] = {
101 .name = DA9063_DRVNAME_RTC, 102 .name = DA9063_DRVNAME_RTC,
102 .num_resources = ARRAY_SIZE(da9063_rtc_resources), 103 .num_resources = ARRAY_SIZE(da9063_rtc_resources),
103 .resources = da9063_rtc_resources, 104 .resources = da9063_rtc_resources,
105 .of_compatible = "dlg,da9063-rtc",
104 }, 106 },
105 { 107 {
106 .name = DA9063_DRVNAME_VIBRATION, 108 .name = DA9063_DRVNAME_VIBRATION,
diff --git a/drivers/mfd/da9063-i2c.c b/drivers/mfd/da9063-i2c.c
index 21fd8d9a217b..6f3a7c0001f9 100644
--- a/drivers/mfd/da9063-i2c.c
+++ b/drivers/mfd/da9063-i2c.c
@@ -25,6 +25,9 @@
25#include <linux/mfd/da9063/pdata.h> 25#include <linux/mfd/da9063/pdata.h>
26#include <linux/mfd/da9063/registers.h> 26#include <linux/mfd/da9063/registers.h>
27 27
28#include <linux/of.h>
29#include <linux/regulator/of_regulator.h>
30
28static const struct regmap_range da9063_ad_readable_ranges[] = { 31static const struct regmap_range da9063_ad_readable_ranges[] = {
29 { 32 {
30 .range_min = DA9063_REG_PAGE_CON, 33 .range_min = DA9063_REG_PAGE_CON,
@@ -203,6 +206,11 @@ static struct regmap_config da9063_regmap_config = {
203 .cache_type = REGCACHE_RBTREE, 206 .cache_type = REGCACHE_RBTREE,
204}; 207};
205 208
209static const struct of_device_id da9063_dt_ids[] = {
210 { .compatible = "dlg,da9063", },
211 { }
212};
213MODULE_DEVICE_TABLE(of, da9063_dt_ids);
206static int da9063_i2c_probe(struct i2c_client *i2c, 214static int da9063_i2c_probe(struct i2c_client *i2c,
207 const struct i2c_device_id *id) 215 const struct i2c_device_id *id)
208{ 216{
@@ -257,6 +265,7 @@ static struct i2c_driver da9063_i2c_driver = {
257 .driver = { 265 .driver = {
258 .name = "da9063", 266 .name = "da9063",
259 .owner = THIS_MODULE, 267 .owner = THIS_MODULE,
268 .of_match_table = of_match_ptr(da9063_dt_ids),
260 }, 269 },
261 .probe = da9063_i2c_probe, 270 .probe = da9063_i2c_probe,
262 .remove = da9063_i2c_remove, 271 .remove = da9063_i2c_remove,
diff --git a/include/linux/mfd/da9063/core.h b/include/linux/mfd/da9063/core.h
index b92a3262f8f6..79f4d822ba13 100644
--- a/include/linux/mfd/da9063/core.h
+++ b/include/linux/mfd/da9063/core.h
@@ -36,6 +36,7 @@ enum da9063_models {
36enum da9063_variant_codes { 36enum da9063_variant_codes {
37 PMIC_DA9063_AD = 0x3, 37 PMIC_DA9063_AD = 0x3,
38 PMIC_DA9063_BB = 0x5, 38 PMIC_DA9063_BB = 0x5,
39 PMIC_DA9063_CA = 0x6,
39}; 40};
40 41
41/* Interrupts */ 42/* Interrupts */