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

C++ spi_get_drvdata函数代码示例

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

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



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

示例1: adis16080_remove

/* fixme, confirm ordering in this function */
static int adis16080_remove(struct spi_device *spi)
{
	iio_device_unregister(spi_get_drvdata(spi));
	iio_device_free(spi_get_drvdata(spi));

	return 0;
}
开发者ID:Forzaferrarileo,项目名称:linux,代码行数:8,代码来源:adis16080_core.c


示例2: ad9850_remove

static int __devexit ad9850_remove(struct spi_device *spi)
{
	iio_device_unregister(spi_get_drvdata(spi));
	iio_free_device(spi_get_drvdata(spi));

	return 0;
}
开发者ID:96boards,项目名称:wilink8-wlan_wl18xx,代码行数:7,代码来源:ad9850.c


示例3: st_magn_spi_remove

static int st_magn_spi_remove(struct spi_device *spi)
{
	struct iio_dev *indio_dev = spi_get_drvdata(spi);
	st_magn_common_remove(indio_dev);

	return 0;
}
开发者ID:03199618,项目名称:linux,代码行数:7,代码来源:st_magn_spi.c


示例4: bma220_resume

static int bma220_resume(struct device *dev)
{
	struct bma220_data *data =
			iio_priv(spi_get_drvdata(to_spi_device(dev)));

	return bma220_read_reg(data->spi_device, BMA220_REG_SUSPEND);
}
开发者ID:AshishNamdev,项目名称:linux,代码行数:7,代码来源:bma220_spi.c


示例5: lis302dl_spi_remove

static int __devexit lis302dl_spi_remove(struct spi_device *spi)
{
	struct lis3lv02d *lis3 = spi_get_drvdata(spi);
	lis3lv02d_joystick_disable();
	lis3lv02d_poweroff(lis3);
	return 0;
}
开发者ID:fwmfee,项目名称:linux-legacy,代码行数:7,代码来源:lis3lv02d_spi.c


示例6: st33zp24_spi_request_resources

static int st33zp24_spi_request_resources(struct spi_device *dev)
{
	struct tpm_chip *chip = spi_get_drvdata(dev);
	struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev);
	struct st33zp24_spi_phy *phy = tpm_dev->phy_id;
	struct st33zp24_platform_data *pdata;
	int ret;

	pdata = dev->dev.platform_data;
	if (!pdata) {
		dev_err(&dev->dev, "No platform data\n");
		return -ENODEV;
	}

	/* store for late use */
	phy->io_lpcpd = pdata->io_lpcpd;

	if (gpio_is_valid(pdata->io_lpcpd)) {
		ret = devm_gpio_request_one(&dev->dev,
				pdata->io_lpcpd, GPIOF_OUT_INIT_HIGH,
				"TPM IO_LPCPD");
		if (ret) {
			dev_err(&dev->dev, "%s : reset gpio_request failed\n",
				__FILE__);
			return ret;
		}
	}

	return 0;
}
开发者ID:asmalldev,项目名称:linux,代码行数:30,代码来源:spi.c


示例7: wm8988_spi_remove

static int __devexit wm8988_spi_remove(struct spi_device *spi)
{
    struct wm8988_priv *wm8988 = spi_get_drvdata(spi);
    snd_soc_unregister_codec(&spi->dev);
    regmap_exit(wm8988->regmap);
    return 0;
}
开发者ID:MiniBlu,项目名称:cm11_kernel_htc_msm8974a3ul,代码行数:7,代码来源:wm8988.c


示例8: bu21150_wake_up_enable_show

static ssize_t bu21150_wake_up_enable_show(struct kobject *kobj,
			struct kobj_attribute *attr, char *buf)
{
	struct bu21150_data *ts = spi_get_drvdata(g_client_bu21150);

	return snprintf(buf, PAGE_SIZE, "%u", ts->wake_up);
}
开发者ID:silversderek,项目名称:msm8909_kernel_lenovo,代码行数:7,代码来源:bu21150.c


示例9: bu21150_wake_up_enable_store

static ssize_t bu21150_wake_up_enable_store(struct kobject *kobj,
		struct kobj_attribute *attr, const char *buf, size_t count)
{
	struct bu21150_data *ts = spi_get_drvdata(g_client_bu21150);
	unsigned long state;
	ssize_t ret;

	ret = kstrtoul(buf, 10, &state);
	if (ret)
		return ret;

	if (!!state == ts->wake_up)
		return count;

	mutex_lock(&ts->mutex_wake);
	if (state == 0) {
		disable_irq_wake(ts->client->irq);
		device_init_wakeup(&ts->client->dev, false);
		ts->wake_up = false;
	} else {
		device_init_wakeup(&ts->client->dev, true);
		enable_irq_wake(ts->client->irq);
		ts->wake_up = true;
	}
	mutex_unlock(&ts->mutex_wake);

	return count;
}
开发者ID:silversderek,项目名称:msm8909_kernel_lenovo,代码行数:28,代码来源:bu21150.c


示例10: bu21150_ioctl_set_timeout

