IIO: inkern: API for manipulating channel attributes
Extend the inkern API with functions for reading and writing attribute of iio channels. Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com> Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:

committed by
Mark Brown

parent
b688c18d30
commit
34739a213d
@@ -215,6 +215,32 @@ int iio_read_channel_average_raw(struct iio_channel *chan, int *val);
|
||||
*/
|
||||
int iio_read_channel_processed(struct iio_channel *chan, int *val);
|
||||
|
||||
/**
|
||||
* iio_write_channel_attribute() - Write values to the device attribute.
|
||||
* @chan: The channel being queried.
|
||||
* @val: Value being written.
|
||||
* @val2: Value being written.val2 use depends on attribute type.
|
||||
* @attribute: info attribute to be read.
|
||||
*
|
||||
* Returns an error code or 0.
|
||||
*/
|
||||
int iio_write_channel_attribute(struct iio_channel *chan, int val,
|
||||
int val2, enum iio_chan_info_enum attribute);
|
||||
|
||||
/**
|
||||
* iio_read_channel_attribute() - Read values from the device attribute.
|
||||
* @chan: The channel being queried.
|
||||
* @val: Value being written.
|
||||
* @val2: Value being written.Val2 use depends on attribute type.
|
||||
* @attribute: info attribute to be written.
|
||||
*
|
||||
* Returns an error code if failed. Else returns a description of what is in val
|
||||
* and val2, such as IIO_VAL_INT_PLUS_MICRO telling us we have a value of val
|
||||
* + val2/1e6
|
||||
*/
|
||||
int iio_read_channel_attribute(struct iio_channel *chan, int *val,
|
||||
int *val2, enum iio_chan_info_enum attribute);
|
||||
|
||||
/**
|
||||
* iio_write_channel_raw() - write to a given channel
|
||||
* @chan: The channel being queried.
|
||||
|
Reference in New Issue
Block a user