• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ pm_power_off函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中pm_power_off函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_power_off函数的具体用法?C++ pm_power_off怎么用?C++ pm_power_off使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了pm_power_off函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:EMFPGA,项目名称:linux_media,代码行数:13,代码来源:process.c


示例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();
	}
}
开发者ID:Astralix,项目名称:rk29_kernel_308,代码行数:59,代码来源:rk29_adc_battery.c


示例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();
}
开发者ID:FreeProjectAce,项目名称:i8160-kernel,代码行数:8,代码来源:ab8500.c


示例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);
}
开发者ID:xf739645524,项目名称:kernel-rhel5,代码行数:8,代码来源:reboot.c


示例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);
}
开发者ID:BackupTheBerlios,项目名称:arp2-svn,代码行数:10,代码来源:reboot.c


示例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);
}
开发者ID:AD5GB,项目名称:wicked_kernel_lge_hammerhead,代码行数:10,代码来源:reboot.c


示例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);
}
开发者ID:0-T-0,项目名称:ps4-linux,代码行数:12,代码来源:reset.c


示例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.");
}
开发者ID:muromec,项目名称:linux-ezxdev,代码行数:21,代码来源:process.c


示例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);
}
开发者ID:Dee-UK,项目名称:RK3288_Lollipop_Kernel,代码行数:18,代码来源:rockchip_tsadc.c


示例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
}
开发者ID:lihui2090,项目名称:barcelona-4.3.3,代码行数:18,代码来源:reboot.c


示例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();
		}
	}
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:21,代码来源:power.c


示例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();
	}
}
开发者ID:Jb2005,项目名称:SamSung-Galaxy-Tab-10.1-Model-GT-P7510,代码行数:21,代码来源:p3_battery.c


示例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();
		}
	}
}
开发者ID:020gzh,项目名称:linux,代码行数:22,代码来源:power.c


示例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);
}
开发者ID:diguokaituozhe,项目名称:XR871,代码行数:39,代码来源:pm.c


示例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);
}
开发者ID:figue,项目名称:semaphore,代码行数:22,代码来源:s5pc110_battery.c


示例16: native_machine_power_off

static void native_machine_power_off(void)
{
	if (pm_power_off)
		pm_power_off();
}
开发者ID:150balbes,项目名称:Amlogic_s905-kernel,代码行数:5,代码来源:reboot.c


示例17: xen_machine_power_off

static void xen_machine_power_off(void)
{
	if (pm_power_off)
		pm_power_off();
	xen_reboot(SHUTDOWN_poweroff);
}
开发者ID:PivotalBigData,项目名称:PivotalHD,代码行数:6,代码来源:enlighten.c


示例18: machine_power_off

void machine_power_off(void)
{
	machine_shutdown();
	if (pm_power_off)
		pm_power_off();
}
开发者ID:CertainlyT,项目名称:Time_Kernel-stock-VEGA-LTE-A-,代码行数:6,代码来源:process.c


示例19: machine_power_off

void machine_power_off(void)
{
	if (pm_power_off)
		pm_power_off();
}
开发者ID:CCNITSilchar,项目名称:linux,代码行数:5,代码来源:process.c


示例20: machine_halt

void machine_halt(void)
{
	pm_power_off();
}
开发者ID:avagin,项目名称:linux,代码行数:4,代码来源:reset.c



注:本文中的pm_power_off函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ pm_prepare_console函数代码示例发布时间:2022-05-30
下一篇:
C++ pm_openr函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap