linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Sourav Poddar <sourav.poddar@ti.com>
Cc: rnayak@ti.com, linux-kernel@vger.kernel.org, balbi@ti.com,
	linux-mtd@lists.infradead.org, tqnguyen@micron.com,
	grant.likely@linaro.org, spi-devel-general@lists.sourceforge.net,
	linux-omap@vger.kernel.org, dwmw2@infradead.org,
	manonuevo@micron.com
Subject: Re: [PATCH 2/3] drivers: spi: Add qspi flash controller
Date: Mon, 1 Jul 2013 11:56:05 +0100	[thread overview]
Message-ID: <20130701105605.GH27646@sirena.org.uk> (raw)
In-Reply-To: <1372232472-2641-3-git-send-email-sourav.poddar@ti.com>


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

On Wed, Jun 26, 2013 at 01:11:11PM +0530, Sourav Poddar wrote:

> +static int dra7xxx_qspi_prepare_xfer(struct spi_master *master)
> +{
> +	return 0;
> +}
> +
> +static int dra7xxx_qspi_unprepare_xfer(struct spi_master *master)
> +{
> +	return 0;
> +}

Remove empty functions, though...

> +	if (flags & XFER_END)
> +		dra7xxx_writel(qspi, qspi->cmd | QSPI_INVAL, QSPI_SPI_CMD_REG);
> +
> +	pm_runtime_mark_last_busy(qspi->dev);
> +	pm_runtime_put_autosuspend(qspi->dev);

...there's no point in doing this per-message, it should be in the
prepare and unprepare functions.

> +	master = spi_alloc_master(&pdev->dev, sizeof(*qspi));
> +	if (!master)
> +		return -ENOMEM;
> +
> +	master->mode_bits = SPI_CPOL | SPI_CPHA;
> +
> +	master->num_chipselect = 1;
> +	master->bus_num = -1;
> +	master->setup = dra7xxx_qspi_setup;
> +	master->prepare_transfer_hardware = dra7xxx_qspi_prepare_xfer;
> +	master->transfer_one_message = dra7xxx_qspi_start_transfer_one;
> +	master->unprepare_transfer_hardware = dra7xxx_qspi_unprepare_xfer;
> +	master->dev.of_node = pdev->dev.of_node;

There should be some bits per word restrictions in here I think - it
looks like only 8 bits per word is supported.

> +	qspi->base = devm_request_and_ioremap(&pdev->dev, r);
> +	if (!qspi->base) {
> +		dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");
> +		ret = -ENOMEM;
> +		goto free_master;
> +	}

Use devm_ioremap_resource().

> +	if (!of_property_read_u32(np, "spi-max-frequency", &max_freq))
> +		qspi->spi_max_frequency = max_freq;

You have OF bindings, there should be a binding document and an OF ID
table.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 144 bytes --]

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2013-07-01 10:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-26  7:41 [PATCH 0/3] spi/mtd generic framework, ti qspi controller and spansion driver Sourav Poddar
2013-06-26  7:41 ` [PATCH 1/3] drivers: mtd: spinand: Add generic spinand frameowrk and micron driver Sourav Poddar
2013-06-26 14:15   ` Florian Fainelli
     [not found]   ` <1372232472-2641-2-git-send-email-sourav.poddar-l0cyMroinI0@public.gmane.org>
2013-06-26 15:22     ` Kamlakant Patel
     [not found]       ` <20130626152243.GA9414-+J/lxNz7zLijYOuY2elzOeoJsYJ2OyzEAL8bYrjMMd8@public.gmane.org>
2013-06-27  4:51         ` Sourav Poddar
2013-07-01  5:17   ` Sourav Poddar
     [not found] ` <1372232472-2641-1-git-send-email-sourav.poddar-l0cyMroinI0@public.gmane.org>
2013-06-26  7:41   ` [PATCH 2/3] drivers: spi: Add qspi flash controller Sourav Poddar
2013-07-01  5:19     ` Sourav Poddar
2013-07-01 10:56     ` Mark Brown [this message]
     [not found]       ` <20130701105605.GH27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-01 11:15         ` Sourav Poddar
2013-06-26  7:41   ` [PATCH 3/3] drivers: mtd: spinand: Add qspi spansion " Sourav Poddar
2013-07-01  5:18     ` Sourav Poddar
2013-07-01  5:17 ` [PATCH 0/3] spi/mtd generic framework,ti qspi controller and spansion driver Sourav Poddar

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=20130701105605.GH27646@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=balbi@ti.com \
    --cc=dwmw2@infradead.org \
    --cc=grant.likely@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=manonuevo@micron.com \
    --cc=rnayak@ti.com \
    --cc=sourav.poddar@ti.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=tqnguyen@micron.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).