diff options
Diffstat (limited to 'drivers/input/touchscreen/cyttsp_spi.c')
| -rw-r--r-- | drivers/input/touchscreen/cyttsp_spi.c | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/drivers/input/touchscreen/cyttsp_spi.c b/drivers/input/touchscreen/cyttsp_spi.c index 4728bcb1916c..ada17f2dadf3 100644 --- a/drivers/input/touchscreen/cyttsp_spi.c +++ b/drivers/input/touchscreen/cyttsp_spi.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Source for: * Cypress TrueTouch(TM) Standard Product (TTSP) SPI touchscreen driver. @@ -10,18 +11,7 @@ * Copyright (C) 2012 Javier Martinez Canillas <javier@dowhile0.org> * Copyright (C) 2013 Cypress Semiconductor * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * version 2, and only version 2, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * * Contact Cypress Semiconductor at www.cypress.com <ttdrivers@cypress.com> - * */ #include "cyttsp_core.h" @@ -30,6 +20,8 @@ #include <linux/input.h> #include <linux/spi/spi.h> +#define CY_SPI_NAME "cyttsp-spi" + #define CY_SPI_WR_OP 0x00 /* r/~w */ #define CY_SPI_RD_OP 0x01 #define CY_SPI_CMD_BYTES 4 @@ -170,23 +162,20 @@ static int cyttsp_spi_probe(struct spi_device *spi) return 0; } -static int cyttsp_spi_remove(struct spi_device *spi) -{ - struct cyttsp *ts = spi_get_drvdata(spi); - - cyttsp_remove(ts); - - 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, - .owner = THIS_MODULE, - .pm = &cyttsp_pm_ops, + .pm = pm_sleep_ptr(&cyttsp_pm_ops), + .of_match_table = cyttsp_of_spi_match, }, .probe = cyttsp_spi_probe, - .remove = cyttsp_spi_remove, }; module_spi_driver(cyttsp_spi_driver); |
