| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Industrial I/O in kernel consumer interface |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * Copyright (c) 2011 Jonathan Cameron |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 7 | | - * under the terms of the GNU General Public License version 2 as published by |
|---|
| 8 | | - * the Free Software Foundation. |
|---|
| 9 | 6 | */ |
|---|
| 10 | 7 | #ifndef _IIO_INKERN_CONSUMER_H_ |
|---|
| 11 | 8 | #define _IIO_INKERN_CONSUMER_H_ |
|---|
| .. | .. |
|---|
| 67 | 64 | struct iio_channel *devm_iio_channel_get(struct device *dev, |
|---|
| 68 | 65 | const char *consumer_channel); |
|---|
| 69 | 66 | /** |
|---|
| 70 | | - * devm_iio_channel_release() - Resource managed version of |
|---|
| 71 | | - * iio_channel_release(). |
|---|
| 72 | | - * @dev: Pointer to consumer device for which resource |
|---|
| 73 | | - * is allocared. |
|---|
| 74 | | - * @chan: The channel to be released. |
|---|
| 75 | | - */ |
|---|
| 76 | | -void devm_iio_channel_release(struct device *dev, struct iio_channel *chan); |
|---|
| 77 | | - |
|---|
| 78 | | -/** |
|---|
| 79 | 67 | * iio_channel_get_all() - get all channels associated with a client |
|---|
| 80 | 68 | * @dev: Pointer to consumer device. |
|---|
| 81 | 69 | * |
|---|
| .. | .. |
|---|
| 108 | 96 | * unbounded. |
|---|
| 109 | 97 | */ |
|---|
| 110 | 98 | struct iio_channel *devm_iio_channel_get_all(struct device *dev); |
|---|
| 111 | | - |
|---|
| 112 | | -/** |
|---|
| 113 | | - * devm_iio_channel_release_all() - Resource managed version of |
|---|
| 114 | | - * iio_channel_release_all(). |
|---|
| 115 | | - * @dev: Pointer to consumer device for which resource |
|---|
| 116 | | - * is allocared. |
|---|
| 117 | | - * @chan: Array channel to be released. |
|---|
| 118 | | - */ |
|---|
| 119 | | -void devm_iio_channel_release_all(struct device *dev, struct iio_channel *chan); |
|---|
| 120 | 99 | |
|---|
| 121 | 100 | struct iio_cb_buffer; |
|---|
| 122 | 101 | /** |
|---|
| .. | .. |
|---|
| 291 | 270 | const int **vals, int *length); |
|---|
| 292 | 271 | |
|---|
| 293 | 272 | /** |
|---|
| 273 | + * iio_read_avail_channel_attribute() - read available channel attribute values |
|---|
| 274 | + * @chan: The channel being queried. |
|---|
| 275 | + * @vals: Available values read back. |
|---|
| 276 | + * @type: Type of values read back. |
|---|
| 277 | + * @length: Number of entries in vals. |
|---|
| 278 | + * @attribute: info attribute to be read back. |
|---|
| 279 | + * |
|---|
| 280 | + * Returns an error code, IIO_AVAIL_RANGE or IIO_AVAIL_LIST. |
|---|
| 281 | + */ |
|---|
| 282 | +int iio_read_avail_channel_attribute(struct iio_channel *chan, |
|---|
| 283 | + const int **vals, int *type, int *length, |
|---|
| 284 | + enum iio_chan_info_enum attribute); |
|---|
| 285 | + |
|---|
| 286 | +/** |
|---|
| 294 | 287 | * iio_get_channel_type() - get the type of a channel |
|---|
| 295 | 288 | * @channel: The channel being queried. |
|---|
| 296 | 289 | * @type: The type of the channel. |
|---|