xref: /OK3568_Linux_fs/kernel/include/linux/iio/machine.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0-only */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Industrial I/O in kernel access map definitions for board files.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (c) 2011 Jonathan Cameron
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #ifndef __LINUX_IIO_MACHINE_H__
9*4882a593Smuzhiyun #define __LINUX_IIO_MACHINE_H__
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun /**
12*4882a593Smuzhiyun  * struct iio_map - description of link between consumer and device channels
13*4882a593Smuzhiyun  * @adc_channel_label:	Label used to identify the channel on the provider.
14*4882a593Smuzhiyun  *			This is matched against the datasheet_name element
15*4882a593Smuzhiyun  *			of struct iio_chan_spec.
16*4882a593Smuzhiyun  * @consumer_dev_name:	Name to uniquely identify the consumer device.
17*4882a593Smuzhiyun  * @consumer_channel:	Unique name used to identify the channel on the
18*4882a593Smuzhiyun  *			consumer side.
19*4882a593Smuzhiyun  * @consumer_data:	Data about the channel for use by the consumer driver.
20*4882a593Smuzhiyun  */
21*4882a593Smuzhiyun struct iio_map {
22*4882a593Smuzhiyun 	const char *adc_channel_label;
23*4882a593Smuzhiyun 	const char *consumer_dev_name;
24*4882a593Smuzhiyun 	const char *consumer_channel;
25*4882a593Smuzhiyun 	void *consumer_data;
26*4882a593Smuzhiyun };
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun #define IIO_MAP(_provider_channel, _consumer_dev_name, _consumer_channel) \
29*4882a593Smuzhiyun {									  \
30*4882a593Smuzhiyun 	.adc_channel_label = _provider_channel,				  \
31*4882a593Smuzhiyun 	.consumer_dev_name = _consumer_dev_name,			  \
32*4882a593Smuzhiyun 	.consumer_channel  = _consumer_channel,				  \
33*4882a593Smuzhiyun }
34*4882a593Smuzhiyun 
35*4882a593Smuzhiyun #endif
36