machine.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Industrial I/O in kernel access map definitions for board files.
  3. *
  4. * 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. */
  10. #ifndef __LINUX_IIO_MACHINE_H__
  11. #define __LINUX_IIO_MACHINE_H__
  12. /**
  13. * struct iio_map - description of link between consumer and device channels
  14. * @adc_channel_label: Label used to identify the channel on the provider.
  15. * This is matched against the datasheet_name element
  16. * of struct iio_chan_spec.
  17. * @consumer_dev_name: Name to uniquely identify the consumer device.
  18. * @consumer_channel: Unique name used to identify the channel on the
  19. * consumer side.
  20. * @consumer_data: Data about the channel for use by the consumer driver.
  21. */
  22. struct iio_map {
  23. const char *adc_channel_label;
  24. const char *consumer_dev_name;
  25. const char *consumer_channel;
  26. void *consumer_data;
  27. };
  28. #define IIO_MAP(_provider_channel, _consumer_dev_name, _consumer_channel) \
  29. { \
  30. .adc_channel_label = _provider_channel, \
  31. .consumer_dev_name = _consumer_dev_name, \
  32. .consumer_channel = _consumer_channel, \
  33. }
  34. #endif