Skip to content

RFC OF-glue devices for I2C/SPI (was: Re: [PATCH 4/7] gpiolib: implement dev_gpiochip_{add,remove} calls

Anton Vorontsov linux-i2c linuxppc-dev lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6of/base: Add new helper of_should_create_pdev()drivers/of/base.c include/linux/of.h+28 -00 replies
2/6of/of_i2c: implement of_{,un}register_i2c_devicedrivers/of/of_i2c.c include/linux/of_i2c.h+48 -270 replies
3/6of/of_i2c: add support for dedicated OF I2C devicesdrivers/of/of_i2c.c+12 -01 reply
4/6of/gpio: add support for two-stage registration for the of_gpio_chipsdrivers/i2c/chips/mcu_mpc8349emitx.c drivers/of/gpio.c include/linux/of_gpio.h+25 -20 replies
5/6gpio/pca953x: pass gpio_chip pointer to the setup/teardown callbacksdrivers/gpio/pca953x.c include/linux/i2c/pca953x.h+8 -70 replies
6/6gpio: OpenFirmware bindings for the pca953xdrivers/gpio/Kconfig drivers/gpio/Makefile drivers/gpio/of_pca953x.c +1 more+163 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6 RFC] OF-glue devices for I2C/SPI (was: Re: [PATCH 4/7] gpiolib: implement dev_gpiochip_{add,remove} calls

On Wed, Oct 22, 2008 at 02:46:06PM +0400, Anton Vorontsov wrote:
[...]

Quoted 13 lines
Quoted 13 lines
Quoted 8 lines

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)

Quoted 8 lines
Quoted 3 lines

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? ;-)

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

Thanks,

Signature · 3 lines
Anton Vorontsov
email: [email protected]
irc://irc.freenode.net/bd2