i.MX53 poweroff -blog archive

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i.MX53 poweroff -blog archive

853件の閲覧回数
JayTu
NXP Employee
NXP Employee

There is no power off command on i.MX53 and how to do it?

In linux, there is a standard interface for power off. It is a system call.

In kernel/sys.c,

SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
                void __user *, arg)
{
        ...

                case LINUX_REBOOT_CMD_POWER_OFF:
                kernel_power_off();
                do_exit(0);
                break;
}

kernel_power_off will invoke pm_power_off which is a function pointer. It is defined to be da9053_power_off on i.MX53.

It will cut off PMIC power directly.

So, in user space, we just need to issue a system call with correct magic number and command.

The sample code is quite easy and list below:

#include <unistd.h>
#include <sys/reboot.h>

int main(void)
{
    return __reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2,
                    LINUX_REBOOT_CMD_POWER_OFF, NULL);
}

The code can be found at:
reboot.c

タグ(1)
0 返答(返信)