From: Grant Likely <grant.likely@secretlab.ca>
To: Andre Schwarz <andre.schwarz@matrix-vision.de>,
Anton Vorontsov <cbouatmailru@gmail.com>
Cc: LinuxPPC List <linuxppc-dev@ozlabs.org>,
DevTreeDiscuss <devicetree-discuss@lists.ozlabs.org>
Subject: Re: How to define an I2C-to-SPI bridge device ?
Date: Thu, 09 Sep 2010 12:23:14 -0600 [thread overview]
Message-ID: <c843f864-2a5a-4146-bd95-13c2fb91f430@email.android.com> (raw)
In-Reply-To: <4C84D334.6060008@matrix-vision.de>
"Andre Schwarz" <andre.schwarz@matrix-vision.de> wrote:
> Anton,
>
>> we're about to get new MPC8377 based hardware with various peripherals.
>>> There are two I2C-to-SPI bridge devices (NXP SC18IS602) and I'm not sure
>>> how to define a proper dts...
>>>
>>> Of course it's an easy thing creating 2 child nodes on the CPU's I2C
>>> device - but how can I represent the created SPI bus ?
>> Um.. the same as the other SPI buses? I.e.
>>
>> i2c-controller { /* SOC I2C controller */
>> spi-controller { /* The I2C-to-SPI bridge */
>> spi-device@0 {
>> };
>> spi-device@1 {
>> };
>> };
>> };
>>
>ok , thanks - looks straight forward.
>Is this any more than plain definition, i.e. will this trigger any I2C
>or SPI device registration/linking ?
>>> Is the (possibly) required driver (of_sc18is60x_spi ?) supposed to be an
>>> I2C slave or an SPI host driver ?
>> It should be an I2C driver that registers an SPI master (i.e.
>> calls spi_alloc_master() and spi_register_master()).
>hmm - ok. Will have to do it manually then ...
Yes, but this is the case for non-of drivers too. The i2c to spi device driver must always create (and trigger population of) the spi bus instance.
>
>I still wonder how to make the driver arch-generic *and* of-capable.
>Do we need a generic I2C slave driver that can be probed along with an
>"of glue driver" or should the of-binding be part of a single device
>driver ?
There is no longer any need for separate of and non-of drivers for the same hardware. Any device may have the of_node pointer in struct device set, and drivers can use the pointer as an alternative to platform_data to get information about the hardware configuration.
Just read the data out of the node in the driver's probe hook.
For i2c and (soon) spi, the core code will even register child devices for you.
g.
>
>Sorry for the dumb questions - looks like I expected a little too much
>functionality already existing.
>
>
>Regards,
>André
>
>
>MATRIX VISION GmbH, Talstrasse 16, DE-71570 Oppenweiler
>Registergericht: Amtsgericht Stuttgart, HRB 271090
>Geschaeftsfuehrer: Gerhard Thullner, Werner Armingeon, Uwe Furtner, Hans-Joachim Reich
>_______________________________________________
>Linuxppc-dev mailing list
>Linuxppc-dev@lists.ozlabs.org
>https://lists.ozlabs.org/listinfo/linuxppc-dev
--
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev
next prev parent reply other threads:[~2010-09-09 18:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-03 8:36 How to define an I2C-to-SPI bridge device ? André Schwarz
2010-09-03 12:08 ` Anton Vorontsov
2010-09-06 11:40 ` Andre Schwarz
[not found] ` <4C84D334.6060008-P0pTl12WyEgpBod+wgzj8A@public.gmane.org>
2010-09-06 14:37 ` André Schwarz
2010-09-09 18:23 ` Grant Likely [this message]
2010-09-10 8:11 ` André Schwarz
2010-09-10 17:37 ` Grant Likely
[not found] ` <20100910173706.GD11284-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-09-10 18:14 ` André Schwarz
2010-09-10 18:27 ` Anton Vorontsov
2010-09-10 18:28 ` Grant Likely
[not found] ` <20100910182815.GH11284-MrY2KI0G/OVr83L8+7iqerDks+cytr/Z@public.gmane.org>
2010-09-12 15:10 ` André Schwarz
2010-09-13 4:39 ` Grant Likely
2010-09-09 17:06 ` Grant Likely
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=c843f864-2a5a-4146-bd95-13c2fb91f430@email.android.com \
--to=grant.likely@secretlab.ca \
--cc=andre.schwarz@matrix-vision.de \
--cc=cbouatmailru@gmail.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linuxppc-dev@ozlabs.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