[i2c] [patch/rfc 2.6.19-rc6 3/3] convert OMAP OSK to "new style" I2C driver binding
Greg KH
greg at kroah.com
Sat Nov 18 10:33:21 CET 2006
On Thu, Nov 16, 2006 at 11:27:53AM -0800, David Brownell wrote:
> Partial conversion of one board to use new style I2C driver binding:
>
> - OMAP5912 OSK gets board info; it has from two to four I2C chips, depending
> on whether the Mistral board is there, and whether a camera is attached.
>
> - The tps65010 driver converts to "new style" driver binding, and moves some
> of its board-specific init code out of the driver. (Unfortunately not all;
> this driver is used during board bringup, and there's a shortage of places
> to put such bringup code...)
>
> This patch doesn't include changes to the AIC23 support (a complex ALSA driver
> that's not yet gone upstream) or the AT24C EEPROM driver.
>
> Most of the tps65010 changes (by volume) are just adjusting to the fact that
> this driver no longer allocates the i2c_client structure. But it's also
> about 10% smaller (with debugfs, probably 20% smaller otherwise) mostly
> because the I2C_CLIENT_INSMOD data is gone.
>
> ---
> arch/arm/mach-omap1/board-osk.c | 37 ++++++
> drivers/i2c/chips/tps65010.c | 231 +++++++++++++++++-----------------------
> 2 files changed, 136 insertions(+), 132 deletions(-)
>
> Index: o26/arch/arm/mach-omap1/board-osk.c
> ===================================================================
> --- o26.orig/arch/arm/mach-omap1/board-osk.c 2006-11-16 01:23:10.000000000 -0800
> +++ o26/arch/arm/mach-omap1/board-osk.c 2006-11-16 11:07:19.000000000 -0800
> @@ -31,6 +31,7 @@
> #include <linux/platform_device.h>
> #include <linux/interrupt.h>
> #include <linux/irq.h>
> +#include <linux/i2c.h>
>
> #include <linux/mtd/mtd.h>
> #include <linux/mtd/partitions.h>
> @@ -179,6 +180,34 @@ static struct platform_device *osk5912_d
> &osk5912_mcbsp1_device,
> };
>
> +static struct i2c_board_info __initdata osk_i2c_board_info[] = { {
> + .modalias = "tps65010",
Can't we automagically set this to THIS_MODULE->name if it's a module so
that people don't type this wrong somehow?
> + .platform_data = "tps65010",
> + .dev_addr = 0x48,
> + .bus_num = 0,
> + .irq = OMAP_GPIO_IRQ(OMAP_MPUIO(1)),
This whole initializer is just crying out for a macro :)
thanks,
greg k-h
More information about the i2c
mailing list