Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2c52b1ef authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-4.10c' of...

Merge tag 'iio-for-4.10c' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-next

Jonathan writes:

Third set of IIO new device support, features and cleanup for the 4.10 cycle.

Includes Peter Rosin's interesting drivers for a comparator. First complex
use we have had with an analog front end made from discrete components.

Brian Masney's work on moving the tsl2583 driver out of staging also
feature extensively!

New Drivers
* DAC based on a digital potentiometer
  - New driver for the use of a dpot as a DAC. Includes bindings and Axentia
  entry in vendor prefixes.
* Envelope detector baed on DAC and a comparator including device tree
  bindings.

Staging Graduation
* tsl2583.

Core new features
- Core provision for _available attributes.   This one had been stalled for
  a long time until Peter picked it up and ran with it!
- In kernel interface helpers to retrieve available info from channels.

Driver new features
* mcp4531
  - Add range of available raw values (used for the dpot dac driver).

Driver cleanups and fixes for issues introduced
* ad7766
  - Testing the wrong variable following devm_regulator_bulk_get introduced
  with the driver earlier in this cycle.
* ad9832
  - Fix a wrong ordering in the probe introduced in the previous set of
    patches.  A use before allocation bug.
* cros_ec_sensors
  - Testing for an error in a u8 will never work.
* mpu3050
  - Remove duplicate initializer for the module owner.
  - Add missing i2c dependency.
  - Inform the i2c mux core how it is used - step one in implifying device
  tree bindings.
* st-sensors
  - Get rid of large number of uninformative defines in favour of putting the
  constants where they are relevant. It is clear what they are from where
  they are used.
* tsl2583
  - Fix unused function warning when CONFIG_PM disabled and remove the
  ifdefs in favour of __maybe_unused.
  - Refactor taos_chip_on  to only read relevant registers.
  - Make sure calibscale and integration time are being set.
  - Verify chip is in ready to be used before calibration.
  - Remove some repeated checks for chip status (it's protected by a mutex
  so can't change until it's released)
  - Change current state storage from a tristate enum to a boolean seeing as
  only two values are actually used now.
  - Drop a redundant write to the control regiser in taos_probe (it's a noop)
  - Drop the FSF mailing address.
  - Clean up logging to not use hard coded function names (use __func__
  instead).
  - Cleanup up variable and function name prefixes.
  - Alignment of #define fixes.
  - Fix comparison between signed and unsigned integer warnings.
  - Add some newlines in favour of readability.
  - Combine the two sysfs ABI docs that somehow ended up in different places.
  - Fix multiline comment syntax.
  - Move a code block to inside an else statement as it makes more sense there.
  - Change tsl2583_als_calibrate to return 0 rather than a value nothing
  reads.
  - Drop some pointless brackets
  - Don't assume 32bit unsigned int.
  - Change to a per device instance lux table.
  - Add missing tsl2583 to the list of supported devices in the intro comments.
  - Improve commment on clearing of interrupts.
  - Drop some uninformative comments.
  - Drop a memset call that doesn't do anything useful any more.
  - Don't initialize some return variables that are always set.
  - Add Brian Masney as a module author after all these changes.
parents 81710951 f44d5c8a
Loading
Loading
Loading
Loading
+36 −0
Original line number Diff line number Diff line
What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltageY_invert
Date:		October 2016
KernelVersion:	4.9
Contact:	Peter Rosin <peda@axentia.se>
Description:
		The DAC is used to find the peak level of an alternating
		voltage input signal by a binary search using the output
		of a comparator wired to an interrupt pin. Like so:
		                           _
		                          | \
		     input +------>-------|+ \
		                          |   \
		            .-------.     |    }---.
		            |       |     |   /    |
		            |    dac|-->--|- /     |
		            |       |     |_/      |
		            |       |              |
		            |       |              |
		            |    irq|------<-------'
		            |       |
		            '-------'
		The boolean invert attribute (0/1) should be set when the
		input signal is centered around the maximum value of the
		dac instead of zero. The envelope detector will search
		from below in this case and will also invert the result.
		The edge/level of the interrupt is also switched to its
		opposite value.

