linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Cc: thierry.reding@gmail.com, jonathanh@nvidia.com,
	linux-spi@vger.kernel.org, linux-tegra@vger.kernel.org,
	skomatineni@nvidia.com, ldewangan@nvidia.com, robh+dt@kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	p.zabel@pengutronix.de
Subject: Re: [PATCH 6/6] spi: tegra210-quad: combined sequence mode
Date: Fri, 4 Feb 2022 14:09:21 +0000	[thread overview]
Message-ID: <Yf0zkdS2nqHOZjMG@sirena.org.uk> (raw)
In-Reply-To: <1643970576-31503-7-git-send-email-kyarlagadda@nvidia.com>

[-- Attachment #1: Type: text/plain, Size: 1587 bytes --]

On Fri, Feb 04, 2022 at 03:59:36PM +0530, Krishna Yarlagadda wrote:

> +	/* Process individual transfer list */
> +	list_for_each_entry(xfer, &msg->transfers, transfer_list) {
> +		if (transfer_phase == CMD_TRANSFER) {

> +		} else if (transfer_phase == ADDR_TRANSFER) {

> +		} else {

Looks like you're writing a switch statement here...

> +			/* X1 SDR mode */
> +			cmd_config = tegra_qspi_cmd_config(false, 0,
> +							   xfer->len);
> +			cmd_value = *((const u8 *)(xfer->tx_buf));
> +
> +			len = xfer->len;

> +			/* X1 SDR mode */
> +			addr_config = tegra_qspi_addr_config(false, 0,
> +							     xfer->len);
> +			address_value = *((const u32 *)(xfer->tx_buf));

> +			/* Program Command, Address value in register */
> +			tegra_qspi_writel(tqspi, cmd_value, QSPI_CMB_SEQ_CMD);
> +			tegra_qspi_writel(tqspi, address_value,
> +					  QSPI_CMB_SEQ_ADDR);
> +			/* Program Command and Address config in register */
> +			tegra_qspi_writel(tqspi, cmd_config,
> +					  QSPI_CMB_SEQ_CMD_CFG);
> +			tegra_qspi_writel(tqspi, addr_config,
> +					  QSPI_CMB_SEQ_ADDR_CFG);

It looks like the command and address have to be specific lengths?  If
that's the case then

> +	if (cdata->is_cmb_xfer && transfer_count == 3)
> +		ret = tegra_qspi_combined_seq_xfer(tqspi, msg);
> +	else
> +		ret = tegra_qspi_non_combined_seq_xfer(tqspi, msg);

This check needs to be more specific.  But like I said in reply to the
binding patch I don't see why we can't just pattern match on the data
without requiring a property here, we'd need to check that the message
is suitable no matter what.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-02-04 14:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-04 10:29 [PATCH 0/6] Tegra QUAD SPI combined sequence mode Krishna Yarlagadda
2022-02-04 10:29 ` [PATCH 1/6] spi: tegra210-quad: use device_reset method Krishna Yarlagadda
2022-02-04 10:29 ` [PATCH 2/6] dt-bindings: spi: Tegra234 QUAD SPI compatible Krishna Yarlagadda
2022-02-11 14:48   ` Rob Herring
2022-02-14 16:18   ` [PATCH 2/6] " Mark Brown
2022-02-04 10:29 ` [PATCH 3/6] spi: tegra210-quad: add new chips to compatible Krishna Yarlagadda
2022-02-04 10:29 ` [PATCH 4/6] spi: tegra210-quad: add acpi support Krishna Yarlagadda
2022-02-04 10:29 ` [PATCH 5/6] dt-bindings: spi: Tegra QUAD SPI combined sequence Krishna Yarlagadda
2022-02-04 13:47   ` Mark Brown
2022-02-04 10:29 ` [PATCH 6/6] spi: tegra210-quad: combined sequence mode Krishna Yarlagadda
2022-02-04 14:09   ` Mark Brown [this message]
2022-02-07 14:54     ` Krishna Yarlagadda
2022-02-07 15:05       ` Mark Brown
2022-02-07 15:40         ` Krishna Yarlagadda
2022-02-24 22:59 ` (subset) [PATCH 0/6] Tegra QUAD SPI " 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=Yf0zkdS2nqHOZjMG@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=kyarlagadda@nvidia.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=skomatineni@nvidia.com \
    --cc=thierry.reding@gmail.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).