From: Sourav Poddar <sourav.poddar@ti.com>
To: Mark Brown <broonie@kernel.org>
Cc: <linux-mtd@lists.infradead.org>,
<spi-devel-general@lists.sourceforge.net>, <dwmw2@infradead.org>,
<manonuevo@micron.com>, <tqnguyen@micron.com>,
<grant.likely@linaro.org>, <balbi@ti.com>, <rnayak@ti.com>,
<linux-kernel@vger.kernel.org>, <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 2/3] drivers: spi: Add qspi flash controller
Date: Mon, 1 Jul 2013 16:45:36 +0530 [thread overview]
Message-ID: <51D164D8.1050707@ti.com> (raw)
In-Reply-To: <20130701105605.GH27646@sirena.org.uk>
Hi Mark,
Thanks for the review.
Comments in lined.
On Monday 01 July 2013 04:26 PM, Mark Brown wrote:
> 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.
>
Ok, will do runtime PM part in prepare/unprepare in my next version.
>> + 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.
>
Yes, currently its only 8 bits per word support.
Yes, bits_per_word_mask can be filled to support upto 32 bits word
transition. Will add in v2.
>> + 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().
>
Ok. Will replace.
>> + 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.
Yes, will add binding documentation in my next version.
Though, I have a "of_device_id" [1] populated in my patch.
May be, I need to re-arrange it above probe function. ?
[1]:
+
+static const struct of_device_id dra7xxx_qspi_match[] = {
+ {.compatible = "ti,dra7xxx-qspi" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, dra7xxx_qspi_match);
+
Thanks,
Sourav
next prev parent reply other threads:[~2013-07-01 11:16 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
2013-06-26 15:22 ` Kamlakant Patel
2013-06-27 4:51 ` Sourav Poddar
2013-07-01 5:17 ` Sourav Poddar
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
2013-07-01 11:15 ` Sourav Poddar [this message]
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=51D164D8.1050707@ti.com \
--to=sourav.poddar@ti.com \
--cc=balbi@ti.com \
--cc=broonie@kernel.org \
--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=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