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

C++ sensors_unregister函数代码示例

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

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



在下文中一共展示了sensors_unregister函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: cm36686_i2c_remove

static int cm36686_i2c_remove(struct i2c_client *client)
{
	struct cm36686_data *cm36686 = i2c_get_clientdata(client);

	/* free irq */
	if (cm36686->power_state & PROXIMITY_ENABLED) {
		disable_irq_wake(cm36686->irq);
		disable_irq(cm36686->irq);
	}
	free_irq(cm36686->irq, cm36686);
	gpio_free(cm36686->pdata->irq);

	/* device off */
	if (cm36686->power_state & LIGHT_ENABLED)
		cm36686_light_disable(cm36686);
	if (cm36686->power_state & PROXIMITY_ENABLED) {
		cm36686_i2c_write_word(cm36686, REG_PS_CONF1,
					   0x0001);
	}

	/* destroy workqueue */
	destroy_workqueue(cm36686->light_wq);
	destroy_workqueue(cm36686->prox_wq);

	/* sysfs destroy */
	sensors_unregister(cm36686->light_dev, light_sensor_attrs);
	sensors_unregister(cm36686->proximity_dev, prox_sensor_attrs);
	sensors_remove_symlink(&cm36686->light_input_dev->dev.kobj,
			cm36686->light_input_dev->name);
	sensors_remove_symlink(&cm36686->proximity_input_dev->dev.kobj,
			cm36686->proximity_input_dev->name);

	/* input device destroy */
	sysfs_remove_group(&cm36686->light_input_dev->dev.kobj,
				&light_attribute_group);
	input_unregister_device(cm36686->light_input_dev);
	sysfs_remove_group(&cm36686->proximity_input_dev->dev.kobj,
				&proximity_attribute_group);
	input_unregister_device(cm36686->proximity_input_dev);
#if defined(CONFIG_SENSORS_CM36686_LEDA_EN_GPIO)
	cm36686_leden_gpio_onoff(cm36686, 0);
	gpio_free(cm36686->pdata->leden_gpio);
#else
	prox_led_onoff(cm36686, 0);
#endif

	/* lock destroy */
	mutex_destroy(&cm36686->read_lock);
	mutex_destroy(&cm36686->power_lock);
	wake_lock_destroy(&cm36686->prx_wake_lock);

	kfree(cm36686);

	return 0;
}
开发者ID:thanhltd,项目名称:android_kernel_sm_g800h_kk,代码行数:55,代码来源:cm36686.c


示例2: remove_pressure_factorytest

void remove_pressure_factorytest(struct ssp_data *data)
{
#if defined (LPS25H_REV)
	if(data->ap_rev >= LPS25H_REV)
		sensors_unregister(data->prs_device, pressure_attrs_lps25h);
	else
		sensors_unregister(data->prs_device, pressure_attrs);
#else
	sensors_unregister(data->prs_device, pressure_attrs);
#endif
}
开发者ID:Svard73,项目名称:SM-T700-T705-Kernel,代码行数:11,代码来源:pressure_bmp182.c


示例3: gp2a_shutdown

