From 8d05ffd2b8a08668cfea9e64a2991ab8ec9b494e Mon Sep 17 00:00:00 2001 From: Lukas Wunner Date: Sat, 25 Nov 2017 09:38:17 +0100 Subject: iio: Add macro to populate struct iio_map array The GPIO core provides a handy GPIO_LOOKUP() macro to populate a struct gpiod_lookup array without having to spell out attribute names (but still avoid breakage when attributes within the struct are rearranged or added). The axp288_adc.c driver uses a similar macro to populate a struct iio_map array. Make it available to others. Cc: Jacob Pan Signed-off-by: Lukas Wunner Acked-by: Chen-Yu Tsai Signed-off-by: Jonathan Cameron --- include/linux/iio/machine.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/linux/iio') diff --git a/include/linux/iio/machine.h b/include/linux/iio/machine.h index 1601a2a63a72..5e1cfa75f652 100644 --- a/include/linux/iio/machine.h +++ b/include/linux/iio/machine.h @@ -28,4 +28,11 @@ struct iio_map { void *consumer_data; }; +#define IIO_MAP(_provider_channel, _consumer_dev_name, _consumer_channel) \ +{ \ + .adc_channel_label = _provider_channel, \ + .consumer_dev_name = _consumer_dev_name, \ + .consumer_channel = _consumer_channel, \ +} + #endif -- cgit v1.2.3 From 08e2e51f9acf9d2ab0437721aed71de53bd334e6 Mon Sep 17 00:00:00 2001 From: Tobin C. Harding Date: Tue, 19 Dec 2017 16:59:35 +1100 Subject: iio: fix SPHINX kernel-docs build warning When building kernel documentation sphinx emits the following warnings No description found for parameter 'iio_dev' Excess function parameter 'indio_dev' description in 'iio_device_register' These warnings are caused by a macro with a different argument identifier to the one listed in the kernel-docs. Change macro argument to be the same as the docs. Signed-off-by: Tobin C. Harding Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- include/linux/iio/iio.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/linux/iio') diff --git a/include/linux/iio/iio.h b/include/linux/iio/iio.h index 20b61347ea58..1234e5571d45 100644 --- a/include/linux/iio/iio.h +++ b/include/linux/iio/iio.h @@ -606,8 +606,8 @@ const struct iio_chan_spec * iio_device_register() - register a device with the IIO subsystem * @indio_dev: Device structure filled by the device driver **/ -#define iio_device_register(iio_dev) \ - __iio_device_register((iio_dev), THIS_MODULE) +#define iio_device_register(indio_dev) \ + __iio_device_register((indio_dev), THIS_MODULE) int __iio_device_register(struct iio_dev *indio_dev, struct module *this_mod); void iio_device_unregister(struct iio_dev *indio_dev); /** -- cgit v1.2.3 From e7f62713eb4e0952f43c862fc2f0ff68b257464f Mon Sep 17 00:00:00 2001 From: Tobin C. Harding Date: Sun, 7 Jan 2018 08:56:05 +1100 Subject: iio: add kernel-doc for field @owner When building kernel documentation sphinx emits the following warning warning: No description found for parameter 'owner' Add description for struct member 'owner'. Signed-off-by: Tobin C. Harding Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- include/linux/iio/trigger.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux/iio') diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 7d5e44518379..390789d43369 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h @@ -43,6 +43,7 @@ struct iio_trigger_ops { /** * struct iio_trigger - industrial I/O trigger device * @ops: [DRIVER] operations structure + * @owner: [INTERN] owner of this driver module * @id: [INTERN] unique id number * @name: [DRIVER] unique name * @dev: [DRIVER] associated device (if relevant) -- cgit v1.2.3 From 284d95c707ffb3d9c7562d0b6bb19e363768d12b Mon Sep 17 00:00:00 2001 From: Tobin C. Harding Date: Sun, 7 Jan 2018 08:56:06 +1100 Subject: iio: add field identifier for @use_count kernel-doc Kernel-doc for @use_count does not currently have a field identifier. All the rest of the fields do. @use_count is used internally and should not be accessed directly by the driver so it should be marked as so. Add [INTERN] identifier to @use_count field. Signed-off-by: Tobin C. Harding Signed-off-by: Jonathan Cameron Signed-off-by: Greg Kroah-Hartman --- include/linux/iio/trigger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux/iio') diff --git a/include/linux/iio/trigger.h b/include/linux/iio/trigger.h index 390789d43369..b19b7204ef84 100644 --- a/include/linux/iio/trigger.h +++ b/include/linux/iio/trigger.h @@ -49,7 +49,7 @@ struct iio_trigger_ops { * @dev: [DRIVER] associated device (if relevant) * @list: [INTERN] used in maintenance of global trigger list * @alloc_list: [DRIVER] used for driver specific trigger list - * @use_count: use count for the trigger + * @use_count: [INTERN] use count for the trigger. * @subirq_chip: [INTERN] associate 'virtual' irq chip. * @subirq_base: [INTERN] base number for irqs provided by trigger. * @subirqs: [INTERN] information about the 'child' irqs. -- cgit v1.2.3