From: Javier Martinez Canillas <javier@dowhile0.org>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Ferruh Yigit <fery@cypress.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Henrik Rydberg <rydberg@bitmath.org>,
linux-input@vger.kernel.org
Subject: Re: [PATCH 1/7] Input: cyttsp - Probe from compatibles
Date: Tue, 30 Mar 2021 12:51:19 +0200 [thread overview]
Message-ID: <CABxcv=kspnfCM+pQfFhEJJXhp2FqRsJ8uxt5v3voqmQoV-G=tg@mail.gmail.com> (raw)
In-Reply-To: <20210330085424.2244653-2-linus.walleij@linaro.org>
Hello Linus,
On Tue, Mar 30, 2021 at 10:54 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> 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.
>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/input/touchscreen/cyttsp_i2c.c | 7 +++++++
> drivers/input/touchscreen/cyttsp_spi.c | 7 +++++++
> 2 files changed, 14 insertions(+)
>
> diff --git a/drivers/input/touchscreen/cyttsp_i2c.c b/drivers/input/touchscreen/cyttsp_i2c.c
> index 061debf64a2b..0f097f34832a 100644
> --- a/drivers/input/touchscreen/cyttsp_i2c.c
> +++ b/drivers/input/touchscreen/cyttsp_i2c.c
> @@ -52,10 +52,17 @@ static const struct i2c_device_id cyttsp_i2c_id[] = {
> };
> MODULE_DEVICE_TABLE(i2c, cyttsp_i2c_id);
>
> +static const struct of_device_id cyttsp_of_i2c_match[] = {
> + { .compatible = "cypress,cy8ctma340", },
> + { .compatible = "cypress,cy8ctst341", },
> + { /* sentinel */ }
> +};
> +
I think we want to export this as modalias with
MODULE_DEVICE_TABLE(of, cyttsp_of_i2c_match) so the driver could be
autoloaded if built as a module ?
> static struct i2c_driver cyttsp_i2c_driver = {
> .driver = {
> .name = CY_I2C_NAME,
> .pm = &cyttsp_pm_ops,
> + .of_match_table = cyttsp_of_i2c_match,
> },
> .probe = cyttsp_i2c_probe,
> .id_table = cyttsp_i2c_id,
> diff --git a/drivers/input/touchscreen/cyttsp_spi.c b/drivers/input/touchscreen/cyttsp_spi.c
> index 54e410921d53..ad8b3c6c4d3e 100644
> --- a/drivers/input/touchscreen/cyttsp_spi.c
> +++ b/drivers/input/touchscreen/cyttsp_spi.c
> @@ -160,10 +160,17 @@ 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 */ }
> +};
> +
And same here.
Other than that, the patch looks good to me.
Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org>
Best regards,
Javier
next prev parent reply other threads:[~2021-03-30 10:52 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-30 8:54 [PATCH 0/7] Input: cyttsp - First round of modernizations Linus Walleij
2021-03-30 8:54 ` [PATCH 1/7] Input: cyttsp - Probe from compatibles Linus Walleij
2021-03-30 10:51 ` Javier Martinez Canillas [this message]
2021-03-30 8:54 ` [PATCH 2/7] Input: cyttsp - Obtain regulators Linus Walleij
2021-03-30 10:54 ` Javier Martinez Canillas
2021-03-30 8:54 ` [PATCH 3/7] Input: cyttsp - Error message on boot mode exit error Linus Walleij
2021-03-30 10:56 ` Javier Martinez Canillas
2021-03-30 8:54 ` [PATCH 4/7] Input: cyttsp - Reduce reset pulse timings Linus Walleij
2021-03-30 10:57 ` Javier Martinez Canillas
2021-03-30 8:54 ` [PATCH 5/7] Input: cyttsp - Drop the phys path Linus Walleij
2021-03-30 11:00 ` Javier Martinez Canillas
2021-03-30 8:54 ` [PATCH 6/7] Input: cyttsp - Set abs params for ABS_MT_TOUCH_MAJOR Linus Walleij
2021-03-30 11:00 ` Javier Martinez Canillas
2021-03-30 8:54 ` [PATCH 7/7] Input: cyttsp - Flag the device properly Linus Walleij
2021-03-30 11:01 ` Javier Martinez Canillas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CABxcv=kspnfCM+pQfFhEJJXhp2FqRsJ8uxt5v3voqmQoV-G=tg@mail.gmail.com' \
--to=javier@dowhile0.org \
--cc=dmitry.torokhov@gmail.com \
--cc=fery@cypress.com \
--cc=linus.walleij@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=rydberg@bitmath.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).