Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Industrial I/O in kernel access map interface.
0004  *
0005  * Copyright (c) 2011 Jonathan Cameron
0006  */
0007 
0008 #ifndef _IIO_INKERN_H_
0009 #define _IIO_INKERN_H_
0010 
0011 struct device;
0012 struct iio_dev;
0013 struct iio_map;
0014 
0015 /**
0016  * iio_map_array_register() - tell the core about inkernel consumers
0017  * @indio_dev:  provider device
0018  * @map:    array of mappings specifying association of channel with client
0019  */
0020 int iio_map_array_register(struct iio_dev *indio_dev,
0021                struct iio_map *map);
0022 
0023 /**
0024  * iio_map_array_unregister() - tell the core to remove consumer mappings for
0025  *              the given provider device
0026  * @indio_dev:  provider device
0027  */
0028 int iio_map_array_unregister(struct iio_dev *indio_dev);
0029 
0030 /**
0031  * devm_iio_map_array_register - device-managed version of iio_map_array_register
0032  * @dev:    Device object to which to bind the unwinding of this registration
0033  * @indio_dev:  Pointer to the iio_dev structure
0034  * @maps:   Pointer to an IIO map object which is to be registered to this IIO device
0035  *
0036  * This function will call iio_map_array_register() to register an IIO map object
0037  * and will also hook a callback to the iio_map_array_unregister() function to
0038  * handle de-registration of the IIO map object when the device's refcount goes to
0039  * zero.
0040  */
0041 int devm_iio_map_array_register(struct device *dev, struct iio_dev *indio_dev, struct iio_map *maps);
0042 
0043 #endif