static void gp2a_shutdown(struct i2c_client *client)
{
	struct gp2a_data *data = i2c_get_clientdata(client);

	pr_info("%s, is called\n", __func__);

	if (data->light_enabled) {
		cancel_delayed_work_sync(&data->light_work);
		lightsensor_onoff(0, data);

		input_report_rel(data->light_input_dev, REL_MISC,
			data->lux + 1);
		input_sync(data->light_input_dev);
	}

	if (data->prox_enabled) {
		disable_irq(data->irq);
		disable_irq_wake(data->irq);
		gp2a_prox_onoff(0, data);
		wake_unlock(&data->prx_wake_lock);
	}
	wake_lock_destroy(&data->prx_wake_lock);

	mutex_destroy(&data->light_mutex);
	mutex_destroy(&data->data_mutex);
 
	sensors_unregister(data->prox_sensor_device, prox_sensor_attrs);
	sensors_unregister(data->light_sensor_device, light_sensor_attrs);

	sysfs_remove_group(&data->prox_input_dev->dev.kobj,
			&gp2a_prox_attribute_group);
	sensors_remove_symlink(&data->prox_input_dev->dev.kobj,
			data->prox_input_dev->name);
	input_unregister_device(data->prox_input_dev);
	input_free_device(data->prox_input_dev);

	gpio_free(data->gpio);

	sysfs_remove_group(&data->light_input_dev->dev.kobj,
			&gp2a_light_attribute_group);
	sensors_remove_symlink(&data->light_input_dev->dev.kobj,
			data->light_input_dev->name);
	input_unregister_device(data->light_input_dev);
	input_free_device(data->light_input_dev);

	sensor_power_on_vdd(data, 0);
	kfree(data);
	bShutdown = true;
}
开发者ID:Serranove,项目名称:android_kernel_samsung_serranovelte,代码行数:49,代码来源:gp2ap030.c


示例4: cm3323_remove

static int __devexit cm3323_remove(struct i2c_client *client)
{
	struct cm3323_p *data = i2c_get_clientdata(client);

	/* device off */
	if (data->power_state & LIGHT_ENABLED)
		cm3323_light_disable(data);

	/* destroy workqueue */
	destroy_workqueue(data->light_wq);

	/* lock destroy */
	mutex_destroy(&data->read_lock);
	mutex_destroy(&data->power_lock);

	/* sysfs destroy */
	sensors_unregister(data->light_dev, sensor_attrs);
	sensors_remove_symlink(&data->input->dev.kobj, data->input->name);

	/* input device destroy */
	sysfs_remove_group(&data->input->dev.kobj, &light_attribute_group);
	input_unregister_device(data->input);
	kfree(data);

	return 0;
}
开发者ID:android-armv7a-belalang-tempur,项目名称:N900-Exynos-kernel-4.3,代码行数:26,代码来源:cm3323.c


示例5: uv_shutdown

static void uv_shutdown(struct platform_device *pdev)
{
	struct uv_info *uv = dev_get_drvdata(&pdev->dev);

	pr_info("%s+\n", __func__);
	if (uv->onoff) {
		hrtimer_cancel(&uv->uv_timer);
		cancel_work_sync(&uv->work_uv);
	}
	destroy_workqueue(uv->uv_wq);
#ifdef CONFIG_HAS_EARLYSUSPEND
	unregister_early_suspend(&uv->early_suspend);
#endif
	sensors_unregister(uv->uv_dev, uv_sensor_attrs);
	sysfs_remove_group(&uv->uv_input_dev->dev.kobj,
			   &uv_attribute_group);
	input_unregister_device(uv->uv_input_dev);

	if (uv->onoff && uv->pdata->power_on)
		uv->pdata->power_on(false);
	if (uv->pdata->adc_ap_exit)
		uv->pdata->adc_ap_exit(uv->pdev_uv_adc);
	if (uv->pdev_uv_adc)
		platform_device_put(uv->pdev_uv_adc);
	mutex_destroy(&uv->read_lock);
	mutex_destroy(&uv->power_lock);
	kfree(uv);
	pr_info("%s-\n", __func__);
}
开发者ID:dangordon1212,项目名称:sgs4duos_kernel,代码行数:29,代码来源:ssp_c12sd.c


示例6: bma280_remove

