linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wan ZongShun <mcuos.com-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Li Jie <eltshanli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-spi
	<spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Andrew Morton
	<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	David Brownell-sourceforge
	<dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
	Russell King <linux-lFZ/pmaqli7XmaaqVzeoHQ@public.gmane.org>,
	linux-arm-kernel
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>
Subject: Re: [PATCH v2]: NUC900: Add spi driver support for nuc900
Date: Sun, 22 Nov 2009 01:38:55 +0800	[thread overview]
Message-ID: <e68bb3470911210938v2a91b39ax1f1073edab150c11@mail.gmail.com> (raw)
In-Reply-To: <8fb2581d0911210610j125b5700ydeb25e72efa88eac-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Dear Li Jie,


2009/11/21 Li Jie <eltshanli@gmail.com>:
> On Fri, Nov 20, 2009 at 1:26 PM, Wan ZongShun <mcuos.com@gmail.com> wrote:
>>
>> +static void w90p910_init_spi(struct w90p910_spi *hw)
>> +{
>> +       clk_enable(hw->clk);
>> +       spin_lock_init(&hw->lock);
>> +
>> +       w90p910_tx_edge(hw, hw->pdata->txneg);
>> +       w90p910_rx_edge(hw, hw->pdata->rxneg);
>> +       w90p910_send_first(hw, hw->pdata->lsb);
>> +       w90p910_set_sleep(hw, hw->pdata->sleep);
>> +       w90p910_spi_setup_txbitlen(hw, hw->pdata->txbitlen);
>> +       w90p910_spi_setup_txnum(hw, hw->pdata->txnum);
>> +       w90p910_set_divider(hw);
>> +       w90p910_enable_int(hw, 1);
>> +}
>> +
>> +static int __devinit w90p910_spi_probe(struct platform_device *pdev)
>> +{
>> +       struct w90p910_spi *hw;
>> +       struct spi_master *master;
>> +       struct resource *res;
>> +       int err = 0;
>> +
>> +       master = spi_alloc_master(&pdev->dev, sizeof(struct w90p910_spi));
>> +       if (master == NULL) {
>> +               dev_err(&pdev->dev, "No memory for spi_master\n");
>> +               err = -ENOMEM;
>> +               goto err_nomem;
>> +       }
>> +
>> +       hw = spi_master_get_devdata(master);
>> +       memset(hw, 0, sizeof(struct w90p910_spi));
>> +
>> +       hw->master = spi_master_get(master);
>> +       hw->pdata  = pdev->dev.platform_data;
>
> Seems that platform_data is necessary in your driver,
> but I found it is not initialized in mach-w90x900/dev.c:
>
> static struct platform_device nuc900_device_spi = {
>        .name           = "nuc900-spi",
>        .id             = -1,
>        .num_resources  = ARRAY_SIZE(nuc900_spi_resource),
>        .resource       = nuc900_spi_resource,
> };
>

Yes , you are right, I tested the spi driver via 'm25p80', so I must
add some its definition  to my dev.c and use 'spi_register_board_info'
to register this type flash info.

So, I just want to add the platform_data definition patch along with
above and I think I will submit it later.

Anyway, thanks a lot for your careful reviewing my patch.

> --
> Regards
> Li Jie
>



-- 
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

  parent reply	other threads:[~2009-11-21 17:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-20  5:26 [PATCH v2]: NUC900: Add spi driver support for nuc900 Wan ZongShun
2009-11-20  8:18 ` Li Jie
     [not found]   ` <8fb2581d0911200018v53bad77aob74d0c33a7c14716-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-20  9:49     ` Wan ZongShun
2009-11-21 14:10 ` Li Jie
     [not found]   ` <8fb2581d0911210610j125b5700ydeb25e72efa88eac-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-21 17:38     ` Wan ZongShun [this message]
     [not found] ` <4B062887.90803-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2009-11-26  6:40   ` Wan ZongShun
     [not found]     ` <e68bb3470911252240x7f10dbf1n7e8423340f3a7d25-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-30 22:13       ` Andrew Morton

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=e68bb3470911210938v2a91b39ax1f1073edab150c11@mail.gmail.com \
    --to=mcuos.com-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
    --cc=dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=eltshanli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-lFZ/pmaqli7XmaaqVzeoHQ@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).