Skip to content

Commit

Permalink
OMAP: mux: Add support for control module split in several partitions
Browse files Browse the repository at this point in the history
Starting on OMAP4, the pin mux configuration is located in two
different partitions of the control module (CODE_PAD and WKUP_PAD).
The first one is inside the core power domain whereas the second
one is inside the wakeup.
- Add the capability to add any number of partition during board init
time depending of Soc partitioning.
- Add some init flags as well in order to avoid explicit Soc version
check inside the mux core code.
- Add a comment with mux0 mode on top of omap_mux/board/<partition>
if the current mux mode is not the default one.

Thanks to Tony Lindgren <tony@atomide.com> for the following improvements:
- Add omap_mux_get for getting the partition data so platform level
device code can use it.
- Fix the rx51 board code to use the new API.
- Do not store the partition for each mux entry. Look up the partition
for debugfs instead.

Thanks to Dan Murphy <dmurphy@ti.com> for testing on OMAP4 and reporting
a couple of bugs.
Thanks to Anand Gadiyar <gadiyar@ti.com> for testing on OMAP3 zoom and
bug report.

Signed-off-by: Benoit Cousson <b-cousson@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Tested-by: Murphy Dan <dmurphy@ti.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Anand Gadiyar <gadiyar@ti.com>
  • Loading branch information
Benoit Cousson committed Nov 17, 2010
1 parent 1cbb3a9 commit 112485e
Show file tree
Hide file tree
Showing 6 changed files with 312 additions and 128 deletions.
12 changes: 9 additions & 3 deletions arch/arm/mach-omap2/board-rx51-peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,18 @@ static struct omap_board_mux rx51_mmc2_off_mux[] = {
{ .reg_offset = OMAP_MUX_TERMINATOR },
};

static struct omap_mux_partition *partition;

/*
* Current flows to eMMC when eMMC is off and the data lines are pulled up,
* so pull them down. N.B. we pull 8 lines because we are using 8 lines.
*/
static void rx51_mmc2_remux(struct device *dev, int slot, int power_on)
{
if (power_on)
omap_mux_write_array(rx51_mmc2_on_mux);
omap_mux_write_array(partition, rx51_mmc2_on_mux);
else
omap_mux_write_array(rx51_mmc2_off_mux);
omap_mux_write_array(partition, rx51_mmc2_off_mux);
}

static struct omap2_hsmmc_info mmc[] __initdata = {
Expand Down Expand Up @@ -922,7 +924,11 @@ void __init rx51_peripherals_init(void)
rx51_init_wl1251();
spi_register_board_info(rx51_peripherals_spi_board_info,
ARRAY_SIZE(rx51_peripherals_spi_board_info));
omap2_hsmmc_init(mmc);

partition = omap_mux_get("core");
if (partition)
omap2_hsmmc_init(mmc);

platform_device_register(&rx51_charger_device);
}

Loading

0 comments on commit 112485e

Please sign in to comment.