Loading drivers/iio/inkern.c +18 −0 Original line number Diff line number Diff line Loading @@ -927,3 +927,21 @@ ssize_t iio_write_channel_ext_info(struct iio_channel *chan, const char *attr, chan->channel, buf, len); } EXPORT_SYMBOL_GPL(iio_write_channel_ext_info); int iio_write_channel_processed(struct iio_channel *chan, int val) { int ret; mutex_lock(&chan->indio_dev->info_exist_lock); if (chan->indio_dev->info == NULL) { ret = -ENODEV; goto err_unlock; } ret = iio_channel_write(chan, val, 0, IIO_CHAN_INFO_PROCESSED); err_unlock: mutex_unlock(&chan->indio_dev->info_exist_lock); return ret; } EXPORT_SYMBOL(iio_write_channel_processed); include/linux/iio/consumer.h +9 −0 Original line number Diff line number Diff line Loading @@ -252,6 +252,15 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val); */ int iio_read_avail_channel_raw(struct iio_channel *chan, const int **vals, int *length); /** * iio_write_channel_processed() - write to a given channel * @chan: The channel being queried. * @val: Value being written. * * Note processed writes to iio channels are converted to raw * values before being written. */ int iio_write_channel_processed(struct iio_channel *chan, int val); /** * iio_get_channel_type() - get the type of a channel Loading Loading
drivers/iio/inkern.c +18 −0 Original line number Diff line number Diff line Loading @@ -927,3 +927,21 @@ ssize_t iio_write_channel_ext_info(struct iio_channel *chan, const char *attr, chan->channel, buf, len); } EXPORT_SYMBOL_GPL(iio_write_channel_ext_info); int iio_write_channel_processed(struct iio_channel *chan, int val) { int ret; mutex_lock(&chan->indio_dev->info_exist_lock); if (chan->indio_dev->info == NULL) { ret = -ENODEV; goto err_unlock; } ret = iio_channel_write(chan, val, 0, IIO_CHAN_INFO_PROCESSED); err_unlock: mutex_unlock(&chan->indio_dev->info_exist_lock); return ret; } EXPORT_SYMBOL(iio_write_channel_processed);
include/linux/iio/consumer.h +9 −0 Original line number Diff line number Diff line Loading @@ -252,6 +252,15 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val); */ int iio_read_avail_channel_raw(struct iio_channel *chan, const int **vals, int *length); /** * iio_write_channel_processed() - write to a given channel * @chan: The channel being queried. * @val: Value being written. * * Note processed writes to iio channels are converted to raw * values before being written. */ int iio_write_channel_processed(struct iio_channel *chan, int val); /** * iio_get_channel_type() - get the type of a channel Loading