LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Sowjanya Komatineni <skomatineni@nvidia.com>
Cc: broonie@kernel.org, jonathanh@nvidia.com, ldewangan@nvidia.com,
	linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
	linux-tegra@vger.kernel.org, Mark Brown <broonie@kernel.org>,
	thierry.reding@gmail.com
Subject: Applied "spi: tegra114: add support for gpio based CS" to the spi tree
Date: Wed, 15 May 2019 12:18:24 +0100 (BST)	[thread overview]
Message-ID: <20190515111824.4C5A51126D70@debutante.sirena.org.uk> (raw)
In-Reply-To: <1557810235-16401-2-git-send-email-skomatineni@nvidia.com>

The patch

   spi: tegra114: add support for gpio based CS

has been applied to the spi tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-5.3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From 63c1440596ff0a34efec491f41832c2c9ea01857 Mon Sep 17 00:00:00 2001
From: Sowjanya Komatineni <skomatineni@nvidia.com>
Date: Mon, 13 May 2019 22:03:52 -0700
Subject: [PATCH] spi: tegra114: add support for gpio based CS

This patch adds support for GPIO based CS control through SPI core
function spi_set_cs.

Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/spi/spi-tegra114.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/drivers/spi/spi-tegra114.c b/drivers/spi/spi-tegra114.c
index b1f31bb16659..f47417dd9edb 100644
--- a/drivers/spi/spi-tegra114.c
+++ b/drivers/spi/spi-tegra114.c
@@ -776,6 +776,10 @@ static u32 tegra_spi_setup_transfer_one(struct spi_device *spi,
 		} else
 			tegra_spi_writel(tspi, command1, SPI_COMMAND1);
 
+		/* GPIO based chip select control */
+		if (spi->cs_gpiod)
+			gpiod_set_value(spi->cs_gpiod, 1);
+
 		command1 |= SPI_CS_SW_HW;
 		if (spi->mode & SPI_CS_HIGH)
 			command1 |= SPI_CS_SW_VAL;
@@ -864,6 +868,10 @@ static int tegra_spi_setup(struct spi_device *spi)
 	}
 
 	spin_lock_irqsave(&tspi->lock, flags);
+	/* GPIO based chip select control */
+	if (spi->cs_gpiod)
+		gpiod_set_value(spi->cs_gpiod, 0);
+
 	val = tspi->def_command1_reg;
 	if (spi->mode & SPI_CS_HIGH)
 		val &= ~SPI_CS_POL_INACTIVE(spi->chip_select);
@@ -893,6 +901,10 @@ static void tegra_spi_transfer_end(struct spi_device *spi)
 	struct tegra_spi_data *tspi = spi_master_get_devdata(spi->master);
 	int cs_val = (spi->mode & SPI_CS_HIGH) ? 0 : 1;
 
+	/* GPIO based chip select control */
+	if (spi->cs_gpiod)
+		gpiod_set_value(spi->cs_gpiod, 0);
+
 	if (cs_val)
 		tspi->command1_reg |= SPI_CS_SW_VAL;
 	else
@@ -1199,6 +1211,7 @@ static int tegra_spi_probe(struct platform_device *pdev)
 		master->max_speed_hz = 25000000; /* 25MHz */
 
 	/* the spi->mode bits understood by this driver: */
+	master->use_gpio_descriptors = true;
 	master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH | SPI_LSB_FIRST |
 			    SPI_TX_DUAL | SPI_RX_DUAL | SPI_3WIRE;
 	master->bits_per_word_mask = SPI_BPW_RANGE_MASK(4, 32);
-- 
2.20.1


  parent reply	other threads:[~2019-05-15 11:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14  5:03 [PATCH V5 0/4] additional features to Tegra SPI Sowjanya Komatineni
2019-05-14  5:03 ` [PATCH V5 1/4] spi: tegra114: add support for gpio based CS Sowjanya Komatineni
2019-05-14  9:33   ` Jon Hunter
2019-05-14 17:18     ` Sowjanya Komatineni
2019-05-14 17:31       ` Jon Hunter
2019-05-15  9:35       ` Mark Brown
2019-05-15 11:24         ` Sowjanya Komatineni
2019-05-15 11:29           ` Mark Brown
     [not found]             ` <BYAPR12MB3398528B86D3DE9CC3AA6D85C2090@BYAPR12MB3398.namprd12.prod.outlook.com>
2019-05-15 11:42               ` Mark Brown
2019-05-15 11:18   ` Mark Brown [this message]
2019-05-14  5:03 ` [PATCH V5 2/4] spi: tegra114: add support for hw based cs Sowjanya Komatineni
2019-05-15 11:18   ` Applied "spi: tegra114: add support for hw based cs" to the spi tree Mark Brown
2019-05-14  5:03 ` [PATCH V5 3/4] spi: tegra114: add support for HW CS timing Sowjanya Komatineni
2019-05-15 11:18   ` Applied "spi: tegra114: add support for HW CS timing" to the spi tree Mark Brown
2019-05-14  5:03 ` [PATCH V5 4/4] spi: tegra114: add support for TX and RX trimmers Sowjanya Komatineni
2019-05-15 11:18   ` Applied "spi: tegra114: add support for TX and RX trimmers" to the spi tree Mark Brown
2019-05-23  1:02   ` [PATCH V5 4/4] spi: tegra114: add support for TX and RX trimmers Nathan Chancellor
2019-05-23  1:10     ` Sowjanya Komatineni

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=20190515111824.4C5A51126D70@debutante.sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=skomatineni@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --subject='Re: Applied "spi: tegra114: add support for gpio based CS" to the spi tree' \
    /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

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).