From: Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
To: Grant Likely
<grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
Mark Brown
<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
Laxman Dewangan
<ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: [PATCH 1/4] spi: tegra slink: remove redundant code
Date: Fri, 15 Feb 2013 15:03:47 -0700 [thread overview]
Message-ID: <1360965830-19795-1-git-send-email-swarren@wwwdotorg.org> (raw)
From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
There is no code to set spi->controller_data, and hence the HW CS logic
can never trigger. Remove the unused code.
Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/spi/spi-tegra20-slink.c | 32 +-------------------------------
1 file changed, 1 insertion(+), 31 deletions(-)
diff --git a/drivers/spi/spi-tegra20-slink.c b/drivers/spi/spi-tegra20-slink.c
index b8698b3..00f1b06 100644
--- a/drivers/spi/spi-tegra20-slink.c
+++ b/drivers/spi/spi-tegra20-slink.c
@@ -189,7 +189,6 @@ struct tegra_slink_data {
unsigned dma_buf_size;
unsigned max_buf_size;
bool is_curr_dma_xfer;
- bool is_hw_based_cs;
struct completion rx_dma_complete;
struct completion tx_dma_complete;
@@ -720,7 +719,6 @@ static int tegra_slink_start_transfer_one(struct spi_device *spi,
u8 bits_per_word;
unsigned total_fifo_words;
int ret;
- struct tegra_spi_device_controller_data *cdata = spi->controller_data;
unsigned long command;
unsigned long command2;
@@ -743,39 +741,11 @@ static int tegra_slink_start_transfer_one(struct spi_device *spi,
command = tspi->def_command_reg;
command |= SLINK_BIT_LENGTH(bits_per_word - 1);
+ command |= SLINK_CS_SW | SLINK_CS_VALUE;
command2 = tspi->def_command2_reg;
command2 |= SLINK_SS_EN_CS(spi->chip_select);
- /* possibly use the hw based chip select */
- tspi->is_hw_based_cs = false;
- if (cdata && cdata->is_hw_based_cs && is_single_xfer &&
- ((tspi->curr_dma_words * tspi->bytes_per_word) ==
- (t->len - tspi->cur_pos))) {
- int setup_count;
- int sts2;
-
- setup_count = cdata->cs_setup_clk_count >> 1;
- setup_count = max(setup_count, 3);
- command2 |= SLINK_SS_SETUP(setup_count);
- if (tspi->chip_data->cs_hold_time) {
- int hold_count;
-
- hold_count = cdata->cs_hold_clk_count;
- hold_count = max(hold_count, 0xF);
- sts2 = tegra_slink_readl(tspi, SLINK_STATUS2);
- sts2 &= ~SLINK_SS_HOLD_TIME(0xF);
- sts2 |= SLINK_SS_HOLD_TIME(hold_count);
- tegra_slink_writel(tspi, sts2, SLINK_STATUS2);
- }
- tspi->is_hw_based_cs = true;
- }
-
- if (tspi->is_hw_based_cs)
- command &= ~SLINK_CS_SW;
- else
- command |= SLINK_CS_SW | SLINK_CS_VALUE;
-
command &= ~SLINK_MODES;
if (spi->mode & SPI_CPHA)
command |= SLINK_CK_SDA;
--
1.7.10.4
next reply other threads:[~2013-02-15 22:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-15 22:03 Stephen Warren [this message]
[not found] ` <1360965830-19795-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-15 22:03 ` [PATCH 2/4] spi: tegra sflash: assume CONFIG_OF, remove platform data Stephen Warren
2013-02-15 22:03 ` [PATCH 3/4] spi: tegra slink: " Stephen Warren
2013-02-15 22:03 ` [PATCH 4/4] spi: remove unused Tegra platform data header Stephen Warren
[not found] ` <1360965830-19795-4-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-03-02 23:02 ` Grant Likely
2013-03-08 17:10 ` Rhyland Klein
[not found] ` <513A1B82.6060101-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2013-03-09 9:21 ` Grant Likely
[not found] ` <CACxGe6uFCLzm2LCtchRxv9uQTNcyxjHQMXEdCTBwOkf5suV2Cw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-04-03 18:43 ` Stephen Warren
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=1360965830-19795-1-git-send-email-swarren@wwwdotorg.org \
--to=swarren-3lzwwm7+weoh9zmkesr00q@public.gmane.org \
--cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
--cc=grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
--cc=ldewangan-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.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).