lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 21 Oct 2020 09:29:35 +0000
From:   "Ardelean, Alexandru" <alexandru.Ardelean@...log.com>
To:     Oleksij Rempel <o.rempel@...gutronix.de>,
        Dmitry Torokhov <dmitry.torokhov@...il.com>
CC:     "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-input@...r.kernel.org" <linux-input@...r.kernel.org>,
        David Jander <david@...tonic.nl>
Subject: RE: [PATCH v1] Input: ads7846: do not overwrite spi->mode flags set
 by spi framework



> -----Original Message-----
> From: Oleksij Rempel <o.rempel@...gutronix.de>
> Sent: Wednesday, October 21, 2020 12:05 PM
> To: Dmitry Torokhov <dmitry.torokhov@...il.com>; Ardelean, Alexandru
> <alexandru.Ardelean@...log.com>
> Cc: Oleksij Rempel <o.rempel@...gutronix.de>; kernel@...gutronix.de; linux-
> kernel@...r.kernel.org; linux-input@...r.kernel.org; David Jander
> <david@...tonic.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@...gutronix.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