devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Suchanek <hramrach@gmail.com>
To: linux-sunxi@googlegroups.com, Rob Herring <robh+dt@kernel.org>,
	Pawel Moll <pawel.moll@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Kumar Gala <galak@codeaurora.org>,
	Maxime Ripard <maxime.ripard@free-electrons.com>,
	Chen-Yu Tsai <wens@csie.org>,
	Russell King <linux@armlinux.org.uk>,
	Mark Brown <broonie@kernel.org>,
	Michal Suchanek <hramrach@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>,
	Javier Martinez Canillas <javier@osg.samsung.com>,
	Simon Horman <horms+renesas@verge.net.au>,
	Sjoerd Simons <sjoerd.simons@collabora.co.uk>,
	Thierry Reding <treding@nvidia.com>,
	Alison Wang <b18965@freescale.com>,
	Timo Sigurdsson <public_timo.s@silentcreek.de>,
	Jonathan Liu <net147@gmail.com>,
	Gerhard Bertelsmann <info@gerhard-bertelsmann.de>,
	Priit Laes <plaes@p>
Subject: [PATCH v3 04/13] spi: sunxi: expose maximum transfer size limit
Date: 13 Jun 2016 17:46:50 -0000	[thread overview]
Message-ID: <6962eec8da0b5255cafd7782bcc39ca19041c2b1.1465490774.git.hramrach@gmail.com> (raw)
In-Reply-To: <cover.1465490774.git.hramrach@gmail.com>

The sun4i spi hardware can trasfer at most 63 bytes of data without DMA
support so report the limitation. Same for sun6i.

Signed-off-by: Michal Suchanek <hramrach@gmail.com>
---
 drivers/spi/spi-sun4i.c | 6 ++++++
 drivers/spi/spi-sun6i.c | 5 +++++
 2 files changed, 11 insertions(+)

diff --git a/drivers/spi/spi-sun4i.c b/drivers/spi/spi-sun4i.c
index f2848b7..ba2b5c8 100644
--- a/drivers/spi/spi-sun4i.c
+++ b/drivers/spi/spi-sun4i.c
@@ -167,6 +167,11 @@ static void sun4i_spi_set_cs(struct spi_device *spi, bool enable)
 	sun4i_spi_write(sspi, SUN4I_CTL_REG, reg);
 }
 
+static size_t sun4i_spi_max_transfer_size(struct spi_device *spi)
+{
+	return SUN4I_FIFO_DEPTH - 1;
+}
+
 static int sun4i_spi_transfer_one(struct spi_master *master,
 				  struct spi_device *spi,
 				  struct spi_transfer *tfr)
@@ -411,6 +416,7 @@ static int sun4i_spi_probe(struct platform_device *pdev)
 	master->bits_per_word_mask = SPI_BPW_MASK(8);
 	master->dev.of_node = pdev->dev.of_node;
 	master->auto_runtime_pm = true;
+	master->max_transfer_size = sun4i_spi_max_transfer_size;
 
 	sspi->hclk = devm_clk_get(&pdev->dev, "ahb");
 	if (IS_ERR(sspi->hclk)) {
diff --git a/drivers/spi/spi-sun6i.c b/drivers/spi/spi-sun6i.c
index 8f6be86..bc29a98 100644
--- a/drivers/spi/spi-sun6i.c
+++ b/drivers/spi/spi-sun6i.c
@@ -153,6 +153,10 @@ static void sun6i_spi_set_cs(struct spi_device *spi, bool enable)
 	sun6i_spi_write(sspi, SUN6I_TFR_CTL_REG, reg);
 }
 
