mirror of
https://github.com/torvalds/linux.git
synced 2024-12-17 16:43:08 +00:00
Mixed back of updates and trivial examples fixes.
Nothing terribly interesting in this one. 8 July 2012 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iQIcBAABAgAGBQJP+d34AAoJEFSFNJnE9BaIJtMQAI3LR9H/WW00adqHZuRf1bZe +24h/yrrLuWx3KxyzHDh+AQwhFdRMUaWSme4K8wn9p4K0qVQXmY2XWE1pPk5OzdC LnXVl+QT8Ij+hz02Gl2GEiraAvSWVgR8jxZBfRBQtpfrsDFgyaDaq0+MlfT8W7O+ 5sF/OcraYqeaE+jx3Y1kZwgcpo4b2zd4R70HCJNxLCGEV9xC7tMDeCs7PzOwgM1B 65/hw7EAFvDaq+xzpV+W0fmvbSnWhoYtSHSYPg5gZB0N38gYWay5fOJv3TB+4TWM vDxbWVfFx+qFFyOhCWXnezhnlIpt/+HLiJo/9WHma8Nonao6Dly++nYeHizVbeMc yk/fR7DuNKRjw5EbwNj+i9mIBnjtREGI8JSVqc9QQxuIvvXIh52Fmf0nXlFt1P/a yjzj1kycmWJ4P3Mll2xXlnOqE0VpHp645rbdfOz2Ix8q0LlByeRN736mlfpSrv1l vP9QZecufpeUvIM5z7kS/RWFZAC8wYIJVQkFHm56LrKXTec/OS7TO9g/nx8rGlzu eP5XfPpwUUw4BXQSRHZBY3rFhrF+p3mx5WFlQeCie/eDPgGJ1yHoCZUCc7tMRLwR So+7SRIoJYF6OWRkyZQE1VjiMpuHrmFG5WIKv9WuzSzyZloRZYyAD6yx4dJAz9z2 CwzEn+/tbrwu8+8hdZSb =ihIe -----END PGP SIGNATURE----- Merge tag 'togreg_8_7_2012' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next Mixed back of updates and trivial examples fixes. Nothing terribly interesting in this one. 8 July 2012
This commit is contained in:
commit
f12db36d3f
@ -275,7 +275,7 @@ What: /sys/.../iio:deviceX/in_voltage-voltage_scale_available
|
||||
What: /sys/.../iio:deviceX/out_voltageX_scale_available
|
||||
What: /sys/.../iio:deviceX/out_altvoltageX_scale_available
|
||||
What: /sys/.../iio:deviceX/in_capacitance_scale_available
|
||||
KernelVersion: 2.635
|
||||
KernelVersion: 2.6.35
|
||||
Contact: linux-iio@vger.kernel.org
|
||||
Description:
|
||||
If a discrete set of scale values is available, they
|
||||
|
@ -51,25 +51,19 @@ static ssize_t iio_trigger_read_name(struct device *dev,
|
||||
|
||||
static DEVICE_ATTR(name, S_IRUGO, iio_trigger_read_name, NULL);
|
||||
|
||||
/**
|
||||
* iio_trigger_register_sysfs() - create a device for this trigger
|
||||
* @trig_info: the trigger
|
||||
*
|
||||
* Also adds any control attribute registered by the trigger driver
|
||||
**/
|
||||
static int iio_trigger_register_sysfs(struct iio_trigger *trig_info)
|
||||
{
|
||||
return sysfs_add_file_to_group(&trig_info->dev.kobj,
|
||||
&dev_attr_name.attr,
|
||||
NULL);
|
||||
}
|
||||
static struct attribute *iio_trig_dev_attrs[] = {
|
||||
&dev_attr_name.attr,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static void iio_trigger_unregister_sysfs(struct iio_trigger *trig_info)
|
||||
{
|
||||
sysfs_remove_file_from_group(&trig_info->dev.kobj,
|
||||
&dev_attr_name.attr,
|
||||
NULL);
|
||||
}
|
||||
static struct attribute_group iio_trig_attr_group = {
|
||||
.attrs = iio_trig_dev_attrs,
|
||||
};
|
||||
|
||||
static const struct attribute_group *iio_trig_attr_groups[] = {
|
||||
&iio_trig_attr_group,
|
||||
NULL
|
||||
};
|
||||
|
||||
int iio_trigger_register(struct iio_trigger *trig_info)
|
||||
{
|
||||
@ -88,10 +82,6 @@ int iio_trigger_register(struct iio_trigger *trig_info)
|
||||
if (ret)
|
||||
goto error_unregister_id;
|
||||
|
||||
ret = iio_trigger_register_sysfs(trig_info);
|
||||
if (ret)
|
||||
goto error_device_del;
|
||||
|
||||
/* Add to list of available triggers held by the IIO core */
|
||||
mutex_lock(&iio_trigger_list_lock);
|
||||
list_add_tail(&trig_info->list, &iio_trigger_list);
|
||||
@ -99,8 +89,6 @@ int iio_trigger_register(struct iio_trigger *trig_info)
|
||||
|
||||
return 0;
|
||||
|
||||
error_device_del:
|
||||
device_del(&trig_info->dev);
|
||||
error_unregister_id:
|
||||
ida_simple_remove(&iio_trigger_ida, trig_info->id);
|
||||
error_ret:
|
||||
@ -114,7 +102,6 @@ void iio_trigger_unregister(struct iio_trigger *trig_info)
|
||||
list_del(&trig_info->list);
|
||||
mutex_unlock(&iio_trigger_list_lock);
|
||||
|
||||
iio_trigger_unregister_sysfs(trig_info);
|
||||
ida_simple_remove(&iio_trigger_ida, trig_info->id);
|
||||
/* Possible issue in here */
|
||||
device_unregister(&trig_info->dev);
|
||||
@ -234,7 +221,7 @@ static int iio_trigger_attach_poll_func(struct iio_trigger *trig,
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int iio_trigger_dettach_poll_func(struct iio_trigger *trig,
|
||||
static int iio_trigger_detach_poll_func(struct iio_trigger *trig,
|
||||
struct iio_poll_func *pf)
|
||||
{
|
||||
int ret = 0;
|
||||
@ -406,6 +393,7 @@ static void iio_trig_release(struct device *device)
|
||||
|
||||
static struct device_type iio_trig_type = {
|
||||
.release = iio_trig_release,
|
||||
.groups = iio_trig_attr_groups,
|
||||
};
|
||||
|
||||
static void iio_trig_subirqmask(struct irq_data *d)
|
||||
@ -502,7 +490,7 @@ EXPORT_SYMBOL(iio_triggered_buffer_postenable);
|
||||
|
||||
int iio_triggered_buffer_predisable(struct iio_dev *indio_dev)
|
||||
{
|
||||
return iio_trigger_dettach_poll_func(indio_dev->trig,
|
||||
return iio_trigger_detach_poll_func(indio_dev->trig,
|
||||
indio_dev->pollfunc);
|
||||
}
|
||||
EXPORT_SYMBOL(iio_triggered_buffer_predisable);
|
||||
|
@ -68,6 +68,12 @@ static const char * const iio_modifier_names[] = {
|
||||
[IIO_MOD_Z] = "z",
|
||||
[IIO_MOD_LIGHT_BOTH] = "both",
|
||||
[IIO_MOD_LIGHT_IR] = "ir",
|
||||
[IIO_MOD_ROOT_SUM_SQUARED_X_Y] = "sqrt(x^2+y^2)",
|
||||
[IIO_MOD_SUM_SQUARED_X_Y_Z] = "x^2+y^2+z^2",
|
||||
[IIO_MOD_LIGHT_CLEAR] = "clear",
|
||||
[IIO_MOD_LIGHT_RED] = "red",
|
||||
[IIO_MOD_LIGHT_GREEN] = "green",
|
||||
[IIO_MOD_LIGHT_BLUE] = "blue",
|
||||
};
|
||||
|
||||
static bool event_is_known(struct iio_event_data *event)
|
||||
@ -106,6 +112,12 @@ static bool event_is_known(struct iio_event_data *event)
|
||||
case IIO_MOD_Z:
|
||||
case IIO_MOD_LIGHT_BOTH:
|
||||
case IIO_MOD_LIGHT_IR:
|
||||
case IIO_MOD_ROOT_SUM_SQUARED_X_Y:
|
||||
case IIO_MOD_SUM_SQUARED_X_Y_Z:
|
||||
case IIO_MOD_LIGHT_CLEAR:
|
||||
case IIO_MOD_LIGHT_RED:
|
||||
case IIO_MOD_LIGHT_GREEN:
|
||||
case IIO_MOD_LIGHT_BLUE:
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
|
@ -453,7 +453,7 @@ inline int find_type_by_name(const char *name, const char *type)
|
||||
|
||||
dp = opendir(iio_dir);
|
||||
if (dp == NULL) {
|
||||
printf("No industrialio devices available");
|
||||
printf("No industrialio devices available\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
@ -711,6 +711,7 @@ static int __devinit adt7410_probe(struct i2c_client *client,
|
||||
struct iio_dev *indio_dev;
|
||||
int ret = 0;
|
||||
unsigned long *adt7410_platform_data = client->dev.platform_data;
|
||||
unsigned long local_pdata[] = {0, 0};
|
||||
|
||||
indio_dev = iio_device_alloc(sizeof(*chip));
|
||||
if (indio_dev == NULL) {
|
||||
@ -728,6 +729,9 @@ static int __devinit adt7410_probe(struct i2c_client *client,
|
||||
indio_dev->info = &adt7410_info;
|
||||
indio_dev->modes = INDIO_DIRECT_MODE;
|
||||
|
||||
if (!adt7410_platform_data)
|
||||
adt7410_platform_data = local_pdata;
|
||||
|
||||
/* CT critcal temperature event. line 0 */
|
||||
if (client->irq) {
|
||||
ret = request_threaded_irq(client->irq,
|
||||
@ -753,13 +757,15 @@ static int __devinit adt7410_probe(struct i2c_client *client,
|
||||
goto error_unreg_ct_irq;
|
||||
}
|
||||
|
||||
if (client->irq && adt7410_platform_data[0]) {
|
||||
ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
|
||||
if (ret) {
|
||||
ret = -EIO;
|
||||
goto error_unreg_int_irq;
|
||||
}
|
||||
|
||||
ret = adt7410_i2c_read_byte(chip, ADT7410_CONFIG, &chip->config);
|
||||
if (ret) {
|
||||
ret = -EIO;
|
||||
goto error_unreg_int_irq;
|
||||
}
|
||||
chip->config |= ADT7410_RESOLUTION;
|
||||
|
||||
if (client->irq && adt7410_platform_data[0]) {
|
||||
|
||||
/* set irq polarity low level */
|
||||
chip->config &= ~ADT7410_CT_POLARITY;
|
||||
@ -768,12 +774,12 @@ static int __devinit adt7410_probe(struct i2c_client *client,
|
||||
chip->config |= ADT7410_INT_POLARITY;
|
||||
else
|
||||
chip->config &= ~ADT7410_INT_POLARITY;
|
||||
}
|
||||
|
||||
ret = adt7410_i2c_write_byte(chip, ADT7410_CONFIG, chip->config);
|
||||
if (ret) {
|
||||
ret = -EIO;
|
||||
goto error_unreg_int_irq;
|
||||
}
|
||||
ret = adt7410_i2c_write_byte(chip, ADT7410_CONFIG, chip->config);
|
||||
if (ret) {
|
||||
ret = -EIO;
|
||||
goto error_unreg_int_irq;
|
||||
}
|
||||
ret = iio_device_register(indio_dev);
|
||||
if (ret)
|
||||
|
@ -85,7 +85,7 @@ struct iio_buffer {
|
||||
|
||||
/**
|
||||
* iio_buffer_init() - Initialize the buffer structure
|
||||
* @buffer: buffer to be initialized
|
||||
* @buffer: buffer to be initialized
|
||||
**/
|
||||
void iio_buffer_init(struct iio_buffer *buffer);
|
||||
|
||||
@ -107,8 +107,9 @@ int iio_scan_mask_query(struct iio_dev *indio_dev,
|
||||
|
||||
/**
|
||||
* iio_scan_mask_set() - set particular bit in the scan mask
|
||||
* @buffer: the buffer whose scan mask we are interested in
|
||||
* @bit: the bit to be set.
|
||||
* @indio_dev IIO device structure
|
||||
* @buffer: the buffer whose scan mask we are interested in
|
||||
* @bit: the bit to be set.
|
||||
**/
|
||||
int iio_scan_mask_set(struct iio_dev *indio_dev,
|
||||
struct iio_buffer *buffer, int bit);
|
||||
@ -116,8 +117,8 @@ int iio_scan_mask_set(struct iio_dev *indio_dev,
|
||||
/**
|
||||
* iio_push_to_buffer() - push to a registered buffer.
|
||||
* @buffer: IIO buffer structure for device
|
||||
* @scan: Full scan.
|
||||
* @timestamp:
|
||||
* @data: the data to push to the buffer
|
||||
* @timestamp: timestamp to associate with the data
|
||||
*/
|
||||
int iio_push_to_buffer(struct iio_buffer *buffer, unsigned char *data,
|
||||
s64 timestamp);
|
||||
@ -126,7 +127,9 @@ int iio_update_demux(struct iio_dev *indio_dev);
|
||||
|
||||
/**
|
||||
* iio_buffer_register() - register the buffer with IIO core
|
||||
* @indio_dev: device with the buffer to be registered
|
||||
* @indio_dev: device with the buffer to be registered
|
||||
* @channels: the channel descriptions used to construct buffer
|
||||
* @num_channels: the number of channels
|
||||
**/
|
||||
int iio_buffer_register(struct iio_dev *indio_dev,
|
||||
const struct iio_chan_spec *channels,
|
||||
@ -134,7 +137,7 @@ int iio_buffer_register(struct iio_dev *indio_dev,
|
||||
|
||||
/**
|
||||
* iio_buffer_unregister() - unregister the buffer from IIO core
|
||||
* @indio_dev: the device with the buffer to be unregistered
|
||||
* @indio_dev: the device with the buffer to be unregistered
|
||||
**/
|
||||
void iio_buffer_unregister(struct iio_dev *indio_dev);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user