All of lore.kernel.org
 help / color / mirror / Atom feed
From: "tiejun.chen" <tiejun.chen@windriver.com>
To: WANG YiFei <yifei_wang@hotmail.com>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: ppc405 + MCP23S17
Date: Wed, 13 Oct 2010 11:09:05 +0800	[thread overview]
Message-ID: <4CB522D1.5090802@windriver.com> (raw)
In-Reply-To: <BAY158-ds7DB18D88ED851794F4E19F5540@phx.gbl>

WANG YiFei wrote:
> Hi,
> 
>  
> 
> I'm a newbie for linux device driver development.
> 
> We have a custom ppc405 board which has MCP23S17
> 
> (16-Bit I/O Expander with SPI Interface) on it.
> 
> I noticed that current kernel has MCP23S08 driver
> 
> support, I'd like to know:
> 
> 1. if passing platform data to MCP23S08 driver, can it make
> 
>    MCP23S17 work?
> 

These chips should be same vendor product so I think 16-bit mcp23s17 may be
compatible to 8-bit modes. But you have to check the data sheet to confirm this
and track how to configure that as 8-bit mode. After that it's possible to run
mcp23s17 with mcp23s08.c.

> 2. Generally, I'd like to know how to pass platform data to
> 
>    a particular device driver. In my mind, platform data should
> 
>    not be in driver code, right? However, I don't know where is

Firstly you should define this on your dts. Then parse that to register
corresponding of_platform_device or platform_device when you setup your target
on <your target>.c.

When spi_register_driver prober successfully, you can get the platform_data from
associated spi device.

> 
>    the suitable place to pass platform data to driver.
> 
> 3. How to describe this in dts file?
> 

You can get more from the file, Documentation/powerpc/dts-bindings/spi-bus.txt.
Or refer to those existed spi nodes on other platform dts.

Tiejun

>  
> 
> Thanks in advance,
> 
> YiFei
> 
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev

  reply	other threads:[~2010-10-13  3:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12 14:49 ppc405 + MCP23S17 WANG YiFei
2010-10-13  3:09 ` tiejun.chen [this message]
2010-10-13  6:23   ` WANG YiFei
2010-10-13  7:49     ` tiejun.chen
2010-10-13 15:03       ` WANG YiFei
2010-10-14  5:03         ` tiejun.chen
2010-10-16 10:35     ` Help about chip select on SPI slave devices WANG YiFei
2010-10-18  8:17       ` tiejun.chen

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=4CB522D1.5090802@windriver.com \
    --to=tiejun.chen@windriver.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=yifei_wang@hotmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.