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

Commit 3c9a6793 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Merge tag 'iio-for-4.8b' of...

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

Jonathan writes:

Second round of new iio device support, features and cleanups in the 4.8 cycle

Firstly some contact detail updates:
* NXP took over freescale. Update the mma8452 header to reflect this.
* Martin Kepplinger email address change in mma8452 header.
* Adriana Reus has changed email address. Update .mailmap.
* Matt Ranostay has changed email address. Update .mailmap.

New Device Support
* max1363
  - add the missing i2c_device_ids for a couple of parts so they can actually
    be used.
* ms5867
  - add device ids for ms5805 and ms5837 parts.

New Features
* ad5755
  - DT support.  This one was a bit controversial and under review for a long
    time.  Still no one could come up with a better solution.
* stx104
  - add gpio support
* ti-adc081c
  - Add ACPI device ID matching.

Core changes
* Refuse to register triggers with duplicate names.  There is no way to
  distinguish between them so this makes no sense.  A few drivers do not
  generate unique names for each instance of the device present.  We can't
  fix this without changing ABI so leave them and wait for someone to
  actually take the rare step of two identical accelerometers on the same
  board.
* buffer-dma
  - use ARRAY_SIZE in a few appropriate locations.

Tools
* Fix the fact that the --trigger-num option in generic_buffer didn't allow
  0 which is perfectly valid in the ABI.

Cleanups
* as3935
  - improve error reporting.
  - remove redundant zeroing of a field in iio_priv.
* gp2ap020a00f
  - use the iio_device_claim_*_mode helpers rather than open coding locking
  around mode changes.
* isl29125
  - use the iio_device_claim_*_mode helpers rather than open coding locking.
* lidar
  - use the iio_device_claim_*_mode helpers rather than open coding locking.
* mma8452
  - more detail in devices supported description in comments (addresses and
  similar)
* sca3000
  - add a missing error check.
* tcs3414
  - use the iio_device_claim_*_mode helpers rather than open coding locking.
* tcs3472
  - use the iio_device_claim_*_mode helpers rather than open coding locking.
parents 9989b599 67626cc1
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@ Aaron Durbin <adurbin@google.com>
Adam Oldham <oldhamca@gmail.com>
Adam Radford <aradford@gmail.com>
Adrian Bunk <bunk@stusta.de>
Adriana Reus <adi.reus@gmail.com> <adriana.reus@intel.com>
Alan Cox <alan@lxorguk.ukuu.org.uk>
Alan Cox <root@hraefn.swansea.linux.org.uk>
Aleksey Gorelov <aleksey_gorelov@phoenix.com>
@@ -90,6 +91,8 @@ Linas Vepstas <linas@austin.ibm.com>
Mark Brown <broonie@sirena.org.uk>
Matthieu CASTET <castet.matthieu@free.fr>
Mauro Carvalho Chehab <mchehab@kernel.org> <maurochehab@gmail.com> <mchehab@infradead.org> <mchehab@redhat.com> <m.chehab@samsung.com> <mchehab@osg.samsung.com> <mchehab@s-opensource.com>
Matt Ranostay <mranostay@gmail.com> Matthew Ranostay <mranostay@embeddedalley.com>
Matt Ranostay <mranostay@gmail.com> <matt.ranostay@intel.com>
Mayuresh Janorkar <mayur@ti.com>
Michael Buesch <m@bues.ch>
Michel Dänzer <michel@tungstengraphics.com>
+124 −0
Original line number Diff line number Diff line
* Analog Device AD5755 IIO Multi-Channel DAC Linux Driver

Required properties:
 - compatible: Has to contain one of the following:
	adi,ad5755
	adi,ad5755-1
	adi,ad5757
	adi,ad5735
	adi,ad5737

 - reg: spi chip select number for the device
 - spi-cpha or spi-cpol: is the only modes that is supported

Recommended properties:
 - spi-max-frequency: Definition as per
		Documentation/devicetree/bindings/spi/spi-bus.txt

