[i2c] mixed-speed I2C system

Jean Delvare khali at linux-fr.org
Sun Apr 8 17:45:38 CEST 2007


Hi Kashim,

On Fri, 6 Apr 2007 17:20:47 -0500, Syed Mohammed, Khasim wrote:
> >Is there anything the i2c subsystem could do to help? Platform data
> >sounds like the right place to pass board-specific parameters, I'm not
> >sure if there is any benefit in doing it differently.
> 
> Actually we don't have a global I2C config structure to pass the clock /
> config info as platform_data.
> 
> I was proposing the below one.
> 
> static int omap2_i2c2_clkrate = 400;
> 
> static struct platform_device omap_i2c_device2 = {
>         .name           = "i2c_omap",
>         .id             = 2,
>         .num_resources  = ARRAY_SIZE(i2c_resources2),
>         .resource       = i2c_resources2,
>         .dev            = {
>                 .platform_data = &omap2_i2c2_clkrate,
>         },
> };

This looks OK to me.

> Can we add a config structure like the one for SPI shown below,
> 
> static struct omap2_mcspi_platform_config omap2_mcspi2_config = {
>         .num_cs         = 2,
> };
> 
> struct platform_device omap2_mcspi2 = {
>         .name           = "omap2_mcspi",
>         .id             = 2,
>         .num_resources  = ARRAY_SIZE(omap2_mcspi2_resources),
>         .resource       = omap2_mcspi2_resources,
>         .dev            = {
>                 .platform_data = &omap2_mcspi2_config,
>         },
> };

Sure, you can do something like this for I2C as well. The platform_data
pointer can point to any structure you like.

-- 
Jean Delvare



More information about the i2c mailing list