linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alban Bedel <albeu@free.fr>
To: linux-kernel@vger.kernel.org
Cc: Alban Bedel <albeu@free.fr>, Mark Brown <broonie@kernel.org>,
	linux-spi@vger.kernel.org
Subject: [PATCH 1/6] spi: bitbang: Don't call chipselect() in spi_bitbang_setup()
Date: Wed, 16 Jan 2019 19:55:44 +0100	[thread overview]
Message-ID: <20190116185549.23295-1-albeu@free.fr> (raw)

spi_setup() already call spi_set_cs() right after calling the
controller setup method, so there is no need for the bitbang driver to
do that. Because of this the chipselect() callback was confusingly
still called when CS is GPIO based.

Signed-off-by: Alban Bedel <albeu@free.fr>
---
 drivers/spi/spi-bitbang.c | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/drivers/spi/spi-bitbang.c b/drivers/spi/spi-bitbang.c
index f29176000b8d..dd9a8c54a693 100644
--- a/drivers/spi/spi-bitbang.c
+++ b/drivers/spi/spi-bitbang.c
@@ -213,19 +213,6 @@ int spi_bitbang_setup(struct spi_device *spi)
 
 	dev_dbg(&spi->dev, "%s, %u nsec/bit\n", __func__, 2 * cs->nsecs);
 
-	/* NOTE we _need_ to call chipselect() early, ideally with adapter
-	 * setup, unless the hardware defaults cooperate to avoid confusion
-	 * between normal (active low) and inverted chipselects.
-	 */
-
-	/* deselect chip (low or high) */
-	mutex_lock(&bitbang->lock);
-	if (!bitbang->busy) {
-		bitbang->chipselect(spi, BITBANG_CS_INACTIVE);
-		ndelay(cs->nsecs);
-	}
-	mutex_unlock(&bitbang->lock);
-
 	return 0;
 }
 EXPORT_SYMBOL_GPL(spi_bitbang_setup);
-- 
2.19.1

             reply	other threads:[~2019-01-16 18:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16 18:55 Alban Bedel [this message]
2019-01-16 18:55 ` [PATCH 2/6] spi: ath79: Simplify ath79_spi_chipselect() Alban Bedel
2019-01-17 12:40   ` Applied "spi: ath79: Simplify ath79_spi_chipselect()" to the spi tree Mark Brown
2019-01-16 18:55 ` [PATCH 3/6] spi: ath79: Enable support for compile test Alban Bedel
2019-01-17 12:40   ` Applied "spi: ath79: Enable support for compile test" to the spi tree Mark Brown
2019-01-16 18:55 ` [PATCH 4/6] spi: ath79: Remove now useless code Alban Bedel
2019-01-17 12:40   ` Applied "spi: ath79: Remove now useless code" to the spi tree Mark Brown
2019-01-16 18:55 ` [PATCH 5/6] spi: ath79: Remove some useless includes Alban Bedel
2019-01-16 20:06   ` Joe Perches
2019-01-17 12:40 ` Applied "spi: bitbang: Don't call chipselect() in spi_bitbang_setup()" to the spi tree Mark Brown

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=20190116185549.23295-1-albeu@free.fr \
    --to=albeu@free.fr \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    /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).