xref: /openbmc/linux/include/linux/iio/machine.h (revision 8d05ffd2)
106458e27SJonathan Cameron /*
206458e27SJonathan Cameron  * Industrial I/O in kernel access map definitions for board files.
306458e27SJonathan Cameron  *
406458e27SJonathan Cameron  * Copyright (c) 2011 Jonathan Cameron
506458e27SJonathan Cameron  *
606458e27SJonathan Cameron  * This program is free software; you can redistribute it and/or modify it
706458e27SJonathan Cameron  * under the terms of the GNU General Public License version 2 as published by
806458e27SJonathan Cameron  * the Free Software Foundation.
906458e27SJonathan Cameron  */
1006458e27SJonathan Cameron 
1108d6005cSLars-Peter Clausen #ifndef __LINUX_IIO_MACHINE_H__
1208d6005cSLars-Peter Clausen #define __LINUX_IIO_MACHINE_H__
1308d6005cSLars-Peter Clausen 
1406458e27SJonathan Cameron /**
1506458e27SJonathan Cameron  * struct iio_map - description of link between consumer and device channels
1606458e27SJonathan Cameron  * @adc_channel_label:	Label used to identify the channel on the provider.
1706458e27SJonathan Cameron  *			This is matched against the datasheet_name element
1806458e27SJonathan Cameron  *			of struct iio_chan_spec.
1906458e27SJonathan Cameron  * @consumer_dev_name:	Name to uniquely identify the consumer device.
2033e0c249SPeter Meerwald  * @consumer_channel:	Unique name used to identify the channel on the
2106458e27SJonathan Cameron  *			consumer side.
220464415dSJonathan Cameron  * @consumer_data:	Data about the channel for use by the consumer driver.
2306458e27SJonathan Cameron  */
2406458e27SJonathan Cameron struct iio_map {
2506458e27SJonathan Cameron 	const char *adc_channel_label;
2606458e27SJonathan Cameron 	const char *consumer_dev_name;
2706458e27SJonathan Cameron 	const char *consumer_channel;
280464415dSJonathan Cameron 	void *consumer_data;
2906458e27SJonathan Cameron };
3008d6005cSLars-Peter Clausen 
318d05ffd2SLukas Wunner #define IIO_MAP(_provider_channel, _consumer_dev_name, _consumer_channel) \
328d05ffd2SLukas Wunner {									  \
338d05ffd2SLukas Wunner 	.adc_channel_label = _provider_channel,				  \
348d05ffd2SLukas Wunner 	.consumer_dev_name = _consumer_dev_name,			  \
358d05ffd2SLukas Wunner 	.consumer_channel  = _consumer_channel,				  \
368d05ffd2SLukas Wunner }
378d05ffd2SLukas Wunner 
3808d6005cSLars-Peter Clausen #endif
39