iMX51 android 10.4 在suspend 時,需要對 gpio 作重新設置嗎?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

iMX51 android 10.4 在suspend 時,需要對 gpio 作重新設置嗎?

Jump to solution
2,253 Views
vincent_rtk
Contributor II

在進入 suspend 模式時, (echo mem > /sys/power/state) ,

為了減少 suspend 的電流,需要對 imx51 的 gpio 作重新設置嗎?

例如:設置為 High-Z (input) mode,以減少電流消耗。

在其他的 application processor 都有類似的動作,但是在 imx51 android bsp 中沒有看到。

請問 imx51 不需要這樣作嗎?

謝謝

Translation: Subject---is it necessary to set GPIO pin to high-Z when entering Suspend mode in i.MX51 Androd 10.4?

When entering suspend mode, in order to reduce current, is it necessary to set GPIO pins? For example, set pin to High-Z (input) mode to reduce power consumption. In other application platform, it is required to do it. However, in i.MX51 bsp, it is not seen.

Does i.MX51 not need the action?

1 Solution
1,609 Views
xinyu_chen
NXP Employee
NXP Employee

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));     

View solution in original post

4 Replies
1,609 Views
YixingKong
Senior Contributor IV

vincent_rtk, if your question has been answered, please select Correct Answer so that we can close the DI.

Thanks,

Yixing

0 Kudos
Reply
1,609 Views
vincent_rtk
Contributor II

Hi Yixing,

Thanks your reply, I have apply it right after I read it.

and I don't know it's necessary to set the "Correct Answer'.

Sorry for that.

0 Kudos
Reply
1,609 Views
YixingKong
Senior Contributor IV

No reply from the originator of the DI, I will mark the reply from XinyuChen as Correct Answer.

0 Kudos
Reply
1,610 Views
xinyu_chen
NXP Employee
NXP Employee

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));