Loading drivers/iio/inkern.c +18 −0 Original line number Diff line number Diff line Loading @@ -746,3 +746,21 @@ int iio_write_channel_raw(struct iio_channel *chan, int val) return ret; } EXPORT_SYMBOL_GPL(iio_write_channel_raw); 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_GPL(iio_write_channel_processed); include/linux/iio/consumer.h +10 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,16 @@ int iio_read_channel_processed(struct iio_channel *chan, int *val); */ int iio_write_channel_raw(struct iio_channel *chan, int val); /** * 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 * @channel: The channel being queried. Loading Loading
drivers/iio/inkern.c +18 −0 Original line number Diff line number Diff line Loading @@ -746,3 +746,21 @@ int iio_write_channel_raw(struct iio_channel *chan, int val) return ret; } EXPORT_SYMBOL_GPL(iio_write_channel_raw); 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_GPL(iio_write_channel_processed);
include/linux/iio/consumer.h +10 −0 Original line number Diff line number Diff line Loading @@ -225,6 +225,16 @@ int iio_read_channel_processed(struct iio_channel *chan, int *val); */ int iio_write_channel_raw(struct iio_channel *chan, int val); /** * 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 * @channel: The channel being queried. Loading