iio_trigger_free(st->trig);
}
if (indio_dev->buffer != NULL) {
- iio_buffer_unregister(indio_dev);
iio_kfifo_free(indio_dev->buffer);
}
if (st->ch)
return ret;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
indio_dev->buffer = iio_kfifo_allocate(indio_dev);
+#else
+ indio_dev->buffer = iio_kfifo_allocate();
+#endif
if (!indio_dev->buffer) {
dev_err(st->dev, "%s iio_kfifo_allocate ERR\n", __func__);
return -ENOMEM;
st->info.write_raw = &nvs_write_raw;
indio_dev->info = &st->info;
indio_dev->setup_ops = &nvs_buffer_setup_ops;
- ret = iio_buffer_register(indio_dev, indio_dev->channels,
- indio_dev->num_channels);
- if (ret) {
- dev_err(st->dev, "%s iio_buffer_register ERR\n", __func__);
- return ret;
- }
-
if (st->cfg->kbuf_sz) {
indio_dev->buffer->access->set_length(indio_dev->buffer,
st->cfg->kbuf_sz);
dividend = (x2 - x1) * (y3 - y1);
if (dividend < 0) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
dividend = abs64(dividend);
+#else
+ dividend = abs(dividend);
+#endif
do_div(dividend, divisor);
dividend = 0 - dividend;
} else {
dividend = (x2 - x1) * (y3 - y1);
if (dividend < 0) {
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 3, 0)
dividend = abs64(dividend);
+#else
+ dividend = abs(dividend);
+#endif
do_div(dividend, divisor);
dividend = 0 - dividend;
} else {
source "drivers/iio/imu/inv_mpu6050/Kconfig"
source "drivers/iio/imu/nvi_mpu/Kconfig"
-endmenu
config IIO_ADIS_LIB
tristate
help
A set of buffer helper functions for the Analog Devices ADIS* device
family.
+
+endmenu
/* The industrial I/O core
*
* Copyright (c) 2008 Jonathan Cameron
- * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
}
return 0;
+error_del_device:
+ device_del(&indio_dev->dev);
error_cdev_del:
cdev_del(&indio_dev->chrdev);
error_unreg_eventset:
mutex_unlock(&indio_dev->info_exist_lock);
- iio_buffer_free_sysfs_and_mask(indio_dev);
kfree(indio_dev->link_name);
+ iio_buffer_free_sysfs_and_mask(indio_dev);
}
EXPORT_SYMBOL(iio_device_unregister);
MODULE_AUTHOR("Jonathan Cameron <jic23@kernel.org>");
MODULE_DESCRIPTION("Industrial I/O core");
MODULE_LICENSE("GPL");
+
To compile this driver as a module, choose M here: the
module will be called sx9500.
-#
-# proximity sensors
-#
-menu "Proximity sensors"
config NVS_IQS2X3
tristate "Azoteq IQS253/IQS263 SAR proximity"
#define _IIO_TYPES_H_
#include <uapi/linux/iio/types.h>
-enum iio_chan_type {
- IIO_VOLTAGE,
- IIO_CURRENT,
- IIO_POWER,
- IIO_ACCEL,
- IIO_ANGL_VEL,
- IIO_MAGN,
- IIO_LIGHT,
- IIO_INTENSITY,
- IIO_PROXIMITY,
- IIO_TEMP,
- IIO_INCLI,
- IIO_ROT,
- IIO_ANGL,
- IIO_TIMESTAMP,
- IIO_CAPACITANCE,
- IIO_ALTVOLTAGE,
- IIO_CCT,
- IIO_PRESSURE,
- IIO_HUMIDITYRELATIVE,
- IIO_ORIENTATION,
- IIO_GRAVITY,
- IIO_LINEAR_ACCEL,
- IIO_HUMIDITY,
- IIO_MAGN_UNCAL,
- IIO_ANGLVEL_UNCAL,
- IIO_GAME_ROT,
- IIO_MOTION,
- IIO_STEP,
- IIO_STEP_COUNT,
- IIO_GEOMAGN_ROT,
- IIO_HEART_RATE,
- IIO_GESTURE_WAKE,
- IIO_GESTURE_GLANCE,
- IIO_GESTURE_PICKUP,
- IIO_GENERIC,
-};
-
-enum iio_modifier {
- IIO_NO_MOD,
- IIO_MOD_X,
- IIO_MOD_Y,
- IIO_MOD_Z,
- IIO_MOD_COS,
- IIO_MOD_X_AND_Y,
- IIO_MOD_X_AND_Z,
- IIO_MOD_Y_AND_Z,
- IIO_MOD_X_AND_Y_AND_Z,
- IIO_MOD_X_OR_Y,
- IIO_MOD_X_OR_Z,
- IIO_MOD_Y_OR_Z,
- IIO_MOD_X_OR_Y_OR_Z,
- IIO_MOD_LIGHT_BOTH,
- IIO_MOD_LIGHT_IR,
- IIO_MOD_ROOT_SUM_SQUARED_X_Y,
- IIO_MOD_SUM_SQUARED_X_Y_Z,
- IIO_MOD_LIGHT_CLEAR,
- IIO_MOD_LIGHT_RED,
- IIO_MOD_LIGHT_GREEN,
- IIO_MOD_LIGHT_BLUE,
- IIO_MOD_QUATERNION,
- IIO_MOD_TEMP_AMBIENT,
- IIO_MOD_TEMP_OBJECT,
- IIO_MOD_NORTH_MAGN,
- IIO_MOD_NORTH_TRUE,
- IIO_MOD_NORTH_MAGN_TILT_COMP,
- IIO_MOD_NORTH_TRUE_TILT_COMP,
- IIO_MOD_X_UNCALIB,
- IIO_MOD_Y_UNCALIB,
- IIO_MOD_Z_UNCALIB,
- IIO_MOD_X_BIAS,
- IIO_MOD_Y_BIAS,
- IIO_MOD_Z_BIAS,
- IIO_MOD_STATUS,
- IIO_MOD_BPM,
-};
-
-enum iio_event_type {
- IIO_EV_TYPE_THRESH,
- IIO_EV_TYPE_MAG,
- IIO_EV_TYPE_ROC,
- IIO_EV_TYPE_THRESH_ADAPTIVE,
- IIO_EV_TYPE_MAG_ADAPTIVE,
-};
enum iio_event_info {
IIO_EV_INFO_ENABLE,
/* industrial I/O data types needed both in and out of kernel
*
* Copyright (c) 2008 Jonathan Cameron
+ * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published by
IIO_VELOCITY,
IIO_CONCENTRATION,
IIO_RESISTANCE,
+ IIO_ORIENTATION,
+ IIO_GRAVITY,
+ IIO_LINEAR_ACCEL,
+ IIO_HUMIDITY,
+ IIO_MAGN_UNCAL,
+ IIO_ANGLVEL_UNCAL,
+ IIO_GAME_ROT,
+ IIO_MOTION,
+ IIO_STEP,
+ IIO_STEP_COUNT,
+ IIO_GEOMAGN_ROT,
+ IIO_HEART_RATE,
+ IIO_GESTURE_WAKE,
+ IIO_GESTURE_GLANCE,
+ IIO_GESTURE_PICKUP,
+ IIO_GENERIC,
};
+
enum iio_modifier {
IIO_NO_MOD,
IIO_MOD_X,
IIO_MOD_Y,
IIO_MOD_Z,
+ IIO_MOD_COS,
IIO_MOD_X_AND_Y,
IIO_MOD_X_AND_Z,
IIO_MOD_Y_AND_Z,
IIO_MOD_Q,
IIO_MOD_CO2,
IIO_MOD_VOC,
+ IIO_MOD_X_UNCALIB,
+ IIO_MOD_Y_UNCALIB,
+ IIO_MOD_Z_UNCALIB,
+ IIO_MOD_X_BIAS,
+ IIO_MOD_Y_BIAS,
+ IIO_MOD_Z_BIAS,
+ IIO_MOD_STATUS,
+ IIO_MOD_BPM,
};
enum iio_event_type {