本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}