linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Jie <eltshanli@gmail.com>
To: Wan ZongShun <mcuos.com@gmail.com>
Cc: linux-spi <spi-devel-general@lists.sourceforge.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Brownell-sourceforge <dbrownell@users.sourceforge.net>,
	Russell King <linux@arm.linux.org.uk>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH v2]: NUC900: Add spi driver support for nuc900
Date: Sat, 21 Nov 2009 22:10:24 +0800	[thread overview]
Message-ID: <8fb2581d0911210610j125b5700ydeb25e72efa88eac@mail.gmail.com> (raw)
In-Reply-To: <4B062887.90803@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,
};

-- 
Regards
Li Jie

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

  parent reply	other threads:[~2009-11-21 14:10 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 [this message]
     [not found]   ` <8fb2581d0911210610j125b5700ydeb25e72efa88eac-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-11-21 17:38     ` Wan ZongShun
     [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=8fb2581d0911210610j125b5700ydeb25e72efa88eac@mail.gmail.com \
    --to=eltshanli@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mcuos.com@gmail.com \
    --cc=spi-devel-general@lists.sourceforge.net \
    /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).