static int __devexit bma280_remove(struct i2c_client *client)
{
	struct bma280_p *data = (struct bma280_p *)i2c_get_clientdata(client);

	if (atomic_read(&data->enable) == ON)
		bma280_set_enable(data, OFF);

	atomic_set(&data->enable, OFF);
	cancel_delayed_work_sync(&data->irq_work);

	bma280_set_mode(data, BMA280_MODE_SUSPEND);
	sensors_unregister(data->factory_device, sensor_attrs);
	sensors_remove_symlink(&data->input->dev.kobj, data->input->name);

	sysfs_remove_group(&data->input->dev.kobj, &bma280_attribute_group);
	input_unregister_device(data->input);

	free_irq(data->irq1, data);
	wake_lock_destroy(&data->reactive_wake_lock);
	mutex_destroy(&data->mode_mutex);
	gpio_free(data->acc_int1);
	kfree(data);

	return 0;
}
开发者ID:Svard73,项目名称:SM-T700-T705-Kernel,代码行数:25,代码来源:bma280.c


示例7: bh1721fvc_remove

static int bh1721fvc_remove(struct i2c_client *client)
{

	struct bh1721fvc_data *bh1721fvc = i2c_get_clientdata(client);

	sensors_unregister(bh1721fvc->light_sensor_device);

	sysfs_remove_group(&bh1721fvc->input_dev->dev.kobj,
			   &bh1721fvc_attribute_group);

	input_unregister_device(bh1721fvc->input_dev);

	if (bh1721fvc_is_measuring(bh1721fvc))

		bh1721fvc_disable(bh1721fvc);

	destroy_workqueue(bh1721fvc->wq);

	mutex_destroy(&bh1721fvc->lock);

	kfree(bh1721fvc);

	bh1721fvc_dbmsg("bh1721fvc_remove -\n");

	return 0;

}
开发者ID:andi34,项目名称:kernel_samsung_espresso,代码行数:27,代码来源:bh1721.c


示例8: remove_temphumidity_factorytest

void remove_temphumidity_factorytest(struct ssp_data *data)
{
	if (data->comp_engine_ver != NULL)
		kfree(data->comp_engine_ver);
	if (data->comp_engine_ver2 != NULL)
		kfree(data->comp_engine_ver2);
	sensors_unregister(data->temphumidity_device, temphumidity_attrs);
}
开发者ID:SiliconAcid,项目名称:kernel_samsung-jfltevzw-VRUFNC5,代码行数:8,代码来源:temphumidity_shtc1.c


示例9: remove_magnetic_sensor

void remove_magnetic_sensor(struct ssp_data *data)
{
	sensors_unregister(data->mag_device, mag_attrs);
	device_remove_file(&data->mag_input_dev->dev,
		&dev_attr_mag_poll_delay);
	sensors_remove_symlink(&data->mag_input_dev->dev.kobj,
		data->mag_input_dev->name);
	input_unregister_device(data->mag_input_dev);
}
开发者ID:NoDEAL,项目名称:Dokdo-Leak-Kernel,代码行数:9,代码来源:magnetic_yas532.c


示例10: KXSD9_sysfs_exit

void KXSD9_sysfs_exit(struct sensors_dev *sdev)
#endif
{
    trace_in();

#ifdef CONFIG_MACH_OSCAR
    sensors_unregister(sdev);
#endif

    trace_out();
}	
开发者ID:macroliu,项目名称:samsung_kernel_nowplus,代码行数:11,代码来源:KXSD9_sysfs.c


示例11: remove_temphumidity_factorytest

void remove_temphumidity_factorytest(struct ssp_data *data)
{
	if (data->comp_engine_ver != NULL)
		kfree(data->comp_engine_ver);
	if (data->comp_engine_ver2 != NULL)
		kfree(data->comp_engine_ver2);
	sensors_unregister(data->temphumidity_device, temphumidity_attrs);
	ssp_temphumidity_fops.unlocked_ioctl = NULL;
	misc_deregister(&data->shtc1_device);

}
开发者ID:GalaxyTab4,项目名称:android_kernel_samsung_matissewifi.bak,代码行数:11,代码来源:temphumidity_shtc1.c


示例12: remove_temphumidity_factorytest

