Commit 2475c515 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'staging-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging and IIO updates from Greg KH:
 "Here are the big staging/iio patches for 4.19-rc1.

  Lots of churn here, with tons of cleanups happening in staging
  drivers, a removal of an old crypto driver that no one was using
  (skein), and the addition of some new IIO drivers. Also added was a
  "gasket" driver from Google that needs loads of work and the erofs
  filesystem.

  Even with adding all of the new drivers and a new filesystem, we are
  only adding about 1000 lines overall to the kernel linecount, which
  shows just how much cleanup happened, and how big the unused crypto
  driver was.

  All of these have been in the linux-next tree for a while now with no
  reported issues"

* tag 'staging-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (903 commits)
  staging:rtl8192u: Remove unused macro definitions - Style
  staging:rtl8192u: Add spaces around '+' operator - Style
  staging:rtl8192u: Remove stale comment - Style
  staging: rtl8188eu: remove unused mp_custom_oid.h
  staging: fbtft: Add spaces around / - Style
  staging: fbtft: Erases some repetitive usage of function name - Style
  staging: fbtft: Adjust some empty-line problems - Style
  staging: fbtft: Removes one nesting level to help readability - Style
  staging: fbtft: Changes gamma table to define.
  staging: fbtft: A bit more information on dev_err.
  staging: fbtft: Fixes some alignment issues - Style
  staging: fbtft: Puts macro arguments in parenthesis to avoid precedence issues - Style
  staging: rtl8188eu: remove unused array dB_Invert_Table
  staging: rtl8188eu: remove whitespace, add missing blank line
  staging: rtl8188eu: use is_multicast_ether_addr in rtw_sta_mgt.c
  staging: rtl8188eu: remove whitespace - style
  staging: rtl8188eu: cleanup block comment - style
  staging: rtl8188eu: use is_multicast_ether_addr in rtl8188eu_xmit.c
  staging: rtl8188eu: use is_multicast_ether_addr in recv_linux.c
  staging: rtlwifi: refactor rtl_get_tcb_desc
  ...
parents 336722eb e4f6a44c
...@@ -197,6 +197,18 @@ Description: ...@@ -197,6 +197,18 @@ Description:
Angle of rotation. Units after application of scale and offset Angle of rotation. Units after application of scale and offset
are radians. are radians.
What: /sys/bus/iio/devices/iio:deviceX/in_positionrelative_x_raw
What: /sys/bus/iio/devices/iio:deviceX/in_positionrelative_y_raw
KernelVersion: 4.18
Contact: linux-iio@vger.kernel.org
Description:
Relative position in direction x or y on a pad (may be
arbitrarily assigned but should match other such assignments on
device).
Units after application of scale and offset are milli percents
from the pad's size in both directions. Should be calibrated by
the consumer.
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_x_raw What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_x_raw
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_raw What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_y_raw
What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_raw What: /sys/bus/iio/devices/iio:deviceX/in_anglvel_z_raw
...@@ -1295,13 +1307,16 @@ What: /sys/.../iio:deviceX/in_intensityY_raw ...@@ -1295,13 +1307,16 @@ What: /sys/.../iio:deviceX/in_intensityY_raw
What: /sys/.../iio:deviceX/in_intensityY_ir_raw What: /sys/.../iio:deviceX/in_intensityY_ir_raw
What: /sys/.../iio:deviceX/in_intensityY_both_raw What: /sys/.../iio:deviceX/in_intensityY_both_raw
What: /sys/.../iio:deviceX/in_intensityY_uv_raw What: /sys/.../iio:deviceX/in_intensityY_uv_raw
What: /sys/.../iio:deviceX/in_intensityY_duv_raw
KernelVersion: 3.4 KernelVersion: 3.4
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
Unit-less light intensity. Modifiers both and ir indicate Unit-less light intensity. Modifiers both and ir indicate
that measurements contain visible and infrared light that measurements contain visible and infrared light
components or just infrared light, respectively. Modifier uv indicates components or just infrared light, respectively. Modifier
that measurements contain ultraviolet light components. uv indicates that measurements contain ultraviolet light
components. Modifier duv indicates that measurements
contain deep ultraviolet light components.
What: /sys/.../iio:deviceX/in_uvindex_input What: /sys/.../iio:deviceX/in_uvindex_input
KernelVersion: 4.6 KernelVersion: 4.6
...@@ -1663,3 +1678,10 @@ KernelVersion: 4.12 ...@@ -1663,3 +1678,10 @@ KernelVersion: 4.12
Contact: linux-iio@vger.kernel.org Contact: linux-iio@vger.kernel.org
Description: Description:
Raw counter device counters direction for channel Y. Raw counter device counters direction for channel Y.
What: /sys/bus/iio/devices/iio:deviceX/in_phaseY_raw
KernelVersion: 4.18
Contact: linux-iio@vger.kernel.org
Description:
Raw (unscaled) phase difference reading from channel Y
that can be processed to radians.
\ No newline at end of file
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_agc_gain
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_agc_gain_bias
KernelVersion: 4.18
Contact: linux-iio@vger.kernel.org
Description:
This sensor has an automatic gain control (agc) loop
which sets the analog signal levels at an optimum
level by controlling programmable gain amplifiers. The
criteria for optimal gain is determined by the sensor.
Return the actual gain value as an integer in [0; 65536]
range when read from.
The agc gain read when measuring crosstalk shall be
written into in_proximity0_agc_gain_bias.
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calib_phase_temp_a
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calib_phase_temp_b
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calib_phase_light_a
What: /sys/bus/iio/devices/iio:deviceX/in_proximity0_calib_phase_light_b
KernelVersion: 4.18
Contact: linux-iio@vger.kernel.org
Description:
The sensor is able to perform correction of distance
measurements due to changing temperature and ambient
light conditions. It can be programmed to correct for
a second order error polynomial.
Phase data has to be collected when temperature and
ambient light are modulated independently.
Then a least squares curve fit to a second order
polynomial has to be generated from the data. The
resultant curves have the form ax^2 + bx + c.
From those two curves, a and b coefficients shall be
stored in in_proximity0_calib_phase_temp_a and
in_proximity0_calib_phase_temp_b for temperature and
in in_proximity0_calib_phase_light_a and
in_proximity0_calib_phase_light_b for ambient light.
Those values must be integer in [0; 8355840] range.
Finally, the c constant is set by the sensor
internally.
The value stored in sensor is displayed when read from.
What: /sys/bus/iio/devices/iio:deviceX/in_intensity_ir_small_raw
KernelVersion: 4.18
Contact: linux-iio@vger.kernel.org
Description:
Unit-less infrared intensity. The intensity is measured from 1
dark photodiode. "small" indicate the surface area capturing
infrared.
What: /sys/bus/iio/devices/iio:deviceX/in_intensity_ir_large_raw
KernelVersion: 4.18
Contact: linux-iio@vger.kernel.org
Description:
Unit-less infrared intensity. The intensity is measured from 4
dark photodiodes. "large" indicate the surface area capturing
infrared.
What: /sys/bus/iio/devices/iio:deviceX/in_intensity_large_raw
KernelVersion: 4.18
Contact: linux-iio@vger.kernel.org
Description:
Unit-less light intensity with more diodes.
Analog Devices ADXL345 3-Axis, +/-(2g/4g/8g/16g) Digital Accelerometer Analog Devices ADXL345/ADXL375 3-Axis Digital Accelerometers
http://www.analog.com/en/products/mems/accelerometers/adxl345.html http://www.analog.com/en/products/mems/accelerometers/adxl345.html
http://www.analog.com/en/products/sensors-mems/accelerometers/adxl375.html
Required properties: Required properties:
- compatible : should be "adi,adxl345" - compatible : should be one of
"adi,adxl345"
"adi,adxl375"
- reg : the I2C address or SPI chip select number of the sensor - reg : the I2C address or SPI chip select number of the sensor
Required properties for SPI bus usage: Required properties for SPI bus usage:
......
...@@ -4,6 +4,7 @@ Required properties: ...@@ -4,6 +4,7 @@ Required properties:
- compatible: depending on the SoC this should be one of: - compatible: depending on the SoC this should be one of:
- "amlogic,meson8-saradc" for Meson8 - "amlogic,meson8-saradc" for Meson8
- "amlogic,meson8b-saradc" for Meson8b - "amlogic,meson8b-saradc" for Meson8b
- "amlogic,meson8m2-saradc" for Meson8m2
- "amlogic,meson-gxbb-saradc" for GXBB - "amlogic,meson-gxbb-saradc" for GXBB
- "amlogic,meson-gxl-saradc" for GXL - "amlogic,meson-gxl-saradc" for GXL
- "amlogic,meson-gxm-saradc" for GXM - "amlogic,meson-gxm-saradc" for GXM
......
...@@ -21,6 +21,14 @@ Optional properties: ...@@ -21,6 +21,14 @@ Optional properties:
- dmas: Phandle to dma channel for the ADC. - dmas: Phandle to dma channel for the ADC.
- dma-names: Must be "rx" when dmas property is being used. - dma-names: Must be "rx" when dmas property is being used.
See ../../dma/dma.txt for details. See ../../dma/dma.txt for details.
- #io-channel-cells: in case consumer drivers are attached, this must be 1.
See <Documentation/devicetree/bindings/iio/iio-bindings.txt> for details.
Properties for consumer drivers:
- Consumer drivers can be connected to this producer device, as specified
in <Documentation/devicetree/bindings/iio/iio-bindings.txt>
- Channels exposed are specified in:
<dt-bindings/iio/adc/at91-sama5d2_adc.txt>
Example: Example:
...@@ -38,4 +46,5 @@ adc: adc@fc030000 { ...@@ -38,4 +46,5 @@ adc: adc@fc030000 {
atmel,trigger-edge-type = <IRQ_TYPE_EDGE_BOTH>; atmel,trigger-edge-type = <IRQ_TYPE_EDGE_BOTH>;
dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(25))>; dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(25))>;
dma-names = "rx"; dma-names = "rx";
#io-channel-cells = <1>;
} }
...@@ -8,11 +8,17 @@ Required properties: ...@@ -8,11 +8,17 @@ Required properties:
See Documentation/devicetree/bindings/gpio/gpio.txt See Documentation/devicetree/bindings/gpio/gpio.txt
- avdd-supply: Definition of the regulator used as analog supply - avdd-supply: Definition of the regulator used as analog supply
Optional properties:
- clock-frequency: Frequency of PD_SCK in Hz
Minimum value allowed is 10 kHz because of maximum
high time of 50 microseconds.
Example: Example:
weight@0 { weight {
compatible = "avia,hx711"; compatible = "avia,hx711";
sck-gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>; sck-gpios = <&gpio3 10 GPIO_ACTIVE_HIGH>;
dout-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>; dout-gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
avdd-suppy = <&avdd>; avdd-suppy = <&avdd>;
clock-frequency = <100000>;
}; };
...@@ -7,7 +7,7 @@ Required properties: ...@@ -7,7 +7,7 @@ Required properties:
Example node: Example node:
ads1202: adc@0 { ads1202: adc {
compatible = "sd-modulator"; compatible = "sd-modulator";
#io-channel-cells = <0>; #io-channel-cells = <0>;
}; };
Spreadtrum SC27XX series PMICs ADC binding
Required properties:
- compatible: Should be one of the following.
"sprd,sc2720-adc"
"sprd,sc2721-adc"
"sprd,sc2723-adc"
"sprd,sc2730-adc"
"sprd,sc2731-adc"
- reg: The address offset of ADC controller.
- interrupt-parent: The interrupt controller.
- interrupts: The interrupt number for the ADC device.
- #io-channel-cells: Number of cells in an IIO specifier.
- hwlocks: Reference to a phandle of a hwlock provider node.
Example:
sc2731_pmic: pmic@0 {
compatible = "sprd,sc2731";
reg = <0>;
spi-max-frequency = <26000000>;
interrupts = <GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>;
interrupt-controller;
#interrupt-cells = <2>;
#address-cells = <1>;
#size-cells = <0>;
pmic_adc: adc@480 {
compatible = "sprd,sc2731-adc";
reg = <0x480>;
interrupt-parent = <&sc2731_pmic>;
interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
#io-channel-cells = <1>;
hwlocks = <&hwlock 4>;
};
};
Analog Devices AD5758 DAC device driver
Required properties for the AD5758:
- compatible: Must be "adi,ad5758"
- reg: SPI chip select number for the device
- spi-max-frequency: Max SPI frequency to use (< 50000000)
- spi-cpha: is the only mode that is supported
Required properties:
- adi,dc-dc-mode: Mode of operation of the dc-to-dc converter
Dynamic Power Control (DPC)
In this mode, the AD5758 circuitry senses the output
voltage and dynamically regulates the supply voltage,
VDPC+, to meet compliance requirements plus an optimized
headroom voltage for the output buffer.
Programmable Power Control (PPC)
In this mode, the VDPC+ voltage is user-programmable to
a fixed level that needs to accommodate the maximum output
load required.
The output of the DAC core is either converted to a
current or voltage output at the VIOUT pin. Only one mode
can be enabled at any one time.
The following values are currently supported:
* 1: DPC current mode
* 2: DPC voltage mode
* 3: PPC current mode
Depending on the selected output mode (voltage or current) one of the
two properties must
be present:
- adi,range-microvolt: Voltage output range
The array of voltage output ranges must contain two fields:
* <0 5000000>: 0 V to 5 V voltage range
* <0 10000000>: 0 V to 10 V voltage range
* <(-5000000) 5000000>: ±5 V voltage range
* <(-10000000) 10000000>: ±10 V voltage range
- adi,range-microamp: Current output range
The array of current output ranges must contain two fields:
* <0 20000>: 0 mA to 20 mA current range
* <0 24000>: 0 mA to 24 mA current range
* <4 24000>: 4 mA to 20 mA current range
* <(-20000) 20000>: ±20 mA current range
* <(-24000) 24000>: ±24 mA current range
* <(-1000) 22000>: −1 mA to +22 mA current range
Optional properties:
- adi,dc-dc-ilim-microamp: The dc-to-dc converter current limit
The following values are currently supported [uA]:
* 150000
* 200000
* 250000
* 300000
* 350000
* 400000
- adi,slew-time-us: The time it takes for the output to reach the
full scale [uS]
The supported range is between 133us up to 1023984375us
AD5758 Example:
dac@0 {
compatible = "adi,ad5758";
reg = <0>;
spi-max-frequency = <1000000>;
spi-cpha;
adi,dc-dc-mode = <2>;
adi,range-microvolt = <0 10000000>;
adi,dc-dc-ilim-microamp = <200000>;
adi,slew-time-us = <125000>;
};
...@@ -6,6 +6,7 @@ Required properties: ...@@ -6,6 +6,7 @@ Required properties:
- compatible : should be one of - compatible : should be one of
"invensense,mpu6050" "invensense,mpu6050"
"invensense,mpu6500" "invensense,mpu6500"
"invensense,mpu6515"
"invensense,mpu9150" "invensense,mpu9150"
"invensense,mpu9250" "invensense,mpu9250"
"invensense,mpu9255" "invensense,mpu9255"
......
* ISL29501 Time-of-flight sensor.
Required properties:
- compatible : should be "renesas,isl29501"
- reg : the I2C address of the sensor
Example:
isl29501@57 {
compatible = "renesas,isl29501";
reg = <0x57>;
};
...@@ -8,10 +8,6 @@ Required properties: ...@@ -8,10 +8,6 @@ Required properties:
"bosch,bme280" "bosch,bme280"
Optional properties: Optional properties:
- chip-id: configurable chip id for non-default chip revisions
- temp-measurement-period: temperature measurement period (milliseconds)
- default-oversampling: default oversampling value to be used at startup,
value range is 0-3 with rising sensitivity.
- interrupts: interrupt mapping for IRQ - interrupts: interrupt mapping for IRQ
- reset-gpios: a GPIO line handling reset of the sensor: as the line is - reset-gpios: a GPIO line handling reset of the sensor: as the line is
active low, it should be marked GPIO_ACTIVE_LOW (see gpio/gpio.txt) active low, it should be marked GPIO_ACTIVE_LOW (see gpio/gpio.txt)
...@@ -23,9 +19,6 @@ Example: ...@@ -23,9 +19,6 @@ Example:
pressure@77 { pressure@77 {
compatible = "bosch,bmp085"; compatible = "bosch,bmp085";
reg = <0x77>; reg = <0x77>;
chip-id = <10>;
temp-measurement-period = <100>;
default-oversampling = <2>;
interrupt-parent = <&gpio0>; interrupt-parent = <&gpio0>;
interrupts = <25 IRQ_TYPE_EDGE_RISING>; interrupts = <25 IRQ_TYPE_EDGE_RISING>;
reset-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>; reset-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
......
Generic resistive touchscreen ADC
Required properties:
- compatible: must be "resistive-adc-touch"
The device must be connected to an ADC device that provides channels for
position measurement and optional pressure.
Refer to ../iio/iio-bindings.txt for details
- iio-channels: must have at least two channels connected to an ADC device.
These should correspond to the channels exposed by the ADC device and should
have the right index as the ADC device registers them. These channels
represent the relative position on the "x" and "y" axes.
- iio-channel-names: must have all the channels' names. Mandatory channels
are "x" and "y".
Optional properties:
- iio-channels: The third channel named "pressure" is optional and can be
used if the ADC device also measures pressure besides position.
If this channel is missing, pressure will be ignored and the touchscreen
will only report position.
- iio-channel-names: optional channel named "pressure".
Example:
resistive_touch: resistive_touch {
compatible = "resistive-adc-touch";
touchscreen-min-pressure = <50000>;
io-channels = <&adc 24>, <&adc 25>, <&adc 26>;
io-channel-names = "x", "y", "pressure";
};
...@@ -7,6 +7,9 @@ Optional properties for Touchscreens: ...@@ -7,6 +7,9 @@ Optional properties for Touchscreens:
(in pixels) (in pixels)
- touchscreen-max-pressure : maximum reported pressure (arbitrary range - touchscreen-max-pressure : maximum reported pressure (arbitrary range
dependent on the controller) dependent on the controller)
- touchscreen-min-pressure : minimum pressure on the touchscreen to be
achieved in order for the touchscreen
driver to report a touch event.
- touchscreen-fuzz-x : horizontal noise value of the absolute input - touchscreen-fuzz-x : horizontal noise value of the absolute input
device (in pixels) device (in pixels)
- touchscreen-fuzz-y : vertical noise value of the absolute input - touchscreen-fuzz-y : vertical noise value of the absolute input
......
...@@ -822,6 +822,14 @@ S: Supported ...@@ -822,6 +822,14 @@ S: Supported
F: drivers/iio/dac/ad5686* F: drivers/iio/dac/ad5686*
F: drivers/iio/dac/ad5696* F: drivers/iio/dac/ad5696*
ANALOG DEVICES INC AD5758 DRIVER
M: Stefan Popa <stefan.popa@analog.com>
L: linux-iio@vger.kernel.org
W: http://ez.analog.com/community/linux-device-drivers
S: Supported
F: drivers/iio/dac/ad5758.c
F: Documentation/devicetree/bindings/iio/dac/ad5758.txt
ANALOG DEVICES INC AD9389B DRIVER ANALOG DEVICES INC AD9389B DRIVER
M: Hans Verkuil <hans.verkuil@cisco.com> M: Hans Verkuil <hans.verkuil@cisco.com>
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
...@@ -2575,6 +2583,13 @@ S: Maintained ...@@ -2575,6 +2583,13 @@ S: Maintained
F: drivers/auxdisplay/ F: drivers/auxdisplay/
F: include/linux/cfag12864b.h F: include/linux/cfag12864b.h
AVIA HX711 ANALOG DIGITAL CONVERTER IIO DRIVER
M: Andreas Klinger <ak@it-klinger.de>
L: linux-iio@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/iio/adc/avia-hx711.txt
F: drivers/iio/adc/hx711.c
AX.25 NETWORK LAYER AX.25 NETWORK LAYER
M: Ralf Baechle <ralf@linux-mips.org> M: Ralf Baechle <ralf@linux-mips.org>
L: linux-hams@vger.kernel.org L: linux-hams@vger.kernel.org
...@@ -4472,7 +4487,8 @@ S: Maintained ...@@ -4472,7 +4487,8 @@ S: Maintained
F: drivers/staging/fsl-dpaa2/ethernet F: drivers/staging/fsl-dpaa2/ethernet
DPAA2 ETHERNET SWITCH DRIVER DPAA2 ETHERNET SWITCH DRIVER
M: Razvan Stefanescu <razvan.stefanescu@nxp.com> M: Ioana Radulescu <ruxandra.radulescu@nxp.com>
M: Ioana Ciornei <ioana.ciornei@nxp.com>
L: linux-kernel@vger.kernel.org L: linux-kernel@vger.kernel.org
S: Maintained S: Maintained
F: drivers/staging/fsl-dpaa2/ethsw F: drivers/staging/fsl-dpaa2/ethsw
...@@ -5980,6 +5996,13 @@ F: scripts/gcc-plugin.sh ...@@ -5980,6 +5996,13 @@ F: scripts/gcc-plugin.sh
F: scripts/Makefile.gcc-plugins F: scripts/Makefile.gcc-plugins
F: Documentation/gcc-plugins.txt F: Documentation/gcc-plugins.txt
GASKET DRIVER FRAMEWORK
M: Rob Springer <rspringer@google.com>
M: John Joseph <jnjoseph@google.com>
M: Ben Chan <benchan@chromium.org>
S: Maintained
F: drivers/staging/gasket/
GCOV BASED KERNEL PROFILING GCOV BASED KERNEL PROFILING
M: Peter Oberparleiter <oberpar@linux.ibm.com> M: Peter Oberparleiter <oberpar@linux.ibm.com>
S: Maintained S: Maintained
...@@ -6064,6 +6087,12 @@ F: drivers/base/power/domain*.c ...@@ -6064,6 +6087,12 @@ F: drivers/base/power/domain*.c
F: include/linux/pm_domain.h F: include/linux/pm_domain.h
F: Documentation/devicetree/bindings/power/power_domain.txt F: Documentation/devicetree/bindings/power/power_domain.txt
GENERIC RESISTIVE TOUCHSCREEN ADC DRIVER
M: Eugen Hristev <eugen.hristev@microchip.com>
L: linux-input@vger.kernel.org
S: Maintained
F: drivers/input/touchscreen/resistive-adc-touch.c
GENERIC UIO DRIVER FOR PCI DEVICES GENERIC UIO DRIVER FOR PCI DEVICES
M: "Michael S. Tsirkin" <mst@redhat.com> M: "Michael S. Tsirkin" <mst@redhat.com>
L: kvm@vger.kernel.org L: kvm@vger.kernel.org
...@@ -6199,7 +6228,7 @@ F: drivers/staging/greybus/bootrom.c ...@@ -6199,7 +6228,7 @@ F: drivers/staging/greybus/bootrom.c
F: drivers/staging/greybus/firmware.h F: drivers/staging/greybus/firmware.h
F: drivers/staging/greybus/fw-core.c F: drivers/staging/greybus/fw-core.c
F: drivers/staging/greybus/fw-download.c F: drivers/staging/greybus/fw-download.c
F: drivers/staging/greybus/fw-managament.c F: drivers/staging/greybus/fw-management.c
F: drivers/staging/greybus/greybus_authentication.h F: drivers/staging/greybus/greybus_authentication.h
F: drivers/staging/greybus/greybus_firmware.h F: drivers/staging/greybus/greybus_firmware.h
F: drivers/staging/greybus/hid.c F: drivers/staging/greybus/hid.c
...@@ -6208,12 +6237,10 @@ F: drivers/staging/greybus/spi.c ...@@ -6208,12 +6237,10 @@ F: drivers/staging/greybus/spi.c
F: drivers/staging/greybus/spilib.c F: drivers/staging/greybus/spilib.c
F: drivers/staging/greybus/spilib.h F: drivers/staging/greybus/spilib.h
GREYBUS LOOPBACK/TIME PROTOCOLS DRIVERS GREYBUS LOOPBACK DRIVER
M: Bryan O'Donoghue <pure.logic@nexus-software.ie> M: Bryan O'Donoghue <pure.logic@nexus-software.ie>
S: Maintained S: Maintained
F: drivers/staging/greybus/loopback.c F: drivers/staging/greybus/loopback.c
F: drivers/staging/greybus/timesync.c
F: drivers/staging/greybus/timesync_platform.c
GREYBUS PLATFORM DRIVERS GREYBUS PLATFORM DRIVERS
M: Vaibhav Hiremath <hvaibhav.linux@gmail.com> M: Vaibhav Hiremath <hvaibhav.linux@gmail.com>
...@@ -13619,6 +13646,13 @@ M: H Hartley Sweeten <hsweeten@visionengravers.com> ...@@ -13619,6 +13646,13 @@ M: H Hartley Sweeten <hsweeten@visionengravers.com>
S: Odd Fixes S: Odd Fixes
F: drivers/staging/comedi/ F: drivers/staging/comedi/
STAGING - EROFS FILE SYSTEM
M: Gao Xiang <gaoxiang25@huawei.com>
M: Chao Yu <yuchao0@huawei.com>
L: linux-erofs@lists.ozlabs.org
S: Maintained
F: drivers/staging/erofs/
STAGING - FLARION FT1000 DRIVERS STAGING - FLARION FT1000 DRIVERS
M: Marek Belisko <marek.belisko@gmail.com> M: Marek Belisko <marek.belisko@gmail.com>
S: Odd Fixes S: Odd Fixes
......
...@@ -40,7 +40,7 @@ config ADXL345_I2C ...@@ -40,7 +40,7 @@ config ADXL345_I2C
select REGMAP_I2C select REGMAP_I2C
help help
Say Y here if you want to build support for the Analog Devices Say Y here if you want to build support for the Analog Devices
ADXL345 3-axis digital accelerometer. ADXL345 or ADXL375 3-axis digital accelerometer.
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called adxl345_i2c and you will also get adxl345_core will be called adxl345_i2c and you will also get adxl345_core
...@@ -54,7 +54,7 @@ config ADXL345_SPI ...@@ -54,7 +54,7 @@ config ADXL345_SPI
select REGMAP_SPI select REGMAP_SPI
help help
Say Y here if you want to build support for the Analog Devices Say Y here if you want to build support for the Analog Devices
ADXL345 3-axis digital accelerometer. ADXL345 or ADXL375 3-axis digital accelerometer.
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called adxl345_spi and you will also get adxl345_core will be called adxl345_spi and you will also get adxl345_core
......
...@@ -11,8 +11,13 @@ ...@@ -11,8 +11,13 @@
#ifndef _ADXL345_H_ #ifndef _ADXL345_H_
#define _ADXL345_H_ #define _ADXL345_H_
enum adxl345_device_type {
ADXL345,
ADXL375,
};
int adxl345_core_probe(struct device *dev, struct regmap *regmap, int adxl345_core_probe(struct device *dev, struct regmap *regmap,
const char *name); enum adxl345_device_type type, const char *name);
int adxl345_core_remove(struct device *dev); int adxl345_core_remove(struct device *dev);
#endif /* _ADXL345_H_ */ #endif /* _ADXL345_H_ */
...@@ -6,21 +6,35 @@ ...@@ -6,21 +6,35 @@
* This file is subject to the terms and conditions of version 2 of * 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 * the GNU General Public License. See the file COPYING in the main
* directory of this archive for more details. * directory of this archive for more details.
*
* Datasheet: http://www.analog.com/media/en/technical-documentation/data-sheets/ADXL345.pdf
*/ */
#include <linux/module.h> #include <linux/module.h>
#include <linux/regmap.h> #include <linux/regmap.h>
#include <linux/iio/iio.h> #include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include "adxl345.h" #include "adxl345.h"
#define ADXL345_REG_DEVID 0x00 #define ADXL345_REG_DEVID 0x00
#define ADXL345_REG_OFSX 0x1e
#define ADXL345_REG_OFSY 0x1f
#define ADXL345_REG_OFSZ 0x20
#define ADXL345_REG_OFS_AXIS(index) (ADXL345_REG_OFSX + (index))
#define ADXL345_REG_BW_RATE 0x2C
#define ADXL345_REG_POWER_CTL 0x2D #define ADXL345_REG_POWER_CTL 0x2D
#define ADXL345_REG_DATA_FORMAT 0x31 #define ADXL345_REG_DATA_FORMAT 0x31
#define ADXL345_REG_DATAX0 0x32 #define ADXL345_REG_DATAX0 0x32
#define ADXL345_REG_DATAY0 0x34 #define ADXL345_REG_DATAY0 0x34
#define ADXL345_REG_DATAZ0 0x36 #define ADXL345_REG_DATAZ0 0x36
#define ADXL345_REG_DATA_AXIS(index) \
(ADXL345_REG_DATAX0 + (index) * sizeof(__le16))
#define ADXL345_BW_RATE GENMASK(3, 0)
#define ADXL345_BASE_RATE_NANO_HZ 97656250LL
#define NHZ_PER_HZ 1000000000LL
#define ADXL345_POWER_CTL_MEASURE BIT(3) #define ADXL345_POWER_CTL_MEASURE BIT(3)
#define ADXL345_POWER_CTL_STANDBY 0x00 #define ADXL345_POWER_CTL_STANDBY 0x00
...@@ -42,24 +56,33 @@ ...@@ -42,24 +56,33 @@
*/ */
static const int adxl345_uscale = 38300; static const int adxl345_uscale = 38300;
/*
* The Datasheet lists a resolution of Resolution is ~49 mg per LSB. That's
* ~480mm/s**2 per LSB.
*/
static const int adxl375_uscale = 480000;
struct adxl345_data { struct adxl345_data {
struct regmap *regmap; struct regmap *regmap;
u8 data_range; u8 data_range;
enum adxl345_device_type type;
}; };
#define ADXL345_CHANNEL(reg, axis) { \ #define ADXL345_CHANNEL(index, axis) { \
.type = IIO_ACCEL, \ .type = IIO_ACCEL, \
.modified = 1, \ .modified = 1, \
.channel2 = IIO_MOD_##axis, \ .channel2 = IIO_MOD_##axis, \
.address = reg, \ .address = index, \
.info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ BIT(IIO_CHAN_INFO_CALIBBIAS), \
.info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE) | \
BIT(IIO_CHAN_INFO_SAMP_FREQ), \
} }
static const struct iio_chan_spec adxl345_channels[] = { static const struct iio_chan_spec adxl345_channels[] = {
ADXL345_CHANNEL(ADXL345_REG_DATAX0, X), ADXL345_CHANNEL(0, X),
ADXL345_CHANNEL(ADXL345_REG_DATAY0, Y), ADXL345_CHANNEL(1, Y),
ADXL345_CHANNEL(ADXL345_REG_DATAZ0, Z), ADXL345_CHANNEL(2, Z),
}; };
static int adxl345_read_raw(struct iio_dev *indio_dev, static int adxl345_read_raw(struct iio_dev *indio_dev,
...@@ -67,7 +90,9 @@ static int adxl345_read_raw(struct iio_dev *indio_dev, ...@@ -67,7 +90,9 @@ static int adxl345_read_raw(struct iio_dev *indio_dev,
int *val, int *val2, long mask) int *val, int *val2, long mask)
{ {
struct adxl345_data *data = iio_priv(indio_dev); struct adxl345_data *data = iio_priv(indio_dev);
__le16 regval; __le16 accel;
long long samp_freq_nhz;
unsigned int regval;
int ret; int ret;
switch (mask) { switch (mask) {
...@@ -77,29 +102,117 @@ static int adxl345_read_raw(struct iio_dev *indio_dev, ...@@ -77,29 +102,117 @@ static int adxl345_read_raw(struct iio_dev *indio_dev,
* ADXL345_REG_DATA(X0/Y0/Z0) contain the least significant byte * ADXL345_REG_DATA(X0/Y0/Z0) contain the least significant byte
* and ADXL345_REG_DATA(X0/Y0/Z0) + 1 the most significant byte * and ADXL345_REG_DATA(X0/Y0/Z0) + 1 the most significant byte
*/ */
ret = regmap_bulk_read(data->regmap, chan->address, &regval, ret = regmap_bulk_read(data->regmap,
sizeof(regval)); ADXL345_REG_DATA_AXIS(chan->address),
&accel, sizeof(accel));
if (ret < 0) if (ret < 0)
return ret; return ret;
*val = sign_extend32(le16_to_cpu(regval), 12); *val = sign_extend32(le16_to_cpu(accel), 12);
return IIO_VAL_INT; return IIO_VAL_INT;
case IIO_CHAN_INFO_SCALE: case IIO_CHAN_INFO_SCALE:
*val = 0; *val = 0;
*val2 = adxl345_uscale; switch (data->type) {
case ADXL345:
*val2 = adxl345_uscale;
break;
case ADXL375:
*val2 = adxl375_uscale;
break;
}
return IIO_VAL_INT_PLUS_MICRO; return IIO_VAL_INT_PLUS_MICRO;
case IIO_CHAN_INFO_CALIBBIAS:
ret = regmap_read(data->regmap,
ADXL345_REG_OFS_AXIS(chan->address), &regval);
if (ret < 0)
return ret;
/*
* 8-bit resolution at +/- 2g, that is 4x accel data scale
* factor
*/
*val = sign_extend32(regval, 7) * 4;
return IIO_VAL_INT;
case IIO_CHAN_INFO_SAMP_FREQ:
ret = regmap_read(data->regmap, ADXL345_REG_BW_RATE, &regval);
if (ret < 0)
return ret;
samp_freq_nhz = ADXL345_BASE_RATE_NANO_HZ <<
(regval & ADXL345_BW_RATE);
*val = div_s64_rem(samp_freq_nhz, NHZ_PER_HZ, val2);
return IIO_VAL_INT_PLUS_NANO;
} }
return -EINVAL; return -EINVAL;
} }
static int adxl345_write_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
int val, int val2, long mask)
{
struct adxl345_data *data = iio_priv(indio_dev);
s64 n;
switch (mask) {
case IIO_CHAN_INFO_CALIBBIAS:
/*
* 8-bit resolution at +/- 2g, that is 4x accel data scale
* factor
*/
return regmap_write(data->regmap,
ADXL345_REG_OFS_AXIS(chan->address),
val / 4);
case IIO_CHAN_INFO_SAMP_FREQ:
n = div_s64(val * NHZ_PER_HZ + val2, ADXL345_BASE_RATE_NANO_HZ);
return regmap_update_bits(data->regmap, ADXL345_REG_BW_RATE,
ADXL345_BW_RATE,
clamp_val(ilog2(n), 0,
ADXL345_BW_RATE));
}
return -EINVAL;
}
static int adxl345_write_raw_get_fmt(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan,
long mask)
{
switch (mask) {
case IIO_CHAN_INFO_CALIBBIAS:
return IIO_VAL_INT;
case IIO_CHAN_INFO_SAMP_FREQ:
return IIO_VAL_INT_PLUS_NANO;
default:
return -EINVAL;
}
}
static IIO_CONST_ATTR_SAMP_FREQ_AVAIL(
"0.09765625 0.1953125 0.390625 0.78125 1.5625 3.125 6.25 12.5 25 50 100 200 400 800 1600 3200"
);
static struct attribute *adxl345_attrs[] = {
&iio_const_attr_sampling_frequency_available.dev_attr.attr,
NULL,
};
static const struct attribute_group adxl345_attrs_group = {
.attrs = adxl345_attrs,
};
static const struct iio_info adxl345_info = { static const struct iio_info adxl345_info = {
.attrs = &adxl345_attrs_group,
.read_raw = adxl345_read_raw, .read_raw = adxl345_read_raw,
.write_raw = adxl345_write_raw,
.write_raw_get_fmt = adxl345_write_raw_get_fmt,
}; };
int adxl345_core_probe(struct device *dev, struct regmap *regmap, int adxl345_core_probe(struct device *dev, struct regmap *regmap,
const char *name) enum adxl345_device_type type, const char *name)
{ {
struct adxl345_data *data; struct adxl345_data *data;
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
...@@ -125,6 +238,7 @@ int adxl345_core_probe(struct device *dev, struct regmap *regmap, ...@@ -125,6 +238,7 @@ int adxl345_core_probe(struct device *dev, struct regmap *regmap,
data = iio_priv(indio_dev); data = iio_priv(indio_dev);
dev_set_drvdata(dev, indio_dev); dev_set_drvdata(dev, indio_dev);
data->regmap = regmap; data->regmap = regmap;
data->type = type;
/* Enable full-resolution mode */ /* Enable full-resolution mode */
data->data_range = ADXL345_DATA_FORMAT_FULL_RES; data->data_range = ADXL345_DATA_FORMAT_FULL_RES;
......
...@@ -34,7 +34,8 @@ static int adxl345_i2c_probe(struct i2c_client *client, ...@@ -34,7 +34,8 @@ static int adxl345_i2c_probe(struct i2c_client *client,
return PTR_ERR(regmap); return PTR_ERR(regmap);
} }
return adxl345_core_probe(&client->dev, regmap, id ? id->name : NULL); return adxl345_core_probe(&client->dev, regmap, id->driver_data,
id ? id->name : NULL);
} }
static int adxl345_i2c_remove(struct i2c_client *client) static int adxl345_i2c_remove(struct i2c_client *client)
...@@ -43,7 +44,8 @@ static int adxl345_i2c_remove(struct i2c_client *client) ...@@ -43,7 +44,8 @@ static int adxl345_i2c_remove(struct i2c_client *client)
} }
static const struct i2c_device_id adxl345_i2c_id[] = { static const struct i2c_device_id adxl345_i2c_id[] = {
{ "adxl345", 0 }, { "adxl345", ADXL345 },
{ "adxl375", ADXL375 },
{ } { }
}; };
...@@ -51,6 +53,7 @@ MODULE_DEVICE_TABLE(i2c, adxl345_i2c_id); ...@@ -51,6 +53,7 @@ MODULE_DEVICE_TABLE(i2c, adxl345_i2c_id);
static const struct of_device_id adxl345_of_match[] = { static const struct of_device_id adxl345_of_match[] = {
{ .compatible = "adi,adxl345" }, { .compatible = "adi,adxl345" },
{ .compatible = "adi,adxl375" },
{ }, { },
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment