Hi Vincent
Do you have 2.6.35 kernel. If so you can refer to arch/arm/mach-mx5/mx50_rdp.c.
There's a suspend enter/exit callback to do such GPIO pin configurations:
static struct mxc_pm_platform_data mx50_pm_data = {
.suspend_enter = mx50_suspend_enter,
.suspend_exit = mx50_suspend_exit,
};
We define a sets of iomux which you want that gpio configured, define all the pins as GPIO like:
static iomux_v3_cfg_t suspend_enter_pads[] = {
MX50_PAD_EIM_DA0__GPIO_1_0,
MX50_PAD_EIM_DA1__GPIO_1_1,
MX50_PAD_EIM_DA2__GPIO_1_2,
MX50_PAD_EIM_DA3__GPIO_1_3,
MX50_PAD_EIM_DA4__GPIO_1_4,
In mx50_suspend_enter callback, we unset the PAD CTRL mask, and save current iomux configuration, set them all to GPIO ALT:
for (i = 0; i < ARRAY_SIZE(suspend_enter_pads); i++) {
suspend_exit_pads[i] = *p;
*p &= ~MUX_PAD_CTRL_MASK;
p++;
}
mxc_iomux_v3_get_multiple_pads(suspend_exit_pads,
ARRAY_SIZE(suspend_exit_pads));
mxc_iomux_v3_setup_multiple_pads(suspend_enter_pads,
ARRAY_SIZE(suspend_enter_pads));
In mx50_suspend_exit callback, restore all the iomux configurations:
mxc_iomux_v3_setup_multiple_pads(suspend_exit_pads,
ARRAY_SIZE(suspend_exit_pads));