void remove_temphumidity_factorytest(struct ssp_data *data)
{
	if (data->adc_client)
		s3c_adc_release(data->adc_client);
	if (data->pdev_pam_temp)
		platform_device_put(data->pdev_pam_temp);
	sensors_unregister(data->temphumidity_device, temphumidity_attrs);
	kfree(data->comp_engine_ver);
	ssp_temphumidity_fops.unlocked_ioctl = NULL;
	misc_deregister(&data->shtc1_device);
}
开发者ID:halaszk,项目名称:android_kernel_samsung_lt03,代码行数:11,代码来源:temphumidity_shtc1.c


示例13: L_sysfs_exit

void L_sysfs_exit(struct sensors_dev *sdev)
#endif
{
    trace_in();

#ifdef CONFIG_MACH_OSCAR
    struct device *dev = sdev->dev;
    sensors_unregister(sdev);
#endif
    device_remove_file( dev, &dev_attr_L_adc_val );
    device_remove_file( dev, &dev_attr_L_illum_lvl );

    trace_out();
}	
开发者ID:macroliu,项目名称:samsung_kernel_nowplus,代码行数:14,代码来源:sysfs.c


示例14: P_sysfs_exit

void P_sysfs_exit(struct sensors_dev *sdev)
#endif
{
    trace_in();

#ifdef CONFIG_MACH_OSCAR
    sensors_unregister(sdev);
#else
    class_destroy(P_obj_state);
    device_remove_file( dev, &dev_attr_P_output );
    device_remove_file( dev, &dev_attr_P_operation );
#endif
    trace_out();
}
开发者ID:macroliu,项目名称:samsung_kernel_nowplus,代码行数:14,代码来源:sysfs.c


示例15: ak09911c_remove

static int __devexit ak09911c_remove(struct i2c_client *client)
{
	struct ak09911c_p *data =
			(struct ak09911c_p *)i2c_get_clientdata(client);

	if (atomic_read(&data->enable) == 1)
		ak09911c_set_enable(data, 0);

	gpio_free(data->m_rst_n);
	mutex_destroy(&data->lock);

	sensors_unregister(data->factory_device, sensor_attrs);
	sensors_remove_symlink(&data->input->dev.kobj, data->input->name);

	sysfs_remove_group(&data->input->dev.kobj, &ak09911c_attribute_group);
	input_unregister_device(data->input);
	kfree(data);

	return 0;
}
开发者ID:moonlightly,项目名称:android_kernel_samsung_ms013g,代码行数:20,代码来源:ak09911c.c


示例16: bma280_probe


