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

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

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

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

Jonathan writes:

Third set of new drivers, cleanups and features for IIO in the 3.12 cycle.

New drivers

1) Bosh BMA180 accelerometer + a new sysfs abi element, power_mode to
   allow for device that trade off accuracy and power usage.

Cleanups

1) Another lot of devm_iio_device_alloc patches
2) An code ordering bug in the twl6030 driver introduced earlier in this
   cycle.

New features

1) at91 adc driver rework to support a wider range of parts and drop
   the necessity for some of the current device tree elements.  This is
   a precursor to introducing input support which is still under review.
parents 115cac2e 9120c0be
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -794,6 +794,16 @@ Description:
		This attribute is used to read the amount of quadrature error
		present in the device at a given time.

What:		/sys/.../iio:deviceX/in_accelX_power_mode
KernelVersion:	3.11
Contact:	linux-iio@vger.kernel.org
Description:
		Specifies the chip power mode.
		low_noise: reduce noise level from ADC,
		low_power: enable low current consumption.
		For a list of available output power modes read
		in_accel_power_mode_available.

What:		/sys/bus/iio/devices/iio:deviceX/store_eeprom
KernelVersion:	3.4.0
Contact:	linux-iio@vger.kernel.org
+2 −5
Original line number Diff line number Diff line
* AT91's Analog to Digital Converter (ADC)

Required properties:
  - compatible: Should be "atmel,at91sam9260-adc"
  - compatible: Should be "atmel,<chip>-adc"
    <chip> can be "at91sam9260", "at91sam9g45" or "at91sam9x5"
  - reg: Should contain ADC registers location and length
  - interrupts: Should contain the IRQ line for the ADC
  - atmel,adc-channel-base: Offset of the first channel data register
  - atmel,adc-channels-used: Bitmask of the channels muxed and enable for this
    device
  - atmel,adc-drdy-mask: Mask of the DRDY interruption in the ADC
  - atmel,adc-num-channels: Number of channels available in the ADC
  - atmel,adc-startup-time: Startup Time of the ADC in microseconds as
    defined in the datasheet
  - atmel,adc-status-register: Offset of the Interrupt Status Register
  - atmel,adc-trigger-register: Offset of the Trigger Register
  - atmel,adc-vref: Reference voltage in millivolts for the conversions
  - atmel,adc-res: List of resolution in bits supported by the ADC. List size
		   must be two at least.
+24 −0
Original line number Diff line number Diff line
* Bosch BMA180 triaxial acceleration sensor

http://omapworld.com/BMA180_111_1002839.pdf

Required properties:

  - compatible : should be "bosch,bma180"
  - reg : the I2C address of the sensor

Optional properties:

  - interrupt-parent : should be the phandle for the interrupt controller

  - interrupts : interrupt mapping for GPIO IRQ, it should by configured with
		flags IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING

Example:

bma180@40 {
	compatible = "bosch,bma180";
	reg = <0x40>;
	interrupt-parent = <&gpio6>;
	interrupts = <18 (IRQ_TYPE_LEVEL_HIGH | IRQ_TYPE_EDGE_RISING)>;
};
+14 −2
Original line number Diff line number Diff line
@@ -28,9 +28,12 @@
#define			AT91_ADC_TRGSEL_EXTERNAL	(6 << 1)
#define		AT91_ADC_LOWRES		(1 << 4)	/* Low Resolution */
#define		AT91_ADC_SLEEP		(1 << 5)	/* Sleep Mode */
#define		AT91_ADC_PRESCAL	(0x3f << 8)	/* Prescalar Rate Selection */
#define		AT91_ADC_PRESCAL_9260	(0x3f << 8)	/* Prescalar Rate Selection */
#define		AT91_ADC_PRESCAL_9G45	(0xff << 8)
#define			AT91_ADC_PRESCAL_(x)	((x) << 8)
#define		AT91_ADC_STARTUP	(0x1f << 16)	/* Startup Up Time */
#define		AT91_ADC_STARTUP_9260	(0x1f << 16)	/* Startup Up Time */
#define		AT91_ADC_STARTUP_9G45	(0x7f << 16)
#define		AT91_ADC_STARTUP_9X5	(0xf << 16)
#define			AT91_ADC_STARTUP_(x)	((x) << 16)
#define		AT91_ADC_SHTIM		(0xf  << 24)	/* Sample & Hold Time */
#define			AT91_ADC_SHTIM_(x)	((x) << 24)
@@ -48,6 +51,9 @@
#define		AT91_ADC_ENDRX		(1 << 18)	/* End of RX Buffer */
#define		AT91_ADC_RXFUFF		(1 << 19)	/* RX Buffer Full */

#define AT91_ADC_SR_9X5		0x30		/* Status Register for 9x5 */
#define		AT91_ADC_SR_DRDY_9X5	(1 << 24)	/* Data Ready */

#define AT91_ADC_LCDR		0x20		/* Last Converted Data Register */
#define		AT91_ADC_LDATA		(0x3ff)

@@ -58,4 +64,10 @@
#define AT91_ADC_CHR(n)		(0x30 + ((n) * 4))	/* Channel Data Register N */
#define		AT91_ADC_DATA		(0x3ff)

#define AT91_ADC_CDR0_9X5	(0x50)			/* Channel Data Register 0 for 9X5 */

#define AT91_ADC_TRGR_9260	AT91_ADC_MR
#define AT91_ADC_TRGR_9G45	0x08
#define AT91_ADC_TRGR_9X5	0xC0

#endif
+12 −0
Original line number Diff line number Diff line
@@ -5,6 +5,18 @@

menu "Accelerometers"

config BMA180
	tristate "Bosch BMA180 3-Axis Accelerometer Driver"
	depends on I2C
	select IIO_BUFFER
	select IIO_TRIGGERED_BUFFER
	help
	  Say Y here if you want to build a driver for the Bosch BMA180
	  triaxial acceleration sensor.

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

config HID_SENSOR_ACCEL_3D
	depends on HID_SENSOR_HUB
	select IIO_BUFFER
Loading