Commit 888a87b5 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

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

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

Jonathan writes:

Third set of new device support, functionality and cleanups for IIO in the 4.9 cycle.

Given Linus is hinting (strongly!) at an rc8 this last set is hopefully in
time for the 4.9 merge window.  The zpa2326 and si1145 drivers provide
fine illustrations that devices aren't getting any simpler!

I'm also particularly pleased Linus Walliej did such a thorough job of cleaning
up one of my old drivers.

New device support
* mCube MC3230 accelerometer
  - new fairly minimal driver.
* Murata zpa2326
  - extensive new driver supporting the rather 'novel' buffering of data this
    device provides and handling both it's own data ready trigger and other
    triggers rather elegantly.
* si1141, si1142, si1143, si1145, si1146 and si1147 proximity, UV, visible and
  IR sensors.
  - another extensive new driver supporting all the key bits of what this
    set of devices supplies including dataready triggers, buffers and all the
    various data channels.

Functionality
* kxsd9 - Linus brought this scratch driver I wrote in one afternoon years ago
  up to date adding lots of good stuff along the way.
  - SPI support after extensive rework of the driver.
  - Triggered buffer capture support.
  - Runtime PM.
  - Regulator handling.
  - Mounting matrix support.
* mma7660
  - Add MODULE_DEVICE_TABLE to support autoprobing.

Cleanups
* ad5933
  - Align some function arguements nicely.
* med_z188
  - Constify iio_info structure.
* sca3000
  - Implement IIO_CHAN_INFO_SAMP_FREQ rather than a hand rolled attr.
    There are still quite a few drivers that would benefit from similar updates.
* ssp_sensors
  - Constify iio_info structures in accel and gyro drivers.
parents 530a7061 ac45e57f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ maxim,ds1050 5 Bit Programmable, Pulse-Width Modulator
maxim,max1237		Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs
maxim,max6625		9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface
mc,rv3029c2		Real Time Clock Module with I2C-Bus
mcube,mc3230		mCube 3-axis 8-bit digital accelerometer
microchip,mcp4531-502	Microchip 7-bit Single I2C Digital Potentiometer (5k)
microchip,mcp4531-103	Microchip 7-bit Single I2C Digital Potentiometer (10k)
microchip,mcp4531-503	Microchip 7-bit Single I2C Digital Potentiometer (50k)
+31 −0
Original line number Diff line number Diff line
Murata ZPA2326 pressure sensor

Pressure sensor from Murata with SPI and I2C bus interfaces.

Required properties:
- compatible: "murata,zpa2326"
- reg: the I2C address or SPI chip select the device will respond to

Recommended properties for SPI bus usage:
- spi-max-frequency: maximum SPI bus frequency as documented in
  Documentation/devicetree/bindings/spi/spi-bus.txt

Optional properties:
- vref-supply: an optional regulator that needs to be on to provide VREF
  power to the sensor
- vdd-supply: an optional regulator that needs to be on to provide VDD
  power to the sensor
- interrupt-parent: phandle to the parent interrupt controller as documented in
  Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
- interrupts: interrupt mapping for IRQ as documented in
  Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

Example:

zpa2326@5c {
	compatible = "murata,zpa2326";
	reg = <0x5c>;
	interrupt-parent = <&gpio>;
	interrupts = <12>;
	vdd-supply = <&ldo_1v8_gnss>;
};
+33 −2
Original line number Diff line number Diff line
@@ -119,14 +119,35 @@ config IIO_ST_ACCEL_SPI_3AXIS

config KXSD9
	tristate "Kionix KXSD9 Accelerometer Driver"
	depends on SPI
	select IIO_BUFFER
	select IIO_TRIGGERED_BUFFER
	help
	  Say yes here to build support for the Kionix KXSD9 accelerometer.
	  Currently this only supports the device via an SPI interface.
	  It can be accessed using an (optional) SPI or I2C interface.

	  To compile this driver as a module, choose M here: the module
	  will be called kxsd9.