Optional properties:
See include/dt-bindings/iio/ad5755.h
 - adi,ext-dc-dc-compenstation-resistor: boolean set if the hardware have an
					 external resistor and thereby bypasses
					 the internal compensation resistor.
 - adi,dc-dc-phase:
	Valid values for DC DC Phase control is:
	0: All dc-to-dc converters clock on the same edge.
	1: Channel A and Channel B clock on the same edge,
	   Channel C and Channel D clock on opposite edges.
	2: Channel A and Channel C clock on the same edge,
	   Channel B and Channel D clock on opposite edges.
	3: Channel A, Channel B, Channel C, and Channel D
	   clock 90 degrees out of phase from each other.
 - adi,dc-dc-freq-hz:
	Valid values for DC DC frequency is [Hz]:
	250000
	410000
	650000
 - adi,dc-dc-max-microvolt:
	Valid values for the maximum allowed Vboost voltage supplied by
	the dc-to-dc converter is:
	23000000
	24500000
	27000000
	29500000

Optional for every channel:
 - adi,mode:
	Valid values for DAC modes is:
	0: 0 V to 5 V voltage range.
	1: 0 V to 10 V voltage range.
	2: Plus minus 5 V voltage range.
	3: Plus minus 10 V voltage range.
	4: 4 mA to 20 mA current range.
	5: 0 mA to 20 mA current range.
	6: 0 mA to 24 mA current range.
 - adi,ext-current-sense-resistor: boolean set if the hardware a external
				   current sense resistor.
 - adi,enable-voltage-overrange: boolean enable voltage overrange
 - adi,slew: Array of slewrate settings should contain 3 fields:
	1: Should be either 0 or 1 in order to enable or disable slewrate.
	2: Slew rate settings:
		Valid values for the slew rate update frequency:
		64000
		32000
		16000
		8000
		4000
		2000
		1000
		500
		250
		125
		64
		32
		16
		8
		4
		0
	3: Slew step size:
		Valid values for the step size LSBs:
		1
		2
		4
		16
		32
		64
		128
		256

Example:
dac@0 {
	#address-cells = <1>;
	#size-cells = <0>;
	compatible = "adi,ad5755";
	reg = <0>;
	spi-max-frequency = <1000000>;
	spi-cpha;
	adi,dc-dc-phase = <0>;
	adi,dc-dc-freq-hz = <410000>;
	adi,dc-dc-max-microvolt = <23000000>;
	channel@0 {
		reg = <0>;
		adi,mode = <4>;
		adi,ext-current-sense-resistor;
		adi,slew = <0 64000 1>;
	};
	channel@1 {
		reg = <1>;
		adi,mode = <4>;
		adi,ext-current-sense-resistor;
		adi,slew = <0 64000 1>;
	};
	channel@2 {
		reg = <2>;
		adi,mode = <4>;
		adi,ext-current-sense-resistor;
		adi,slew = <0 64000 1>;
	};
	channel@3 {
		reg = <3>;
		adi,mode = <4>;
		adi,ext-current-sense-resistor;
		adi,slew = <0 64000 1>;
	};
};
+2 −2
Original line number Diff line number Diff line
@@ -157,12 +157,12 @@ config MMA7660
	  will be called mma7660.

config MMA8452
	tristate "Freescale MMA8452Q and similar Accelerometers Driver"
	tristate "Freescale / NXP MMA8452Q and similar Accelerometers Driver"
	depends on I2C
	select IIO_BUFFER
	select IIO_TRIGGERED_BUFFER
	help
	  Say yes here to build support for the following Freescale 3-axis
	  Say yes here to build support for the following Freescale / NXP 3-axis
	  accelerometers: MMA8451Q, MMA8452Q, MMA8453Q, MMA8652FC, MMA8653FC,
	  FXLS8471Q.

