Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752891AbbLGHJM (ORCPT ); Mon, 7 Dec 2015 02:09:12 -0500 Received: from mail1.bemta14.messagelabs.com ([193.109.254.111]:43122 "EHLO mail1.bemta14.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751943AbbLGHJK (ORCPT ); Mon, 7 Dec 2015 02:09:10 -0500 X-Env-Sender: Andreas.Werner@men.de X-Msg-Ref: server-7.tower-193.messagelabs.com!1449472146!8816149!1 X-Originating-IP: [80.255.6.145] X-StarScan-Received: X-StarScan-Version: 7.35; banners=-,-,- X-VirusChecked: Checked X-PGP-Universal: processed; by keys.men.de on Mon, 07 Dec 2015 08:09:07 +0100 Date: Mon, 7 Dec 2015 08:07:16 +0100 From: Andreas Werner To: CC: , Subject: [PATCH] spi/spi-fsl-espi.c: Add spi cs polarity support Message-ID: <20151207070657.GA25586@awelinux> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [192.1.1.170] X-ClientProxiedBy: MEN-EX01.intra.men.de (192.168.1.1) To MEN-EX01.intra.men.de (192.168.1.1) X-EXCLAIMER-MD-CONFIG: e4841e51-7998-49c0-ba41-8b8a0e2d8962 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1333 Lines: 38 Add CS polarity flag to be able to set the CS polarity via the DT property spi-cs-high. Signed-off-by: Andreas Werner --- 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) ®_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(®_base->mode); -- 2.6.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/