-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge tag 'iio-for-4.5b' of git://git.kernel.org/pub/scm/linux/kernel…
…/git/jic23/iio into staging-next Jonathan writes: Second set of IIO new drivers, functionality and cleanups for the 4.5 cycle. The big one here is the configfs support which has been a long time in the works but should allow for cleaner ways to do instantiation of those elements of IIO that aren't directly connected to specific hardware. Lots of cool new stuff we can use this for in the works! New core stuff (basically all configfs support related) * Configfs support - Core support (was waiting for a configfs patch that went in around 4.4rc2) - A little fixlet to add a configfs.h to contain a reference to the configfs_subsystem structure. * Some infrastructure to simplify handling of software based triggers (i.e. ones with no actual hardware associated with them) * A high resolution timer based trigger. This has been around for years but until the configfs support was ready we didn't have a sensible way of instantiating instances of it (the method used for the sysfs_trigger has never been really satisfactory) New Device Support * AMS iAQ Volatile Organic Compounds sensor support. * Freescale imx7d ADC driver * Maxim MAX30100 oximeter driver (note that for these devices most of the smart stuff will be in userspace - effectively they are just light sensors with some interesting led synchronization as far as the kernel is concerned). * Microchip mcp3421 support added to the mcp3422 driver. * TI adc124s021 support added to the adc128s052 driver. * TI ina219, inda226 power monitors. Note that there is an existing hwmon driver for these parts, the usecase is somewhat different so it is unclear at this point if the hwmon driver will eventually be replaced by a bridge from this driver. In the meantime the Kconfig dependencies should prevent both from being built. New driver functionality * us8152d power management support. Cleanups, fixups * Use list_for_each_entry_safe instead of list_for_each_safe with the entry bit coded longhand. * Select IRQ_WORK for IIO_DUMMY_EVGEN. This is a fix that somehow got lost when the driver was moved so lets do it again. * st-accel - drop an unused define. * vz89x, lidar - optimize i2c transactions by using a single i2c tranfers instead of multiple calls where supported (fall back to smbus calls as before if not). * Use dev_get_platdata() in staging drivers: tsl2x7x, adcs and frequency drivers instead of direct access to the structure element.
- Loading branch information
Showing
41 changed files
with
3,163 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
What: /config/iio | ||
Date: October 2015 | ||
KernelVersion: 4.4 | ||
Contact: linux-iio@vger.kernel.org | ||
Description: | ||
This represents Industrial IO configuration entry point | ||
directory. It contains sub-groups corresponding to IIO | ||
objects. | ||
|
||
What: /config/iio/triggers | ||
Date: October 2015 | ||
KernelVersion: 4.4 | ||
Description: | ||
Industrial IO software triggers directory. | ||
|
||
What: /config/iio/triggers/hrtimers | ||
Date: October 2015 | ||
KernelVersion: 4.4 | ||
Description: | ||
High resolution timers directory. Creating a directory here | ||
will result in creating a hrtimer trigger in the IIO subsystem. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Freescale imx7d ADC bindings | ||
|
||
The devicetree bindings are for the ADC driver written for | ||
imx7d SoC. | ||
|
||
Required properties: | ||
- compatible: Should be "fsl,imx7d-adc" | ||
- reg: Offset and length of the register set for the ADC device | ||
- interrupts: The interrupt number for the ADC device | ||
- clocks: The root clock of the ADC controller | ||
- clock-names: Must contain "adc", matching entry in the clocks property | ||
- vref-supply: The regulator supply ADC reference voltage | ||
|
||
Example: | ||
adc1: adc@30610000 { | ||
compatible = "fsl,imx7d-adc"; | ||
reg = <0x30610000 0x10000>; | ||
interrupts = <GIC_SPI 98 IRQ_TYPE_LEVEL_HIGH>; | ||
clocks = <&clks IMX7D_ADC_ROOT_CLK>; | ||
clock-names = "adc"; | ||
vref-supply = <®_vcc_3v3_mcu>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Maxim MAX30100 heart rate and pulse oximeter sensor | ||
|
||
* https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf | ||
|
||
Required properties: | ||
- compatible: must be "maxim,max30100" | ||
- reg: the I2C address of the sensor | ||
- interrupt-parent: should be the phandle for the interrupt controller | ||
- interrupts: the sole interrupt generated by the device | ||
|
||
Refer to interrupt-controller/interrupts.txt for generic | ||
interrupt client node bindings. | ||
|
||
Example: | ||
|
||
max30100@057 { | ||
compatible = "maxim,max30100"; | ||
reg = <57>; | ||
interrupt-parent = <&gpio1>; | ||
interrupts = <16 2>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
Industrial IIO configfs support | ||
|
||
1. Overview | ||
|
||
Configfs is a filesystem-based manager of kernel objects. IIO uses some | ||
objects that could be easily configured using configfs (e.g.: devices, | ||
triggers). | ||
|
||
See Documentation/filesystems/configfs/configfs.txt for more information | ||
about how configfs works. | ||
|
||
2. Usage | ||
|
||
In order to use configfs support in IIO we need to select it at compile | ||
time via CONFIG_IIO_CONFIGFS config option. | ||
|
||
Then, mount the configfs filesystem (usually under /config directory): | ||
|
||
$ mkdir /config | ||
$ mount -t configfs none /config | ||
|
||
At this point, all default IIO groups will be created and can be accessed | ||
under /config/iio. Next chapters will describe available IIO configuration | ||
objects. | ||
|
||
3. Software triggers | ||
|
||
One of the IIO default configfs groups is the "triggers" group. It is | ||
automagically accessible when the configfs is mounted and can be found | ||
under /config/iio/triggers. | ||
|
||
IIO software triggers implementation offers support for creating multiple | ||
trigger types. A new trigger type is usually implemented as a separate | ||
kernel module following the interface in include/linux/iio/sw_trigger.h: | ||
|
||
/* | ||
* drivers/iio/trigger/iio-trig-sample.c | ||
* sample kernel module implementing a new trigger type | ||
*/ | ||
#include <linux/iio/sw_trigger.h> | ||
|
||
|
||
static struct iio_sw_trigger *iio_trig_sample_probe(const char *name) | ||
{ | ||
/* | ||
* This allocates and registers an IIO trigger plus other | ||
* trigger type specific initialization. | ||
*/ | ||
} | ||
|
||
static int iio_trig_hrtimer_remove(struct iio_sw_trigger *swt) | ||
{ | ||
/* | ||
* This undoes the actions in iio_trig_sample_probe | ||
*/ | ||
} | ||
|
||
static const struct iio_sw_trigger_ops iio_trig_sample_ops = { | ||
.probe = iio_trig_sample_probe, | ||
.remove = iio_trig_sample_remove, | ||
}; | ||
|
||
static struct iio_sw_trigger_type iio_trig_sample = { | ||
.name = "trig-sample", | ||
.owner = THIS_MODULE, | ||
.ops = &iio_trig_sample_ops, | ||
}; | ||
|
||
module_iio_sw_trigger_driver(iio_trig_sample); | ||
|
||
Each trigger type has its own directory under /config/iio/triggers. Loading | ||
iio-trig-sample module will create 'trig-sample' trigger type directory | ||
/config/iio/triggers/trig-sample. | ||
|
||
We support the following interrupt sources (trigger types): | ||
* hrtimer, uses high resolution timers as interrupt source | ||
|
||
3.1 Hrtimer triggers creation and destruction | ||
|
||
Loading iio-trig-hrtimer module will register hrtimer trigger types allowing | ||
users to create hrtimer triggers under /config/iio/triggers/hrtimer. | ||
|
||
e.g: | ||
|
||
$ mkdir /config/triggers/hrtimer/instance1 | ||
$ rmdir /config/triggers/hrtimer/instance1 | ||
|
||
Each trigger can have one or more attributes specific to the trigger type. | ||
|
||
3.2 "hrtimer" trigger types attributes | ||
|
||
"hrtimer" trigger type doesn't have any configurable attribute from /config dir. | ||
It does introduce the sampling_frequency attribute to trigger directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.