summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/stmpe.c
diff options
context:
space:
mode:
authorGabriel Fernandez <gabriel.fernandez@stericsson.com>2013-03-01 13:07:26 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-04-05 18:05:54 +0200
commit408a3fa867be13844af13bcbba25e70232fd99e5 (patch)
tree628cc9ecf25e5fd9f522db3f7242cdf60e78f394 /drivers/mfd/stmpe.c
parenta200e320f7ba7daa42e5fae3a1c67ed2f704b05c (diff)
downloadop-kernel-dev-408a3fa867be13844af13bcbba25e70232fd99e5.zip
op-kernel-dev-408a3fa867be13844af13bcbba25e70232fd99e5.tar.gz
mfd: stmpe: DT: Add stmpe-i2c dt alias to get id device
This patch augments the STMP driver to read the device id from the stmpe-i2c dt alias if present. Cc: devicetree-discuss@lists.ozlabs.org Signed-off-by: Gabriel Fernandez <gabriel.fernandez@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/stmpe.c')
-rw-r--r--drivers/mfd/stmpe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
index e550dcb..bc85877 100644
--- a/drivers/mfd/stmpe.c
+++ b/drivers/mfd/stmpe.c
@@ -1015,7 +1015,10 @@ void stmpe_of_probe(struct stmpe_platform_data *pdata, struct device_node *np)
{
struct device_node *child;
- pdata->id = -1;
+ pdata->id = of_alias_get_id(np, "stmpe-i2c");
+ if (pdata->id < 0)
+ pdata->id = -1;
+
pdata->irq_trigger = IRQF_TRIGGER_NONE;
of_property_read_u32(np, "st,autosleep-timeout",
OpenPOWER on IntegriCloud