LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Grant Likely" <grant.likely@secretlab.ca>
To: avorontsov@ru.mvista.com
Cc: "David Brownell" <david-b@pacbell.net>,
	benh@kernel.crashing.org, linux-kernel@vger.kernel.org,
	linuxppc-dev@ozlabs.org, i2c@lm-sensors.org,
	"David Miller" <davem@davemloft.net>
Subject: Re: [PATCH 0/6 RFC] OF-glue devices for I2C/SPI (was: Re: [PATCH 4/7] gpiolib: implement dev_gpiochip_{add,remove} calls
Date: Tue, 28 Oct 2008 11:53:54 -0600	[thread overview]
Message-ID: <fa686aa40810281053u4673dd60sc4e33a1f90f65981@mail.gmail.com> (raw)
In-Reply-To: <20081028174532.GA23834@oksana.dev.rtsoft.ru>

On Tue, Oct 28, 2008 at 11:45 AM, Anton Vorontsov
<avorontsov@ru.mvista.com> wrote:
> On Wed, Oct 22, 2008 at 02:46:06PM +0400, Anton Vorontsov wrote:
> [...]
>> > > Like what I suggested:  "chip-aware OF glue drivers".  The relevant
>> > > bus code being the "of_platform_bus_type" infrastructure.
>> > >
>> > > Example:  instead of Anton's patch #6 modifying the existing pca953x
>> > > driver, an of_pca953x driver that knows how to poke around in the OF
>> > > device attributes to (a) create the pca953x_platform_data, (b) call
>> > > i2c_register_board_info() to make that available later, and then
>> > > finally (c) vanish, since it's not needed any longer.
>> >
>> > Heh. You tell me my first approach:
>> >
>> > http://ozlabs.org/pipermail/linuxppc-dev/2008-May/056730.html (mmc_spi)
>> >
>> > The OF people didn't like the patch which was used to support this
>> > approach:
>> > http://ozlabs.org/pipermail/linuxppc-dev/2008-May/056728.html
>>
>> Though, I think I'll able to persuade Grant that two registration paths
>> are inevitable (i.e. for simple devices we should use
>> drivers/of/of_{i2c,spi}.c and for complex cases we'll have to have
>> another method of registration).
>
> Ok, here it is.
>
> I don't like this approach because:
>
> 1. It feels like an overhead to create an of_device for each i2c
>   device that needs platform data.
>
> 2. We have to do ugly of_should_create_pdev() in the i2c code,
>   and duplicate lists of supported devices.
>
> Could anybody convince me that this isn't a big deal? ;-)

I really don't like this approach either.  I think it is a big deal.
It greatly increases the complexity of the probe path for the device.
Adapting the OF data to pdata is entirely driver specific and it
doesn't make sense to break it out into a separate of_device or use
the board_info mechanism to disassociate the adapter code from the
driver.  Each instance of adapter code will never be associated with a
different driver and I think it is entirely reasonable to have a
driver specific hook in the drivers probe path to build pdata from the
device tree.

>
> Otherwise I'll stick with this approach:
> http://lkml.org/lkml/2008/10/22/471

I like this approach.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

  parent reply	other threads:[~2008-10-28 17:54 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-16 17:12 [PATCH 0/7 RFC] Handle I2C GPIO controllers with the OF (was: pca9539 I2C gpio expander) Anton Vorontsov
2008-10-16 17:12 ` [PATCH 1/7] powerpc and sparc: introduce dev_archdata node accessors Anton Vorontsov
2008-10-16 22:36   ` David Miller
2008-10-16 23:02     ` Grant Likely
2008-10-16 17:12 ` [PATCH 2/7] i2c: add info->archdata field Anton Vorontsov
2008-10-17  9:21   ` Jean Delvare
2008-10-22  0:27     ` Benjamin Herrenschmidt
2008-10-22  6:50       ` Jean Delvare
2008-10-22  7:37         ` Benjamin Herrenschmidt
2008-10-22 10:08           ` Anton Vorontsov
2008-10-22 11:07             ` Jean Delvare
2008-10-22 12:50               ` Anton Vorontsov
2008-10-16 17:12 ` [PATCH 3/7] of: fill the archdata for I2C devices Anton Vorontsov
2008-10-22  4:14   ` Grant Likely
2008-10-16 17:12 ` [PATCH 4/7] gpiolib: implement dev_gpiochip_{add,remove} calls Anton Vorontsov
2008-10-17 20:24   ` David Brownell
2008-10-17 21:29     ` Anton Vorontsov
2008-10-20  7:29       ` David Brownell
2008-10-20 15:48         ` Anton Vorontsov
2008-10-22  0:29           ` Benjamin Herrenschmidt
2008-10-22  1:03             ` Anton Vorontsov
2008-10-22  1:42               ` Anton Vorontsov
2008-10-22  2:28                 ` Benjamin Herrenschmidt
2008-10-22  4:20                   ` Grant Likely
2008-10-22  4:22                   ` David Brownell
2008-10-22 10:36                     ` Anton Vorontsov
2008-10-22 10:46                       ` Anton Vorontsov
2008-10-22 18:32                         ` Anton Vorontsov
2008-10-22 21:04                           ` David Brownell
2008-10-22 21:22                             ` Anton Vorontsov
2008-10-22 21:52                               ` David Brownell
2008-10-22 22:29                                 ` Anton Vorontsov
2008-10-23  5:19                                   ` David Brownell
2008-10-23  4:45                             ` Benjamin Herrenschmidt
2008-10-23  6:06                               ` David Brownell
2008-10-23  6:15                           ` David Brownell
2008-10-28 17:45                         ` [PATCH 0/6 RFC] OF-glue devices for I2C/SPI (was: " Anton Vorontsov
2008-10-28 17:46                           ` [PATCH 1/6] of/base: Add new helper of_should_create_pdev() Anton Vorontsov
2008-10-28 17:46                           ` [PATCH 2/6] of/of_i2c: implement of_{,un}register_i2c_device Anton Vorontsov
2008-10-28 17:46                           ` [PATCH 3/6] of/of_i2c: add support for dedicated OF I2C devices Anton Vorontsov
2008-10-28 18:41                             ` David Miller
2008-10-28 17:46                           ` [PATCH 4/6] of/gpio: add support for two-stage registration for the of_gpio_chips Anton Vorontsov
2008-10-28 17:46                           ` [PATCH 5/6] gpio/pca953x: pass gpio_chip pointer to the setup/teardown callbacks Anton Vorontsov
2008-10-28 17:46                           ` [PATCH 6/6] gpio: OpenFirmware bindings for the pca953x Anton Vorontsov
2008-10-28 17:53                           ` Grant Likely [this message]
2008-10-22  2:27               ` [PATCH 4/7] gpiolib: implement dev_gpiochip_{add,remove} calls Benjamin Herrenschmidt
2008-10-16 17:13 ` [PATCH 5/7] of/gpio: implement of_dev_gpiochip_{add,remove} calls Anton Vorontsov
2008-10-17 20:25   ` David Brownell
2008-10-17 21:13     ` Anton Vorontsov
2008-10-16 17:13 ` [PATCH 6/7] gpio/pca953x: convert to dev_gpiochip_add and make it work with the OF Anton Vorontsov
2008-10-16 17:13 ` [PATCH 7/7] i2c/mcu_mpc8349emitx: convert to the new I2C/OF/GPIO infrastructure Anton Vorontsov
2008-10-17 16:07 ` [PATCH 0/7 RFC] Handle I2C GPIO controllers with the OF (was: pca9539 I2C gpio expander) Steven A. Falco

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=fa686aa40810281053u4673dd60sc4e33a1f90f65981@mail.gmail.com \
    --to=grant.likely@secretlab.ca \
    --cc=avorontsov@ru.mvista.com \
    --cc=benh@kernel.crashing.org \
    --cc=davem@davemloft.net \
    --cc=david-b@pacbell.net \
    --cc=i2c@lm-sensors.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --subject='Re: [PATCH 0/6 RFC] OF-glue devices for I2C/SPI (was: Re: [PATCH 4/7] gpiolib: implement dev_gpiochip_{add,remove} calls' \
    /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

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).