linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Girish Mahadevan <girishm@codeaurora.org>
Cc: broonie@kernel.org, linux-spi@vger.kernel.org,
	linux-kernel@vger.kernel.org, dianders@chromium.org,
	swboyd@chromium.org, linux-arm-msm@vger.kernel.org,
	sdharia@codeaurora.org, kramasub@codeaurora.org
Subject: Re: [PATCH 2/2] spi: Introduce new driver for Qualcomm QuadSPI controller
Date: Tue, 10 Jul 2018 23:19:45 +0200	[thread overview]
Message-ID: <20180710231945.4672a18c@bbrezillon> (raw)
In-Reply-To: <1530827202-9997-2-git-send-email-girishm@codeaurora.org>

Hi Girish,

On Thu,  5 Jul 2018 15:46:42 -0600
Girish Mahadevan <girishm@codeaurora.org> wrote:

> +
> +static int process_data(const struct spi_mem_op *op, struct qcom_qspi *ctrl)
> +{
> +	int ret;
> +
> +	ctrl->xfer.dir = (op->data.dir == SPI_MEM_DATA_IN) ?
> +					QSPI_READ : QSPI_WRITE;
> +	ctrl->xfer.mode = op->data.buswidth;
> +	ctrl->xfer.is_last = true;
> +	ctrl->xfer.rem_bytes = op->data.nbytes;
> +
> +	if (ctrl->xfer.dir == QSPI_WRITE)
> +		ctrl->xfer.tx_buf = op->data.buf.out;
> +	else
> +		ctrl->xfer.rx_buf = op->data.buf.in;
> +	ret = qcom_qspi_pio_xfer(ctrl);
> +	if (ret)
> +		return ret;

Looks like you are converting the spi_mem_op into several regular SPI
transfers. Any good reasons for not relying on the core logic to do
that? In this case, all you'd have to do is implement ->transfer_one()
and be done with it. 

> +	ret = wait_for_xfer(ctrl);
> +	return ret;
> +}
 
Regards,

Boris

  parent reply	other threads:[~2018-07-10 21:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-05 21:46 [PATCH 1/2] dt-bindings: spi: Qualcomm Quad SPI(QSPI) documentation Girish Mahadevan
2018-07-05 21:46 ` [PATCH 2/2] spi: Introduce new driver for Qualcomm QuadSPI controller Girish Mahadevan
2018-07-10 18:10   ` Mark Brown
2018-07-10 21:19   ` Boris Brezillon [this message]
2018-07-12 20:16   ` Doug Anderson
2018-07-16 23:50   ` Doug Anderson
2018-07-10 15:03 ` [PATCH 1/2] dt-bindings: spi: Qualcomm Quad SPI(QSPI) documentation Stephen Boyd
2018-07-16 22:27 ` Rob Herring
2018-07-17 22:19 ` Doug Anderson

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=20180710231945.4672a18c@bbrezillon \
    --to=boris.brezillon@bootlin.com \
    --cc=broonie@kernel.org \
    --cc=dianders@chromium.org \
    --cc=girishm@codeaurora.org \
    --cc=kramasub@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=sdharia@codeaurora.org \
    --cc=swboyd@chromium.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).