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-next>] [day] [month] [year] [list]
Message-ID: <20151207070657.GA25586@awelinux>
Date:	Mon, 7 Dec 2015 08:07:16 +0100
From:	Andreas Werner <andreas.werner@....de>
To:	<linux-kernel@...r.kernel.org>
CC:	<linux-spi@...r.kernel.org>, <broonie@...nel.org>
Subject: [PATCH] spi/spi-fsl-espi.c: Add spi cs polarity support

Add CS polarity flag to be able to set the CS polarity
via the DT property spi-cs-high.

Signed-off-by: Andreas Werner <andreas.werner@....de>
---
 drivers/spi/spi-fsl-espi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c
index c27124a..2dc70953 100644
--- a/drivers/spi/spi-fsl-espi.c
+++ b/drivers/spi/spi-fsl-espi.c
@@ -495,7 +495,7 @@ static int fsl_espi_setup(struct spi_device *spi)
 			&reg_base->csmode[spi->chip_select]);
 	/* mask out bits we are going to set */
 	cs->hw_mode &= ~(CSMODE_CP_BEGIN_EDGECLK | CSMODE_CI_INACTIVEHIGH
-			 | CSMODE_REV);
+			 | CSMODE_REV | CSMODE_POL_1);
 
 	if (spi->mode & SPI_CPHA)
 		cs->hw_mode |= CSMODE_CP_BEGIN_EDGECLK;
@@ -503,6 +503,8 @@ static int fsl_espi_setup(struct spi_device *spi)
 		cs->hw_mode |= CSMODE_CI_INACTIVEHIGH;
 	if (!(spi->mode & SPI_LSB_FIRST))
 		cs->hw_mode |= CSMODE_REV;
+	if (!(spi->mode & SPI_CS_HIGH))
+		cs->hw_mode |= CSMODE_POL_1;
 
 	/* Handle the loop mode */
 	loop_mode = mpc8xxx_spi_read_reg(&reg_base->mode);
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