本文整理汇总了C++中pm_power_off函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_power_off函数的具体用法?C++ pm_power_off怎么用?C++ pm_power_off使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_power_off函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: machine_power_off
/*
* Power-off simply requires that the secondary CPUs stop performing any
* activity (executing tasks, handling interrupts). smp_send_stop()
* achieves this. When the system power is turned off, it will take all CPUs
* with it.
*/
void machine_power_off(void)
{
local_irq_disable();
smp_send_stop();
if (pm_power_off)
pm_power_off();
}
示例2: rk29_adc_battery_lowpower_check
static void rk29_adc_battery_lowpower_check(struct rk29_adc_battery_data *bat)
{
int i;
int level, oldlevel;
struct rk29_adc_battery_platform_data *pdata = bat->pdata;
printk("%s--%d:\n", __FUNCTION__, __LINE__);
old_charge_level = -1;
pSamples = bat->adc_samples;
adc_sync_read(bat->client); //start adc sample
level = oldlevel = rk29_adc_battery_status_samples(bat); //init charge status
/* Fill sample buffer with values */
bat->full_times = 0;
for (i = 0; i < NUM_VOLTAGE_SAMPLE; i++) //0.3 s
{
mdelay(1);
rk29_adc_battery_voltage_samples(bat); //get voltage
//level = rk29_adc_battery_status_samples(bat); //check charge status
level = rk29_adc_battery_get_charge_level(bat);
if (oldlevel != level)
{
oldlevel = level; //if charge status changed, reset sample
i = 0;
}
}
bat->bat_capacity = rk29_adc_battery_voltage_to_capacity(bat, bat->bat_voltageAvg);
bat->bat_status = POWER_SUPPLY_STATUS_NOT_CHARGING;
if (rk29_adc_battery_get_charge_level(bat))
{
bat->bat_status = POWER_SUPPLY_STATUS_CHARGING;
if (pdata->charge_ok_pin != INVALID_GPIO)
{
if (gpio_get_value(pdata->charge_ok_pin) == pdata->charge_ok_level)
{
bat->bat_status = POWER_SUPPLY_STATUS_FULL;
bat->bat_capacity = 100;
}
}
}
#if 0
rk29_adc_battery_poweron_capacity_check();
#else
poweron_check = 1;
#endif
/* Immediate power off for battery protection */
if (bat->bat_voltageAvg <= (pdata->adc_bat_levels[BATT_ZERO_VOL_IDX] + 50))
{
printk("%umV -> low battery: powerdown (%u)\n", bat->bat_voltageAvg, pdata->adc_bat_levels[BATT_ZERO_VOL_IDX]+50);
system_state = SYSTEM_POWER_OFF;
pm_power_off();
}
}
示例3: thermal_power_off
static void thermal_power_off(struct work_struct *work)
{
struct ab8500_temp *data = container_of(work, struct ab8500_temp,
power_off_work.work);
dev_warn(&data->pdev->dev, "Power off due to AB8500 thermal warning\n");
pm_power_off();
}
示例4: machine_power_off
void machine_power_off(void)
{
/* We really want to get pending console data out before we die. */
xencons_force_flush();
if (pm_power_off)
pm_power_off();
HYPERVISOR_shutdown(SHUTDOWN_poweroff);
}
示例5: machine_power_off
void machine_power_off(void)
{
/* We really want to get pending console data out before we die. */
xencons_force_flush();
#if defined(__i386__) || defined(__x86_64__)
if (pm_power_off)
pm_power_off();
#endif
HYPERVISOR_shutdown(SHUTDOWN_poweroff);
}
示例6: native_machine_power_off
static void native_machine_power_off(void)
{
if (pm_power_off) {
if (!reboot_force)
machine_shutdown();
pm_power_off();
}
/* A fallback in case there is no PM info available */
tboot_shutdown(TB_SHUTDOWN_HALT);
}
示例7: machine_power_off
void machine_power_off(void)
{
if (pm_power_off)
pm_power_off();
#ifdef CONFIG_SMP
preempt_disable();
smp_send_stop();
#endif
local_irq_disable();
while (1);
}
示例8: machine_power_off
/*
* This routine is called from sys_reboot to actually turn off the
* machine
*/
void machine_power_off(void)
{
/* If there is a registered power off handler, call it. */
if(pm_power_off)
pm_power_off();
/* Put the soft power button back under hardware control.
* If the user had already pressed the power button, the
* following call will immediately power off. */
pdc_soft_power_button(0);
/* It seems we have no way to power the system off via
* software. The user has to press the button himself. */
printk(KERN_EMERG "System shut down completed.\n"
KERN_EMERG "Please power this system off now.");
}
示例9: rockchip_tsadc_auto_ht_work
void rockchip_tsadc_auto_ht_work(struct work_struct *work)
{
int ret,val;
// printk("%s,line=%d\n", __func__,__LINE__);
mutex_lock(&tsadc_mutex);
val = tsadc_readl(TSADC_INT_PD);
tsadc_writel(val &(~ (1 <<8) ), TSADC_INT_PD);
ret = tsadc_readl(TSADC_INT_PD);
tsadc_writel(ret | 0xff, TSADC_INT_PD); //clr irq status
if ((val & 0x0f) != 0){
printk("rockchip tsadc is over temp . %s,line=%d\n", __func__,__LINE__);
pm_power_off(); //power_off
}
mutex_unlock(&tsadc_mutex);
}
示例10: native_machine_power_off
static void native_machine_power_off(void)
{
#ifdef CONFIG_X86_INTEL_CE_GEN3
machine_shutdown();
while (1) {
outb(0x4, 0xcf9);
udelay(50);
}
#else
if (pm_power_off) {
if (!reboot_force)
machine_shutdown();
pm_power_off();
}
/* A fallback in case there is no PM info available */
tboot_shutdown(TB_SHUTDOWN_HALT);
#endif
}
示例11: process_shutdown
static void process_shutdown(void)
{
if (shutdown_timer == 0)
printk(KERN_ALERT KTHREAD_NAME ": Shutdown requested...\n");
shutdown_timer++;
/* */
if (shutdown_timer == (POWERSWITCH_DOWN_SEC*POWERSWITCH_POLL_PER_SEC)) {
static const char msg[] = "Shutting down...";
printk(KERN_INFO KTHREAD_NAME ": %s\n", msg);
lcd_print(msg);
/* */
if (kill_cad_pid(SIGINT, 1)) {
/* */
if (pm_power_off)
pm_power_off();
}
}
}
示例12: lpm_mode_check
static void lpm_mode_check(struct battery_data *battery)
{
extern int charging_mode_from_boot;
pr_info("%s : charging_mode_from_boot(%d), ta_connected(%d)\n",
__func__, charging_mode_from_boot, check_ta_conn(battery));
if (!charging_mode_from_boot)
return;
if (check_ta_conn(battery)) {
battery->charging_mode_booting = 1;
lpm_mode_flag = 1;
pr_info("%s : charging_mode_booting(%d)\n", __func__,
battery->charging_mode_booting);
} else {
pr_info("%s: ta no longer connected, powering off\n", __func__);
if (pm_power_off)
pm_power_off();
}
}
示例13: process_shutdown
/* check, give feedback and start shutdown after one second */
static void process_shutdown(void)
{
if (shutdown_timer == 0)
printk(KERN_ALERT KTHREAD_NAME ": Shutdown requested...\n");
shutdown_timer++;
/* wait until the button was pressed for 1 second */
if (shutdown_timer == (POWERSWITCH_DOWN_SEC*POWERSWITCH_POLL_PER_SEC)) {
static const char msg[] = "Shutting down...";
printk(KERN_INFO KTHREAD_NAME ": %s\n", msg);
lcd_print(msg);
/* send kill signal */
if (kill_cad_pid(SIGINT, 1)) {
/* just in case killing init process failed */
if (pm_power_off)
pm_power_off();
}
}
}
示例14: __suspend_enter
static void __suspend_enter(enum suspend_state_t state)
{
__record_dbg_status(PM_SUSPEND_ENTER | 5);
if (HAL_Wakeup_SetSrc(1))
return ;
__record_dbg_status(PM_SUSPEND_ENTER | 6);
debug_jtag_deinit();
PM_LOGN("device info. rst:%x clk:%x\n", CCM->BUS_PERIPH_RST_CTRL,
CCM->BUS_PERIPH_CLK_CTRL); /* debug info. */
PM_SetCPUBootArg((uint32_t)&vault_arm_registers);
if (state >= PM_MODE_HIBERNATION) {
__record_dbg_status(PM_SUSPEND_ENTER | 7);
PM_SetCPUBootArg(PM_MODE_MAGIC | state);
#ifdef __CONFIG_ARCH_APP_CORE
HAL_Wakeup_SetIOHold((1 << WAKEUP_IO_MAX) - 1);
#endif
pm_power_off(PM_SHUTDOWN); /* never return */
} else if (state < PM_MODE_STANDBY) {
__record_dbg_status(PM_SUSPEND_ENTER | 8);
/* TODO: set system bus to low freq */
__cpu_sleep(state);
/* TODO: restore system bus to normal freq */
} else {
__record_dbg_status(PM_SUSPEND_ENTER | 9);
__cpu_suspend(state);
}
PM_BUG_ON(!PM_IRQ_GET_FLAGS());
__record_dbg_status(PM_SUSPEND_ENTER | 0xa);
debug_jtag_init();
__record_dbg_status(PM_SUSPEND_ENTER | 0xb);
HAL_Wakeup_ClrSrc(1);
}
示例15: max8998_set_cable
static void max8998_set_cable(struct max8998_charger_callbacks *ptr,
enum cable_type_t status)
{
struct chg_data *chg = container_of(ptr, struct chg_data, callbacks);
chg->cable_status = status;
chg->lowbat_warning = false;
if (chg->esafe == MAX8998_ESAFE_ALLOFF)
chg->esafe = MAX8998_USB_VBUS_AP_ON;
bat_info("%s : cable_status(%d) esafe(%d)\n", __func__, status, chg->esafe);
if (lpm_charging_mode &&
(max8998_check_vdcin(chg) != 1) &&
pm_power_off)
pm_power_off();
power_supply_changed(&chg->psy_ac);
power_supply_changed(&chg->psy_usb);
wake_lock(&chg->work_wake_lock);
queue_work(chg->monitor_wqueue, &chg->bat_work);
}