summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-05-09 14:17:04 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-05-09 14:17:04 +0200
commit188275e2798b5b1039d7b7415042b77335c692fa (patch)
tree49c00e71fb49dd99bcda728d1d513c9eda865215 /drivers/mfd
parentcd4320e3e86bd2ab7b4a19016ef8df6c5d69a5a5 (diff)
parent07329ded178ba6594e575a8d80cfa0448004e331 (diff)
downloadbarebox-188275e2798b5b1039d7b7415042b77335c692fa.tar.gz
barebox-188275e2798b5b1039d7b7415042b77335c692fa.tar.xz
Merge branch 'for-next/aiodev'
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/mc13xxx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mfd/mc13xxx.c b/drivers/mfd/mc13xxx.c
index f6aa922425..a5877dbda1 100644
--- a/drivers/mfd/mc13xxx.c
+++ b/drivers/mfd/mc13xxx.c
@@ -40,10 +40,12 @@ struct mc13xxx {
struct spi_device *spi;
};
int revision;
+ int type;
};
struct mc13xxx_devtype {
int (*revision)(struct mc13xxx*);
+ int type;
};
#define to_mc13xxx(a) container_of(a, struct mc13xxx, cdev)
@@ -56,6 +58,12 @@ struct mc13xxx *mc13xxx_get(void)
}
EXPORT_SYMBOL(mc13xxx_get);
+int mc13xxx_type(struct mc13xxx *mc13xxx)
+{
+ return mc13xxx->type;
+}
+EXPORT_SYMBOL(mc13xxx_type);
+
int mc13xxx_revision(struct mc13xxx *mc13xxx)
{
return mc13xxx->revision;
@@ -347,6 +355,7 @@ static int __init mc13xxx_probe(struct device_d *dev)
}
mc_dev->revision = rev;
+ mc_dev->type = devtype->type;
ret = regmap_register_cdev(mc_dev->map, NULL);
if (ret)
@@ -355,19 +364,25 @@ static int __init mc13xxx_probe(struct device_d *dev)
if (mc13xxx_init_callback)
mc13xxx_init_callback(mc_dev);
+ if (of_property_read_bool(dev->device_node, "fsl,mc13xxx-uses-adc"))
+ mc13xxx_adc_probe(dev, mc_dev);
+
return 0;
}
static struct mc13xxx_devtype mc13783_devtype = {
.revision = mc13783_revision,
+ .type = MC13783_TYPE,
};
static struct mc13xxx_devtype mc13892_devtype = {
.revision = mc13892_revision,
+ .type = MC13892_TYPE,
};
static struct mc13xxx_devtype mc34708_devtype = {
.revision = mc34708_revision,
+ .type = MC34708_TYPE,
};
static struct platform_device_id mc13xxx_ids[] = {