From: Sourav Poddar <sourav.poddar-l0cyMroinI0@public.gmane.org>
To: Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>
Cc: rnayak-l0cyMroinI0@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
balbi-l0cyMroinI0@public.gmane.org,
broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCHv2] drivers: spi: Add qspi flash controller
Date: Tue, 2 Jul 2013 16:29:47 +0530 [thread overview]
Message-ID: <51D2B2A3.3080402@ti.com> (raw)
In-Reply-To: <51D2B220.1010501-l0cyMroinI0@public.gmane.org>
Hi Sekhar,
On Tuesday 02 July 2013 04:27 PM, Sekhar Nori wrote:
> On 7/2/2013 2:26 PM, Sourav Poddar wrote:
>> The patch add basic support for the quad spi controller.
>>
>> QSPI is a kind of spi module that allows single,
>> dual and quad read access to external spi devices. The module
>> has a memory mapped interface which provide direct interface
>> for accessing data form external spi devices.
>>
>> The patch will configure controller clocks, device control
>> register and for defining low level transfer apis which
>> will be used by the spi framework to transfer data to
>> the slave spi device(flash in this case).
>>
>> Signed-off-by: Sourav Poddar<sourav.poddar-l0cyMroinI0@public.gmane.org>
>> ---
>> This patch was sent as a part of a series[1];
>> but this can go in as a standalone patch.
>> [1]: https://lkml.org/lkml/2013/6/26/83
>>
>> v1->v2:
>> 1. Placed pm specific calls in prepare/unprepare apis.
>> 2. Put a mask to support upto 32 bits word length.
>> 3. Used "devm_ioremap_resource" variants.
>> 4. Add dt binding doumentation.
>> Documentation/devicetree/bindings/spi/ti_qspi.txt | 22 ++
>> drivers/spi/Kconfig | 8 +
>> drivers/spi/Makefile | 1 +
>> drivers/spi/ti-qspi.c | 357 +++++++++++++++++++++
>> 4 files changed, 388 insertions(+), 0 deletions(-)
>> create mode 100644 Documentation/devicetree/bindings/spi/ti_qspi.txt
>> create mode 100644 drivers/spi/ti-qspi.c
> Please cc devicetree-discuss list when adding new bindings.
>
Ok.
>> +static int dra7xxx_qspi_probe(struct platform_device *pdev)
>> +{
>> + struct dra7xxx_qspi *qspi;
>> + struct spi_master *master;
>> + struct resource *r;
>> + struct device_node *np = pdev->dev.of_node;
>> + u32 max_freq;
>> + int ret;
>> +
>> + 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;
>> + master->bits_per_word_mask = BIT(32 - 1) | BIT(16 - 1) | BIT(8 - 1);
>> +
>> + dev_set_drvdata(&pdev->dev, master);
>> +
>> + qspi = spi_master_get_devdata(master);
>> + qspi->master = master;
>> + qspi->dev =&pdev->dev;
>> +
>> + r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> + if (r == NULL) {
>> + ret = -ENODEV;
>> + goto free_master;
>> + }
>> +
>> + qspi->base = devm_ioremap_resource(&pdev->dev, r);
>> + if (!qspi->base) {
>> + dev_dbg(&pdev->dev, "can't ioremap MCSPI\n");
>> + ret = -ENOMEM;
>> + goto free_master;
>> + }
> This should be
>
> if (IS_ERR(qspi->base)) {
> dev_dbg(&pdev->dev, "can't ioremap QSPI\n");
> ret = PTR_ERR(qspi->base);
> goto free_master;
> }
>
Ok. will change it in next version.
> Thanks,
> Sekhar
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
next prev parent reply other threads:[~2013-07-02 10:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 8:56 [PATCHv2] drivers: spi: Add qspi flash controller Sourav Poddar
2013-07-02 9:24 ` Felipe Balbi
[not found] ` <20130702092458.GI3352-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-07-02 10:00 ` Sourav Poddar
2013-07-02 10:16 ` Felipe Balbi
[not found] ` <20130702101608.GO3352-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-07-02 10:23 ` Sourav Poddar
2013-07-02 10:31 ` Felipe Balbi
[not found] ` <20130702103122.GP3352-S8G//mZuvNWo5Im9Ml3/Zg@public.gmane.org>
2013-07-02 10:39 ` Sourav Poddar
2013-07-02 9:32 ` Mark Brown
2013-07-02 9:44 ` Felipe Balbi
2013-07-02 10:17 ` Mark Brown
[not found] ` <20130702101718.GE27646-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2013-07-02 10:26 ` Sourav Poddar
2013-07-02 10:43 ` Felipe Balbi
2013-07-02 11:04 ` Mark Brown
2013-07-02 15:19 ` Felipe Balbi
2013-07-02 15:49 ` Mark Brown
[not found] ` <1372755399-21769-1-git-send-email-sourav.poddar-l0cyMroinI0@public.gmane.org>
2013-07-02 10:57 ` Sekhar Nori
[not found] ` <51D2B220.1010501-l0cyMroinI0@public.gmane.org>
2013-07-02 10:59 ` Sourav Poddar [this message]
2013-07-02 15:58 ` Felipe Balbi
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=51D2B2A3.3080402@ti.com \
--to=sourav.poddar-l0cymroini0@public.gmane.org \
--cc=balbi-l0cyMroinI0@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nsekhar-l0cyMroinI0@public.gmane.org \
--cc=rnayak-l0cyMroinI0@public.gmane.org \
--cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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).