+static size_t sun6i_spi_max_transfer_size(struct spi_device *spi)
+{
+	return SUN6I_FIFO_DEPTH - 1;
+}
 
 static int sun6i_spi_transfer_one(struct spi_master *master,
 				  struct spi_device *spi,
@@ -403,6 +407,7 @@ static int sun6i_spi_probe(struct platform_device *pdev)
 	master->bits_per_word_mask = SPI_BPW_MASK(8);
 	master->dev.of_node = pdev->dev.of_node;
 	master->auto_runtime_pm = true;
+	master->max_transfer_size = sun6i_spi_max_transfer_size;
 
 	sspi->hclk = devm_clk_get(&pdev->dev, "ahb");
 	if (IS_ERR(sspi->hclk)) {
-- 
2.8.1

  parent reply	other threads:[~2016-06-13 17:46 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-13 17:46 [PATCH v3 00/13] sunxi spi fixes Michal Suchanek
2016-06-13 17:46 ` [PATCH v3 01/13] spi: sunxi: set maximum and minimum speed of SPI master Michal Suchanek
     [not found]   ` <2db0ce0ea1ddc17e9bb790c8cc50bcb4bb97be58.1465490774.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-13 19:55     ` Maxime Ripard
2016-06-13 17:46 ` Michal Suchanek [this message]
     [not found]   ` <6962eec8da0b5255cafd7782bcc39ca19041c2b1.1465490774.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-13 19:56     ` [PATCH v3 04/13] spi: sunxi: expose maximum transfer size limit Maxime Ripard
     [not found] ` <cover.1465490774.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-13 17:46   ` [PATCH v3 03/13] spi: sun4i: fix FIFO limit Michal Suchanek
     [not found]     ` <6495575d7c7e14da06f86d88a6a15042b4c6b96a.1465490774.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-13 19:56       ` Maxime Ripard
2016-06-13 17:46   ` [PATCH v3 02/13] spi: sunxi: fix transfer timeout Michal Suchanek
2016-06-13 19:55     ` Maxime Ripard
2016-06-13 17:46   ` [PATCH v3 06/13] spi: sunxi: rename sun4i,sun6i -> sunxi Michal Suchanek
2016-06-13 17:46   ` [PATCH v3 05/13] spi: sun6i: update CS handling from spi-sun4i Michal Suchanek
2016-06-13 17:46   ` [PATCH v3 08/13] spi: sunxi: synchronize whitespace, comments, struct Michal Suchanek
2016-06-13 17:46   ` [PATCH v3 09/13] spi: sunxi: use register map Michal Suchanek
2016-06-13 17:46   ` [PATCH v3 07/13] spi: sunxi: rename constants to match between sun4i and sun6i Michal Suchanek
     [not found]     ` <c27d58f634daa4785e90c2716c8bb90399db3bf2.1465490774.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-13 23:31       ` Julian Calaby
     [not found]         ` <CAGRGNgWFKXd64-wYbG0dQez8hbzC1BPWFsBXBr7tCjVO_DBwGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14  4:43           ` Michal Suchanek
2016-06-13 17:46   ` [PATCH v3 11/13] dt: spi: sun4i: merge sun4i and sun6i binding doc Michal Suchanek
     [not found]     ` <cccbd6c3f0a194ec6eecd6627c4874da7b936f37.1465490774.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-13 23:45       ` Julian Calaby
     [not found]         ` <CAGRGNgWXG_d2ScrgehbSHguF-V0cXy-Vr1=zLE36v5rDu6pYtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14  4:40           ` Michal Suchanek
     [not found]             ` <CAOMqctTtpZ-kCJNUO7NZ855444LuAnsJewjK=nEOaoy0NOT3OQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14  4:48               ` Julian Calaby
2016-06-13 17:46   ` [PATCH v3 10/13] spi: sunxi: merge sun4i and sun6i SPI driver Michal Suchanek
     [not found]     ` <ad0ec30ef6b01f58e1b3b92da06e6cbd5c947354.1465490774.git.hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-06-13 23:43       ` Julian Calaby
     [not found]         ` <CAGRGNgVONS+i=57D52VeW8J6SvfmX=iG+3VpxNS8=kJOV+WSLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14  4:34           ` Michal Suchanek
     [not found]             ` <CAOMqctQD=o6YBk-QRiqbE9Cj+ZAH1nAM33rW6ZHefV8dU3aucQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14  4:47               ` Julian Calaby
     [not found]                 ` <CAGRGNgWPBh03zQrM=OMF24ezJvC-K0TMw2oqPhuNLj-nZ=mZQA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14  5:28                   ` Michal Suchanek
     [not found]                     ` <CAOMqctTjGTeaFC3MJe4MoMipdSf2ppOpikBSa8A-ht2v4j86bg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14  5:45                       ` [linux-sunxi] " Julian Calaby
     [not found]                         ` <CAGRGNgUYhwr5gCcp1bkN8R3Mx3LByFXH7j9i=ZXmvX5m7OBb4A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14  6:35                           ` Michal Suchanek
     [not found]                             ` <CAOMqctTff3S9dBa0JVnPwRyY6j2kVbB8SCTKham-MH8CX6JwJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14 11:20                               ` Julian Calaby
2016-06-13 17:46   ` [PATCH v3 13/13] spi: sun4i: add DMA support Michal
2016-06-13 17:46   ` [PATCH v3 12/13] spi: sunxi: remove CONFIG_SPI_SUN6I Michal Suchanek
2016-06-13 19:57 ` [PATCH v3 00/13] sunxi spi fixes Maxime Ripard
2016-06-14  4:50   ` Michal Suchanek
2016-06-17 10:34   ` Michal Suchanek
     [not found]     ` <CAOMqctS6ZQ3_a97sE2e7H34ZCny2aDE38V1tQA=-SBZwF2sbDQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-25  7:32       ` Maxime Ripard
2016-07-25  8:03         ` Michal Suchanek
     [not found]           ` <CAOMqctQybJoOfUHGtpmpB_koQ=iY+GpQ_BOL2o0QBbwC_HXC0g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-07-29 20:22             ` Maxime Ripard
2016-07-30 17:32               ` Michal Suchanek

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=6962eec8da0b5255cafd7782bcc39ca19041c2b1.1465490774.git.hramrach@gmail.com \
    --to=hramrach@gmail.com \
    --cc=arnd@arndb.de \
    --cc=b18965@freescale.com \
    --cc=broonie@kernel.org \
    --cc=galak@codeaurora.org \
    --cc=horms+renesas@verge.net.au \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=info@gerhard-bertelsmann.de \
    --cc=javier@osg.samsung.com \
    --cc=k.kozlowski@samsung.com \
    --cc=linux-sunxi@googlegroups.com \
    --cc=linux@armlinux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=maxime.ripard@free-electrons.com \
    --cc=net147@gmail.com \
    --cc=olof@lixom.net \
    --cc=pawel.moll@arm.com \
    --cc=plaes@p \
    --cc=public_timo.s@silentcreek.de \
    --cc=robh+dt@kernel.org \
    --cc=sjoerd.simons@collabora.co.uk \
    --cc=treding@nvidia.com \
    --cc=wens@csie.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).