summaryrefslogtreecommitdiff
path: root/drivers/input/touchscreen/cyttsp_spi.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2021-05-26 16:34:41 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2021-05-26 16:58:59 -0700
commit007704c99f52e22cd93bcc16c610d7c1a41fd9cd (patch)
treebd08261ffdc7ffcf9ed385f823474d4ec19a4920 /drivers/input/touchscreen/cyttsp_spi.c
parent4b48d935a5e027188d5fd6fd3ce2ee2da1811a0e (diff)
Input: cyttsp - probe from compatibles
The driver (both SPI and I2C interface) should probe from the compatible strings, cypress,cy8ctma340 etc when using device tree, not as now, where it is probing implicitly from the I2C/SPI node name "cypress,cyttsp-i2c" etc. Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20210526230352.1433537-2-linus.walleij@linaro.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/touchscreen/cyttsp_spi.c')
-rw-r--r--drivers/input/touchscreen/cyttsp_spi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/touchscreen/cyttsp_spi.c b/drivers/input/touchscreen/cyttsp_spi.c
index 54e410921d53..8715e5354d79 100644
--- a/drivers/input/touchscreen/cyttsp_spi.c
+++ b/drivers/input/touchscreen/cyttsp_spi.c
@@ -160,10 +160,18 @@ static int cyttsp_spi_probe(struct spi_device *spi)
return 0;
}
+static const struct of_device_id cyttsp_of_spi_match[] = {
+ { .compatible = "cypress,cy8ctma340", },
+ { .compatible = "cypress,cy8ctst341", },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, cyttsp_of_spi_match);
+
static struct spi_driver cyttsp_spi_driver = {
.driver = {
.name = CY_SPI_NAME,
.pm = &cyttsp_pm_ops,
+ .of_match_table = cyttsp_of_spi_match,
},
.probe = cyttsp_spi_probe,
};