static long bu21150_ioctl_set_timeout(unsigned long arg)
{
	struct bu21150_data *ts = spi_get_drvdata(g_client_bu21150);
	void __user *argp = (void __user *)arg;
	struct bu21150_ioctl_timeout_data data;

	if (!ts->timeout_enable)
		return 0;

	if (copy_from_user(&data, argp,
		sizeof(struct bu21150_ioctl_timeout_data))) {
		pr_err("%s: Failed to copy_from_user().\n", __func__);
		return -EFAULT;
	}

	ts->timeout_enb = data.timeout_enb;
	if (data.timeout_enb == 1) {
		ts->timeout = (unsigned int)(data.report_interval_us
			* TIMEOUT_SCALE * HZ / 1000000);
	} else {
		get_frame_timer_delete();
	}

	return 0;
}
开发者ID:silversderek,项目名称:msm8909_kernel_lenovo,代码行数:25,代码来源:bu21150.c


示例11: bu21150_ioctl_spi_write

static long bu21150_ioctl_spi_write(unsigned long arg)
{
	struct bu21150_data *ts = spi_get_drvdata(g_client_bu21150);
	void __user *argp = (void __user *)arg;
	struct bu21150_ioctl_spi_data data;

	if (arg == 0) {
		pr_err("%s: arg == 0.\n", __func__);
		return -EINVAL;
	}
	if (copy_from_user(&data, argp,
		sizeof(struct bu21150_ioctl_spi_data))) {
		pr_err("%s: Failed to copy_from_user().\n", __func__);
		return -EFAULT;
	}
	if (data.buf == 0 || data.count == 0 ||
		MAX_FRAME_SIZE < data.count) {
		pr_err("%s: data.buf == 0 ...\n", __func__);
		return -EINVAL;
	}
	if (copy_from_user(ts->spi_buf, data.buf, data.count)) {
		pr_err("%s: Failed to copy_from_user()..\n", __func__);
		return -EFAULT;
	}

	bu21150_write_register(data.addr, data.count, ts->spi_buf);

	return 0;
}
开发者ID:silversderek,项目名称:msm8909_kernel_lenovo,代码行数:29,代码来源:bu21150.c


示例12: spi_aic3008_remove

static int spi_aic3008_remove(struct spi_device *spi_aic3008)
{
	AUD_DBG("Remove the SPI driver for aic3008.\n");
	snd_soc_unregister_codec(&spi_aic3008->dev);
	kfree(spi_get_drvdata(spi_aic3008));
	return 0;
}
开发者ID:chriscpritchard,项目名称:android_kernel_htc_endeavor,代码行数:7,代码来源:tlv320aic3008.c


示例13: BUG_ON

struct v4l2_subdev *v4l2_spi_new_subdev(struct v4l2_device *v4l2_dev,
		struct spi_master *master, struct spi_board_info *info)
{
	struct v4l2_subdev *sd = NULL;
	struct spi_device *spi = NULL;

	BUG_ON(!v4l2_dev);

	if (info->modalias)
		request_module(info->modalias);

	spi = spi_new_device(master, info);

	if (spi == NULL || spi->dev.driver == NULL)
		goto error;

	if (!try_module_get(spi->dev.driver->owner))
		goto error;

	sd = spi_get_drvdata(spi);

	if (v4l2_device_register_subdev(v4l2_dev, sd))
		sd = NULL;

	
	module_put(spi->dev.driver->owner);

error:
	if (spi && sd == NULL)
		spi_unregister_device(spi);

	return sd;
}
开发者ID:DirtyDroidX,项目名称:android_kernel_htc_m8ul,代码行数:33,代码来源:v4l2-common.c


示例14: hx8357_remove

static int hx8357_remove(struct spi_device *spi)
{
	struct lcd_device *lcdev = spi_get_drvdata(spi);

	lcd_device_unregister(lcdev);
	return 0;
}
开发者ID:AD5GB,项目名称:kernel_n5_3.10-experimental,代码行数:7,代码来源:hx8357.c


示例15: ssp_shutdown