+12 −12
Original line number Diff line number Diff line
/*
 * mma8452.c - Support for following Freescale 3-axis accelerometers:
 * mma8452.c - Support for following Freescale / NXP 3-axis accelerometers:
 *
 * MMA8451Q (14 bit)
 * MMA8452Q (12 bit)
 * MMA8453Q (10 bit)
 * MMA8652FC (12 bit)
 * MMA8653FC (10 bit)
 * FXLS8471Q (14 bit)
 * device name	digital output	7-bit I2C slave address (pin selectable)
 * ---------------------------------------------------------------------
 * MMA8451Q	14 bit		0x1c / 0x1d
 * MMA8452Q	12 bit		0x1c / 0x1d
 * MMA8453Q	10 bit		0x1c / 0x1d
 * MMA8652FC	12 bit		0x1d
 * MMA8653FC	10 bit		0x1d
 * FXLS8471Q	14 bit		0x1e / 0x1d / 0x1c / 0x1f
 *
 * Copyright 2015 Martin Kepplinger <martin.kepplinger@theobroma-systems.com>
 * Copyright 2015 Martin Kepplinger <martink@posteo.de>
 * Copyright 2014 Peter Meerwald <pmeerw@pmeerw.net>
 *
 * This file is subject to the terms and conditions of version 2 of
 * the GNU General Public License.  See the file COPYING in the main
 * directory of this archive for more details.
 *
 * 7-bit I2C slave address 0x1c/0x1d (pin selectable)
 *
 * TODO: orientation events
 */

@@ -108,7 +108,7 @@ struct mma8452_data {
};

/**
 * struct mma_chip_info - chip specific data for Freescale's accelerometers
 * struct mma_chip_info - chip specific data
 * @chip_id:			WHO_AM_I register's value
 * @channels:			struct iio_chan_spec matching the device's
 *				capabilities
@@ -1693,5 +1693,5 @@ static struct i2c_driver mma8452_driver = {
module_i2c_driver(mma8452_driver);

MODULE_AUTHOR("Peter Meerwald <pmeerw@pmeerw.net>");
MODULE_DESCRIPTION("Freescale MMA8452 accelerometer driver");
MODULE_DESCRIPTION("Freescale / NXP MMA8452 accelerometer driver");
MODULE_LICENSE("GPL");
+25 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <linux/i2c.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/acpi.h>

#include <linux/iio/iio.h>
#include <linux/iio/buffer.h>
@@ -149,12 +150,24 @@ static int adc081c_probe(struct i2c_client *client,
{
	struct iio_dev *iio;
	struct adc081c *adc;
	struct adcxx1c_model *model = &adcxx1c_models[id->driver_data];
	struct adcxx1c_model *model;
	int err;

	if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA))
		return -EOPNOTSUPP;

	if (ACPI_COMPANION(&client->dev)) {
		const struct acpi_device_id *ad_id;

		ad_id = acpi_match_device(client->dev.driver->acpi_match_table,
					  &client->dev);
		if (!ad_id)
			return -ENODEV;
		model = &adcxx1c_models[ad_id->driver_data];
	} else {
		model = &adcxx1c_models[id->driver_data];
	}

	iio = devm_iio_device_alloc(&client->dev, sizeof(*adc));
	if (!iio)
		return -ENOMEM;
@@ -231,10 +244,21 @@ static const struct of_device_id adc081c_of_match[] = {
MODULE_DEVICE_TABLE(of, adc081c_of_match);
#endif

#ifdef CONFIG_ACPI
static const struct acpi_device_id adc081c_acpi_match[] = {
	{ "ADC081C", ADC081C },
	{ "ADC101C", ADC101C },
	{ "ADC121C", ADC121C },
	{ }
};
MODULE_DEVICE_TABLE(acpi, adc081c_acpi_match);
#endif

static struct i2c_driver adc081c_driver = {
	.driver = {
		.name = "adc081c",
		.of_match_table = of_match_ptr(adc081c_of_match),
		.acpi_match_table = ACPI_PTR(adc081c_acpi_match),
	},
	.probe = adc081c_probe,
	.remove = adc081c_remove,
Loading