[PATCH v2] ARM: OMAP4: twl-common: Support for additional devices on i2c1 bus

Menon, Nishanth nm at ti.com
Fri Jul 13 06:14:21 EDT 2012


On Fri, Jul 13, 2012 at 3:38 AM, Peter Ujfalusi <peter.ujfalusi at ti.com> wrote:
> On OMAP4 the i2c1 bus is dedicated for the PMIC and audio related devices.
> Manufacturers can opt to use different codec than twl6040 and also can add
> audio related IC to the bus (external amplifier for example on SDP4430).
>
> Make it possible to add differnet set of additional devices to i2c1 bus on
> OMAP4 boards.
>
> Signed-off-by: Peter Ujfalusi <peter.ujfalusi at ti.com>
> ---
>
> Changes since v1:
> Generated against l-o/master
>
> Regards,
> Peter
>
>  arch/arm/mach-omap2/board-4430sdp.c    |   12 +++++++++-
>  arch/arm/mach-omap2/board-omap4panda.c |   12 +++++++++-
>  arch/arm/mach-omap2/twl-common.c       |   35 +++++++++----------------------
>  arch/arm/mach-omap2/twl-common.h       |    3 +-
>  4 files changed, 32 insertions(+), 30 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/board-4430sdp.c b/arch/arm/mach-omap2/board-4430sdp.c
> index ad8a7d9..26466f2 100644
> --- a/arch/arm/mach-omap2/board-4430sdp.c
> +++ b/arch/arm/mach-omap2/board-4430sdp.c
> @@ -547,6 +547,14 @@ static struct twl6040_platform_data twl6040_data = {
>         .irq_base       = TWL6040_CODEC_IRQ_BASE,
>  };
>
> +static struct i2c_board_info __initdata sdp4430_i2c_1_boardinfo[] = {
> +       {
> +               I2C_BOARD_INFO("twl6040", 0x4b),
> +               .irq = OMAP44XX_IRQ_SYS_2N,
> +               .platform_data = &twl6040_data,
> +       },
> +};
> +
>  static struct twl4030_platform_data sdp4430_twldata = {
>         /* Regulators */
>         .vusim          = &sdp4430_vusim,
> @@ -580,8 +588,8 @@ static int __init omap4_i2c_init(void)
>                         TWL_COMMON_REGULATOR_CLK32KG |
>                         TWL_COMMON_REGULATOR_V1V8 |
>                         TWL_COMMON_REGULATOR_V2V1);
> -       omap4_pmic_init("twl6030", &sdp4430_twldata,
> -                       &twl6040_data, OMAP44XX_IRQ_SYS_2N);
> +       omap4_pmic_init("twl6030", &sdp4430_twldata, sdp4430_i2c_1_boardinfo,
> +                       ARRAY_SIZE(sdp4430_i2c_1_boardinfo));

We still need a way to switch to I2C highspeed mode
omap4_pmic_init still does register in 400KHz mode, while setting a bit in 6040
should let us talk 3.3MHz on the bus.

Regards,
Nishanth Menon



More information about the linux-arm-kernel mailing list