driver.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Industrial I/O in kernel access map interface.
  4. *
  5. * Copyright (c) 2011 Jonathan Cameron
  6. */
  7. #ifndef _IIO_INKERN_H_
  8. #define _IIO_INKERN_H_
  9. struct device;
  10. struct iio_dev;
  11. struct iio_map;
  12. /**
  13. * iio_map_array_register() - tell the core about inkernel consumers
  14. * @indio_dev: provider device
  15. * @map: array of mappings specifying association of channel with client
  16. */
  17. int iio_map_array_register(struct iio_dev *indio_dev,
  18. struct iio_map *map);
  19. /**
  20. * iio_map_array_unregister() - tell the core to remove consumer mappings for
  21. * the given provider device
  22. * @indio_dev: provider device
  23. */
  24. int iio_map_array_unregister(struct iio_dev *indio_dev);
  25. /**
  26. * devm_iio_map_array_register - device-managed version of iio_map_array_register
  27. * @dev: Device object to which to bind the unwinding of this registration
  28. * @indio_dev: Pointer to the iio_dev structure
  29. * @maps: Pointer to an IIO map object which is to be registered to this IIO device
  30. *
  31. * This function will call iio_map_array_register() to register an IIO map object
  32. * and will also hook a callback to the iio_map_array_unregister() function to
  33. * handle de-registration of the IIO map object when the device's refcount goes to
  34. * zero.
  35. */
  36. int devm_iio_map_array_register(struct device *dev, struct iio_dev *indio_dev, struct iio_map *maps);
  37. #endif