* Tony Lindgren <t...@atomide.com> [100924 17:14]:
> 
> * Benoit Cousson <b-cous...@ti.com> [100924 02:07]:
> 
> If we wanted to use only the offset in the data, we could initialize
> the various sections separately. But then omapX_mux_init() would have
> to know the partition number somehow..

After thinking about this a bit more, to me it seems like this is
the best way to go. Then there's no need to repeat the partition data
for each entry. How about this:

Earlier defines stay the same:

#define OMAP3_MUX(mode0, mux_value)                                     \
{                                                                       \
        .reg_offset     = (OMAP3_CONTROL_PADCONF_##mode0##_OFFSET),     \
        .value          = (mux_value),                                  \
}

Then for omap4, we need to add a separate board mux table for each
partition:

#define OMAP4_MUX_PARTXXX(mode0, mux_value)                             \
{                                                                       \
        .reg_offset     = (OMAP4_PART_XXX_PADCONF_##mode0##_OFFSET),    \
        .value          = (mux_value),                                  \
}

#define OMAP4_MUX_PARTYYY(mode0, mux_value)                             \
{                                                                       \
        .reg_offset     = (OMAP4_PARTYYY_PADCONF_##mode0##_OFFSET),     \
        .value          = (mux_value),                                  \
}
...

For omap2 and 3, we just call omap_mux_init once with the mux_pbase
as we currently already do. Then for omap4, we call omap_mux_init for
each partition.

We also need to change omap_mux_read/write to allow specifying the
partition base address:

u16 omap_mux_read(void __iomem *base, u16 offset)
{
        if (cpu_is_omap24xx())
                return __raw_readb(base + offset);
        else
                return __raw_readw(base + offset);
}

All the other mux interface functions can stay the same, we just need
to modify the mux.c code to look for signal names or GPIO number in
each registered partition.

Regards,

Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to