From: "Grant Likely" <grant.likely@secretlab.ca>
To: avorontsov@ru.mvista.com
Cc: linuxppc-dev@ozlabs.org, Gary Jennejohn <garyj@denx.de>,
Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Subject: Re: [PATCH 2/4] [OF] spi_of: add support for dedicated SPI constructors
Date: Wed, 21 May 2008 11:05:49 -0600 [thread overview]
Message-ID: <fa686aa40805211005h58ea66dfl792eae460d4ea3d@mail.gmail.com> (raw)
In-Reply-To: <20080521164841.GA17813@polina.dev.rtsoft.ru>
On Wed, May 21, 2008 at 10:48 AM, Anton Vorontsov
<avorontsov@ru.mvista.com> wrote:
> On Wed, May 21, 2008 at 06:24:58PM +0200, Guennadi Liakhovetski wrote:
>> On Wed, 21 May 2008, Anton Vorontsov wrote:
>>
>> > On Wed, May 21, 2008 at 05:56:33PM +0200, Guennadi Liakhovetski wrote:
>> > >
>> > > Hm, I might well misunderstand something here, but it looks to me like you
>> > > are again trying to use both OF _and_ platform (spi_board_info) bindings
>> > > for your SPI setup?
>> >
>> > Yes, you didn't misunderstand. ;-)
>> >
>> > > And this is exactly what we are trying to avoid in
>> > > Grant's series of patches...
>> >
>> > I didn't find other way... The show stopper is "master" argument,
>> > drivers don't know about masters (and should not, since if they should,
>> > then this implies that masters should be registered prior to devices,
>> > and that complicates everything).
>> >
>> > What is the problem with board infos, btw? I missed that part. Board
>>
>> In short: board infos are not bad as such. I find it bad if you have to
>> use both OF and platform bindings to describe _one_ piece of hardware.
Sonething to note: 'platform bindings' is the wrong terminology. I'd
like to be careful here because the term 'platform' is already
overloaded and leads to confusion. Specifically, the 'platform bus'
doesn't come into play at all here and 'platform code' simply refers
to the board specific code in arch/powerpc/platforms. Really, the
discussion is between using 'board info' to pass data vs. using the OF
api.
>
> This particular discussion isn't about describing hardware (since
> we're describing it via device tree), but about implementation
> details, such as:
>
> 1. Passing platform_data to the drivers;
> 2. Creating "SPI Linux devices" from the OF description.
>
> I see there ways:
>
> 1. Grant Likely's approach (works great for simple drivers which don't
> need SPI platform_data).
> 2. Old board infos approach, there we can do whatever we want.
> 3. Implementing OF bindings for the every SPI driver that needs
> platform_data.
or perhaps: 4. allow platform code to pass supplementary board info to
specific spi devices when appropriate (so the '1.' path is always
used, but it can also parse a board info structure if one is provided.
This is different from '2.' which short circuits the spi_of path
entirely).
I concede that sometimes platform code just has to pass data to the
driver that cannot be described in the device tree. callback pointers
being the most significant example and we do need a sane way to do so.
That being said; in most cases I'd much rather see code added to the
driver itself to extract data from the device tree. This has the
advantage that the data transformation code stays with the driver
where it belongs and it keeps code common as much as possible
(discourage duplication of code in the platform directories).
Cheers,
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
next prev parent reply other threads:[~2008-05-21 17:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-21 15:41 [RFC/DRAFT] SPI OF bindings, MMC-over-SPI, chip-selects and so on Anton Vorontsov
2008-05-21 15:41 ` [PATCH 1/4] [SPI] spi_mpc83xx: convert to the OF platform driver Anton Vorontsov
2008-05-21 16:50 ` Grant Likely
2008-05-21 17:05 ` Anton Vorontsov
2008-05-21 17:17 ` Grant Likely
2008-05-21 15:41 ` [PATCH 2/4] [OF] spi_of: add support for dedicated SPI constructors Anton Vorontsov
2008-05-21 15:56 ` Guennadi Liakhovetski
2008-05-21 16:10 ` Anton Vorontsov
2008-05-21 16:24 ` Guennadi Liakhovetski
2008-05-21 16:48 ` Anton Vorontsov
2008-05-21 17:05 ` Grant Likely [this message]
2008-05-21 17:51 ` Guennadi Liakhovetski
2008-05-21 19:06 ` Grant Likely
2008-05-21 19:20 ` Guennadi Liakhovetski
2008-05-21 19:53 ` Grant Likely
2008-05-21 20:00 ` Guennadi Liakhovetski
2008-05-21 20:07 ` Grant Likely
2008-05-21 17:30 ` Grant Likely
2008-05-21 15:41 ` [PATCH 3/4] [OF] MMC-over-SPI OF constructor Anton Vorontsov
2008-05-21 15:41 ` [PATCH 4/4] [POWERPC] 86xx: mpc8610_hpcd: support for MMC-over-SPI and PIXIS' GPIOs Anton Vorontsov
2008-05-21 15:54 ` [RFC/DRAFT] SPI OF bindings, MMC-over-SPI, chip-selects and so on Guennadi Liakhovetski
2008-05-21 16:01 ` Anton Vorontsov
2008-05-21 16:51 ` Grant Likely
2008-05-21 17:32 ` 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=fa686aa40805211005h58ea66dfl792eae460d4ea3d@mail.gmail.com \
--to=grant.likely@secretlab.ca \
--cc=avorontsov@ru.mvista.com \
--cc=g.liakhovetski@gmx.de \
--cc=garyj@denx.de \
--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;
as well as URLs for NNTP newsgroup(s).