What:		/sys/bus/iio/devices/iio:deviceX/in_altvoltageY_compare_interval
Date:		October 2016
KernelVersion:	4.9
Contact:	Peter Rosin <peda@axentia.se>
Description:
		Number of milliseconds to wait for the comparator in each
		step of the binary search for the input peak level. Needs
		to relate to the frequency of the input signal.
+8 −0
Original line number Diff line number Diff line
What:		/sys/bus/iio/devices/iio:deviceX/out_voltageY_raw_available
Date:		October 2016
KernelVersion:	4.9
Contact:	Peter Rosin <peda@axentia.se>
Description:
		The range of available values represented as the minimum value,
		the step and the maximum value, all enclosed in square brackets.
		Example: [0 1 256]
+7 −7
Original line number Diff line number Diff line
What:		/sys/bus/iio/devices/device[n]/lux_table
What:		/sys/bus/iio/devices/device[n]/in_illuminance_calibrate
KernelVersion:	2.6.37
Contact:	linux-iio@vger.kernel.org
Description:
		This property gets/sets the table of coefficients
		used in calculating illuminance in lux.
		This property causes an internal calibration of the als gain trim
		value which is later used in calculating illuminance in lux.

What:		/sys/bus/iio/devices/device[n]/illuminance0_calibrate
What:		/sys/bus/iio/devices/device[n]/in_illuminance_lux_table
KernelVersion:	2.6.37
Contact:	linux-iio@vger.kernel.org
Description:
		This property causes an internal calibration of the als gain trim
		value which is later used in calculating illuminance in lux.
		This property gets/sets the table of coefficients
		used in calculating illuminance in lux.

What:		/sys/bus/iio/devices/device[n]/illuminance0_input_target
What:		/sys/bus/iio/devices/device[n]/in_illuminance_input_target
KernelVersion:	2.6.37
Contact:	linux-iio@vger.kernel.org
Description:
+8 −0
Original line number Diff line number Diff line
What:		/sys/bus/iio/devices/iio:deviceX/out_resistance_raw_available
Date:		October 2016
KernelVersion:	4.9
Contact:	Peter Rosin <peda@axentia.se>
Description:
		The range of available values represented as the minimum value,
		the step and the maximum value, all enclosed in square brackets.
		Example: [0 1 256]
+54 −0
Original line number Diff line number Diff line
Bindings for ADC envelope detector using a DAC and a comparator

The DAC is used to find the peak level of an alternating voltage input
signal by a binary search using the output of a comparator wired to
an interrupt pin. Like so:
                          _
                         | \
    input +------>-------|+ \
                         |   \
           .-------.     |    }---.
           |       |     |   /    |
           |    dac|-->--|- /     |
           |       |     |_/      |
           |       |              |
           |       |              |
           |    irq|------<-------'
           |       |
           '-------'

Required properties:
- compatible: Should be "axentia,tse850-envelope-detector"
- io-channels: Channel node of the dac to be used for comparator input.
- io-channel-names: Should be "dac".
- interrupt specification for one client interrupt,
  see ../../interrupt-controller/interrupts.txt for details.
- interrupt-names: Should be "comp".

Example:

	&i2c {
		dpot: mcp4651-104@28 {
			compatible = "microchip,mcp4651-104";
			reg = <0x28>;
			#io-channel-cells = <1>;
		};
	};

	dac: dac {
		compatible = "dpot-dac";
		vref-supply = <&reg_3v3>;
		io-channels = <&dpot 0>;
		io-channel-names = "dpot";
		#io-channel-cells = <1>;
	};

	envelope-detector {
		compatible = "axentia,tse850-envelope-detector";
		io-channels = <&dac 0>;
		io-channel-names = "dac";

		interrupt-parent = <&gpio>;
		interrupts = <3 IRQ_TYPE_EDGE_FALLING>;
		interrupt-names = "comp";
	};
Loading