这篇教程C++ sysfs_notify函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中sysfs_notify函数的典型用法代码示例。如果您正苦于以下问题:C++ sysfs_notify函数的具体用法?C++ sysfs_notify怎么用?C++ sysfs_notify使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了sysfs_notify函数的23个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: pil_set_statestatic void pil_set_state(struct pil_device *pil, enum pil_state state){ if (pil->state != state) { pil->state = state; sysfs_notify(&pil->dev.kobj, NULL, "state"); }}
开发者ID:Backspace-Dev,项目名称:htx21,代码行数:7,
示例2: vidioc_streamonstatic int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i){ struct omap24xxcam_fh *ofh = fh; struct omap24xxcam_device *cam = ofh->cam; int rval; mutex_lock(&cam->mutex); if (cam->streaming) { rval = -EBUSY; goto out; } rval = omap24xxcam_sensor_if_enable(cam); if (rval) { dev_dbg(cam->dev, "vidioc_int_g_ifparm failed/n"); goto out; } rval = videobuf_streamon(&ofh->vbq); if (!rval) { cam->streaming = file; sysfs_notify(&cam->dev->kobj, NULL, "streaming"); }out: mutex_unlock(&cam->mutex); return rval;}
开发者ID:Aaroneke,项目名称:galaxy-2636,代码行数:29,
示例3: headphone_detect_handlerstatic void headphone_detect_handler(struct work_struct *work){ struct imx_3stack_priv *priv = &card_priv; struct platform_device *pdev = priv->pdev; sysfs_notify(&pdev->dev.kobj, NULL, "headphone");}
开发者ID:YCsuperlife,项目名称:imx53_kernel,代码行数:7,
示例4: twl6030_usb_irqstatic irqreturn_t twl6030_usb_irq(int irq, void *_twl){ struct twl6030_usb *twl = _twl; int status; u8 vbus_state, hw_state; unsigned charger_type; hw_state = twl6030_readb(twl, TWL6030_MODULE_ID0, STS_HW_CONDITIONS); vbus_state = twl6030_readb(twl, TWL_MODULE_MAIN_CHARGE, CONTROLLER_STAT1); vbus_state = vbus_state & VBUS_DET; /* Ignore charger events other than VBUS */ if (vbus_state == twl->prev_vbus) return IRQ_HANDLED; if ((vbus_state) && !(hw_state & STS_USB_ID)) { regulator_enable(twl->usb3v3); charger_type = omap4_charger_detect(); if ((charger_type == POWER_SUPPLY_TYPE_USB_CDP) || (charger_type == POWER_SUPPLY_TYPE_USB)) { status = USB_EVENT_VBUS; twl->otg.default_a = false; twl->asleep = 1; twl->otg.state = OTG_STATE_B_IDLE; twl->linkstat = status; twl->otg.last_event = status; } else if (charger_type == POWER_SUPPLY_TYPE_USB_DCP) { regulator_disable(twl->usb3v3); status = USB_EVENT_CHARGER; twl->usb_cinlimit_mA = 1800; twl->otg.last_event = status; } else { regulator_disable(twl->usb3v3); goto vbus_notify; } atomic_notifier_call_chain(&twl->otg.notifier, status, &charger_type); } if (!vbus_state) { status = USB_EVENT_NONE; twl->linkstat = status; twl->otg.last_event = status; if (twl->asleep) { atomic_notifier_call_chain(&twl->otg.notifier, status, twl->otg.gadget); regulator_disable(twl->usb3v3); twl->asleep = 0; } } sysfs_notify(&twl->dev->kobj, NULL, "vbus");vbus_notify: twl->prev_vbus = vbus_state; return IRQ_HANDLED;}
开发者ID:kf-otterx,项目名称:kernel_omap_otter-common,代码行数:60,
示例5: proximity_sensor_value_changed_cbstatic int proximity_sensor_value_changed_cb( struct oem_rapi_client_streaming_func_cb_arg *arg, struct oem_rapi_client_streaming_func_cb_ret *ret){ struct prox_value_from_rpc_t { u32 sensor_value; u32 adc_value; } *args; if (arg && arg->event == OEM_RAPI_SERVER_EVENT_PROXIMITY_VALUE_CB && arg->in_len == sizeof(struct prox_value_from_rpc_t) && arg->input) { args = (struct prox_value_from_rpc_t *)arg->input; DBG(printk(KERN_DEBUG "%s (%s): sensor adc_value = %d, sensor value = %d./n", DEV_NAME, __func__, args->adc_value, args->sensor_value)); LOCK(); proximity.sensor_value = args->sensor_value; proximity.adc_value = args->adc_value; UNLOCK(); sysfs_notify(&proximity.semc_dev.dev->kobj, NULL, "sensor"); } else { if (arg) printk(KERN_ERR "%s (%s): " "got event %d, in_len %d, input->0x%x/n", DEV_NAME, __func__, arg->event, arg->in_len, (unsigned int)arg->input); else printk(KERN_ERR "%s (%s): Null arg pointer received/n", DEV_NAME, __func__); } return 0;}
开发者ID:emreharbutoglu,项目名称:Xperia-X10-Kernel-2.6.29,代码行数:35,
示例6: wait_for_fb_wake_showstatic ssize_t wait_for_fb_wake_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf){ char *s = buf; int ret; unsigned long irq_flags; spin_lock_irqsave(&fb_state_lock, irq_flags); if (fb_state == FB_STATE_REQUEST_STOP_DRAWING) { fb_state = FB_STATE_STOPPED_DRAWING; wake_up(&fb_state_wq); } spin_unlock_irqrestore(&fb_state_lock, irq_flags); ret = wait_event_interruptible(fb_state_wq, fb_state == FB_STATE_DRAWING_OK); if (ret && fb_state != FB_STATE_DRAWING_OK) return ret; else { s += sprintf(buf, "awake"); if (display == 0) { display = 1; sysfs_notify(power_kobj, NULL, "wait_for_fb_status"); } } return s - buf;}
开发者ID:GREYFOXRGR,项目名称:BPI-M3-bsp,代码行数:27,
示例7: twl6030_usb_irq_wq_funcstatic void twl6030_usb_irq_wq_func(struct work_struct *twl6030_usb_irq_wq)//static irqreturn_t twl6030_usb_irq_wq_func(int irq, void *_twl){ struct twl6030_usb *twl = tmp_twl;// hunsoo _twl; int status = USB_EVENT_NONE; int vbus_state, hw_state; hw_state = twl6030_readb(twl, TWL6030_MODULE_ID0, STS_HW_CONDITIONS); vbus_state = twl6030_readb(twl, TWL6030_MODULE_CHARGER, CONTROLLER_STAT1); /* AC unplugg can also generate this IRQ * we only call the notifier in case of VBUS change */ if (twl->prev_vbus != (vbus_state & VBUS_DET)) { if (!(hw_state & STS_USB_ID)) { if (vbus_state & VBUS_DET) status = USB_EVENT_VBUS; else status = USB_EVENT_NONE; if (status >= 0) { blocking_notifier_call_chain(&twl->otg.notifier, status, twl->otg.gadget); } } twl->linkstat = status; sysfs_notify(&twl->dev->kobj, NULL, "vbus"); } twl->prev_vbus = vbus_state & VBUS_DET; return IRQ_HANDLED;}
开发者ID:twagler,项目名称:LG_Waggle_Kernel,代码行数:35,
示例8: cpu_hotplug_storessize_tcpu_hotplug_store(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, size_t n){ sysfs_notify(hotplug_kobj, NULL, "cpu_hotplug"); return 0;}
开发者ID:BytecodeMe,项目名称:BCM-M7,代码行数:7,
示例9: twl4030_usb_irqstatic irqreturn_t twl4030_usb_irq(int irq, void *_twl){ struct twl4030_usb *twl = _twl; int status; status = twl4030_usb_linkstat(twl); if (status >= 0) { /* FIXME add a set_power() method so that B-devices can * configure the charger appropriately. It's not always * correct to consume VBUS power, and how much current to * consume is a function of the USB configuration chosen * by the host. * * REVISIT usb_gadget_vbus_connect(...) as needed, ditto * its disconnect() sibling, when changing to/from the * USB_LINK_VBUS state. musb_hdrc won't care until it * starts to handle softconnect right. */ if (status == USB_EVENT_NONE) twl4030_phy_suspend(twl, 0); else twl4030_phy_resume(twl); blocking_notifier_call_chain(&twl->otg.notifier, status, twl->otg.gadget); } sysfs_notify(&twl->dev->kobj, NULL, "vbus"); return IRQ_HANDLED;}
开发者ID:matianfu,项目名称:kunlun-kernel,代码行数:30,
示例10: mbox_rx_work/* * Message receiver(workqueue) */static void mbox_rx_work(struct work_struct *work){ struct omap_mbox_queue *mq = container_of(work, struct omap_mbox_queue, work); struct omap_mbox *mbox = mq->queue->queuedata; struct request_queue *q = mbox->rxq->queue; struct request *rq; mbox_msg_t msg; unsigned long flags; if (mbox->rxq->callback == NULL) { sysfs_notify(&mbox->dev.kobj, NULL, "mbox"); return; } while (1) { spin_lock_irqsave(q->queue_lock, flags); rq = elv_next_request(q); spin_unlock_irqrestore(q->queue_lock, flags); if (!rq) break; msg = (mbox_msg_t) rq->data; if (blk_end_request(rq, 0, 0)) BUG(); mbox->rxq->callback((void *)msg); }}
开发者ID:274914765,项目名称:C,代码行数:33,
示例11: touch_event_fnstatic void touch_event_fn(struct work_struct *work){ /* wakeup the userspace poll */ tc_ev_processed = 1; sysfs_notify(power_kobj, NULL, "touch_event"); return;}
开发者ID:ShinySide,项目名称:HispAsian_Kernel_NH7,代码行数:8,
示例12: touch_event_fnstatic void touch_event_fn(struct work_struct *work){ tc_ev_processed = 1; sysfs_notify(power_kobj, NULL, "touch_event"); return;}
开发者ID:jekapaty,项目名称:SebastianFM-kernel,代码行数:8,
示例13: notify_uspace_work_fnstatic void notify_uspace_work_fn(struct work_struct *work){ struct sleep_data *sleep_info = container_of(work, struct sleep_data, work); /* Notify polling threads on change of value */ sysfs_notify(sleep_info->kobj, NULL, "timer_expired");}
开发者ID:b-man,项目名称:hp-kernel-tenderloin-ubuntu,代码行数:8,
示例14: acpi_power_meter_notify/* Handle ACPI event notifications */static void acpi_power_meter_notify(struct acpi_device *device, u32 event){ struct acpi_power_meter_resource *resource; int res; if (!device || !acpi_driver_data(device)) return; resource = acpi_driver_data(device); mutex_lock(&resource->lock); switch (event) { case METER_NOTIFY_CONFIG: free_capabilities(resource); res = read_capabilities(resource); if (res) break; remove_attrs(resource); setup_attrs(resource); break; case METER_NOTIFY_TRIP: sysfs_notify(&device->dev.kobj, NULL, POWER_AVERAGE_NAME); update_meter(resource); break; case METER_NOTIFY_CAP: sysfs_notify(&device->dev.kobj, NULL, POWER_CAP_NAME); update_cap(resource); break; case METER_NOTIFY_INTERVAL: sysfs_notify(&device->dev.kobj, NULL, POWER_AVG_INTERVAL_NAME); update_avg_interval(resource); break; case METER_NOTIFY_CAPPING: sysfs_notify(&device->dev.kobj, NULL, POWER_ALARM_NAME); dev_info(&device->dev, "Capping in progress./n"); break; default: WARN(1, "Unexpected event %d/n", event); break; } mutex_unlock(&resource->lock); acpi_bus_generate_netlink_event(ACPI_POWER_METER_CLASS, dev_name(&device->dev), event, 0);}
开发者ID:BozkurTR,项目名称:kernel,代码行数:47,
示例15: stts751_alertstatic void stts751_alert(struct i2c_client *client, enum i2c_alert_protocol type, unsigned int data){ int ret; struct stts751_priv *priv = i2c_get_clientdata(client); if (type != I2C_PROTOCOL_SMBUS_ALERT) return; dev_dbg(&client->dev, "alert!"); mutex_lock(&priv->access_lock); ret = stts751_update_alert(priv); if (ret < 0) { /* default to worst case */ priv->max_alert = true; priv->min_alert = true; dev_warn(priv->dev, "Alert received, but can't communicate to the device. Triggering all alarms!"); } if (priv->max_alert) { if (priv->notify_max) dev_notice(priv->dev, "got alert for HIGH temperature"); priv->notify_max = false; /* unblock alert poll */ sysfs_notify(&priv->dev->kobj, NULL, "temp1_max_alarm"); } if (priv->min_alert) { if (priv->notify_min) dev_notice(priv->dev, "got alert for LOW temperature"); priv->notify_min = false; /* unblock alert poll */ sysfs_notify(&priv->dev->kobj, NULL, "temp1_min_alarm"); } if (priv->min_alert || priv->max_alert) kobject_uevent(&priv->dev->kobj, KOBJ_CHANGE); mutex_unlock(&priv->access_lock);}
开发者ID:Anjali05,项目名称:linux,代码行数:45,
示例16: mmpfb_vsync_notify_workstatic void mmpfb_vsync_notify_work(struct work_struct *work){ struct mmpfb_vsync *vsync = container_of(work, struct mmpfb_vsync, work); struct mmpfb_info *fbi = container_of(vsync, struct mmpfb_info, vsync); sysfs_notify(&fbi->dev->kobj, NULL, "vsync_ts");}
开发者ID:acorn-marvell,项目名称:brillo_pxa_kernel,代码行数:9,
示例17: headphone_detect_handlerstatic void headphone_detect_handler(struct work_struct *work){ struct imx_3stack_priv *priv = &machine_priv; struct platform_device *pdev = priv->pdev; struct wm8350 *wm8350 = priv->wm8350; sysfs_notify(&pdev->dev.kobj, NULL, "headphone"); wm8350_unmask_irq(wm8350, WM8350_IRQ_CODEC_JCK_DET_R);}
开发者ID:YCsuperlife,项目名称:imx53_kernel,代码行数:9,
示例18: rmidev_sysfs_irqstatic irqreturn_t rmidev_sysfs_irq(int irq, void *data){ struct synaptics_rmi4_data *rmi4_data = data; sysfs_notify(&rmi4_data->input_dev->dev.kobj, ATTRIBUTE_FOLDER_NAME, "attn_state"); return IRQ_HANDLED;}
开发者ID:GAXUSXX,项目名称:G935FGaXusKernel2,代码行数:9,
示例19: pm2xxx_charger_ac_workstatic void pm2xxx_charger_ac_work(struct work_struct *work){ struct pm2xxx_charger *pm2 = container_of(work, struct pm2xxx_charger, ac_work); power_supply_changed(pm2->ac_chg.psy); sysfs_notify(&pm2->ac_chg.psy->dev.kobj, NULL, "present");};
开发者ID:020gzh,项目名称:linux,代码行数:9,
示例20: dp_altmode_configuredstatic int dp_altmode_configured(struct dp_altmode *dp){ int ret; sysfs_notify(&dp->alt->dev.kobj, "displayport", "configuration"); if (!dp->data.conf) return typec_altmode_notify(dp->alt, TYPEC_STATE_USB, &dp->data); ret = dp_altmode_notify(dp); if (ret) return ret; sysfs_notify(&dp->alt->dev.kobj, "displayport", "pin_assignment"); return 0;}
开发者ID:avagin,项目名称:linux,代码行数:18,
示例21: bh1770_prox_read_result/* chip->mutex is kept when this is called */static int bh1770_prox_read_result(struct bh1770_chip *chip){ int ret; bool above; u8 mode; ret = i2c_smbus_read_byte_data(chip->client, BH1770_PS_DATA_LED1); if (ret < 0) goto out; if (ret > chip->prox_threshold_hw) above = true; else above = false; /* * when ALS levels goes above limit, proximity result may be * false proximity. Thus ignore the result. With real proximity * there is a shadow causing low als levels. */ if (chip->lux_data_raw > PROX_IGNORE_LUX_LIMIT) ret = 0; chip->prox_data = bh1770_psraw_to_adjusted(chip, ret); /* Strong proximity level or force mode requires immediate response */ if (chip->prox_data >= chip->prox_abs_thres || chip->prox_force_update) chip->prox_persistence_counter = chip->prox_persistence; chip->prox_force_update = false; /* Persistence filttering to reduce false proximity events */ if (likely(above)) { if (chip->prox_persistence_counter < chip->prox_persistence) { chip->prox_persistence_counter++; ret = -ENODATA; } else { mode = PROX_ABOVE_THRESHOLD; ret = 0; } } else { chip->prox_persistence_counter = 0; mode = PROX_BELOW_THRESHOLD; chip->prox_data = 0; ret = 0; } /* Set proximity detection rate based on above or below value */ if (ret == 0) { bh1770_prox_rate(chip, mode); sysfs_notify(&chip->client->dev.kobj, NULL, "prox0_raw"); }out: return ret;}
开发者ID:BORETS24,项目名称:common.git-android-4.4,代码行数:57,
示例22: pnpmgr_battery_charging_enabledint pnpmgr_battery_charging_enabled(int charging_enabled){ pr_debug("%s: result = %d/n", __func__, charging_enabled); if (charging_enabled_value != charging_enabled) { charging_enabled_value = charging_enabled; sysfs_notify(battery_kobj, NULL, "charging_enabled"); } return 0;}
开发者ID:Arc-Team,项目名称:android_kernel_htc_a11,代码行数:10,
示例23: def_work_fnstatic void def_work_fn(struct work_struct *work){ int64_t diff; diff = ktime_to_ns(ktime_get()) - rq_info.def_start_time; do_div(diff, 1000 * 1000); rq_info.def_interval = (unsigned int) diff; /* Notify polling threads on change of value */ sysfs_notify(rq_info.kobj, NULL, "def_timer_ms");}
开发者ID:b-man,项目名称:hp-kernel-tenderloin-ubuntu,代码行数:11,
注:本文中的sysfs_notify函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ sysfs_put函数代码示例 C++ sysfs_create_link函数代码示例 |