本文整理汇总了C++中round_jiffies_relative函数的典型用法代码示例。如果您正苦于以下问题:C++ round_jiffies_relative函数的具体用法?C++ round_jiffies_relative怎么用?C++ round_jiffies_relative使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了round_jiffies_relative函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: msi_laptop_i8042_filter
static bool msi_laptop_i8042_filter(unsigned char data, unsigned char str,
struct serio *port)
{
static bool extended;
if (str & 0x20)
return false;
/* 0x54 wwan, 0x62 bluetooth, 0x76 wlan, 0xE4 touchpad toggle*/
if (unlikely(data == 0xe0)) {
extended = true;
return false;
} else if (unlikely(extended)) {
extended = false;
switch (data) {
case 0xE4:
schedule_delayed_work(&msi_touchpad_work,
round_jiffies_relative(0.5 * HZ));
break;
case 0x54:
case 0x62:
case 0x76:
schedule_delayed_work(&msi_rfkill_work,
round_jiffies_relative(0.5 * HZ));
break;
}
}
return false;
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:30,代码来源:msi-laptop.c
示例2: idtp9017_resume
static void idtp9017_resume(struct device *dev) {
// struct i2c_client *client = to_i2c_client(dev);
// struct idtp9017_chip *chip = i2c_get_clientdata(client);
pr_info("[WLC] wlc_resume\n");
the_chip->suspend = false;
schedule_delayed_work(&the_chip->wlc_status_work, round_jiffies_relative(
msecs_to_jiffies(500)));
#ifdef CONFIG_LGE_PM_CHARGING_USING_CHGSTS_WLC
schedule_delayed_work(&chip->update_soc_worker, round_jiffies_relative
(msecs_to_jiffies(500)));
#endif
}
开发者ID:KAsp3rd,项目名称:android_kernel_lge_msm8992,代码行数:14,代码来源:idtp9017_wireless_power_receiver.c
示例3: handle_dc_inout
static inline void handle_dc_inout(struct smb349_dual_charger *chip,
int present)
{
if (chip->chg_present != present) {
chip->chg_present = present;
power_supply_changed(&chip->cradle_psy);
if (present) {
dev_dbg(chip->dev, "DC IN\n");
smb349_hw_init(chip);
smb349_pm_stay_awake(chip, PM_SMB349_DC_INSERTED);
schedule_delayed_work(
&chip->periodic_charge_handler_dwork,
round_jiffies_relative(
msecs_to_jiffies(PERIODIC_DELAY_MS)));
notify_external_charger(chip, 0);
dev_dbg(chip->dev, "Periodic work started\n");
} else {
dev_dbg(chip->dev, "DC OUT\n");
cancel_delayed_work(
&chip->periodic_charge_handler_dwork);
smb349_pm_relax(chip, PM_SMB349_DC_INSERTED);
notify_external_charger(chip, 1);
dev_dbg(chip->dev, "Periodic work stopped\n");
}
}
}
开发者ID:Menpiko,项目名称:SnaPKernel-N6P,代码行数:27,代码来源:smb349-dual-charger.c
示例4: init_nonfatal_mce_checker
static int __init init_nonfatal_mce_checker(void)
{
struct cpuinfo_x86 *c = &boot_cpu_data;
/* Check for MCE support */
if (!cpu_has(c, X86_FEATURE_MCE))
return -ENODEV;
/* Check for PPro style MCA */
if (!cpu_has(c, X86_FEATURE_MCA))
return -ENODEV;
/* Some Athlons misbehave when we frob bank 0 */
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD &&
boot_cpu_data.x86 == 6)
firstbank = 1;
else
firstbank = 0;
/*
* Check for non-fatal errors every MCE_RATE s
*/
schedule_delayed_work(&mce_work, round_jiffies_relative(MCE_RATE));
printk(KERN_INFO "Machine check exception polling timer started.\n");
return 0;
}
开发者ID:LouZiffer,项目名称:m900_kernel_cupcake-SDX,代码行数:26,代码来源:non-fatal.c
示例5: rfkill_init
static int rfkill_init(struct platform_device *sdev)
{
/* add rfkill */
int retval;
/* keep the hardware wireless state */
get_wireless_state_ec_standard();
rfk_bluetooth = rfkill_alloc("msi-bluetooth", &sdev->dev,
RFKILL_TYPE_BLUETOOTH,
&rfkill_bluetooth_ops, NULL);
if (!rfk_bluetooth) {
retval = -ENOMEM;
goto err_bluetooth;
}
retval = rfkill_register(rfk_bluetooth);
if (retval)
goto err_bluetooth;
rfk_wlan = rfkill_alloc("msi-wlan", &sdev->dev, RFKILL_TYPE_WLAN,
&rfkill_wlan_ops, NULL);
if (!rfk_wlan) {
retval = -ENOMEM;
goto err_wlan;
}
retval = rfkill_register(rfk_wlan);
if (retval)
goto err_wlan;
if (threeg_exists) {
rfk_threeg = rfkill_alloc("msi-threeg", &sdev->dev,
RFKILL_TYPE_WWAN, &rfkill_threeg_ops, NULL);
if (!rfk_threeg) {
retval = -ENOMEM;
goto err_threeg;
}
retval = rfkill_register(rfk_threeg);
if (retval)
goto err_threeg;
}
/* schedule to run rfkill state initial */
schedule_delayed_work(&msi_rfkill_init,
round_jiffies_relative(1 * HZ));
return 0;
err_threeg:
rfkill_destroy(rfk_threeg);
if (rfk_wlan)
rfkill_unregister(rfk_wlan);
err_wlan:
rfkill_destroy(rfk_wlan);
if (rfk_bluetooth)
rfkill_unregister(rfk_bluetooth);
err_bluetooth:
rfkill_destroy(rfk_bluetooth);
return retval;
}
开发者ID:119-org,项目名称:hi3518-osdrv,代码行数:60,代码来源:msi-laptop.c
示例6: sta32x_watchdog_start
static void sta32x_watchdog_start(struct sta32x_priv *sta32x)
{
if (sta32x->pdata->needs_esd_watchdog) {
sta32x->shutdown = 0;
schedule_delayed_work(&sta32x->watchdog_work,
round_jiffies_relative(HZ));
}
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:8,代码来源:sta32x.c
示例7: iwl_mvm_enter_ctkill
static void iwl_mvm_enter_ctkill(struct iwl_mvm *mvm)
{
u32 duration = mvm->thermal_throttle.params->ct_kill_duration;
IWL_ERR(mvm, "Enter CT Kill\n");
iwl_mvm_set_hw_ctkill_state(mvm, true);
schedule_delayed_work(&mvm->thermal_throttle.ct_kill_exit,
round_jiffies_relative(duration * HZ));
}
开发者ID:Kanel,项目名称:CloudMAC-VAP-Driver,代码行数:9,代码来源:tt.c
示例8: sta32x_watchdog_start
static void sta32x_watchdog_start(struct sta32x_priv *sta32x)
{
if (sta32x->pdata->needs_esd_watchdog) {
sta32x->shutdown = 0;
queue_delayed_work(system_power_efficient_wq,
&sta32x->watchdog_work,
round_jiffies_relative(HZ));
}
}
开发者ID:383530895,项目名称:linux,代码行数:9,代码来源:sta32x.c
示例9: adkey_input_queue_work
static void adkey_input_queue_work(struct adgpio_key_data *adkey)
{
unsigned long delay;
delay = msecs_to_jiffies(adkey->poll_interval);
if (delay >= HZ)
delay = round_jiffies_relative(delay);
queue_delayed_work(system_freezable_wq, &adkey->work, delay);
}
开发者ID:gurkamalsingh88,项目名称:Lamobo-D1,代码行数:10,代码来源:akad-keys.c
示例10: input_polldev_queue_work
static void input_polldev_queue_work(struct input_polled_dev *dev)
{
unsigned long delay;
delay = msecs_to_jiffies(dev->poll_interval);
if (delay >= HZ)
delay = round_jiffies_relative(delay);
queue_delayed_work(system_freezable_wq, &dev->work, delay);
}
开发者ID:AlexShiLucky,项目名称:linux,代码行数:10,代码来源:input-polldev.c
示例11: wlc_eoc_work
static void wlc_eoc_work(struct work_struct *work)
{
struct rt9536_chip *rt9536_chg = container_of(work, struct rt9536_chip,
wireless_eoc_work);
pr_err("[RT9536] %s \n", __func__);
rt9536_chg->chg_done = 1;
if (rt9536_set_charger_enable(rt9536_chg, 0)) {
pr_err("%s : charger enable fail!!!\n", __func__);
}
power_supply_changed(&rt9536_chg->charger);
if (wake_lock_active(&rt9536_chg->wl))
wake_unlock(&rt9536_chg->wl);
#if 0
int chg_state = 0;
int wlc_connect_state = 0;
struct rt9536_chip *rt9536_chg = container_of(work, struct rt9536_chip,
wireless_eoc_work.work);
pr_err("[RT9536] %s \n", __func__);
chg_state = wlc_check_irq_pin(rt9536_chg);
wlc_connect_state = wlc_is_connected();
if (chg_state) {
if (wlc_connect_state == 1) {
power_supply_changed(&rt9536_chg->charger);
rt9536_chg->chg_done = 1;
} else {
schedule_delayed_work(&rt9536_chg->wireless_set_offline_work,
round_jiffies_relative(msecs_to_jiffies(500)));
}
} else {
schedule_delayed_work(&rt9536_chg->wireless_set_online_work,
round_jiffies_relative(msecs_to_jiffies(500)));
}
/* msleep(3500);
gpio_set_value(rt9536_chg->pdata->wlc_chg_full_pin,0);
rt9536_chg->chg_done=1;
rt9536_set_charger_enable(0); // temp */
#endif
return;
}
开发者ID:Vagelis1608,项目名称:-V-_Kernel_2,代码行数:43,代码来源:rt9536_charger.c
示例12: smb349_chg_stat_handler
static irqreturn_t smb349_chg_stat_handler(int irq, void *dev_id)
{
struct smb349_dual_charger *chip = dev_id;
smb349_pm_stay_awake(chip, PM_SMB349_IRQ_HANDLING);
schedule_delayed_work(&chip->irq_handler_dwork,
round_jiffies_relative(msecs_to_jiffies(DELAY_IRQ_LEVEL_MS)));
return IRQ_HANDLED;
}
开发者ID:Menpiko,项目名称:SnaPKernel-N6P,代码行数:10,代码来源:smb349-dual-charger.c
示例13: __tsc200x_enable
/* must be called with ts->mutex held */
static void __tsc200x_enable(struct tsc200x *ts)
{
tsc200x_start_scan(ts);
if (ts->esd_timeout && (ts->set_reset || ts->reset_gpio)) {
ts->last_valid_interrupt = jiffies;
schedule_delayed_work(&ts->esd_work,
round_jiffies_relative(
msecs_to_jiffies(ts->esd_timeout)));
}
}
开发者ID:ChineseDr,项目名称:linux,代码行数:12,代码来源:tsc200x-core.c
示例14: pwronoff_trigger_store
static ssize_t pwronoff_trigger_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t count)
{
sscanf(buf, "%d\n", &pwr_on_trigger);
if (!s_pwrkey)
return 0;
schedule_delayed_work(&s_pwrkey->power_key_emulation_work, round_jiffies_relative(msecs_to_jiffies(pwrkey_delay_ms)));
return count;
}
开发者ID:Pantech-Discover,项目名称:android_kernel_pantech_oscar,代码行数:11,代码来源:pmic8xxx-pwrkey-emulation.c
示例15: tsc200x_esd_work
static void tsc200x_esd_work(struct work_struct *work)
{
struct tsc200x *ts = container_of(work, struct tsc200x, esd_work.work);
int error;
unsigned int r;
if (!mutex_trylock(&ts->mutex)) {
/*
* If the mutex is taken, it means that disable or enable is in
* progress. In that case just reschedule the work. If the work
* is not needed, it will be canceled by disable.
*/
goto reschedule;
}
if (time_is_after_jiffies(ts->last_valid_interrupt +
msecs_to_jiffies(ts->esd_timeout)))
goto out;
/* We should be able to read register without disabling interrupts. */
error = regmap_read(ts->regmap, TSC200X_REG_CFR0, &r);
if (!error &&
!((r ^ TSC200X_CFR0_INITVALUE) & TSC200X_CFR0_RW_MASK)) {
goto out;
}
/*
* If we could not read our known value from configuration register 0
* then we should reset the controller as if from power-up and start
* scanning again.
*/
dev_info(ts->dev, "TSC200X not responding - resetting\n");
disable_irq(ts->irq);
del_timer_sync(&ts->penup_timer);
tsc200x_update_pen_state(ts, 0, 0, 0);
tsc200x_set_reset(ts, false);
usleep_range(100, 500); /* only 10us required */
tsc200x_set_reset(ts, true);
enable_irq(ts->irq);
tsc200x_start_scan(ts);
out:
mutex_unlock(&ts->mutex);
reschedule:
/* re-arm the watchdog */
schedule_delayed_work(&ts->esd_work,
round_jiffies_relative(
msecs_to_jiffies(ts->esd_timeout)));
}
开发者ID:ChineseDr,项目名称:linux,代码行数:53,代码来源:tsc200x-core.c
示例16: uv_mntn_work
static void uv_mntn_work(struct work_struct *work)
{
char battery_capacity_info[16] = {0};
PMIC_MNTN_DESC *pmic_mntn = NULL;
long battery_capacity = 0;
mm_segment_t fs = 0;
struct irq_desc *desc = NULL ;
/* 0:mask; 1:unmask; 2:undefined */
static int uv_irq_flag = 2;
static int battery_info_fd = -1;
pmic_mntn = container_of(work, PMIC_MNTN_DESC, uv_mntn_delayed_work.work);
desc = irq_to_desc(pmic_mntn->uv_irq);
if (!desc) {
pr_err("[%s]irq_to_desc failed\n", __func__);
return ;
}
fs = get_fs();
set_fs(KERNEL_DS);
if (battery_info_fd < 0) {
battery_info_fd = sys_open(PATH_BATTERY_CAPACITY, O_RDONLY, 0);
}
if (battery_info_fd >= 0) {
sys_lseek(battery_info_fd, 0, SEEK_SET);
if (sys_read(battery_info_fd, battery_capacity_info, sizeof(battery_capacity_info)) < 0) {
sys_close(battery_info_fd);
battery_info_fd = -1;
}
}
set_fs(fs);
kstrtol(battery_capacity_info, 0, &battery_capacity);
if ((battery_capacity >= pmic_mntn->bat_cap_info.bat_cap_threshold)) {
if (1 != uv_irq_flag) {
pr_info("unmask uv irq,battery_capacity:%ld\n", battery_capacity);
if (NULL != desc->irq_data.chip->irq_unmask)
desc->irq_data.chip->irq_unmask(&desc->irq_data);
uv_irq_flag = 1;
}
} else {
if ((0 != uv_irq_flag)) {
pr_info("mask uv irq,battery_capacity:%ld\n", battery_capacity);
if (NULL != desc->irq_data.chip->irq_mask)
desc->irq_data.chip->irq_mask(&desc->irq_data);
uv_irq_flag = 0;
}
}
schedule_delayed_work(&pmic_mntn->uv_mntn_delayed_work,
round_jiffies_relative(msecs_to_jiffies(pmic_mntn->bat_cap_info.check_interval)));
}
开发者ID:XePeleato,项目名称:android_kernel_huawei_venus,代码行数:53,代码来源:hisi_pmic_mntn.c
示例17: __schedule_delayed
/*
* Reschedule delayed work timer.
*/
static void __schedule_delayed(struct ceph_mon_client *monc)
{
unsigned long delay;
if (monc->hunting)
delay = CEPH_MONC_HUNT_INTERVAL * monc->hunt_mult;
else
delay = CEPH_MONC_PING_INTERVAL;
dout("__schedule_delayed after %lu\n", delay);
mod_delayed_work(system_wq, &monc->delayed_work,
round_jiffies_relative(delay));
}
开发者ID:acton393,项目名称:linux,代码行数:16,代码来源:mon_client.c
示例18: input_polled_device_work
static void input_polled_device_work(struct work_struct *work)
{
struct input_polled_dev *dev =
container_of(work, struct input_polled_dev, work.work);
unsigned long delay;
dev->poll(dev);
delay = msecs_to_jiffies(dev->poll_interval);
if (delay >= HZ)
delay = round_jiffies_relative(delay);
queue_delayed_work(polldev_wq, &dev->work, delay);
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:14,代码来源:input-polldev.c
示例19: qpnp_iadc_work
static void qpnp_iadc_work(struct work_struct *work)
{
struct qpnp_iadc_drv *iadc = qpnp_iadc;
int rc = 0;
rc = qpnp_iadc_calibrate_for_trim();
if (rc)
pr_debug("periodic IADC calibration failed\n");
else
schedule_delayed_work(&iadc->iadc_work,
round_jiffies_relative(msecs_to_jiffies
(QPNP_IADC_CALIB_SECONDS)));
return;
}
开发者ID:YuechengLi,项目名称:Kernel-Honami-14.1.N.0.52,代码行数:14,代码来源:qpnp-adc-current.c
示例20: qpnp_iadc_work
static void qpnp_iadc_work(struct work_struct *work)
{
struct qpnp_iadc_chip *iadc = container_of(work,
struct qpnp_iadc_chip, iadc_work.work);
int rc = 0;
if (!iadc->skip_auto_calibrations) {
rc = qpnp_iadc_calibrate_for_trim(iadc, true);
if (rc)
pr_debug("periodic IADC calibration failed\n");
}
schedule_delayed_work(&iadc->iadc_work,
round_jiffies_relative(msecs_to_jiffies
(QPNP_IADC_CALIB_SECONDS)));
return;
}
开发者ID:GalaxyTab4,项目名称:android_kernel_samsung_matissewifi.bak,代码行数:17,代码来源:qpnp-adc-current.c
注:本文中的round_jiffies_relative函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论