Linux Audio

Check our new training course

Loading...
v4.17
 
 1/*
 2 * Copyright (C) 2012 Regents of the University of California
 3 *
 4 *   This program is free software; you can redistribute it and/or
 5 *   modify it under the terms of the GNU General Public License
 6 *   as published by the Free Software Foundation, version 2.
 7 *
 8 *   This program is distributed in the hope that it will be useful,
 9 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *   GNU General Public License for more details.
12 */
13
14#include <linux/reboot.h>
15#include <linux/export.h>
16#include <asm/sbi.h>
17
18void (*pm_power_off)(void) = machine_power_off;
 
 
 
 
 
 
19EXPORT_SYMBOL(pm_power_off);
20
21void machine_restart(char *cmd)
22{
23	do_kernel_restart(cmd);
24	while (1);
25}
26
27void machine_halt(void)
28{
29	machine_power_off();
 
30}
31
32void machine_power_off(void)
33{
34	sbi_shutdown();
35	while (1);
36}
v6.13.7
 1// SPDX-License-Identifier: GPL-2.0-only
 2/*
 3 * Copyright (C) 2012 Regents of the University of California
 
 
 
 
 
 
 
 
 
 4 */
 5
 6#include <linux/reboot.h>
 7#include <linux/pm.h>
 
 8
 9static void default_power_off(void)
10{
11	while (1)
12		wait_for_interrupt();
13}
14
15void (*pm_power_off)(void) = NULL;
16EXPORT_SYMBOL(pm_power_off);
17
18void machine_restart(char *cmd)
19{
20	do_kernel_restart(cmd);
21	while (1);
22}
23
24void machine_halt(void)
25{
26	do_kernel_power_off();
27	default_power_off();
28}
29
30void machine_power_off(void)
31{
32	do_kernel_power_off();
33	default_power_off();
34}