linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ardelean, Alexandru" <alexandru.Ardelean@analog.com>
To: Oleksij Rempel <o.rempel@pengutronix.de>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: "kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	David Jander <david@protonic.nl>
Subject: RE: [PATCH v1] Input: ads7846: do not overwrite spi->mode flags set by spi framework
Date: Wed, 21 Oct 2020 09:29:35 +0000	[thread overview]
Message-ID: <DM6PR03MB44110236C07B05C243009E4CF91C0@DM6PR03MB4411.namprd03.prod.outlook.com> (raw)
In-Reply-To: <20201021090434.16387-1-o.rempel@pengutronix.de>



> -----Original Message-----
> From: Oleksij Rempel <o.rempel@pengutronix.de>
> Sent: Wednesday, October 21, 2020 12:05 PM
> To: Dmitry Torokhov <dmitry.torokhov@gmail.com>; Ardelean, Alexandru
> <alexandru.Ardelean@analog.com>
> Cc: Oleksij Rempel <o.rempel@pengutronix.de>; kernel@pengutronix.de; linux-
> kernel@vger.kernel.org; linux-input@vger.kernel.org; David Jander
> <david@protonic.nl>
> Subject: [PATCH v1] Input: ads7846: do not overwrite spi->mode flags set by spi
> framework
> 
> [External]
> 
> Do not overwrite spi->mode flags set by spi framework, otherwise the chip
> select polarity will get lost.
> 
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
>  drivers/input/touchscreen/ads7846.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/touchscreen/ads7846.c
> b/drivers/input/touchscreen/ads7846.c
> index 8fd7fc39c4fd..ea31956f3a90 100644
> --- a/drivers/input/touchscreen/ads7846.c
> +++ b/drivers/input/touchscreen/ads7846.c
> @@ -1288,7 +1288,7 @@ static int ads7846_probe(struct spi_device *spi)
>  	 * may not.  So we stick to very-portable 8 bit words, both RX and TX.
>  	 */
>  	spi->bits_per_word = 8;
> -	spi->mode = SPI_MODE_0;

I think the patch is incorrect.
The initial version is correct; assuming that the datasheet says that this driver operates in mode 0.
If the initial mode is incorrect, maybe we need to change that.

What is unfortunate, is that you cannot [yet] override the mode parameters [polarity & phase] from the device-tree, in case there are some things in-between the SPI controller & SPI chip [level inverters for example].
I was planning to do something for this.

> +	spi->mode |= SPI_MODE_0;
>  	err = spi_setup(spi);
>  	if (err < 0)
>  		return err;
> --
> 2.28.0


  reply	other threads:[~2020-10-21 10:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21  9:04 [PATCH v1] Input: ads7846: do not overwrite spi->mode flags set by spi framework Oleksij Rempel
2020-10-21  9:29 ` Ardelean, Alexandru [this message]
2020-10-21 10:56   ` Oleksij Rempel
2020-10-21 18:27     ` Dmitry Torokhov
2020-10-22  6:54       ` Oleksij Rempel
2020-10-27  3:53         ` Dmitry Torokhov
2020-10-27  8:07           ` Oleksij Rempel

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=DM6PR03MB44110236C07B05C243009E4CF91C0@DM6PR03MB4411.namprd03.prod.outlook.com \
    --to=alexandru.ardelean@analog.com \
    --cc=david@protonic.nl \
    --cc=dmitry.torokhov@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    /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).