static void ssp_shutdown(struct spi_device *spi)
{
	struct ssp_data *data = spi_get_drvdata(spi);

	pr_err("[SSP] %s, data->fw_dl_state[%d]*******************!\n",
			__func__,data->fw_dl_state);
	pr_err("[SSP]  lpm %d recovery \n",lpcharge /*, recovery_mode*/);
	func_dbg();
	if (data->bProbeIsDone == false)
		goto exit;

	disable_debug_timer(data);

	if (data->fw_dl_state >= FW_DL_STATE_SCHEDULED &&
		data->fw_dl_state < FW_DL_STATE_DONE) {
		pr_err("[SSP] %s, cancel_delayed_work_sync state = %d\n",
			__func__, data->fw_dl_state);
		cancel_delayed_work_sync(&data->work_firmware);
	}

	if (SUCCESS != ssp_send_cmd(data, MSG2SSP_AP_STATUS_SHUTDOWN, 0))
		pr_err("[SSP]: %s MSG2SSP_AP_STATUS_SHUTDOWN failed\n",
			__func__);

	ssp_enable(data, false);
	clean_pending_list(data);

#ifdef CONFIG_HAS_EARLYSUSPEND
	unregister_early_suspend(&data->early_suspend);
#endif

	free_irq(data->iIrq, data);
	gpio_free(data->mcu_int1);

	remove_event_symlink(data);
	remove_sysfs(data);
	remove_input_dev(data);

#ifdef CONFIG_SENSORS_SSP_SENSORHUB
	ssp_sensorhub_remove(data);
#endif

	del_timer_sync(&data->debug_timer);
	cancel_work_sync(&data->work_debug);
	cancel_delayed_work_sync(&data->work_refresh);
	destroy_workqueue(data->debug_wq);
	wake_lock_destroy(&data->ssp_wake_lock);
#ifdef CONFIG_SENSORS_SSP_SHTC1
	mutex_destroy(&data->bulk_temp_read_lock);
	mutex_destroy(&data->cp_temp_adc_lock);
#endif
#ifdef CONFIG_SENSORS_SSP_ATMEL
	mutex_destroy(&data->comm_mutex);
	mutex_destroy(&data->pending_mutex);
#endif
	toggle_mcu_reset(data);
	pr_info("[SSP] %s done\n", __func__);
exit:
	kfree(data);
}
开发者ID:GAXUSXX,项目名称:G935FGaXusKernel2,代码行数:60,代码来源:ssp_dev.c


示例16: itdb28fb_remove_spi

static int itdb28fb_remove_spi(struct spi_device *spi)
{
	struct fb_info *info = spi_get_drvdata(spi);

	fbtft_dev_dbg(DEBUG_DRIVER_INIT_FUNCTIONS, &spi->dev, "%s()\n", __func__);
	return itdb28fb_remove_common(&spi->dev, info);
}
开发者ID:rm-hull,项目名称:fbtft,代码行数:7,代码来源:itdb28fb.c


示例17: st33zp24_spi_acpi_request_resources

static int st33zp24_spi_acpi_request_resources(struct spi_device *spi_dev)
{
	struct tpm_chip *chip = spi_get_drvdata(spi_dev);
	struct st33zp24_dev *tpm_dev = dev_get_drvdata(&chip->dev);
	struct st33zp24_spi_phy *phy = tpm_dev->phy_id;
	struct gpio_desc *gpiod_lpcpd;
	struct device *dev = &spi_dev->dev;
	int ret;

	ret = acpi_dev_add_driver_gpios(ACPI_COMPANION(dev), acpi_st33zp24_gpios);
	if (ret)
		return ret;

	/* Get LPCPD GPIO from ACPI */
	gpiod_lpcpd = devm_gpiod_get(dev, "lpcpd", GPIOD_OUT_HIGH);
	if (IS_ERR(gpiod_lpcpd)) {
		dev_err(dev, "Failed to retrieve lpcpd-gpios from acpi.\n");
		phy->io_lpcpd = -1;
		/*
		 * lpcpd pin is not specified. This is not an issue as
		 * power management can be also managed by TPM specific
		 * commands. So leave with a success status code.
		 */
		return 0;
	}

	phy->io_lpcpd = desc_to_gpio(gpiod_lpcpd);

	return 0;
}
开发者ID:asmalldev,项目名称:linux,代码行数:30,代码来源:spi.c


示例18: ds3234_remove

static int __devexit ds3234_remove(struct spi_device *spi)
{
	struct rtc_device *rtc = spi_get_drvdata(spi);

	rtc_device_unregister(rtc);
	return 0;
}
开发者ID:openube,项目名称:android_kernel_sony_c2305,代码行数:7,代码来源:rtc-ds3234.c


示例19: ak4104_spi_remove

static int __devexit ak4104_spi_remove(struct spi_device *spi)
{
	struct ak4104_private *ak4101 = spi_get_drvdata(spi);
	regmap_exit(ak4101->regmap);
	snd_soc_unregister_codec(&spi->dev);
	return 0;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:7,代码来源:ak4104.c


示例20: st_nci_spi_request_resources

static int st_nci_spi_request_resources(struct spi_device *dev)
{
	struct st_nci_nfc_platform_data *pdata;
	struct st_nci_spi_phy *phy = spi_get_drvdata(dev);
	int r;

	pdata = dev->dev.platform_data;
	if (pdata == NULL) {
		nfc_err(&dev->dev, "No platform data\n");
		return -EINVAL;
	}

	/* store for later use */
	phy->gpio_reset = pdata->gpio_reset;
	phy->irq_polarity = pdata->irq_polarity;

	r = devm_gpio_request_one(&dev->dev,
			phy->gpio_reset, GPIOF_OUT_INIT_HIGH, "clf_reset");
	if (r) {
		pr_err("%s : reset gpio_request failed\n", __FILE__);
		return r;
	}

	phy->se_status.is_ese_present = pdata->is_ese_present;
	phy->se_status.is_uicc_present = pdata->is_uicc_present;

	return 0;
}
开发者ID:Chong-Li,项目名称:cse522,代码行数:28,代码来源:spi.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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