summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJavier Martinez Canillas <javier@osg.samsung.com>2015-08-20 09:07:25 +0200
committerLee Jones <lee.jones@linaro.org>2015-08-24 15:27:52 +0100
commit1e955bece28f0f464c2db03c7e12951cea65fab6 (patch)
tree6f8e161606d7378d5389526676adef3b40130746 /drivers
parentaa60a8391337aa0f14ed890b237f5b8e6cadfbbf (diff)
mfd: stmpe: Add OF match table
The Documentation/devicetree/bindings/mfd/stmpe.txt DT binding doc lists "st,stmpe[610|801|811|1601|2401|2403]" as valid compatible strings but the corresponding driver does not have an OF match table. Add the table to the driver so the SPI core can do an OF style match. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/stmpe-spi.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mfd/stmpe-spi.c b/drivers/mfd/stmpe-spi.c
index a81badbaa917..84e2e419bf3b 100644
--- a/drivers/mfd/stmpe-spi.c
+++ b/drivers/mfd/stmpe-spi.c
@@ -11,6 +11,7 @@
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
+#include <linux/of.h>
#include <linux/types.h>
#include "stmpe.h"
@@ -108,6 +109,17 @@ static int stmpe_spi_remove(struct spi_device *spi)
return stmpe_remove(stmpe);
}
+static const struct of_device_id stmpe_spi_of_match[] = {
+ { .compatible = "st,stmpe610", },
+ { .compatible = "st,stmpe801", },
+ { .compatible = "st,stmpe811", },
+ { .compatible = "st,stmpe1601", },
+ { .compatible = "st,stmpe2401", },
+ { .compatible = "st,stmpe2403", },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, stmpe_spi_of_match);
+
static const struct spi_device_id stmpe_spi_id[] = {
{ "stmpe610", STMPE610 },
{ "stmpe801", STMPE801 },
@@ -122,6 +134,7 @@ MODULE_DEVICE_TABLE(spi, stmpe_id);
static struct spi_driver stmpe_spi_driver = {
.driver = {
.name = "stmpe-spi",
+ .of_match_table = of_match_ptr(stmpe_spi_of_match),
.owner = THIS_MODULE,
#ifdef CONFIG_PM
.pm = &stmpe_dev_pm_ops,