From: Addy Ke <addy.ke@rock-chips.com>
To: broonie@kernel.org, heiko@sntech.de, dianders@chromium.org,
grant.likely@linaro.org, robh+dt@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org,
olof@lixom.net, hj@rock-chips.com, kever.yang@rock-chips.com,
xjq@rock-chips.com, huangtao@rock-chips.com, zyw@rock-chips.com,
yzq@rock-chips.com, zhenfu.fang@rock-chips.com,
cf@rock-chips.com, zhangqing@rock-chips.com, hl@rock-chips.com,
wei.luo@rock-chips.com, Addy Ke <addy.ke@rock-chips.com>
Subject: [PATCH] spi: rockchip: return 0 if tx_buf and rx_buf are NULL
Date: Thu, 14 Aug 2014 08:52:24 +0800 [thread overview]
Message-ID: <1407977544-2989-1-git-send-email-addy.ke@rock-chips.com> (raw)
To do so, spi communication can use an empty buf to pull up CS.
This patch merged from ChromiumOS tree.
Cros_ec use this function to turn off CS and add a delay to ensure
the rising edge doesn't come too soon after the end of the data.
Tested-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Addy Ke <addy.ke@rock-chips.com>
---
drivers/spi/spi-rockchip.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c
index 72fb287..1e3bcfa 100644
--- a/drivers/spi/spi-rockchip.c
+++ b/drivers/spi/spi-rockchip.c
@@ -511,8 +511,8 @@ static int rockchip_spi_transfer_one(struct spi_master *master,
WARN_ON((readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY));
if (!xfer->tx_buf && !xfer->rx_buf) {
- dev_err(rs->dev, "No buffer for transfer\n");
- return -EINVAL;
+ dev_dbg(rs->dev, "No buffer for transfer\n");
+ return 0;
}
rs->speed = xfer->speed_hz;
--
1.8.3.2
next reply other threads:[~2014-08-14 0:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-14 0:52 Addy Ke [this message]
[not found] ` <1407977544-2989-1-git-send-email-addy.ke-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2014-08-14 20:09 ` [PATCH] spi: rockchip: return 0 if tx_buf and rx_buf are NULL Dmitry Torokhov
2014-08-14 21:02 ` 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=1407977544-2989-1-git-send-email-addy.ke@rock-chips.com \
--to=addy.ke@rock-chips.com \
--cc=broonie@kernel.org \
--cc=cf@rock-chips.com \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=grant.likely@linaro.org \
--cc=heiko@sntech.de \
--cc=hj@rock-chips.com \
--cc=hl@rock-chips.com \
--cc=huangtao@rock-chips.com \
--cc=kever.yang@rock-chips.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=olof@lixom.net \
--cc=robh+dt@kernel.org \
--cc=wei.luo@rock-chips.com \
--cc=xjq@rock-chips.com \
--cc=yzq@rock-chips.com \
--cc=zhangqing@rock-chips.com \
--cc=zhenfu.fang@rock-chips.com \
--cc=zyw@rock-chips.com \
/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).