//.........这里部分代码省略.........
	ret = bma280_setup_pin(data);
	if (ret < 0) {
		pr_err("[SENSOR]: %s - could not setup pin\n", __func__);
		goto exit_setup_pin;
	}

	i2c_set_clientdata(client, data);
	data->client = client;
	mutex_init(&data->mode_mutex);
	wake_lock_init(&data->reactive_wake_lock, WAKE_LOCK_SUSPEND,
		       "reactive_wake_lock");

	/* read chip id */
	for (i = 0; i < CHIP_ID_RETRIES; i++) {
		ret = i2c_smbus_read_word_data(client, BMA280_CHIP_ID_REG);
		if ((ret & 0x00ff) != BMA280_CHIP_ID) {
			pr_err("[SENSOR]: %s - chip id failed 0x%x\n",
				__func__, (unsigned int)ret & 0x00ff);
		} else {
			pr_info("[SENSOR]: %s - chip id success 0x%x\n",
				__func__, (unsigned int)ret & 0x00ff);
			break;
		}
		msleep(20);
	}

	if (i >= CHIP_ID_RETRIES) {
		ret = -ENODEV;
		goto exit_read_chipid;
	}

	/* input device init */
	ret = bma280_input_init(data);
	if (ret < 0)
		goto exit_input_init;

	sensors_register(data->factory_device, data, sensor_attrs, MODULE_NAME);

	/* accel_timer settings. we poll for light values using a timer. */
	hrtimer_init(&data->accel_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
	data->poll_delay = ns_to_ktime(BMA280_DEFAULT_DELAY);
	data->accel_timer.function = bma280_timer_func;

	/* the timer just fires off a work queue request.  we need a thread
	   to read the i2c (can be slow and blocking). */
	data->accel_wq = create_singlethread_workqueue("accel_wq");
	if (!data->accel_wq) {
		ret = -ENOMEM;
		pr_err("[SENSOR]: %s - could not create workqueue\n", __func__);
		goto exit_create_workqueue;
	}

	/* this is the thread function we run on the work queue */
	INIT_WORK(&data->work, bma280_work_func);
	INIT_DELAYED_WORK(&data->irq_work, bma280_irq_work_func);

	data->irq1 = gpio_to_irq(data->acc_int1);

	ret = request_threaded_irq(data->irq1, NULL, bma280_irq_thread,
		IRQF_TRIGGER_RISING | IRQF_ONESHOT, "bma280_accel", data);
	if (ret < 0) {
		pr_err("[SENSOR]: %s - can't allocate irq.\n", __func__);
		goto exit_request_threaded_irq;
	}

	disable_irq(data->irq1);

	atomic_set(&data->enable, OFF);
	data->time_count = 0;
	data->irq_state = 0;
	data->recog_flag = OFF;

	bma280_set_bandwidth(data, BMA280_BW_125HZ);
	bma280_set_range(data, BMA280_RANGE_2G);
	bma280_set_mode(data, BMA280_MODE_SUSPEND);

	pr_info("[SENSOR]: %s - Probe done!(chip pos : %d)\n",
		__func__, data->chip_pos);

	return 0;

exit_request_threaded_irq:
exit_create_workqueue:
	sensors_unregister(data->factory_device, sensor_attrs);
	sensors_remove_symlink(&data->input->dev.kobj, data->input->name);
	sysfs_remove_group(&data->input->dev.kobj, &bma280_attribute_group);
	input_unregister_device(data->input);
exit_input_init:
exit_read_chipid:
	mutex_destroy(&data->mode_mutex);
	wake_lock_destroy(&data->reactive_wake_lock);
	gpio_free(data->acc_int1);
exit_setup_pin:
exit_of_node:
	kfree(data);
exit_kzalloc:
exit:
	pr_err("[SENSOR]: %s - Probe fail!\n", __func__);
	return ret;
}
开发者ID:Svard73,项目名称:SM-T700-T705-Kernel,代码行数:101,代码来源:bma280.c


示例17: remove_mcu_factorytest

static void remove_mcu_factorytest(struct ssp_data *data)
{
	sensors_unregister(data->mcu_device, mcu_attrs);
}
开发者ID:dangordon1212,项目名称:sgs4duos_kernel,代码行数:4,代码来源:ssp_sysfs.c


示例18: remove_grip_factorytest

void remove_grip_factorytest(struct ssp_data *data)
{
	sensors_unregister(data->grip_device, grip_attrs);
}
开发者ID:GAXUSXX,项目名称:G935FGaXusKernel2,代码行数:4,代码来源:grip_sx9306.c


示例19: remove_uv_factorytest

void remove_uv_factorytest(struct ssp_data *data)
{
	sensors_unregister(data->uv_device, uv_attrs);
}
开发者ID:GalaxyTab4,项目名称:android_kernel_samsung_matissewifi.bak,代码行数:4,代码来源:uv_uvis25.c


示例20: remove_prox_factorytest

void remove_prox_factorytest(struct ssp_data *data)
{
	sensors_unregister(data->prox_device, prox_attrs);
}
开发者ID:GAXUSXX,项目名称:G935FGaXusKernel2,代码行数:4,代码来源:prox_max88920.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ sentinel函数代码示例发布时间:2022-05-30
下一篇:
C++ sensors函数代码示例发布时间: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