当前位置: 首页>>代码示例>>C++>>正文


C++ spi_get_drvdata函数代码示例

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


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


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