config KXSD9_SPI
	tristate "Kionix KXSD9 SPI transport"
	depends on KXSD9
	depends on SPI
	default KXSD9
	select REGMAP_SPI
	help
	  Say yes here to enable the Kionix KXSD9 accelerometer
	  SPI transport channel.

config KXSD9_I2C
	tristate "Kionix KXSD9 I2C transport"
	depends on KXSD9
	depends on I2C
	default KXSD9
	select REGMAP_I2C
	help
	  Say yes here to enable the Kionix KXSD9 accelerometer
	  I2C transport channel.

config KXCJK1013
	tristate "Kionix 3-Axis Accelerometer Driver"
	depends on I2C
@@ -140,6 +161,16 @@ config KXCJK1013
	  To compile this driver as a module, choose M here: the module will
	  be called kxcjk-1013.

config MC3230
	tristate "mCube MC3230 Digital Accelerometer Driver"
	depends on I2C
	help
	  Say yes here to build support for the mCube MC3230 low-g tri-axial
	  digital accelerometer.

	  To compile this driver as a module, choose M here: the
	  module will be called mc3230.

config MMA7455
	tristate
	select IIO_BUFFER
+3 −0
Original line number Diff line number Diff line
@@ -13,6 +13,9 @@ obj-$(CONFIG_DMARD09) += dmard09.o
obj-$(CONFIG_HID_SENSOR_ACCEL_3D) += hid-sensor-accel-3d.o
obj-$(CONFIG_KXCJK1013) += kxcjk-1013.o
obj-$(CONFIG_KXSD9)	+= kxsd9.o
obj-$(CONFIG_KXSD9_SPI)	+= kxsd9-spi.o
obj-$(CONFIG_KXSD9_I2C)	+= kxsd9-i2c.o
obj-$(CONFIG_MC3230)	+= mc3230.o

obj-$(CONFIG_MMA7455)		+= mma7455_core.o
obj-$(CONFIG_MMA7455_I2C)	+= mma7455_i2c.o
+64 −0
Original line number Diff line number Diff line
#include <linux/device.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/regmap.h>

#include "kxsd9.h"

static int kxsd9_i2c_probe(struct i2c_client *i2c,
			   const struct i2c_device_id *id)
{
	static const struct regmap_config config = {
		.reg_bits = 8,
		.val_bits = 8,
		.max_register = 0x0e,
	};
	struct regmap *regmap;

	regmap = devm_regmap_init_i2c(i2c, &config);
	if (IS_ERR(regmap)) {
		dev_err(&i2c->dev, "Failed to register i2c regmap %d\n",
			(int)PTR_ERR(regmap));
		return PTR_ERR(regmap);
	}

	return kxsd9_common_probe(&i2c->dev,
				  regmap,
				  i2c->name);
}

static int kxsd9_i2c_remove(struct i2c_client *client)
{
	return kxsd9_common_remove(&client->dev);
}

#ifdef CONFIG_OF
static const struct of_device_id kxsd9_of_match[] = {
	{ .compatible = "kionix,kxsd9", },
	{ },
};
MODULE_DEVICE_TABLE(of, kxsd9_of_match);
#else
#define kxsd9_of_match NULL
#endif

static const struct i2c_device_id kxsd9_i2c_id[] = {
	{"kxsd9", 0},
	{ },
};
MODULE_DEVICE_TABLE(i2c, kxsd9_i2c_id);

static struct i2c_driver kxsd9_i2c_driver = {
	.driver = {
		.name	= "kxsd9",
		.of_match_table = of_match_ptr(kxsd9_of_match),
		.pm = &kxsd9_dev_pm_ops,
	},
	.probe		= kxsd9_i2c_probe,
	.remove		= kxsd9_i2c_remove,
	.id_table	= kxsd9_i2c_id,
};
module_i2c_driver(kxsd9_i2c_driver);
Loading