IIO V4. Industrial I/O Subsystem
Subsystems (2)
cover IIO V4. Industrial I/O Subsystem
Major changes since last version:
* Allocation of most internal structures now handled in a much simpler fashion - very close to how input does it.
* Moved to cdev based dynamic allocation of all chrdevs.
* Cleaner and more modular code.
* Now works fine with udev
* Patch series reordered in order to aid review by adding devices as soon as there is sufficient support.
* Software ring buffer code thoroughly reworked. Now much more reliable.now reasonably happy with the core design so all comments on the contents of the first patch especially welcome.
* Numerous minor fixes, clarifications etc
As is readily apparent from the patches, some are still very much at the proof of concept stage. The periodic rtc trigger is a tempoary stop gap until a more suitable timer interface is available. The gpio trigger is very minimal. Finally the documenation clearly still needs considerable refinement.
Thanks to everyone who has helped with comments on the previous versions and to the users for bug reports etc.
All comments on any aspect so design or indeed specific elements of the patches would be most welcome! More formal reviews also welcome if anyone has time. Suggestions relating to moving towards merging this also particuarly welcome.
For now I'll still be reworking this patch set in response to reviews, so I wouldn't suggest using the tree as the basis of development just yet.
git tree available at: (based on Linus' tree as of about 2 days ago)
git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio_v4.git
http://www.kernel.org/pub/scm/linux/kernel/git/jic23/iio_v4.git
Updated white paper describing the subsystem to appear in the next few days.
Note that I'm still not all that convinced by the name. Other suggestions would be most welcome.
Jonathan Cameron (14):
IIO: core support for device registration and management
IIO: max1363 ADC driver
IIO: tsl2561 digital light sensor core support
IIO: lis3l02dq accelerometer core support
IIO: kxsd9 accelerometer minimal support
IIO: Add generic ring buffer support to the IIO core
IIO: VTI sca3000 series accelerometer driver (spi)
IIO: Trigger support added to core.
IIO: Ring buffer: Initial pass at rarely locked ring buffer
IIO: lis3l02dq ring buffer and data ready trigger support
IIO: max1363 add software ring buffer support using ring_sw
IIO: Periodic timer based trigger
IIO: Proof of concept gpio trigger
IIO: Initial documentation
Documentation/iio/device.txt | 49 + Documentation/iio/iio_utils.h | 163 +++ Documentation/iio/lis3l02dqbuffersimple.c | 172 +++ Documentation/iio/overview.txt | 62 ++ Documentation/iio/ring.txt | 62 ++ Documentation/iio/trigger.txt | 38 + Documentation/iio/userspace.txt | 60 ++ drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/iio/Kconfig | 42 + drivers/iio/Makefile | 16 + drivers/iio/accel/Kconfig | 28 + drivers/iio/accel/Makefile | 11 + drivers/iio/accel/kxsd9.c | 395 +++++++ drivers/iio/accel/lis3l02dq.h | 232 ++++ drivers/iio/accel/lis3l02dq_core.c | 925 ++++++++++++++++ drivers/iio/accel/lis3l02dq_ring.c | 599 +++++++++++ drivers/iio/accel/sca3000.h | 273 +++++ drivers/iio/accel/sca3000_core.c | 1509 +++++++++++++++++++++++++++ drivers/iio/accel/sca3000_ring.c | 334 ++++++ drivers/iio/adc/Kconfig | 14 + drivers/iio/adc/Makefile | 8 + drivers/iio/adc/max1363.h | 269 +++++ drivers/iio/adc/max1363_core.c | 622 +++++++++++ drivers/iio/adc/max1363_ring.c | 235 +++++ drivers/iio/industrialio-core.c | 847 +++++++++++++++ drivers/iio/industrialio-ring.c | 566 ++++++++++ drivers/iio/industrialio-trigger.c | 400 +++++++ drivers/iio/light/Kconfig | 14 + drivers/iio/light/Makefile | 5 + drivers/iio/light/tsl2561.c | 275 +++++ drivers/iio/ring_sw.c | 431 ++++++++ drivers/iio/trigger/Kconfig | 18 + drivers/iio/trigger/Makefile | 5 + drivers/iio/trigger/iio-trig-gpio.c | 203 ++++ drivers/iio/trigger/iio-trig-periodic-rtc.c | 230 ++++ include/linux/iio/accel.h | 167 +++ include/linux/iio/adc.h | 13 + include/linux/iio/chrdev.h | 118 +++ include/linux/iio/gpio_trigger.h | 6 + include/linux/iio/iio.h | 411 ++++++++ include/linux/iio/light.h | 12 + include/linux/iio/prtc_trigger.h | 7 + include/linux/iio/ring_generic.h | 283 +++++ include/linux/iio/ring_hw.h | 22 + include/linux/iio/ring_sw.h | 189 ++++ include/linux/iio/sca3000.h | 37 + include/linux/iio/sysfs.h | 293 ++++++ include/linux/iio/trigger.h | 148 +++ include/linux/iio/trigger_consumer.h | 45 + 50 files changed, 10866 insertions(+), 0 deletions(-) create mode 100644 Documentation/iio/device.txt create mode 100644 Documentation/iio/iio_utils.h create mode 100644 Documentation/iio/lis3l02dqbuffersimple.c create mode 100644 Documentation/iio/overview.txt create mode 100644 Documentation/iio/ring.txt create mode 100644 Documentation/iio/trigger.txt create mode 100644 Documentation/iio/userspace.txt create mode 100644 drivers/iio/Kconfig create mode 100644 drivers/iio/Makefile create mode 100644 drivers/iio/accel/Kconfig create mode 100644 drivers/iio/accel/Makefile create mode 100644 drivers/iio/accel/kxsd9.c create mode 100644 drivers/iio/accel/lis3l02dq.h create mode 100644 drivers/iio/accel/lis3l02dq_core.c create mode 100644 drivers/iio/accel/lis3l02dq_ring.c create mode 100644 drivers/iio/accel/sca3000.h create mode 100644 drivers/iio/accel/sca3000_core.c create mode 100644 drivers/iio/accel/sca3000_ring.c create mode 100644 drivers/iio/adc/Kconfig create mode 100644 drivers/iio/adc/Makefile create mode 100644 drivers/iio/adc/max1363.h create mode 100644 drivers/iio/adc/max1363_core.c create mode 100644 drivers/iio/adc/max1363_ring.c create mode 100644 drivers/iio/industrialio-core.c create mode 100644 drivers/iio/industrialio-ring.c create mode 100644 drivers/iio/industrialio-trigger.c create mode 100644 drivers/iio/light/Kconfig create mode 100644 drivers/iio/light/Makefile create mode 100644 drivers/iio/light/tsl2561.c create mode 100644 drivers/iio/ring_sw.c create mode 100644 drivers/iio/trigger/Kconfig create mode 100644 drivers/iio/trigger/Makefile create mode 100644 drivers/iio/trigger/iio-trig-gpio.c create mode 100644 drivers/iio/trigger/iio-trig-periodic-rtc.c create mode 100644 include/linux/iio/accel.h create mode 100644 include/linux/iio/adc.h create mode 100644 include/linux/iio/chrdev.h create mode 100644 include/linux/iio/gpio_trigger.h create mode 100644 include/linux/iio/iio.h create mode 100644 include/linux/iio/light.h create mode 100644 include/linux/iio/prtc_trigger.h create mode 100644 include/linux/iio/ring_generic.h create mode 100644 include/linux/iio/ring_hw.h create mode 100644 include/linux/iio/ring_sw.h create mode 100644 include/linux/iio/sca3000.h create mode 100644 include/linux/iio/sysfs.h create mode 100644 include/linux/iio/trigger.h create mode 100644 include/linux/iio/trigger_consumer.h
PATCH 1/14 IIO: core support for device registration and management
---
Changes since V2.
* New structure, much closer to that on input subsystem. An IIO device now has an associated struct device which has the underlying hardware device (i2c, spi etc) as its parent. This in turn has struct devices as children for event interfaces.
* Chrdevs now handled via cdev structures with
dynamically allocated major number.
* Ring buffer and trigger functionality made more modular (and hence hardly show up in the core at all). This results in device drivers having to call a couple more functions but results in a much cleaner core. Also trigger consumer head separated from main trigger header.
* Scan mode selection etc changed to being via access functions to allow for simple change of implementation as apprpriate as device requirements become apparent.
* Numerous clean ups and comment fixes.
--- drivers/Kconfig | 2 + drivers/Makefile | 1 + drivers/iio/Kconfig | 11 + drivers/iio/Makefile | 6 + drivers/iio/industrialio-core.c | 847 ++++++++++++++++++++++++++++++++++ include/linux/iio/chrdev.h | 118 +++++ include/linux/iio/iio.h | 411 ++++++++++++++++ include/linux/iio/sysfs.h | 293 ++++++++++++ include/linux/iio/trigger_consumer.h | 26 + 9 files changed, 1715 insertions(+), 0 deletions(-) create mode 100644 drivers/iio/Kconfig create mode 100644 drivers/iio/Makefile create mode 100644 drivers/iio/industrialio-core.c create mode 100644 include/linux/iio/chrdev.h create mode 100644 include/linux/iio/iio.h create mode 100644 include/linux/iio/sysfs.h create mode 100644 include/linux/iio/trigger_consumer.h
drivers/Kconfig +2 -0
@@ -110,6 +110,8 @@ source "drivers/vlynq/Kconfig" source "drivers/xen/Kconfig" +source "drivers/iio/Kconfig" + source "drivers/staging/Kconfig" source "drivers/platform/Kconfig"
drivers/Makefile +1 -0
@@ -107,6 +107,7 @@ obj-$(CONFIG_OF) += of/ obj-$(CONFIG_SSB) += ssb/ obj-$(CONFIG_VIRTIO) += virtio/ obj-$(CONFIG_VLYNQ) += vlynq/ +obj-$(CONFIG_IIO) += iio/ obj-$(CONFIG_STAGING) += staging/ obj-y += platform/ obj-y += ieee802154/
drivers/iio/Kconfig new file +11 -0
@@ -0,0 +1,11 @@ +# +# Industrial I/O subsytem configuration +# + +menuconfig IIO + tristate "Industrial I/O support" + ---help--- + The industrial I/O subsystem provides a unified framework for + drivers for many different types of embedded sensors using a + number of different physical interfaces (i2c, spi etc). See + Documentation/industrialio for more information.
drivers/iio/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# +# Makefile for the industrial I/O core. +# + +obj-$(CONFIG_IIO) += industrialio.o +industrialio-y := industrialio-core.o
drivers/iio/industrialio-core.c new file +847 -0
847 lines not on this page · raw message
include/linux/iio/chrdev.h new file +118 -0
118 lines not on this page · raw message
include/linux/iio/iio.h new file +411 -0
411 lines not on this page · raw message
include/linux/iio/sysfs.h new file +293 -0
293 lines not on this page · raw message
include/linux/iio/trigger_consumer.h new file +26 -0
@@ -0,0 +1,26 @@ + +/* The industrial I/O core, trigger consumer handling functions +* +* Copyright (c) 2008 Jonathan Cameron +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +*/ + +/** +* iio_device_register_trigger_consumer() - set up an iio_dev to use triggers. +* @dev_info: iio_dev associated with the device that will consume the trigger +**/ +int iio_device_register_trigger_consumer (struct iio_dev *dev_info) +{ +return 0 ; +}; +/** +* iio_device_unregister_trigger_consumer() - reverse the registration process +. * @dev_info: iio_dev associated with the device that consumed the trigger +**/ +int iio_device_unregister_trigger_consumer (struct iio_dev *dev_info) +{ +return 0 ; +};
Signature · 1 line
1.6.2
PATCH 2/14 IIO: max1363 ADC driver
Core support for MAX1361, MAX1362, MAX1363, MAX1364, MAX1136, MAX1137, MAX1138, MAX1139, MAX1236, MAX1237, MAX1238, MAX1239.
Ring buffer support later in series.
---
Changes since V2:
* Moved to new iio registration functions
* General cleanups
--- drivers/iio/Kconfig | 2 + drivers/iio/Makefile | 2 + drivers/iio/adc/Kconfig | 14 + drivers/iio/adc/Makefile | 7 + drivers/iio/adc/max1363.h | 257 +++++++++++++++++ drivers/iio/adc/max1363_core.c | 622 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 904 insertions(+), 0 deletions(-) create mode 100644 drivers/iio/adc/Kconfig create mode 100644 drivers/iio/adc/Makefile create mode 100644 drivers/iio/adc/max1363.h create mode 100644 drivers/iio/adc/max1363_core.c
drivers/iio/Kconfig +2 -0
@@ -9,3 +9,5 @@ menuconfig IIO drivers for many different types of embedded sensors using a number of different physical interfaces (i2c, spi etc). See Documentation/industrialio for more information. + +source drivers/iio/adc/Kconfig
drivers/iio/Makefile +2 -0
@@ -4,3 +4,5 @@ obj-$(CONFIG_IIO) += industrialio.o industrialio-y := industrialio-core.o + +obj-y += adc/
drivers/iio/adc/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +# +# ADC drivers +# +comment "Analog to digital convertors" + depends on IIO + +config MAX1363 + tristate "MAXIM max1363 ADC driver" + depends on IIO + help + Say yes here to build support for many MAXIM i2c analog to digital + convertors (ADC). (max1361, max1362, max1363, max1364, max1136, + max1136, max1137, max1138, max1139, max1236, max1237, max11238, + max1239) Provides direct access via sysfs.
drivers/iio/adc/Makefile new file +7 -0
@@ -0,0 +1,7 @@ + +# Makefile for industrial I/O ADC drivers +# + +max1363-y := max1363_core.o + +obj-$(CONFIG_MAX1363) += max1363.o
drivers/iio/adc/max1363.h new file +257 -0
257 lines not on this page · raw message
drivers/iio/adc/max1363_core.c new file +622 -0
622 lines not on this page · raw message
Signature · 1 line
1.6.2
PATCH 3/14 IIO: tsl2561 digital light sensor core support
This is a pretty minimalist example of an IIO driver.
---
Unlike the existing light sensor driver tsl2550 all conversion to units is left to userspace. This is similar to the isl29003 driver.
IIO may in future provide a home for such light sensor drivers.
--- drivers/iio/Kconfig | 3 +- drivers/iio/Makefile | 3 +- drivers/iio/light/Kconfig | 14 ++ drivers/iio/light/Makefile | 5 + drivers/iio/light/tsl2561.c | 275 +++++++++++++++++++++++++++++++++++++++++++ include/linux/iio/light.h | 12 ++ 6 files changed, 310 insertions(+), 2 deletions(-) create mode 100644 drivers/iio/light/Kconfig create mode 100644 drivers/iio/light/Makefile create mode 100644 drivers/iio/light/tsl2561.c create mode 100644 include/linux/iio/light.h
drivers/iio/Kconfig +2 -1
@@ -10,4 +10,5 @@ menuconfig IIO number of different physical interfaces (i2c, spi etc). See Documentation/industrialio for more information. -source drivers/iio/adc/Kconfig +source drivers/iio/adc/Kconfig +source drivers/iio/light/Kconfig
drivers/iio/Makefile +2 -1
@@ -5,4 +5,5 @@ obj-$(CONFIG_IIO) += industrialio.o industrialio-y := industrialio-core.o -obj-y += adc/ +obj-y += adc/ +obj-y += light/
drivers/iio/light/Kconfig new file +14 -0
@@ -0,0 +1,14 @@ +# +# Light sensors +# +comment "Light sensors" + depends on IIO + +config TSL2561 + tristate "TAOS TSL2561 light-to-digital convertor" + depends on IIO + help + Say yes bere to build support for the TAOS light to digital + convertor. This chip has two light sensors. One is broadband + including infrared whilst the other measures only infrared. + Provides direct access via sysfs.
drivers/iio/light/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for industrial I/O Light sensors +# + +obj-$(CONFIG_TSL2561) += tsl2561.o
drivers/iio/light/tsl2561.c new file +275 -0
275 lines not on this page · raw message
include/linux/iio/light.h new file +12 -0
@@ -0,0 +1,12 @@ +#include <linux/iio/sysfs.h> + +/* Light to digital sensor attributes */ + +#define IIO_DEV_ATTR_LIGHT_INFRARED (_num, _show, _addr) \ + IIO_DEVICE_ATTR(light_infrared##_num, S_IRUGO, _show, NULL, _addr) + +#define IIO_DEV_ATTR_LIGHT_BROAD (_num, _show, _addr) \ + IIO_DEVICE_ATTR(light_broadspectrum##_num, S_IRUGO, _show, NULL, _addr) + +#define IIO_DEV_ATTR_LIGHT_VISIBLE (_num, _show, _addr) \ + IIO_DEVICE_ATTR(light_visible##_num, S_IRUGO, _show, NULL, _addr)
Signature · 1 line
1.6.2
PATCH 4/14 IIO: lis3l02dq accelerometer core support
A later patch in the series will add data ready triggering and ring buffer support.
This core patch provides an event interface and sysfs based reading of values.
--- drivers/iio/Kconfig | 1 + drivers/iio/Makefile | 1 + drivers/iio/accel/Kconfig | 13 + drivers/iio/accel/Makefile | 5 + drivers/iio/accel/lis3l02dq.h | 212 ++++++++ drivers/iio/accel/lis3l02dq_core.c | 925 ++++++++++++++++++++++++++++++++++++ include/linux/iio/accel.h | 167 +++++++ 7 files changed, 1324 insertions(+), 0 deletions(-) create mode 100644 drivers/iio/accel/Kconfig create mode 100644 drivers/iio/accel/Makefile create mode 100644 drivers/iio/accel/lis3l02dq.h create mode 100644 drivers/iio/accel/lis3l02dq_core.c create mode 100644 include/linux/iio/accel.h
drivers/iio/Kconfig +1 -0
@@ -10,5 +10,6 @@ menuconfig IIO number of different physical interfaces (i2c, spi etc). See Documentation/industrialio for more information. +source drivers/iio/accel/Kconfig source drivers/iio/adc/Kconfig source drivers/iio/light/Kconfig
drivers/iio/Makefile +1 -0
@@ -5,5 +5,6 @@ obj-$(CONFIG_IIO) += industrialio.o industrialio-y := industrialio-core.o +obj-y += accel/ obj-y += adc/ obj-y += light/
drivers/iio/accel/Kconfig new file +13 -0
@@ -0,0 +1,13 @@ +# +# Accelerometer drivers +# +comment "Accelerometers" + depends on IIO + +config LIS3L02DQ + tristate "ST Microelectronics LIS3L02DQ Accelerometer Driver" + depends on IIO && SPI + help + Say yes here to build SPI support for the ST microelectronics + accelerometer. The driver supplies direct access via sysfs files + and an event interface via a character device.
drivers/iio/accel/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for industrial I/O accelerometer drivers +# +lis3l02dq-y := lis3l02dq_core.o +obj-$(CONFIG_LIS3L02DQ) += lis3l02dq.o
drivers/iio/accel/lis3l02dq.h new file +212 -0
212 lines not on this page · raw message
drivers/iio/accel/lis3l02dq_core.c new file +925 -0
925 lines not on this page · raw message
include/linux/iio/accel.h new file +167 -0
167 lines not on this page · raw message
Signature · 1 line
1.6.2
PATCH 5/14 IIO: kxsd9 accelerometer minimal support
This provides only very minimal support for this device. Note that an alternate driver has been posted to the input mailing list.
When the original LMKL discussion that led to the descision to develop IIO occured, the question on whether the differing requirements of IIO and input drivers made it a good idea to have unified drivers was left as an open question. It still is. All opinions on this question welcome.
--- drivers/iio/accel/Kconfig | 7 + drivers/iio/accel/Makefile | 2 + drivers/iio/accel/kxsd9.c | 395 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/iio/adc.h | 13 ++ 4 files changed, 417 insertions(+), 0 deletions(-) create mode 100644 drivers/iio/accel/kxsd9.c create mode 100644 include/linux/iio/adc.h
drivers/iio/accel/Kconfig +7 -0
@@ -4,6 +4,13 @@ comment "Accelerometers" depends on IIO +config KXSD9 + tristate "Kionix KXSD9 Accelerometer Driver" + depends on IIO && SPI + help + Say yes here to build support for the Kionix KXSD9 accelerometer. + Currently this only supports the device via an SPI interface. + config LIS3L02DQ tristate "ST Microelectronics LIS3L02DQ Accelerometer Driver" depends on IIO && SPI
drivers/iio/accel/Makefile +2 -0
@@ -1,5 +1,7 @@ # # Makefile for industrial I/O accelerometer drivers # +obj-$(CONFIG_KXSD9) += kxsd9.o + lis3l02dq-y := lis3l02dq_core.o obj-$(CONFIG_LIS3L02DQ) += lis3l02dq.o
drivers/iio/accel/kxsd9.c new file +395 -0
395 lines not on this page · raw message
include/linux/iio/adc.h new file +13 -0
@@ -0,0 +1,13 @@ +/* +* adc.h - sysfs attributes associated with ADCs +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* Copyright (c) 2008 Jonathan Cameron <[email protected]> +* +*/ + +#define IIO_DEV_ATTR_ADC (_num, _show, _addr) \ + IIO_DEVICE_ATTR(adc_##_num, S_IRUGO, _show, NULL, _addr)
Signature · 1 line
1.6.2
PATCH 6/14 IIO: Add generic ring buffer support to the IIO core
This provides a unified interface for hardware and software ring buffers.
Changes since V2:
* Moved to a more consistent structure. Now the ring buffer has an associated struct device which is a child of the relevant iio_dev. This in turn has two children, one for the event interface and one for the access interface. These two interfaces are now managed via cdev structures.
* Numerous minor cleanups
--- drivers/iio/Kconfig | 7 + drivers/iio/Makefile | 1 + drivers/iio/industrialio-ring.c | 566 ++++++++++++++++++++++++++++++++++++++ include/linux/iio/ring_generic.h | 283 +++++++++++++++++++ 4 files changed, 857 insertions(+), 0 deletions(-) create mode 100644 drivers/iio/industrialio-ring.c create mode 100644 include/linux/iio/ring_generic.h
drivers/iio/Kconfig +7 -0
@@ -10,6 +10,13 @@ menuconfig IIO number of different physical interfaces (i2c, spi etc). See Documentation/industrialio for more information. +config IIO_RING_BUFFER + depends on IIO + bool "Enable ring buffer support within IIO" + help + Provide core support for various ring buffer based data + acquisition methods. + source drivers/iio/accel/Kconfig source drivers/iio/adc/Kconfig source drivers/iio/light/Kconfig
drivers/iio/Makefile +1 -0
@@ -4,6 +4,7 @@ obj-$(CONFIG_IIO) += industrialio.o industrialio-y := industrialio-core.o +industrialio-$(CONFIG_IIO_RING_BUFFER) += industrialio-ring.o obj-y += accel/ obj-y += adc/
drivers/iio/industrialio-ring.c new file +566 -0
566 lines not on this page · raw message
include/linux/iio/ring_generic.h new file +283 -0
283 lines not on this page · raw message
Signature · 1 line
1.6.2
PATCH 7/14 IIO: VTI sca3000 series accelerometer driver (spi)
Example of how a device with a hardware ring buffer is handled within IIO.
Changes since V2:
* Moved to new registration functions giving much cleaner interface.
--- drivers/iio/accel/Kconfig | 8 + drivers/iio/accel/Makefile | 3 + drivers/iio/accel/sca3000.h | 273 +++++++ drivers/iio/accel/sca3000_core.c | 1509 ++++++++++++++++++++++++++++++++++++++ drivers/iio/accel/sca3000_ring.c | 334 +++++++++ include/linux/iio/ring_hw.h | 22 + include/linux/iio/sca3000.h | 37 + 7 files changed, 2186 insertions(+), 0 deletions(-) create mode 100644 drivers/iio/accel/sca3000.h create mode 100644 drivers/iio/accel/sca3000_core.c create mode 100644 drivers/iio/accel/sca3000_ring.c create mode 100644 include/linux/iio/ring_hw.h create mode 100644 include/linux/iio/sca3000.h
drivers/iio/accel/Kconfig +8 -0
@@ -18,3 +18,11 @@ config LIS3L02DQ Say yes here to build SPI support for the ST microelectronics accelerometer. The driver supplies direct access via sysfs files and an event interface via a character device. + +config SCA3000 + depends on IIO && IIO_RING_BUFFER + depends on SPI + tristate "VTI SCA3000 series accelerometers" + help + Say yes here to build support for the VTI SCA3000 series of SPI + accelerometers. These devices use a hardware ring buffer.
drivers/iio/accel/Makefile +3 -0
@@ -5,3 +5,6 @@ obj-$(CONFIG_KXSD9) += kxsd9.o lis3l02dq-y := lis3l02dq_core.o obj-$(CONFIG_LIS3L02DQ) += lis3l02dq.o + +sca3000-y := sca3000_core.o sca3000_ring.o +obj-$(CONFIG_SCA3000) += sca3000.o
drivers/iio/accel/sca3000.h new file +273 -0
273 lines not on this page · raw message
drivers/iio/accel/sca3000_core.c new file +1509 -0
1,509 lines not on this page · raw message
drivers/iio/accel/sca3000_ring.c new file +334 -0
334 lines not on this page · raw message
include/linux/iio/ring_hw.h new file +22 -0
@@ -0,0 +1,22 @@ +/* +* ring_hw.h - common functionality for iio hardware ring buffers +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* Copyright (c) 2009 Jonathan Cameron <[email protected]> +* +*/ + +/** +* struct iio_hw_ring_buffer- hardware ring buffer +* @buf: generic ring buffer elements +* @private: device specific data +*/ +struct iio_hw_ring_buffer { +struct iio_ring_buffer buf; +void *private; +}; + +#define iio_to_hw_ring_buf (r) container_of(r, struct iio_hw_ring_buffer, buf)
include/linux/iio/sca3000.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* sca3000.h -- conversion functions related to VTI sca3000 +* series accelerometers +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* Copyright (c) 2007 Jonathan Cameron <[email protected]> +* +*/ + +#ifndef _SCA3000_H_USER_ +#define _SCA3000_H_USER_ + +/* Conversion function for use with the ring buffer when in 11bit mode */ +static inline int sca3000_11bit_convert (uint8_t msb,uint8_t lsb) +{ +int16_t val; + + val = ((lsb >>3 ) &0x1C ) | (msb <<5 ); + val |= (val & (1 <<12 )) ?0xE000 :0 ; + +return val; +}; + +static inline int sca3000_13bit_convert (uint8_t msb,uint8_t lsb) +{ +s16 val; + + val = ((lsb >>3 ) &0x1F ) | (msb <<5 ); +/* sign fill */ + val |= (val & (1 <<12 )) ?0xE000 :0 ; + +return val; +} +#endif /* _SCA3000_H_USER_ */
Signature · 1 line
1.6.2
PATCH 8/14 IIO: Trigger support added to core.
Add general registration support for IIO triggers. These are currently only used to initialize a 'poll' of a given device. Examples include the lis3l02dq's data ready signal being used to initialize a read and gpio triggers being used to allow externally synchronized sensor reading.
Each trigger can cause any number of 'consumer' devices to be polled with each storing data into a related ring buffer.
Two stage triggering is supported with 'fast' and 'slow' paths. The first is used for things like pulling a data hold line high and the second for actual read which may take far longer.
Changes since V2:
* As with IIO triggers now use a registration approach much closer to that of input leading to cleaner code.
--- drivers/iio/Kconfig | 9 + drivers/iio/Makefile | 1 + drivers/iio/industrialio-trigger.c | 400 ++++++++++++++++++++++++++++++++++ include/linux/iio/trigger.h | 148 +++++++++++++ include/linux/iio/trigger_consumer.h | 21 ++- 5 files changed, 578 insertions(+), 1 deletions(-) create mode 100644 drivers/iio/industrialio-trigger.c create mode 100644 include/linux/iio/trigger.h
drivers/iio/Kconfig +9 -0
@@ -17,6 +17,15 @@ config IIO_RING_BUFFER Provide core support for various ring buffer based data acquisition methods. +config IIO_TRIGGER + boolean "Enable triggered sampling support" + depends on IIO + help + Provides IIO core support for triggers. Currently these + are used to initialize capture of samples to push into + ring buffers. The triggers are effectively a 'capture + data now' interrupt. + source drivers/iio/accel/Kconfig source drivers/iio/adc/Kconfig source drivers/iio/light/Kconfig
drivers/iio/Makefile +1 -0
@@ -5,6 +5,7 @@ obj-$(CONFIG_IIO) += industrialio.o industrialio-y := industrialio-core.o industrialio-$(CONFIG_IIO_RING_BUFFER) += industrialio-ring.o +industrialio-$(CONFIG_IIO_TRIGGER) += industrialio-trigger.o obj-y += accel/ obj-y += adc/
drivers/iio/industrialio-trigger.c new file +400 -0
400 lines not on this page · raw message
include/linux/iio/trigger.h new file +148 -0
148 lines not on this page · raw message
include/linux/iio/trigger_consumer.h +20 -1
@@ -8,6 +8,20 @@* the Free Software Foundation. */ +#ifdef CONFIG_IIO_TRIGGER +/** +* iio_device_register_trigger_consumer() - set up an iio_dev to use triggers. +* @dev_info: iio_dev associated with the device that will consume the trigger +**/ +int iio_device_register_trigger_consumer (struct iio_dev *dev_info); +/** +* iio_device_unregister_trigger_consumer() - reverse the registration process. +* @dev_info: iio_dev associated with the device that consumed the trigger +**/ +int iio_device_unregister_trigger_consumer (struct iio_dev *dev_info); + +#else +/** * iio_device_register_trigger_consumer() - set up an iio_dev to use triggers. * @dev_info: iio_dev associated with the device that will consume the trigger
@@ -18,9 +32,14 @@ int iio_device_register_trigger_consumer(struct iio_dev *dev_info) };/** * iio_device_unregister_trigger_consumer() - reverse the registration process -. * @dev_info: iio_dev associated with the device that consumed the trigger +* @dev_info: iio_dev associated with the device that consumed the trigger **/ int iio_device_unregister_trigger_consumer (struct iio_dev *dev_info) {return 0 ; }; + +#endif /* CONFIG_TRIGGER_CONSUMER */ + + +
Signature · 1 line
1.6.2
PATCH 9/14 IIO: Ring buffer: Initial pass at rarely locked ring buffer
Please note this ring buffer implementation is very much a work in progress (and hence RFC). In it's current form it is stable and reasonably efficient. There are a couple of unlikely cases that will lead to more data being lost that is strictly necessary. The target was for the case of requiring regular sampling even during user space reads.
All comments welcome.
The intention is to make this only one of several implementations with run time selection. For now there is only one, so it is hard coded into the drivers using it.
--- drivers/iio/Kconfig | 9 + drivers/iio/Makefile | 2 + drivers/iio/ring_sw.c | 431 +++++++++++++++++++++++++++++++++++++++++++ include/linux/iio/ring_sw.h | 189 +++++++++++++++++++ 4 files changed, 631 insertions(+), 0 deletions(-) create mode 100644 drivers/iio/ring_sw.c create mode 100644 include/linux/iio/ring_sw.h
drivers/iio/Kconfig +9 -0
@@ -17,6 +17,15 @@ config IIO_RING_BUFFER Provide core support for various ring buffer based data acquisition methods. +config IIO_SW_RING + tristate "Industrial I/O lock free software ring" + depends on IIO_RING_BUFFER && IIO + help + example software ring buffer implementation. The design aim + of this particular realization was to minize write locking + with the intention that some devices would be able to write + in interrupt context. + config IIO_TRIGGER boolean "Enable triggered sampling support" depends on IIO
drivers/iio/Makefile +2 -0
@@ -7,6 +7,8 @@ industrialio-y := industrialio-core.o industrialio-$(CONFIG_IIO_RING_BUFFER) += industrialio-ring.o industrialio-$(CONFIG_IIO_TRIGGER) += industrialio-trigger.o +obj-$(CONFIG_IIO_SW_RING) += ring_sw.o + obj-y += accel/ obj-y += adc/ obj-y += light/
drivers/iio/ring_sw.c new file +431 -0
431 lines not on this page · raw message
include/linux/iio/ring_sw.h new file +189 -0
189 lines not on this page · raw message
Signature · 1 line
1.6.2
PATCH 10/14 IIO: lis3l02dq ring buffer and data ready trigger support
Example of relatively common case of device sampling based on internal clock and providing a data ready signal to indicate that new data is available to be read out.
Generic trigger approach used to allow other devices to be sampled 'at the same time' as this the accelerometer. This is very useful in various motion estimation algorithms.
--- drivers/iio/accel/Makefile | 1 + drivers/iio/accel/lis3l02dq.h | 22 ++- drivers/iio/accel/lis3l02dq_ring.c | 599 ++++++++++++++++++++++++++++++++++++ 3 files changed, 621 insertions(+), 1 deletions(-) create mode 100644 drivers/iio/accel/lis3l02dq_ring.c
drivers/iio/accel/Makefile +1 -0
@@ -4,6 +4,7 @@ obj-$(CONFIG_KXSD9) += kxsd9.o lis3l02dq-y := lis3l02dq_core.o +lis3l02dq-$(CONFIG_IIO_RING_BUFFER) += lis3l02dq_ring.o obj-$(CONFIG_LIS3L02DQ) += lis3l02dq.o sca3000-y := sca3000_core.o sca3000_ring.o
drivers/iio/accel/lis3l02dq.h +21 -1
@@ -183,6 +183,26 @@ int lis3l02dq_spi_write_reg_8(struct device *dev,#define LIS3L02DQ_SCAN_ACC_Y 1#define LIS3L02DQ_SCAN_ACC_Z 2 + +#ifdef CONFIG_IIO_RING_BUFFER +/* At the moment triggers are only used for ring buffer +* filling. This may change! +*/ +void lis3l02dq_remove_trigger (struct iio_dev *indio_dev); +int lis3l02dq_probe_trigger (struct iio_dev *indio_dev); + +ssize_t lis3l02dq_read_accel_from_ring (struct device *dev, +struct device_attribute *attr, +char *buf); + + +int lis3l02dq_configure_ring (struct iio_dev *indio_dev); +void lis3l02dq_unconfigure_ring (struct iio_dev *indio_dev); + +int lis3l02dq_initialize_ring (struct iio_ring_buffer *ring); +void lis3l02dq_uninitialize_ring (struct iio_ring_buffer *ring); +#else /* CONFIG_IIO_RING_BUFFER */ +static inline void lis3l02dq_remove_trigger (struct iio_dev *indio_dev) {};static inline int lis3l02dq_probe_trigger (struct iio_dev *indio_dev) {
@@ -208,5 +228,5 @@ static inline int lis3l02dq_initialize_ring(struct iio_ring_buffer *ring)return 0 ; };static inline void lis3l02dq_uninitialize_ring (struct iio_ring_buffer *ring) {}; - +#endif /* CONFIG_IIO_RING_BUFFER */ #endif /* SPI_LIS3L02DQ_H_ */
drivers/iio/accel/lis3l02dq_ring.c new file +599 -0
599 lines not on this page · raw message
Signature · 1 line
1.6.2
PATCH 11/14 IIO: max1363 add software ring buffer support using ring_sw
Changes since V2:
* Moved to new registration methodology.
--- drivers/iio/adc/Makefile | 1 + drivers/iio/adc/max1363.h | 14 +++- drivers/iio/adc/max1363_ring.c | 235 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 249 insertions(+), 1 deletions(-) create mode 100644 drivers/iio/adc/max1363_ring.c
drivers/iio/adc/Makefile +1 -0
@@ -3,5 +3,6 @@ # max1363-y := max1363_core.o +max1363-$(CONFIG_IIO_RING_BUFFER) += max1363_ring.o obj-$(CONFIG_MAX1363) += max1363.o
drivers/iio/adc/max1363.h +13 -1
@@ -228,6 +228,18 @@ struct max1363_state {struct iio_trigger *trig;struct regulator *reg; }; +#ifdef CONFIG_IIO_RING_BUFFER + +ssize_t max1363_scan_from_ring (struct device *dev, +struct device_attribute *attr, +char *buf); +int max1363_register_ring_funcs_and_init (struct iio_dev *indio_dev); +void max1363_ring_cleanup (struct iio_dev *indio_dev); + +int max1363_initialize_ring (struct iio_ring_buffer *ring); +void max1363_uninitialize_ring (struct iio_ring_buffer *ring); + +#else /* CONFIG_IIO_RING_BUFFER */ static inline void max1363_uninitialize_ring (struct iio_ring_buffer *ring) {
@@ -253,5 +265,5 @@ max1363_register_ring_funcs_and_init(struct iio_dev *indio_dev) };static inline void max1363_ring_cleanup (struct iio_dev *indio_dev) {}; - +#endif /* CONFIG_IIO_RING_BUFFER */ #endif /* _MAX1363_H_ */
drivers/iio/adc/max1363_ring.c new file +235 -0
235 lines not on this page · raw message
Signature · 1 line
1.6.2
PATCH 12/14 IIO: Periodic timer based trigger
The original posting of this driver led to a discussion in which it was commented that a better system was needed for dealing with the many possible periodic interrupt sources available on some SoCs. Unfortunately that is a big task and as far as I know, no-one has taken it on as yet. So in the meantime this driver is still in here.
--- drivers/iio/Kconfig | 2 + drivers/iio/Makefile | 4 +- drivers/iio/trigger/Kconfig | 12 ++ drivers/iio/trigger/Makefile | 5 + drivers/iio/trigger/iio-trig-periodic-rtc.c | 230 +++++++++++++++++++++++++++ include/linux/iio/prtc_trigger.h | 7 + 6 files changed, 259 insertions(+), 1 deletions(-) create mode 100644 drivers/iio/trigger/Kconfig create mode 100644 drivers/iio/trigger/Makefile create mode 100644 drivers/iio/trigger/iio-trig-periodic-rtc.c create mode 100644 include/linux/iio/prtc_trigger.h
drivers/iio/Kconfig +2 -0
@@ -38,3 +38,5 @@ config IIO_TRIGGER source drivers/iio/accel/Kconfig source drivers/iio/adc/Kconfig source drivers/iio/light/Kconfig + +source drivers/iio/trigger/Kconfig
drivers/iio/Makefile +3 -1
@@ -11,4 +11,6 @@ obj-$(CONFIG_IIO_SW_RING) += ring_sw.o obj-y += accel/ obj-y += adc/ -obj-y += light/ +obj-y += light/ + +obj-y += trigger/
drivers/iio/trigger/Kconfig new file +12 -0
@@ -0,0 +1,12 @@ +# +# Industrial I/O standalone triggers +# +comment "Triggers - standalone" + depends on IIO + +config IIO_PERIODIC_RTC_TRIGGER + tristate "Periodic RTC triggers" + depends on IIO && IIO_TRIGGER && RTC_CLASS + help + Provides support for using periodic capable real time + clocks as IIO triggers.
drivers/iio/trigger/Makefile new file +5 -0
@@ -0,0 +1,5 @@ +# +# Makefile for triggers not associated with iio-devices +# +obj-$(CONFIG_IIO_PERIODIC_RTC_TRIGGER) += iio-trig-periodic-rtc.o +
drivers/iio/trigger/iio-trig-periodic-rtc.c new file +230 -0
230 lines not on this page · raw message
include/linux/iio/prtc_trigger.h new file +7 -0
@@ -0,0 +1,7 @@ +struct iio_prtc_trigger { +const char *name; +}; +struct iio_prtc_trigger_group { +int num_triggers; +struct iio_prtc_trigger *triggers; +};
Signature · 1 line
1.6.2
PATCH 13/14 IIO: Proof of concept gpio trigger
Simple example of how a gpio trigger driver would work. Things to be added include interupt type control (high, low).
--- drivers/iio/trigger/Kconfig | 6 + drivers/iio/trigger/Makefile | 2 +- drivers/iio/trigger/iio-trig-gpio.c | 203 +++++++++++++++++++++++++++++++++++ include/linux/iio/gpio_trigger.h | 6 + 4 files changed, 216 insertions(+), 1 deletions(-) create mode 100644 drivers/iio/trigger/iio-trig-gpio.c create mode 100644 include/linux/iio/gpio_trigger.h
drivers/iio/trigger/Kconfig +6 -0
@@ -10,3 +10,9 @@ config IIO_PERIODIC_RTC_TRIGGER help Provides support for using periodic capable real time clocks as IIO triggers. + +config IIO_GPIO_TRIGGER + tristate "GPIO trigger" + depends on IIO && IIO_TRIGGER && GENERIC_GPIO + help + Provides support for using GPIO pins as IIO triggers.
drivers/iio/trigger/Makefile +1 -1
@@ -2,4 +2,4 @@ # Makefile for triggers not associated with iio-devices # obj-$(CONFIG_IIO_PERIODIC_RTC_TRIGGER) += iio-trig-periodic-rtc.o - +obj-$(CONFIG_IIO_GPIO_TRIGGER) += iio-trig-gpio.o
drivers/iio/trigger/iio-trig-gpio.c new file +203 -0
203 lines not on this page · raw message
include/linux/iio/gpio_trigger.h new file +6 -0
@@ -0,0 +1,6 @@ + + +struct iio_gpio_trigger_pdata { +int num_gpios; +int *gpios; +};
Signature · 1 line
1.6.2
PATCH 14/14 IIO: Initial documentation
This needs considerably more work, all comments / suggestions welcomed.
--- Documentation/iio/device.txt | 49 ++++++++ Documentation/iio/iio_utils.h | 163 +++++++++++++++++++++++++++ Documentation/iio/lis3l02dqbuffersimple.c | 172 +++++++++++++++++++++++++++++ Documentation/iio/overview.txt | 62 ++++++++++ Documentation/iio/ring.txt | 62 ++++++++++ Documentation/iio/trigger.txt | 38 +++++++ Documentation/iio/userspace.txt | 60 ++++++++++ 7 files changed, 606 insertions(+), 0 deletions(-) create mode 100644 Documentation/iio/device.txt create mode 100644 Documentation/iio/iio_utils.h create mode 100644 Documentation/iio/lis3l02dqbuffersimple.c create mode 100644 Documentation/iio/overview.txt create mode 100644 Documentation/iio/ring.txt create mode 100644 Documentation/iio/trigger.txt create mode 100644 Documentation/iio/userspace.txt
Documentation/iio/device.txt new file +49 -0
@@ -0,0 +1,49 @@ +IIO Device drivers + +This is not intended to provide a comprehensive guide to writing an +IIO device driver. For further information see the drivers within the +subsystem. + +The crucial structure for device drivers in iio is iio_dev. + +First allocate one using: + +struct iio_dev *indio_dev = iio_allocate_device(); + +The fill in the following. + +indio_dev->dev.parent + the struct device associated with the underlying hardware. + +indio_dev->num_interrupt_lines + number of event triggering hardware lines the device has. + +indio_dev->event_attrs + attributes used to enable / disable hardware events - note the + attributes are embedded in iio_event_attr structures with an + associated iio_event_handler which may or may note be shared. + If num_interrupt_lines = 0, then no need to fill this in. + +indio_dev->attrs + general attributes such as polled access to device channels. + +indio_dev->dev_data + private device specific data. + +indio_dev->driver_module + typically set to THIS_MODULE. Used to specify ownership of some + iio created resources. + +indio_dev->modes + whether direct access and / or ring buffer access is supported. + +Once these are set up, a call to iio_device_register(indio_dev), +will register the device with the iio core. + +Worth noting here is that, if a ring buffer is to be used, it can be +allocated prior to registering the device with the iio-core, but must +be registered afterwards (otherwise the whole parentage of devices +gets confused) + +On remove iio_device_unregister(indio_dev) will remove the device from +the core, and iio_free_device will clean up.
Documentation/iio/iio_utils.h new file +163 -0
163 lines not on this page · raw message
Documentation/iio/lis3l02dqbuffersimple.c new file +172 -0
172 lines not on this page · raw message
Documentation/iio/overview.txt new file +62 -0
62 lines not on this page · raw message
Documentation/iio/ring.txt new file +62 -0
62 lines not on this page · raw message
Documentation/iio/trigger.txt new file +38 -0
@@ -0,0 +1,38 @@ +IIO trigger drivers. + +Many triggers are provided by hardware that will also be registered as +an IIO device. Whilst this can create device specific complexities +such triggers are registered with the core in the same way as +stand-alone triggers. + +struct iio_trig *trig = iio_allocate_trigger(); + +allocates a trigger structure. The key elements to then fill in within +a driver are: + +trig->control_attrs + Any sysfs attributes needed to control parameters of the trigger + +trig->private_data + Device specific private data. + +trig->owner + Typically set to THIS_MODULE. Used to ensure correct + ownership of core allocated resources. + +trig->name + A unique name for the trigger. + +When these have been set call: + +iio_trigger_register(trig); + +to register the trigger with the core, making it available to trigger +consumers. + + +Trigger Consumers + +Currently triggers are only used for the filling of software ring +buffers and as such any device supporting INDIO_RING_TRIGGERED has the +consumer interface automatically created.
Documentation/iio/userspace.txt new file +60 -0
60 lines not on this page · raw message
Signature · 1 line
1.6.2
PATCH 1/1 IIO: Add missing I2C dependencies for max1363 and tsl2561
I will roll these into the original patches at some point, but for now they are here.
Thanks to David Brownell for spotting this.
--- drivers/iio/adc/Kconfig | 2 +- drivers/iio/light/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/iio/adc/Kconfig +1 -1
@@ -6,7 +6,7 @@ comment "Analog to digital convertors" config MAX1363 tristate "MAXIM max1363 ADC driver" - depends on IIO + depends on IIO && I2C help Say yes here to build support for many MAXIM i2c analog to digital convertors (ADC). (max1361, max1362, max1363, max1364, max1136,
drivers/iio/light/Kconfig +1 -1
@@ -6,7 +6,7 @@ comment "Light sensors" config TSL2561 tristate "TAOS TSL2561 light-to-digital convertor" - depends on IIO + depends on IIO && I2C help Say yes bere to build support for the TAOS light to digital convertor. This chip has two light sensors. One is broadband
Signature · 1 line
1.6.2
Re: [PATCH] IIO: Add missing I2C dependencies for max1363 and tsl2561
Quoted 29 lines · Jonathan Cameron
Signed-off-by Jonathan Cameron <[email protected]>I will roll these into the original patches at some point, but for now they are here.
Thanks to David Brownell for spotting this.
--- drivers/iio/adc/Kconfig | 2 +- drivers/iio/light/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/iio/adc/Kconfig +1
-1@@ -6,7 +6,7 @@ comment "Analog to digital convertors" config MAX1363 tristate "MAXIM max1363 ADC driver" - depends on IIO + depends on IIO && I2C help Say yes here to build support for many MAXIM i2c analog to digital convertors (ADC). (max1361, max1362, max1363, max1364, max1136,drivers/iio/light/Kconfig +0
-0
drivers/iio/light/Kconfig comment "Light sensors" · line 12
Quoted 8 lines
drivers/iio/light/Kconfig +1
-1@@ -6,7 +6,7 @@ comment "Light sensors" config TSL2561 tristate "TAOS TSL2561 light-to-digital convertor" - depends on IIO + depends on IIO && I2C help Say yes bere to build support for the TAOS light to digital convertor. This chip has two light sensors. One is broadband
Unrelated suggestion: you could surround all the driver configuration entries with a big
if IIO
(...)
endif # IIO
This would save you the hassle of adding "depends on IIO" to every driver. Many subsystems have resorted to this technique by now.
Signature · 1 line
Jean Delvare
Re: [PATCH] IIO: Add missing I2C dependencies for max1363 and tsl2561
Quoted 42 lines · Jean Delvare
Quoted 29 lines · Jonathan Cameron
Signed-off-by Jonathan Cameron <[email protected]>I will roll these into the original patches at some point, but for now they are here.
Thanks to David Brownell for spotting this.
--- drivers/iio/adc/Kconfig | 2 +- drivers/iio/light/Kconfig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)drivers/iio/adc/Kconfig +1
-1@@ -6,7 +6,7 @@ comment "Analog to digital convertors" config MAX1363 tristate "MAXIM max1363 ADC driver" - depends on IIO + depends on IIO && I2C help Say yes here to build support for many MAXIM i2c analog to digital convertors (ADC). (max1361, max1362, max1363, max1364, max1136,drivers/iio/light/Kconfig +0
-0drivers/iio/light/Kconfig comment "Light sensors" · line 12
Quoted 8 lines
drivers/iio/light/Kconfig +1
-1@@ -6,7 +6,7 @@ comment "Light sensors" config TSL2561 tristate "TAOS TSL2561 light-to-digital convertor" - depends on IIO + depends on IIO && I2C help Say yes bere to build support for the TAOS light to digital convertor. This chip has two light sensors. One is broadbandUnrelated suggestion: you could surround all the driver configuration entries with a big
Quoted 9 lines
if IIO
(...)
endif # IIO
This would save you the hassle of adding "depends on IIO" to every driver. Many subsystems have resorted to this technique by now.
Thanks Jean, I hadn't realized you could do that.
Jonathan