Char/Misc/IIO/Whatever driver subsystem updates for 6.13-rc1

Here is the "big and hairy" char/misc/iio and other small driver
 subsystem updates for 6.13-rc1.  Sorry for doing this at the end of the
 merge window, conference and holiday travel got in the way on my side
 (hence the 5am pull request emails...)
 
 Loads of things in here, and even a fun merge conflict!
   - rust misc driver bindings and other rust changes to make misc
     drivers actually possible.  I think this is the tipping point,
     expect to see way more rust drivers going forward now that these
     bindings are present.  Next merge window hopefully we will have pci
     and platform drivers working, which will fully enable almost all
     driver subsystems to start accepting (or at least getting) rust
     drivers.  This is the end result of a lot of work from a lot of
     people, congrats to all of them for getting this far, you've proved
     many of us wrong in the best way possible, working code :)
   - IIO driver updates, too many to list individually, that subsystem
     keeps growing and growing...
   - Interconnect driver updates
   - nvmem driver updates
   - pwm driver updates
   - platform_driver::remove() fixups, loads of them
   - counter driver updates
   - misc driver updates (keba?)
   - binder driver updates and fixes
   - loads of other small char/misc/etc driver updates and additions,
     full details in the shortlog.
 
 Note, there is a semi-hairy rust merge conflict when pulling this.  The
 resolution has been in linux-next for a while and can be seen here:
 	https://lore.kernel.org/all/20241111173459.2646d4af@canb.auug.org.au/
 
 All of these have been in linux-next for a while, with no other reported
 issues other than that merge conflict.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCZ0lGpg8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ykKHQCgvI4Muu2tpdINBVe24Zc8S3ozg0AAnRNg3F7r
 ikneftUDYtuviSGU/Rs8
 =CW+i
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc/IIO/whatever driver subsystem updates from Greg KH:
 "Here is the 'big and hairy' char/misc/iio and other small driver
  subsystem updates for 6.13-rc1.

  Loads of things in here, and even a fun merge conflict!

   - rust misc driver bindings and other rust changes to make misc
     drivers actually possible.

     I think this is the tipping point, expect to see way more rust
     drivers going forward now that these bindings are present. Next
     merge window hopefully we will have pci and platform drivers
     working, which will fully enable almost all driver subsystems to
     start accepting (or at least getting) rust drivers.

     This is the end result of a lot of work from a lot of people,
     congrats to all of them for getting this far, you've proved many of
     us wrong in the best way possible, working code :)

   - IIO driver updates, too many to list individually, that subsystem
     keeps growing and growing...

   - Interconnect driver updates

   - nvmem driver updates

   - pwm driver updates

   - platform_driver::remove() fixups, loads of them

   - counter driver updates

   - misc driver updates (keba?)

   - binder driver updates and fixes

   - loads of other small char/misc/etc driver updates and additions,
     full details in the shortlog.

  All of these have been in linux-next for a while, with no other
  reported issues other than that merge conflict"

* tag 'char-misc-6.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (401 commits)
  mei: vsc: Fix typo "maintstepping" -> "mainstepping"
  firmware: Switch back to struct platform_driver::remove()
  misc: isl29020: Fix the wrong format specifier
  scripts/tags.sh: Don't tag usages of DEFINE_MUTEX
  fpga: Switch back to struct platform_driver::remove()
  mei: vsc: Improve error logging in vsc_identify_silicon()
  mei: vsc: Do not re-enable interrupt from vsc_tp_reset()
  dt-bindings: spmi: qcom,x1e80100-spmi-pmic-arb: Add SAR2130P compatible
  dt-bindings: spmi: spmi-mtk-pmif: Add compatible for MT8188
  spmi: pmic-arb: fix return path in for_each_available_child_of_node()
  iio: Move __private marking before struct element priv in struct iio_dev
  docs: iio: ad7380: add adaq4370-4 and adaq4380-4
  iio: adc: ad7380: add support for adaq4370-4 and adaq4380-4
  iio: adc: ad7380: use local dev variable to shorten long lines
  iio: adc: ad7380: fix oversampling formula
  dt-bindings: iio: adc: ad7380: add adaq4370-4 and adaq4380-4 compatible parts
  bus: mhi: host: pci_generic: Use pcim_iomap_region() to request and map MHI BAR
  bus: mhi: host: Switch trace_mhi_gen_tre fields to native endian
  misc: atmel-ssc: Use of_property_present() for non-boolean properties
  misc: keba: Add hardware dependency
  ...
This commit is contained in:
Linus Torvalds 2024-11-29 11:58:27 -08:00
commit 2eff01ee28
449 changed files with 22870 additions and 5432 deletions

View File

@ -2268,6 +2268,30 @@ Description:
An example format is 16-bytes, 2-digits-per-byte, HEX-string
representing the sensor unique ID number.
What: /sys/bus/iio/devices/iio:deviceX/filter_type_available
What: /sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_mode_available
KernelVersion: 6.1
Contact: linux-iio@vger.kernel.org
Description:
Reading returns a list with the possible filter modes. Options
for the attribute:
* "sinc3" - The digital sinc3 filter. Moderate 1st
conversion time. Good noise performance.
* "sinc4" - Sinc 4. Excellent noise performance. Long
1st conversion time.
* "sinc5" - The digital sinc5 filter. Excellent noise
performance
* "sinc4+sinc1" - Sinc4 + averaging by 8. Low 1st conversion
time.
* "sinc3+rej60" - Sinc3 + 60Hz rejection.
* "sinc3+sinc1" - Sinc3 + averaging by 8. Low 1st conversion
time.
* "sinc3+pf1" - Sinc3 + device specific Post Filter 1.
* "sinc3+pf2" - Sinc3 + device specific Post Filter 2.
* "sinc3+pf3" - Sinc3 + device specific Post Filter 3.
* "sinc3+pf4" - Sinc3 + device specific Post Filter 4.
What: /sys/.../events/in_proximity_thresh_either_runningperiod
KernelVersion: 6.6
Contact: linux-iio@vger.kernel.org
@ -2339,3 +2363,11 @@ KernelVersion: 6.10
Contact: linux-iio@vger.kernel.org
Description:
The value of current sense resistor in Ohms.
What: /sys/.../iio:deviceX/in_attention_input
KernelVersion: 6.13
Contact: linux-iio@vger.kernel.org
Description:
Value representing the user's attention to the system expressed
in units as percentage. This usually means if the user is
looking at the screen or not.

View File

@ -1,46 +0,0 @@
What: /sys/bus/iio/devices/iio:deviceX/in_voltage-voltage_filter_mode_available
KernelVersion: 6.2
Contact: linux-iio@vger.kernel.org
Description:
Reading returns a list with the possible filter modes.
* "sinc4" - Sinc 4. Excellent noise performance. Long
1st conversion time. No natural 50/60Hz rejection.
* "sinc4+sinc1" - Sinc4 + averaging by 8. Low 1st conversion
time.
* "sinc3" - Sinc3. Moderate 1st conversion time.
Good noise performance.
* "sinc3+rej60" - Sinc3 + 60Hz rejection. At a sampling
frequency of 50Hz, achieves simultaneous 50Hz and 60Hz
rejection.
* "sinc3+sinc1" - Sinc3 + averaging by 8. Low 1st conversion
time. Best used with a sampling frequency of at least
216.19Hz.
* "sinc3+pf1" - Sinc3 + Post Filter 1. 53dB rejection @
50Hz, 58dB rejection @ 60Hz.
* "sinc3+pf2" - Sinc3 + Post Filter 2. 70dB rejection @
50Hz, 70dB rejection @ 60Hz.
* "sinc3+pf3" - Sinc3 + Post Filter 3. 99dB rejection @
50Hz, 103dB rejection @ 60Hz.
* "sinc3+pf4" - Sinc3 + Post Filter 4. 103dB rejection @
50Hz, 109dB rejection @ 60Hz.
What: /sys/bus/iio/devices/iio:deviceX/in_voltageY-voltageZ_filter_mode
KernelVersion: 6.2
Contact: linux-iio@vger.kernel.org
Description:
Set the filter mode of the differential channel. When the filter
mode changes, the in_voltageY-voltageZ_sampling_frequency and
in_voltageY-voltageZ_sampling_frequency_available attributes
might also change to accommodate the new filter mode.
If the current sampling frequency is out of range for the new
filter mode, the sampling frequency will be changed to the
closest valid one.

View File

@ -37,6 +37,10 @@ properties:
to both the positive and negative inputs of a differential ADC.
The first value specifies the positive input pin, the second
specifies the negative input pin.
There are also some ADCs, where the differential channel has dedicated
positive and negative inputs which can be used to measure differential
voltage levels. For those setups, this property can be configured with
the 'reg' property for both inputs (i.e. diff-channels = <reg reg>).
single-channel:
$ref: /schemas/types.yaml#/definitions/uint32

View File

@ -28,6 +28,7 @@ description: |
Datasheets for supported chips:
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4111.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4112.pdf
<AD4113: not released yet>
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4114.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4115.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/AD4116.pdf
@ -44,6 +45,7 @@ properties:
enum:
- adi,ad4111
- adi,ad4112
- adi,ad4113
- adi,ad4114
- adi,ad4115
- adi,ad4116
@ -331,6 +333,7 @@ allOf:
enum:
- adi,ad4111
- adi,ad4112
- adi,ad4113
- adi,ad4114
- adi,ad4115
- adi,ad4116

View File

@ -25,6 +25,8 @@ description: |
* https://www.analog.com/en/products/ad7386-4.html
* https://www.analog.com/en/products/ad7387-4.html
* https://www.analog.com/en/products/ad7388-4.html
* https://www.analog.com/en/products/adaq4370-4.html
* https://www.analog.com/en/products/adaq4380-4.html
$ref: /schemas/spi/spi-peripheral-props.yaml#
@ -46,6 +48,8 @@ properties:
- adi,ad7386-4
- adi,ad7387-4
- adi,ad7388-4
- adi,adaq4370-4
- adi,adaq4380-4
reg:
maxItems: 1
@ -70,6 +74,20 @@ properties:
refin-supply:
description:
A 2.5V to 3.3V supply for external reference voltage, for ad7380-4 only.
For adaq devices, a 5V supply voltage. A 3.3V internal reference is
derived from it. Connect to vs-p-supply for normal operation.
vs-p-supply:
description:
Amplifiers positive supply.
vs-n-supply:
description:
Amplifiers negative supply.
ldo-supply:
description:
LDO supply. Connect to vs-p-supply or a 3.6 to 5.5 V supply.
aina-supply:
description:
@ -97,12 +115,45 @@ properties:
specify the ALERT interrupt.
maxItems: 1
"#address-cells":
const: 1
"#size-cells":
const: 0
required:
- compatible
- reg
- vcc-supply
- vlogic-supply
patternProperties:
"^channel@[0-3]$":
$ref: adc.yaml
type: object
properties:
reg:
description:
The channel number. From 0 to 3 corresponding to channels A,B,C,D
minimum: 0
maximum: 3
adi,gain-milli:
description:
The hardware gain applied to the ADC input (in milli units).
If not present, default to 1000 (no actual gain applied).
Refer to the typical connection diagrams section of the datasheet for
pin wiring.
$ref: /schemas/types.yaml#/definitions/uint16
enum: [300, 600, 1000, 1600]
default: 1000
required:
- reg
additionalProperties: false
unevaluatedProperties: false
allOf:
@ -140,6 +191,7 @@ allOf:
aind-supply: false
# ad7380-4 uses refin-supply as external reference.
# adaq devices use internal reference only, derived from refin-supply
# All other chips from ad738x family use refio as optional external reference.
# When refio-supply is omitted, internal reference is used.
- if:
@ -147,6 +199,8 @@ allOf:
compatible:
enum:
- adi,ad7380-4
- adi,adaq4370-4
- adi,adaq4380-4
then:
properties:
refio-supply: false
@ -156,6 +210,27 @@ allOf:
properties:
refin-supply: false
# adaq devices need more supplies and using channel to declare gain property
# only applies to adaq devices
- if:
properties:
compatible:
enum:
- adi,adaq4370-4
- adi,adaq4380-4
then:
required:
- vs-p-supply
- vs-n-supply
- ldo-supply
else:
properties:
vs-p-supply: false
vs-n-supply: false
ldo-supply: false
patternProperties:
"^channel@[0-3]$": false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
@ -180,3 +255,48 @@ examples:
refio-supply = <&supply_2_5V>;
};
};
- |
#include <dt-bindings/interrupt-controller/irq.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
adc@0 {
compatible = "adi,adaq4380-4";
reg = <0>;
spi-cpol;
spi-cpha;
spi-max-frequency = <80000000>;
interrupts = <27 IRQ_TYPE_EDGE_FALLING>;
interrupt-parent = <&gpio0>;
vcc-supply = <&supply_3_3V>;
vlogic-supply = <&supply_3_3V>;
refin-supply = <&supply_5V>;
vs-p-supply = <&supply_5V>;
vs-n-supply = <&supply_0V>;
ldo-supply = <&supply_5V>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
adi,gain-milli = /bits/ 16 <300>;
};
channel@2 {
reg = <2>;
adi,gain-milli = /bits/ 16 <600>;
};
channel@3 {
reg = <3>;
adi,gain-milli = /bits/ 16 <1000>;
};
};
};

View File

@ -14,6 +14,11 @@ description: |
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7605-4.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606_7606-6_7606-4.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7606B.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-16.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7606c-18.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7607.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7608.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7609.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/AD7616.pdf
properties:
@ -24,11 +29,27 @@ properties:
- adi,ad7606-6
- adi,ad7606-8 # Referred to as AD7606 (without -8) in the datasheet
- adi,ad7606b
- adi,ad7606c-16
- adi,ad7606c-18
- adi,ad7607
- adi,ad7608
- adi,ad7609
- adi,ad7616
reg:
maxItems: 1
"#address-cells":
const: 1
"#size-cells":
const: 0
# According to the datasheet, "Data is clocked in from SDI on the falling
# edge of SCLK, while data is clocked out on DOUTA on the rising edge of
# SCLK". Also, even if not stated textually in the datasheet, it is made
# clear on the diagrams that sclk idles at high. Subsequently, in case SPI
# interface is used, the correct way is to only set spi-cpol.
spi-cpha: true
spi-cpol: true
@ -114,18 +135,91 @@ properties:
assumed that the pins are hardwired to VDD.
type: boolean
pwms:
description:
In case the conversion is triggered by a PWM instead of a GPIO plugged to
the CONVST pin, the PWM must be referenced.
The first is the PWM connected to CONVST or CONVST1 for the chips with the
2nd PWM connected to CONVST2, if CONVST2 is available and not shorted to
CONVST1.
minItems: 1
maxItems: 2
pwm-names:
items:
- const: convst1
- const: convst2
io-backends:
description:
A reference to the iio-backend, which is responsible handling the BUSY
pin's falling edge and communication.
An example of backend can be found at
http://analogdevicesinc.github.io/hdl/library/axi_ad7606x/index.html
patternProperties:
"^channel@[1-8]$":
type: object
$ref: adc.yaml
unevaluatedProperties: false
properties:
reg:
description:
The channel number, as specified in the datasheet (from 1 to 8).
minimum: 1
maximum: 8
diff-channels:
description:
Each channel can be configured as a bipolar differential channel.
The ADC uses the same positive and negative inputs for this.
This property must be specified as 'reg' (or the channel number) for
both positive and negative inputs (i.e. diff-channels = <reg reg>).
Since the configuration is bipolar differential, the 'bipolar'
property is required.
items:
minimum: 1
maximum: 8
bipolar:
description:
The ADC channels can be configured as
* Bipolar single-ended
* Unipolar single-ended
* Bipolar differential
Therefore in the DT, if no channel node is specified, it is considered
'unipolar single-ended'. So for the other configurations the 'bipolar'
property must be specified. If 'diff-channels' is specified, it is
considered a bipolar differential channel. Otherwise it is bipolar
single-ended.
required:
- reg
- bipolar
required:
- compatible
- reg
- spi-cpha
- avcc-supply
- vdrive-supply
- interrupts
- adi,conversion-start-gpios
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
- oneOf:
- required:
- adi,conversion-start-gpios
- required:
- pwms
- oneOf:
- required:
- interrupts
- required:
- io-backends
- if:
properties:
compatible:
@ -162,17 +256,66 @@ allOf:
- adi,ad7606-4
- adi,ad7606-6
- adi,ad7606-8
- adi,ad7607
- adi,ad7608
- adi,ad7609
then:
properties:
adi,sw-mode: false
else:
properties:
pwms:
maxItems: 1
pwm-names:
maxItems: 1
adi,conversion-start-gpios:
maxItems: 1
- if:
not:
required:
- adi,sw-mode
then:
patternProperties:
"^channel@[1-8]$": false
- if:
not:
properties:
compatible:
enum:
- adi,ad7606c-16
- adi,ad7606c-18
then:
patternProperties:
"^channel@[1-8]$": false
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
iio-backend {
#address-cells = <1>;
#size-cells = <0>;
adi_adc@0 {
compatible = "adi,ad7606b";
reg = <0>;
pwms = <&axi_pwm_gen 0 0>;
avcc-supply = <&adc_vref>;
vdrive-supply = <&vdd_supply>;
reset-gpios = <&gpio0 91 GPIO_ACTIVE_HIGH>;
standby-gpios = <&gpio0 90 GPIO_ACTIVE_LOW>;
adi,range-gpios = <&gpio0 89 GPIO_ACTIVE_HIGH>;
adi,oversampling-ratio-gpios = <&gpio0 88 GPIO_ACTIVE_HIGH
&gpio0 87 GPIO_ACTIVE_HIGH
&gpio0 86 GPIO_ACTIVE_HIGH>;
io-backends = <&iio_backend>;
};
};
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
@ -185,7 +328,6 @@ examples:
reg = <0>;
spi-max-frequency = <1000000>;
spi-cpol;
spi-cpha;
avcc-supply = <&adc_vref>;
vdrive-supply = <&vdd_supply>;
@ -202,4 +344,53 @@ examples:
standby-gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
};
};
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
adc@0 {
compatible = "adi,ad7606c-18";
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <1000000>;
spi-cpol;
avcc-supply = <&adc_vref>;
vdrive-supply = <&vdd_supply>;
interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
interrupt-parent = <&gpio>;
adi,conversion-start-gpios = <&gpio 17 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio 27 GPIO_ACTIVE_HIGH>;
adi,first-data-gpios = <&gpio 22 GPIO_ACTIVE_HIGH>;
standby-gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
adi,sw-mode;
channel@1 {
reg = <1>;
diff-channels = <1 1>;
bipolar;
};
channel@3 {
reg = <3>;
bipolar;
};
channel@8 {
reg = <8>;
diff-channels = <8 8>;
bipolar;
};
};
};
...

View File

@ -0,0 +1,176 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad7625.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices Fast PulSAR Analog to Digital Converters
maintainers:
- Michael Hennerich <Michael.Hennerich@analog.com>
- Nuno Sá <nuno.sa@analog.com>
description: |
A family of single channel differential analog to digital converters.
* https://www.analog.com/en/products/ad7625.html
* https://www.analog.com/en/products/ad7626.html
* https://www.analog.com/en/products/ad7960.html
* https://www.analog.com/en/products/ad7961.html
properties:
compatible:
enum:
- adi,ad7625
- adi,ad7626
- adi,ad7960
- adi,ad7961
vdd1-supply: true
vdd2-supply: true
vio-supply: true
ref-supply:
description:
Voltage regulator for the external reference voltage (REF).
refin-supply:
description:
Voltage regulator for the reference buffer input (REFIN).
clocks:
description:
The clock connected to the CLK pins, gated by the clk_gate PWM.
maxItems: 1
pwms:
items:
- description: PWM connected to the CNV input on the ADC.
- description: PWM that gates the clock connected to the ADC's CLK input.
pwm-names:
items:
- const: cnv
- const: clk_gate
io-backends:
description:
The AXI ADC IP block connected to the D+/- and DCO+/- lines of the
ADC. An example backend can be found at
http://analogdevicesinc.github.io/hdl/projects/pulsar_lvds/index.html.
maxItems: 1
adi,no-dco:
$ref: /schemas/types.yaml#/definitions/flag
description:
Indicates the wiring of the DCO+/- lines. If true, then they are
grounded and the device is in self-clocked mode. If this is not
present, then the device is in echoed clock mode.
adi,en0-always-on:
$ref: /schemas/types.yaml#/definitions/flag
description:
Indicates if EN0 is hard-wired to the high state. If neither this
nor en0-gpios are present, then EN0 is hard-wired low.
adi,en1-always-on:
$ref: /schemas/types.yaml#/definitions/flag
description:
Indicates if EN1 is hard-wired to the high state. If neither this
nor en1-gpios are present, then EN1 is hard-wired low.
adi,en2-always-on:
$ref: /schemas/types.yaml#/definitions/flag
description:
Indicates if EN2 is hard-wired to the high state. If neither this
nor en2-gpios are present, then EN2 is hard-wired low.
adi,en3-always-on:
$ref: /schemas/types.yaml#/definitions/flag
description:
Indicates if EN3 is hard-wired to the high state. If neither this
nor en3-gpios are present, then EN3 is hard-wired low.
en0-gpios:
description:
Configurable EN0 pin.
en1-gpios:
description:
Configurable EN1 pin.
en2-gpios:
description:
Configurable EN2 pin.
en3-gpios:
description:
Configurable EN3 pin.
required:
- compatible
- vdd1-supply
- vdd2-supply
- vio-supply
- clocks
- pwms
- pwm-names
- io-backends
allOf:
- if:
required:
- ref-supply
then:
properties:
refin-supply: false
- if:
required:
- refin-supply
then:
properties:
ref-supply: false
- if:
properties:
compatible:
contains:
enum:
- adi,ad7625
- adi,ad7626
then:
properties:
en2-gpios: false
en3-gpios: false
adi,en2-always-on: false
adi,en3-always-on: false
- if:
properties:
compatible:
contains:
enum:
- adi,ad7960
- adi,ad7961
then:
# ad796x parts must have one of the two supplies
oneOf:
- required: [ref-supply]
- required: [refin-supply]
additionalProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
adc {
compatible = "adi,ad7625";
vdd1-supply = <&supply_5V>;
vdd2-supply = <&supply_2_5V>;
vio-supply = <&supply_2_5V>;
io-backends = <&axi_adc>;
clocks = <&ref_clk>;
pwms = <&axi_pwm_gen 0 0>, <&axi_pwm_gen 1 0>;
pwm-names = "cnv", "clk_gate";
en0-gpios = <&gpio0 86 GPIO_ACTIVE_HIGH>;
en1-gpios = <&gpio0 87 GPIO_ACTIVE_HIGH>;
};

View File

@ -0,0 +1,110 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/adi,ad7779.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices AD777X family 8-Channel, 24-Bit, Simultaneous Sampling ADCs
maintainers:
- Ramona Nechita <ramona.nechita@analog.com>
description: |
The AD777X family consist of 8-channel, simultaneous sampling analog-to-
digital converter (ADC). Eight full Σ-Δ ADCs are on-chip. The
AD7771 provides an ultralow input current to allow direct sensor
connection. Each input channel has a programmable gain stage
allowing gains of 1, 2, 4, and 8 to map lower amplitude sensor
outputs into the full-scale ADC input range, maximizing the
dynamic range of the signal chain.
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7770.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7771.pdf
https://www.analog.com/media/en/technical-documentation/data-sheets/ad7779.pdf
$ref: /schemas/spi/spi-peripheral-props.yaml#
properties:
compatible:
enum:
- adi,ad7770
- adi,ad7771
- adi,ad7779
reg:
maxItems: 1
'#address-cells':
const: 1
'#size-cells':
const: 0
clocks:
maxItems: 1
avdd1-supply:
description: Front-End analog supply AVDD1. Can be used as conversion ref.
avdd2-supply:
description: AVDD2 Analog Supply from 2.2 V to 3.6 V.
avdd4-supply:
description: AVDD4 SAR Analog Supply and Reference Source.
interrupts:
minItems: 1
items:
- description: |
adc_rdy: Interrupt line for DRDY signal which indicates the end of
conversion independently of the interface selected to read back the
Σ-∆ conversion.
- description: |
Alert: The chip includes self diagnostic features to guarantee the
correct operation. If an error is detected, the ALERT pin is pulled
high to generate an external interruption to the controller.
interrupt-names:
minItems: 1
maxItems: 2
items:
enum:
- adc_rdy
- alert
start-gpios:
description:
Pin that controls start synchronization pulse.
maxItems: 1
reset-gpios:
maxItems: 1
required:
- compatible
- reg
- clocks
- interrupts
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interrupt-controller/irq.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
adc@0 {
compatible = "adi,ad7779";
reg = <0>;
start-gpios = <&gpio0 87 GPIO_ACTIVE_LOW>;
reset-gpios = <&gpio0 93 GPIO_ACTIVE_LOW>;
interrupt-parent = <&intc>;
interrupts = <0 56 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "adc_rdy";
clocks = <&adc_clk>;
};
};
...

View File

@ -98,6 +98,7 @@ allOf:
compatible:
contains:
enum:
- amlogic,meson8-saradc
- amlogic,meson8b-saradc
- amlogic,meson8m2-saradc
then:

View File

@ -0,0 +1,86 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/adc/gehc,pmc-adc.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: GE HealthCare PMC Analog to Digital Converter (ADC)
maintainers:
- Herve Codina <herve.codina@bootlin.com>
description:
The GE HealthCare PMC ADC is a 16-Channel (voltage and current), 16-Bit ADC
with an I2C Interface.
properties:
compatible:
const: gehc,pmc-adc
reg:
maxItems: 1
vdd-supply:
description:
Regulator for the VDD power supply.
vdda-supply:
description:
Regulator for the VDD analog (VDDA) power supply.
vddio-supply:
description:
Regulator for the VDD IO (VDDIO) power supply.
vref-supply:
description:
Regulator for the voltage reference power supply.
clocks:
maxItems: 1
description:
The component uses an external oscillator (osc) if an external oscillator
is connected to its clock pins. Otherwise, it uses an internal reference
clock.
clock-names:
items:
- const: osc
"#io-channel-cells":
const: 2
description: |
The first cell is the channel type (dt-bindings/iio/adc/gehc,pmc-adc.h
defines these values):
- 0: voltage
- 1: current
The second cell is the channel number from 0 to 15.
required:
- compatible
- reg
- vdd-supply
- vdda-supply
- vddio-supply
- vref-supply
- '#io-channel-cells'
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
adc@14 {
compatible = "gehc,pmc-adc";
reg = <0x14>;
vdd-supply = <&reg_vdd>;
vdda-supply = <&reg_vdda>;
vddio-supply = <&reg_vddio>;
vref-supply = <&reg_vref>;
#io-channel-cells = <2>;
};
};
...

View File

@ -30,7 +30,7 @@ properties:
maxItems: 1
spi-max-frequency:
maximum: 30000000
maximum: 66000000
reset-gpios:
maxItems: 1
@ -60,6 +60,12 @@ properties:
$ref: /schemas/types.yaml#/definitions/uint32
enum: [0, 1, 2, 3]
io-backends:
description: The iio backend reference.
Device can be optionally connected to the "axi-ad3552r IP" fpga-based
QSPI + DDR (Double Data Rate) controller to reach high speed transfers.
maxItems: 1
'#address-cells':
const: 1
@ -128,6 +134,7 @@ patternProperties:
- custom-output-range-config
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
- if:
properties:
compatible:

View File

@ -26,16 +26,47 @@ properties:
vdd-supply: true
vss-supply: true
vcc-supply:
description:
Supply that powers the chip.
iovcc-supply:
description:
Supply for the digital interface.
vrefp-supply:
description:
Positive referance input voltage range. From 5v to (vdd - 2.5)
vrefn-supply:
description:
Negative referance input voltage range. From (vss + 2.5) to 0.
adi,rbuf-gain2-en:
description: Specify to allow an external amplifier to be connected in a
gain of two configuration.
type: boolean
reset-gpios:
maxItems: 1
clear-gpios:
maxItems: 1
ldac-gpios:
description:
LDAC pin to be used as a hardware trigger to update the DAC channels.
maxItems: 1
required:
- compatible
- reg
- vdd-supply
- vss-supply
- vcc-supply
- iovcc-supply
- vrefp-supply
- vrefn-supply
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
@ -44,6 +75,7 @@ unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
@ -53,6 +85,13 @@ examples:
reg = <0>;
vss-supply = <&dac_vss>;
vdd-supply = <&dac_vdd>;
vcc-supply = <&dac_vcc>;
iovcc-supply = <&dac_iovcc>;
vrefp-supply = <&dac_vrefp>;
vrefn-supply = <&dac_vrefn>;
reset-gpios = <&gpio_bd 16 GPIO_ACTIVE_LOW>;
clear-gpios = <&gpio_bd 17 GPIO_ACTIVE_LOW>;
ldac-gpios = <&gpio_bd 18 GPIO_ACTIVE_HIGH>;
};
};
...

View File

@ -0,0 +1,164 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
# Copyright 2024 Analog Devices Inc.
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/dac/adi,ad8460.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Analog Devices AD8460 DAC
maintainers:
- Mariel Tinaco <mariel.tinaco@analog.com>
description: |
Analog Devices AD8460 110 V High Voltage, 1 A High Current,
Arbitrary Waveform Generator with Integrated 14-Bit High Speed DAC
https://www.analog.com/media/en/technical-documentation/data-sheets/ad8460.pdf
properties:
compatible:
enum:
- adi,ad8460
reg:
maxItems: 1
clocks:
maxItems: 1
dmas:
maxItems: 1
dma-names:
items:
- const: tx
spi-max-frequency:
maximum: 20000000
hvcc-supply:
description: Positive high voltage power supply line
hvee-supply:
description: Negative high voltage power supply line
vcc-5v-supply:
description: Low voltage power supply
vref-5v-supply:
description: Reference voltage for analog low voltage
dvdd-3p3v-supply:
description: Digital supply bypass
avdd-3p3v-supply:
description: Analog supply bypass
refio-1p2v-supply:
description: Drive voltage in the range of 1.2V maximum to as low as
low as 0.12V through the REF_IO pin to adjust full scale output span
adi,external-resistor-ohms:
description: Specify value of external resistor connected to FS_ADJ pin
to establish internal HVDAC's reference current I_REF
minimum: 2000
maximum: 20000
default: 2000
adi,range-microvolt:
description: Voltage output range specified as <minimum, maximum>
items:
- minimum: -55000000
maximum: 0
default: 0
- minimum: 0
maximum: 55000000
default: 0
adi,range-microamp:
description: Current output range specified as <minimum, maximum>
items:
- minimum: -1000000
maximum: 0
default: 0
- minimum: 0
maximum: 1000000
default: 0
adi,max-millicelsius:
description: Overtemperature threshold
minimum: 0
maximum: 150000
default: 0
shutdown-reset-gpios:
description: Corresponds to SDN_RESET pin. To exit shutdown
or sleep mode, pulse SDN_RESET HIGH, then leave LOW.
maxItems: 1
reset-gpios:
description: Manual Power On Reset (POR). Pull this GPIO pin
LOW and then HIGH to reset all digital registers to default
maxItems: 1
shutdown-gpios:
description: Corresponds to SDN_IO pin. Shutdown may be
initiated by the user, by pulsing SDN_IO high. To exit shutdown,
pulse SDN_IO low, then float.
maxItems: 1
required:
- compatible
- reg
- clocks
- hvcc-supply
- hvee-supply
- vcc-5v-supply
- vref-5v-supply
- dvdd-3p3v-supply
- avdd-3p3v-supply
- refio-1p2v-supply
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/gpio/gpio.h>
spi {
#address-cells = <1>;
#size-cells = <0>;
dac@0 {
compatible = "adi,ad8460";
reg = <0>;
spi-max-frequency = <8000000>;
dmas = <&tx_dma 0>;
dma-names = "tx";
shutdown-reset-gpios = <&gpio 86 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio 91 GPIO_ACTIVE_LOW>;
shutdown-gpios = <&gpio 88 GPIO_ACTIVE_HIGH>;
clocks = <&sync_ext_clk>;
hvcc-supply = <&hvcc>;
hvee-supply = <&hvee>;
vcc-5v-supply = <&vcc_5>;
vref-5v-supply = <&vref_5>;
dvdd-3p3v-supply = <&dvdd_3_3>;
avdd-3p3v-supply = <&avdd_3_3>;
refio-1p2v-supply = <&refio_1_2>;
adi,external-resistor-ohms = <2000>;
adi,range-microvolt = <(-40000000) 40000000>;
adi,range-microamp = <0 50000>;
adi,max-millicelsius = <50000>;
};
};
...

View File

@ -19,11 +19,13 @@ description: |
memory via DMA into the DAC.
https://wiki.analog.com/resources/fpga/docs/axi_dac_ip
https://analogdevicesinc.github.io/hdl/library/axi_ad3552r/index.html
properties:
compatible:
enum:
- adi,axi-dac-9.1.b
- adi,axi-ad3552r
reg:
maxItems: 1
@ -36,7 +38,14 @@ properties:
- const: tx
clocks:
maxItems: 1
minItems: 1
maxItems: 2
clock-names:
items:
- const: s_axi_aclk
- const: dac_clk
minItems: 1
'#io-backend-cells':
const: 0
@ -47,7 +56,29 @@ required:
- reg
- clocks
additionalProperties: false
allOf:
- if:
properties:
compatible:
contains:
const: adi,axi-ad3552r
then:
$ref: /schemas/spi/spi-controller.yaml#
properties:
clocks:
minItems: 2
clock-names:
minItems: 2
required:
- clock-names
else:
properties:
clocks:
maxItems: 1
clock-names:
maxItems: 1
unevaluatedProperties: false
examples:
- |
@ -57,6 +88,38 @@ examples:
dmas = <&tx_dma 0>;
dma-names = "tx";
#io-backend-cells = <0>;
clocks = <&axi_clk>;
clocks = <&clkc 15>;
clock-names = "s_axi_aclk";
};
- |
#include <dt-bindings/gpio/gpio.h>
axi_dac: spi@44a70000 {
compatible = "adi,axi-ad3552r";
reg = <0x44a70000 0x1000>;
dmas = <&dac_tx_dma 0>;
dma-names = "tx";
#io-backend-cells = <0>;
clocks = <&clkc 15>, <&ref_clk>;
clock-names = "s_axi_aclk", "dac_clk";
#address-cells = <1>;
#size-cells = <0>;
dac@0 {
compatible = "adi,ad3552r";
reg = <0>;
reset-gpios = <&gpio0 92 GPIO_ACTIVE_HIGH>;
io-backends = <&axi_dac>;
spi-max-frequency = <20000000>;
#address-cells = <1>;
#size-cells = <0>;
channel@0 {
reg = <0>;
adi,output-range-microvolt = <(-10000000) (10000000)>;
};
};
};
...

View File

@ -0,0 +1,79 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/imu/bosch,bmi270.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Bosch BMI270 6-Axis IMU
maintainers:
- Alex Lanzano <lanzano.alex@gmail.com>
description: |
BMI270 is a 6-axis inertial measurement unit that can measure acceleration and
angular velocity. The sensor also supports configurable interrupt events such
as motion, step counter, and wrist motion gestures. The sensor can communicate
I2C or SPI.
https://www.bosch-sensortec.com/products/motion-sensors/imus/bmi270/
properties:
compatible:
enum:
- bosch,bmi260
- bosch,bmi270
reg:
maxItems: 1
vdd-supply: true
vddio-supply: true
interrupts:
minItems: 1
maxItems: 2
interrupt-names:
minItems: 1
maxItems: 2
items:
enum:
- INT1
- INT2
drive-open-drain:
description:
set if the specified interrupt pins should be configured as
open drain. If not set, defaults to push-pull.
mount-matrix:
description:
an optional 3x3 mounting rotation matrix.
required:
- compatible
- reg
- vdd-supply
- vddio-supply
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
imu@68 {
compatible = "bosch,bmi270";
reg = <0x68>;
vdd-supply = <&vdd>;
vddio-supply = <&vddio>;
interrupt-parent = <&gpio1>;
interrupts = <16 IRQ_TYPE_EDGE_RISING>;
interrupt-names = "INT1";
};
};

View File

@ -0,0 +1,51 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/imu/bosch,smi240.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Bosch smi240 imu
maintainers:
- Jianping Shen <Jianping.Shen@de.bosch.com>
description:
Inertial Measurement Unit with Accelerometer and Gyroscope
with a measurement range of +/-300°/s and up to 16g.
https://www.bosch-semiconductors.com/mems-sensors/highly-automated-driving/smi240/
properties:
compatible:
const: bosch,smi240
reg:
maxItems: 1
vdd-supply: true
vddio-supply: true
required:
- compatible
- reg
- vdd-supply
- vddio-supply
allOf:
- $ref: /schemas/spi/spi-peripheral-props.yaml#
unevaluatedProperties: false
examples:
- |
spi {
#address-cells = <1>;
#size-cells = <0>;
imu@0 {
compatible = "bosch,smi240";
reg = <0>;
vdd-supply = <&vdd>;
vddio-supply = <&vddio>;
spi-max-frequency = <10000000>;
};
};

View File

@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: InvenSense ICM-426xx Inertial Measurement Unit
maintainers:
- Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
- Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
description: |
6-axis MotionTracking device that combines a 3-axis gyroscope and a 3-axis

View File

@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml#
title: InvenSense MPU-6050 Six-Axis (Gyro + Accelerometer) MEMS MotionTracking Device
maintainers:
- Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
- Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
description: |
These devices support both I2C and SPI bus interfaces.
@ -36,6 +36,11 @@ properties:
- items:
- const: invensense,icm20608d
- const: invensense,icm20608
- items:
- enum:
- invensense,iam20680hp
- invensense,iam20680ht
- const: invensense,iam20680
reg:
maxItems: 1

View File

@ -15,7 +15,9 @@ description: |
properties:
compatible:
const: ti,opt3001
enum:
- ti,opt3001
- ti,opt3002
reg:
maxItems: 1

View File

@ -1,64 +0,0 @@
# SPDX-License-Identifier: GPL-2.0+
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/light/veml6030.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: VEML6030 Ambient Light Sensor (ALS)
maintainers:
- Rishi Gupta <gupt21@gmail.com>
description: |
Bindings for the ambient light sensor veml6030 from Vishay
Semiconductors over an i2c interface.
Irrespective of whether interrupt is used or not, application
can get the ALS and White channel reading from IIO raw interface.
If the interrupts are used, application will receive an IIO event
whenever configured threshold is crossed.
Specifications about the sensor can be found at:
https://www.vishay.com/docs/84366/veml6030.pdf
properties:
compatible:
enum:
- vishay,veml6030
reg:
description:
I2C address of the device.
enum:
- 0x10 # ADDR pin pulled down
- 0x48 # ADDR pin pulled up
interrupts:
description:
interrupt mapping for IRQ. Configure with IRQ_TYPE_LEVEL_LOW.
Refer to interrupt-controller/interrupts.txt for generic
interrupt client node bindings.
maxItems: 1
required:
- compatible
- reg
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
light-sensor@10 {
compatible = "vishay,veml6030";
reg = <0x10>;
interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
};
};
...

View File

@ -0,0 +1,107 @@
# SPDX-License-Identifier: GPL-2.0+
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/light/vishay,veml6030.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: VEML3235, VEML6030, VEML6035 and VEML7700 Ambient Light Sensors (ALS)
maintainers:
- Rishi Gupta <gupt21@gmail.com>
description: |
Bindings for the ambient light sensors veml6030 and veml6035 from
Vishay Semiconductors over an i2c interface.
Irrespective of whether interrupt is used or not, application
can get the ALS and White channel reading from IIO raw interface.
If the interrupts are used, application will receive an IIO event
whenever configured threshold is crossed.
Specifications about the sensors can be found at:
https://www.vishay.com/docs/80131/veml3235.pdf
https://www.vishay.com/docs/84366/veml6030.pdf
https://www.vishay.com/docs/84889/veml6035.pdf
https://www.vishay.com/docs/84286/veml7700.pdf
properties:
compatible:
enum:
- vishay,veml3235
- vishay,veml6030
- vishay,veml6035
- vishay,veml7700
reg:
maxItems: 1
interrupts:
description:
interrupt mapping for IRQ. Configure with IRQ_TYPE_LEVEL_LOW.
Refer to interrupt-controller/interrupts.txt for generic
interrupt client node bindings.
maxItems: 1
vdd-supply: true
required:
- compatible
- reg
- vdd-supply
allOf:
- if:
properties:
compatible:
enum:
- vishay,veml6030
then:
properties:
reg:
enum:
- 0x10 # ADDR pin pulled down
- 0x48 # ADDR pin pulled up
- if:
properties:
compatible:
enum:
- vishay,veml6035
then:
properties:
reg:
enum:
- 0x29
- if:
properties:
compatible:
enum:
- vishay,veml3235
- vishay,veml7700
then:
properties:
reg:
enum:
- 0x10
interrupts: false
additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
light-sensor@10 {
compatible = "vishay,veml6030";
reg = <0x10>;
interrupts = <12 IRQ_TYPE_LEVEL_LOW>;
vdd-supply = <&vdd>;
};
};
...

View File

@ -4,7 +4,7 @@
$id: http://devicetree.org/schemas/iio/light/vishay,veml6075.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Vishay VEML6075 UVA/B and VEML6040 RGBW sensors
title: Vishay VEML6070 UVA, VEML6075 UVA/B and VEML6040 RGBW sensors
maintainers:
- Javier Carrasco <javier.carrasco.cruz@gmail.com>
@ -16,11 +16,19 @@ properties:
compatible:
enum:
- vishay,veml6040
- vishay,veml6070
- vishay,veml6075
reg:
maxItems: 1
vishay,rset-ohms:
description:
Resistor used to select the integration time.
default: 270000
minimum: 75000
maximum: 1200000
vdd-supply: true
required:
@ -28,6 +36,17 @@ required:
- reg
- vdd-supply
allOf:
- if:
properties:
compatible:
enum:
- vishay,veml6040
- vishay,veml6075
then:
properties:
vishay,rset-ohms: false
additionalProperties: false
examples:

View File

@ -0,0 +1,46 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/iio/magnetometer/allegromicro,als31300.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Allegro MicroSystems ALS31300 3-D Linear Hall Effect sensor
maintainers:
- Neil Armstrong <neil.armstrong@linaro.org>
properties:
$nodename:
pattern: '^magnetometer@[0-9a-f]+$'
compatible:
enum:
- allegromicro,als31300-500 # Factory configured at 500 Gauss input range
- allegromicro,als31300-1000 # Factory configured at 1000 Gauss input range
- allegromicro,als31300-2000 # Factory configured at 2000 Gauss input range
reg:
maxItems: 1
vcc-supply:
description: 5.5V supply
interrupts:
maxItems: 1
required:
- compatible
additionalProperties: false
examples:
- |
i2c {
#address-cells = <1>;
#size-cells = <0>;
magnetometer@61 {
compatible = "allegromicro,als31300-500";
reg = <0x61>;
vcc-supply = <&hall_vcc>;
};
};

View File

@ -47,15 +47,33 @@ properties:
maxItems: 1
interrupts:
description:
interrupt mapping for IRQ (BMP085 only)
maxItems: 1
drive-open-drain:
description:
set if the interrupt pin should be configured as open drain.
If not set, defaults to push-pull configuration.
type: boolean
required:
- compatible
- vddd-supply
- vdda-supply
allOf:
- if:
properties:
compatible:
not:
contains:
enum:
- bosch,bmp085
- bosch,bmp380
- bosch,bmp580
then:
properties:
interrupts: false
additionalProperties: false
examples:

View File

@ -23,6 +23,9 @@ properties:
vdd-supply:
description: provide VDD power to the sensor.
interrupts:
maxItems: 1
required:
- compatible
- reg
@ -31,6 +34,7 @@ additionalProperties: false
examples:
- |
#include <dt-bindings/interrupt-controller/irq.h>
i2c {
#address-cells = <1>;
#size-cells = <0>;
@ -38,5 +42,7 @@ examples:
compatible = "ti,tmp006";
reg = <0x40>;
vdd-supply = <&ldo4_reg>;
interrupt-parent = <&gpio1>;
interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
};
};

View File

@ -26,6 +26,7 @@ properties:
- items:
- enum:
- qcom,qcm2290-cpu-bwmon
- qcom,qcs8300-cpu-bwmon
- qcom,sa8775p-cpu-bwmon
- qcom,sc7180-cpu-bwmon
- qcom,sc7280-cpu-bwmon
@ -40,6 +41,7 @@ properties:
- const: qcom,sdm845-bwmon # BWMON v4, unified register space
- items:
- enum:
- qcom,qcs8300-llcc-bwmon
- qcom,sa8775p-llcc-bwmon
- qcom,sc7180-llcc-bwmon
- qcom,sc8280xp-llcc-bwmon

View File

@ -0,0 +1,73 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/interconnect/qcom,qcs615-rpmh.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm RPMh Network-On-Chip Interconnect on QCS615
maintainers:
- Raviteja Laggyshetty <quic_rlaggysh@quicinc.com>
description: |
RPMh interconnect providers support system bandwidth requirements through
RPMh hardware accelerators known as Bus Clock Manager (BCM). The provider is
able to communicate with the BCM through the Resource State Coordinator (RSC)
associated with each execution environment. Provider nodes must point to at
least one RPMh device child node pertaining to their RSC and each provider
can map to multiple RPMh resources.
See also: include/dt-bindings/interconnect/qcom,qcs615-rpmh.h
properties:
compatible:
enum:
- qcom,qcs615-aggre1-noc
- qcom,qcs615-camnoc-virt
- qcom,qcs615-config-noc
- qcom,qcs615-dc-noc
- qcom,qcs615-gem-noc
- qcom,qcs615-ipa-virt
- qcom,qcs615-mc-virt
- qcom,qcs615-mmss-noc
- qcom,qcs615-system-noc
reg:
maxItems: 1
required:
- compatible
allOf:
- $ref: qcom,rpmh-common.yaml#
- if:
properties:
compatible:
contains:
enum:
- qcom,qcs615-camnoc-virt
- qcom,qcs615-ipa-virt
- qcom,qcs615-mc-virt
then:
properties:
reg: false
else:
required:
- reg
unevaluatedProperties: false
examples:
- |
gem_noc: interconnect@9680000 {
compatible = "qcom,qcs615-gem-noc";
reg = <0x9680000 0x3e200>;
#interconnect-cells = <2>;
qcom,bcm-voters = <&apps_bcm_voter>;
};
mc_virt: interconnect-2 {
compatible = "qcom,qcs615-mc-virt";
#interconnect-cells = <2>;
qcom,bcm-voters = <&apps_bcm_voter>;
};

View File

@ -0,0 +1,72 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/interconnect/qcom,qcs8300-rpmh.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm RPMh Network-On-Chip Interconnect on QCS8300
maintainers:
- Raviteja Laggyshetty <quic_rlaggysh@quicinc.com>
description: |
RPMh interconnect providers support system bandwidth requirements through
RPMh hardware accelerators known as Bus Clock Manager (BCM).
See also: include/dt-bindings/interconnect/qcom,qcs8300-rpmh.h
properties:
compatible:
enum:
- qcom,qcs8300-aggre1-noc
- qcom,qcs8300-aggre2-noc
- qcom,qcs8300-clk-virt
- qcom,qcs8300-config-noc
- qcom,qcs8300-dc-noc
- qcom,qcs8300-gem-noc
- qcom,qcs8300-gpdsp-anoc
- qcom,qcs8300-lpass-ag-noc
- qcom,qcs8300-mc-virt
- qcom,qcs8300-mmss-noc
- qcom,qcs8300-nspa-noc
- qcom,qcs8300-pcie-anoc
- qcom,qcs8300-system-noc
reg:
maxItems: 1
required:
- compatible
allOf:
- $ref: qcom,rpmh-common.yaml#
- if:
properties:
compatible:
contains:
enum:
- qcom,qcs8300-clk-virt
- qcom,qcs8300-mc-virt
then:
properties:
reg: false
else:
required:
- reg
unevaluatedProperties: false
examples:
- |
gem_noc: interconnect@9100000 {
compatible = "qcom,qcs8300-gem-noc";
reg = <0x9100000 0xf7080>;
#interconnect-cells = <2>;
qcom,bcm-voters = <&apps_bcm_voter>;
};
clk_virt: interconnect-0 {
compatible = "qcom,qcs8300-clk-virt";
#interconnect-cells = <2>;
qcom,bcm-voters = <&apps_bcm_voter>;
};

View File

@ -0,0 +1,117 @@
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/interconnect/qcom,sar2130p-rpmh.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Qualcomm RPMh Network-On-Chip Interconnect on SAR2130P
maintainers:
- Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
- Georgi Djakov <djakov@kernel.org>
description: |
RPMh interconnect providers support system bandwidth requirements through
RPMh hardware accelerators known as Bus Clock Manager (BCM). The provider is
able to communicate with the BCM through the Resource State Coordinator (RSC)
associated with each execution environment. Provider nodes must point to at
least one RPMh device child node pertaining to their RSC and each provider
can map to multiple RPMh resources.
See also:: include/dt-bindings/interconnect/qcom,sar2130p-rpmh.h
properties:
compatible:
enum:
- qcom,sar2130p-clk-virt
- qcom,sar2130p-config-noc
- qcom,sar2130p-gem-noc
- qcom,sar2130p-lpass-ag-noc
- qcom,sar2130p-mc-virt
- qcom,sar2130p-mmss-noc
- qcom,sar2130p-nsp-noc
- qcom,sar2130p-pcie-anoc
- qcom,sar2130p-system-noc
reg:
maxItems: 1
clocks:
minItems: 1
maxItems: 2
required:
- compatible
allOf:
- $ref: qcom,rpmh-common.yaml#
- if:
properties:
compatible:
contains:
enum:
- qcom,sar2130p-clk-virt
- qcom,sar2130p-mc-virt
then:
properties:
reg: false
else:
required:
- reg
- if:
properties:
compatible:
contains:
enum:
- qcom,sar2130p-pcie-anoc
then:
properties:
clocks:
items:
- description: aggre-NOC PCIe AXI clock
- description: cfg-NOC PCIe a-NOC AHB clock
- if:
properties:
compatible:
contains:
enum:
- qcom,sar2130p-system-noc
then:
properties:
clocks:
items:
- description: aggre USB3 PRIM AXI clock
- if:
properties:
compatible:
contains:
enum:
- qcom,sar2130p-system-noc
- qcom,sar2130p-pcie-anoc
then:
required:
- clocks
else:
properties:
clocks: false
unevaluatedProperties: false
examples:
- |
clk_virt: interconnect-0 {
compatible = "qcom,sar2130p-clk-virt";
#interconnect-cells = <2>;
qcom,bcm-voters = <&apps_bcm_voter>;
};
aggre1_noc: interconnect@1680000 {
compatible = "qcom,sar2130p-system-noc";
reg = <0x01680000 0x29080>;
#interconnect-cells = <2>;
clocks = <&gcc_prim_axi_clk>;
qcom,bcm-voters = <&apps_bcm_voter>;
};

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/fuse/renesas,rcar-efuse.yaml#
$id: http://devicetree.org/schemas/nvmem/renesas,rcar-efuse.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: R-Car E-FUSE connected to PFC
@ -13,6 +13,9 @@ description:
The E-FUSE is a type of non-volatile memory, which is accessible through the
Pin Function Controller (PFC) on some R-Car Gen4 SoCs.
allOf:
- $ref: nvmem.yaml#
properties:
compatible:
enum:
@ -39,17 +42,27 @@ required:
- power-domains
- resets
additionalProperties: false
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/r8a779a0-cpg-mssr.h>
#include <dt-bindings/power/r8a779a0-sysc.h>
#include <dt-bindings/clock/r8a779f0-cpg-mssr.h>
#include <dt-bindings/power/r8a779f0-sysc.h>
fuse: fuse@e6078800 {
compatible = "renesas,r8a779a0-efuse";
reg = <0xe6078800 0x100>;
clocks = <&cpg CPG_MOD 916>;
power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
resets = <&cpg 916>;
fuse@e6078800 {
compatible = "renesas,r8a779f0-efuse";
reg = <0xe6078800 0x200>;
clocks = <&cpg CPG_MOD 915>;
power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
resets = <&cpg 915>;
nvmem-layout {
compatible = "fixed-layout";
#address-cells = <1>;
#size-cells = <1>;
calib@144 {
reg = <0x144 0x08>;
};
};
};

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/fuse/renesas,rcar-otp.yaml#
$id: http://devicetree.org/schemas/nvmem/renesas,rcar-otp.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: R-Car E-FUSE connected to OTP_MEM
@ -13,6 +13,9 @@ description:
The E-FUSE is a type of non-volatile memory, which is accessible through the
One-Time Programmable Memory (OTP_MEM) module on some R-Car Gen4 SoCs.
allOf:
- $ref: nvmem.yaml#
properties:
compatible:
enum:
@ -22,17 +25,19 @@ properties:
reg:
items:
- description: OTP_MEM_0
- description: OTP_MEM_1
- description: OTP_MEM_1.
The addresses of cells defined under the optional nvmem-layout
subnode are relative to this register bank.
required:
- compatible
- reg
additionalProperties: false
unevaluatedProperties: false
examples:
- |
otp: otp@e61be000 {
compatible = "renesas,r8a779g0-otp";
reg = <0xe61be000 0x1000>, <0xe61bf000 0x1000>;
otp@e61be000 {
compatible = "renesas,r8a779g0-otp";
reg = <0xe61be000 0x1000>, <0xe61bf000 0x1000>;
};

View File

@ -1,52 +0,0 @@
= Spreadtrum SC27XX PMIC eFuse device tree bindings =
Required properties:
- compatible: Should be one of the following.
"sprd,sc2720-efuse"
"sprd,sc2721-efuse"
"sprd,sc2723-efuse"
"sprd,sc2730-efuse"
"sprd,sc2731-efuse"
- reg: Specify the address offset of efuse controller.
- hwlocks: Reference to a phandle of a hwlock provider node.
= Data cells =
Are child nodes of eFuse, bindings of which as described in
bindings/nvmem/nvmem.txt
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>;
efuse@380 {
compatible = "sprd,sc2731-efuse";
reg = <0x380>;
#address-cells = <1>;
#size-cells = <1>;
hwlocks = <&hwlock 12>;
/* Data cells */
thermal_calib: calib@10 {
reg = <0x10 0x2>;
};
};
};
= Data consumers =
Are device nodes which consume nvmem data cells.
Example:
thermal {
...
nvmem-cells = <&thermal_calib>;
nvmem-cell-names = "calibration";
};

View File

@ -0,0 +1,68 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/nvmem/sprd,sc2731-efuse.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Spreadtrum SC27XX PMIC eFuse
maintainers:
- Orson Zhai <orsonzhai@gmail.com>
- Baolin Wang <baolin.wang7@gmail.com>
- Chunyan Zhang <zhang.lyra@gmail.com>
properties:
compatible:
enum:
- sprd,sc2720-efuse
- sprd,sc2721-efuse
- sprd,sc2723-efuse
- sprd,sc2730-efuse
- sprd,sc2731-efuse
reg:
maxItems: 1
hwlocks:
maxItems: 1
required:
- compatible
- reg
- hwlocks
allOf:
- $ref: nvmem.yaml#
- $ref: nvmem-deprecated-cells.yaml#
unevaluatedProperties: false
examples:
- |
pmic {
#address-cells = <1>;
#size-cells = <0>;
efuse@380 {
compatible = "sprd,sc2731-efuse";
reg = <0x380>;
hwlocks = <&hwlock 12>;
#address-cells = <1>;
#size-cells = <1>;
/* Data cells */
fgu_calib: calib@6 {
reg = <0x6 0x2>;
bits = <0 9>;
};
adc_big_scale: calib@24 {
reg = <0x24 0x2>;
};
adc_small_scale: calib@26 {
reg = <0x26 0x2>;
};
};
};
...

View File

@ -0,0 +1,61 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/nvmem/sprd,ums312-efuse.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Spreadtrum UMS312 eFuse
maintainers:
- Orson Zhai <orsonzhai@gmail.com>
- Baolin Wang <baolin.wang7@gmail.com>
- Chunyan Zhang <zhang.lyra@gmail.com>
properties:
compatible:
const: sprd,ums312-efuse
reg:
maxItems: 1
clocks:
maxItems: 1
clock-names:
const: enable
hwlocks:
maxItems: 1
required:
- compatible
- reg
- clocks
- clock-names
- hwlocks
allOf:
- $ref: nvmem.yaml#
- $ref: nvmem-deprecated-cells.yaml#
unevaluatedProperties: false
examples:
- |
#include <dt-bindings/clock/sprd,ums512-clk.h>
efuse@32240000 {
compatible = "sprd,ums312-efuse";
reg = <0x32240000 0x10000>;
clocks = <&aonapb_gate CLK_EFUSE_EB>;
clock-names = "enable";
hwlocks = <&hwlock 8>;
#address-cells = <1>;
#size-cells = <1>;
/* Data cells */
thermal_calib: calib@10 {
reg = <0x10 0x2>;
};
};
...

View File

@ -1,39 +0,0 @@
= Spreadtrum eFuse device tree bindings =
Required properties:
- compatible: Should be "sprd,ums312-efuse".
- reg: Specify the address offset of efuse controller.
- clock-names: Should be "enable".
- clocks: The phandle and specifier referencing the controller's clock.
- hwlocks: Reference to a phandle of a hwlock provider node.
= Data cells =
Are child nodes of eFuse, bindings of which as described in
bindings/nvmem/nvmem.txt
Example:
ap_efuse: efuse@32240000 {
compatible = "sprd,ums312-efuse";
reg = <0 0x32240000 0 0x10000>;
clock-names = "enable";
hwlocks = <&hwlock 8>;
clocks = <&aonapb_gate CLK_EFUSE_EB>;
/* Data cells */
thermal_calib: calib@10 {
reg = <0x10 0x2>;
};
};
= Data consumers =
Are device nodes which consume nvmem data cells.
Example:
thermal {
...
nvmem-cells = <&thermal_calib>;
nvmem-cell-names = "calibration";
};

View File

@ -1,40 +0,0 @@
Zodiac Inflight Innovations RAVE EEPROM Bindings
RAVE SP EEPROM device is a "MFD cell" device exposing physical EEPROM
attached to RAVE Supervisory Processor. It is expected that its Device
Tree node is specified as a child of the node corresponding to the
parent RAVE SP device (as documented in
Documentation/devicetree/bindings/mfd/zii,rave-sp.txt)
Required properties:
- compatible: Should be "zii,rave-sp-eeprom"
Optional properties:
- zii,eeprom-name: Unique EEPROM identifier describing its function in the
system. Will be used as created NVMEM deivce's name.
Data cells:
Data cells are child nodes of eerpom node, bindings for which are
documented in Documentation/devicetree/bindings/nvmem/nvmem.txt
Example:
rave-sp {
compatible = "zii,rave-sp-rdu1";
current-speed = <38400>;
eeprom@a4 {
compatible = "zii,rave-sp-eeprom";
reg = <0xa4 0x4000>;
#address-cells = <1>;
#size-cells = <1>;
zii,eeprom-name = "main-eeprom";
wdt_timeout: wdt-timeout@81 {
reg = <0x81 2>;
};
};
}

View File

@ -0,0 +1,54 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/nvmem/zii,rave-sp-eeprom.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
title: Zodiac Inflight Innovations RAVE EEPROM
maintainers:
- Frank Li <Frank.Li@nxp.com>
description:
RAVE SP EEPROM device is a "MFD cell" device exposing physical EEPROM
attached to RAVE Supervisory Processor. It is expected that its Device
Tree node is specified as a child of the node corresponding to the
parent RAVE SP device (as documented in
Documentation/devicetree/bindings/mfd/zii,rave-sp.yaml)
properties:
compatible:
const: zii,rave-sp-eeprom
reg:
maxItems: 1
zii,eeprom-name:
$ref: /schemas/types.yaml#/definitions/string
description:
Unique EEPROM identifier describing its function in the
system. Will be used as created NVMEM deivce's name.
required:
- compatible
allOf:
- $ref: nvmem.yaml#
- $ref: nvmem-deprecated-cells.yaml#
unevaluatedProperties: false
examples:
- |
eeprom@a4 {
compatible = "zii,rave-sp-eeprom";
reg = <0xa4 0x4000>;
#address-cells = <1>;
#size-cells = <1>;
zii,eeprom-name = "main-eeprom";
wdt-timeout@81 {
reg = <0x81 2>;
};
};

View File

@ -25,6 +25,7 @@ properties:
- items:
- enum:
- mediatek,mt8186-spmi
- mediatek,mt8188-spmi
- const: mediatek,mt8195-spmi
reg:

View File

@ -19,7 +19,11 @@ description: |
properties:
compatible:
const: qcom,x1e80100-spmi-pmic-arb
oneOf:
- items:
- const: qcom,sar2130p-spmi-pmic-arb
- const: qcom,x1e80100-spmi-pmic-arb
- const: qcom,x1e80100-spmi-pmic-arb
reg:
items:

View File

@ -83,6 +83,8 @@ patternProperties:
description: ALFA Network Inc.
"^allegro,.*":
description: Allegro DVT
"^allegromicro,.*":
description: Allegro MicroSystems, Inc.
"^alliedvision,.*":
description: Allied Vision Technologies GmbH
"^allo,.*":
@ -565,6 +567,8 @@ patternProperties:
description: GE Fanuc Intelligent Platforms Embedded Systems, Inc.
"^GEFanuc,.*":
description: GE Fanuc Intelligent Platforms Embedded Systems, Inc.
"^gehc,.*":
description: GE HealthCare
"^gemei,.*":
description: Gemei Digital Technology Co., Ltd.
"^gemtek,.*":

View File

@ -27,6 +27,8 @@ The following chips are supported by this driver:
* `AD7386-4 <https://www.analog.com/en/products/ad7386-4.html>`_
* `AD7387-4 <https://www.analog.com/en/products/ad7387-4.html>`_
* `AD7388-4 <https://www.analog.com/en/products/ad7388-4.html>`_
* `ADAQ4370-4 <https://www.analog.com/en/products/adaq4370-4.html>`_
* `ADAQ4380-4 <https://www.analog.com/en/products/adaq4380-4.html>`_
Supported features
@ -47,6 +49,12 @@ ad7380-4
ad7380-4 supports only an external reference voltage (2.5V to 3.3V). It must be
declared in the device tree as ``refin-supply``.
ADAQ devices
~~~~~~~~~~~~
adaq4370-4 and adaq4380-4 don't have an external reference, but use a 3.3V
internal reference derived from one of its supplies (``refin-supply``)
All other devices from ad738x family
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -121,6 +129,14 @@ Example for AD7386/7/8 (2 channels parts):
When enabling sequencer mode, the effective sampling rate is divided by two.
Gain (ADAQ devices only)
~~~~~~~~~~~~~~~~~~~~~~~~
ADAQ devices have a pin selectable gain in front of each ADC. The appropriate
gain is selectable from device tree using the ``adi,gain-milli`` property.
Refer to the typical connection diagrams section of the datasheet for pin
wiring.
Unimplemented features
----------------------

View File

@ -0,0 +1,144 @@
.. SPDX-License-Identifier: GPL-2.0-only
=============
AD7606 driver
=============
ADC driver for Analog Devices Inc. AD7606 and similar devices. The module name
is ``ad7606``.
Supported devices
=================
The following chips are supported by this driver:
* `AD7605 <https://www.analog.com/en/products/ad7605.html>`_
* `AD7606 <https://www.analog.com/en/products/ad7606.html>`_
* `AD7606B <https://www.analog.com/en/products/ad7606b.html>`_
* `AD7616 <https://www.analog.com/en/products/ad7616.html>`_
Supported features
==================
SPI wiring modes
----------------
These ADCs can output data on several SDO lines (1/2/4/8). The driver
currently supports only 1 SDO line.
Parallel wiring mode
--------------------
There is also a parallel interface, with 16 lines (that can be reduced to 8 in
byte mode). The parallel interface is selected by declaring the device as
platform in the device tree (with no io-backends node defined, see below).
IIO-backend mode
----------------
This mode allows to reach the best sample rates, but it requires an external
hardware (eg HDL or APU) to handle the low level communication.
The backend mode is enabled when through the definition of the "io-backends"
property in the device tree.
The reference configuration for the current implementation of IIO-backend mode
is the HDL reference provided by ADI:
https://wiki.analog.com/resources/eval/user-guides/ad7606x-fmc/hdl
This implementation embeds an IIO-backend compatible IP (adi-axi-adc) and a PWM
connected to the conversion trigger pin.
.. code-block::
+---+ +----------------------------
| | +-------+ |AD76xx
| A | controls | | |
| D |-------------->| PWM |-------------->| cnvst
| 7 | | | |
| 6 | +-------+ |
| 0 | controls +-----------+-----------+ |
| 6 |---------->| | |<--| frstdata
| | | Backend | Backend |<--| busy
| D | | Driver | | |
| R | | | |-->| clk
| I | requests |+---------+| DMA | |
| V |----------->| Buffer ||<---- |<=>| DATA
| E | |+---------+| | |
| R | +-----------+-----------+ |
| |-------------------------------------->| reset/configuration gpios
+---+ +-----------------------------
Software and hardware modes
---------------------------
While all the AD7606/AD7616 series parts can be configured using GPIOs, some of
them can be configured using register.
The chips that support software mode have more values available for configuring
the device, as well as more settings, and allow to control the range and
calibration per channel.
The following settings are available per channel in software mode:
- Scale
Also, there is a broader choice of oversampling ratios in software mode.
Conversion triggering
---------------------
The conversion can be triggered by two distinct ways:
- A GPIO is connected to the conversion trigger pin, and this GPIO is controlled
by the driver directly. In this configuration, the driver sets back the
conversion trigger pin to high as soon as it has read all the conversions.
- An external source is connected to the conversion trigger pin. In the
current implementation, it must be a PWM. In this configuration, the driver
does not control directly the conversion trigger pin. Instead, it can
control the PWM's frequency. This trigger is enabled only for iio-backend.
Reference voltage
-----------------
2 possible reference voltage sources are supported:
- Internal reference (2.5V)
- External reference (2.5V)
The source is determined by the device tree. If ``refin-supply`` is present,
then the external reference is used, otherwise the internal reference is used.
Oversampling
------------
This family supports oversampling to improve SNR.
In software mode, the following ratios are available:
1 (oversampling disabled)/2/4/8/16/32/64/128/256.
Unimplemented features
----------------------
- 2/4/8 SDO lines
- CRC indication
- Calibration
Device buffers
==============
IIO triggered buffer
--------------------
This driver supports IIO triggered buffers, with a "built in" trigger, i.e the
trigger is allocated and linked by the driver, and a new conversion is triggered
as soon as the samples are transferred, and a timestamp channel is added to make
up for the potential jitter induced by the delays in the interrupt handling.
IIO backend buffer
------------------
When IIO backend is used, the trigger is not needed, and the sample rate is
considered as stable. There is no timestamp channel. The communication is
delegated to an external logic, called a backend, and the backend's driver
handles the buffer. When this mode is enabled, the driver cannot control the
conversion pin, because the busy pin is bound to the backend.

View File

@ -0,0 +1,91 @@
.. SPDX-License-Identifier: GPL-2.0-only
====================
AD7625 driver
====================
ADC driver for Analog Devices Inc. AD7625, AD7626, AD7960, and AD7961
devices. The module name is ``ad7625``.
Supported devices
=================
The following chips are supported by this driver:
* `AD7625 <https://www.analog.com/AD7625>`_
* `AD7626 <https://www.analog.com/AD7626>`_
* `AD7960 <https://www.analog.com/AD7960>`_
* `AD7961 <https://www.analog.com/AD7961>`_
The driver requires use of the Pulsar LVDS HDL project:
* `Pulsar LVDS HDL <http://analogdevicesinc.github.io/hdl/projects/pulsar_lvds/index.html>`_
To trigger conversions and enable subsequent data transfer, the devices
require coupled PWM signals with a phase offset.
Supported features
==================
Conversion control modes
------------------------
The driver currently supports one of two possible LVDS conversion control methods.
Echoed-Clock interface mode
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. code-block::
+----------------+
+xxxxxxxxxxxxxxxxxxxxxxxxxx| CNV |
X | |
v | HOST |
+----------------------------+ | |
| CNV+/CNV- DCO+/DCO- |xxxxxxx>| CLK_IN |
| | | |
| | | |
| AD7625 D+/D- |xxxxxxx>| DATA_IN |
| | | |
| | | |
| CLK+/CLK- |<xxxxxxx| CLK & CLK_GATE |
+----------------------------+ | |
+----------------+
Reference voltage
-----------------
Three possible reference voltage sources are supported:
- Internal reference (only available on AD7625 and AD7626)
- External reference and internal buffer
- External reference
The source is determined by the device tree. If ``ref-supply`` is present, then
the external reference is used. If ``refin-supply`` is present, then the internal
buffer is used. If neither is present, then the internal reference is used.
Unimplemented features
----------------------
- Self-clocked mode
Device attributes
=================
The AD762x is a fully-differential ADC and has the following attributes:
+---------------------------------------+--------------------------------------------------------------+
| Attribute | Description |
+=======================================+==============================================================+
| ``scale`` | Scale factor to convert raw value from buffered reads to mV. |
+---------------------------------------+--------------------------------------------------------------+
Device buffers
==============
This driver supports IIO triggered buffers.
See :doc:`iio_devbuf` for more information.

View File

@ -22,7 +22,7 @@ This driver supports also IIO buffers.
The IMU continuously performs an autocalibration procedure if (and only if)
operating in fusion mode. The magnetometer autocalibration can however be
disabled writing 0 in the sysfs in_magn_calibration_fast_enable attribute.
disabled by writing 0 in the sysfs in_magn_calibration_fast_enable attribute.
The driver provides access to autocalibration flags (i.e. you can known if
the IMU has successfully autocalibrated) and to the calibration data blob.

View File

@ -21,6 +21,8 @@ Industrial I/O Kernel Drivers
ad4000
ad4695
ad7380
ad7606
ad7625
ad7944
adis16475
adis16480

View File

@ -1271,7 +1271,6 @@ M: Cosmin Tanislav <cosmin.tanislav@analog.com>
L: linux-iio@vger.kernel.org
S: Supported
W: https://ez.analog.com/linux-software-drivers
F: Documentation/ABI/testing/sysfs-bus-iio-adc-ad4130
F: Documentation/devicetree/bindings/iio/adc/adi,ad4130.yaml
F: drivers/iio/adc/ad4130.c
@ -1336,6 +1335,17 @@ F: Documentation/devicetree/bindings/iio/addac/adi,ad74413r.yaml
F: drivers/iio/addac/ad74413r.c
F: include/dt-bindings/iio/addac/adi,ad74413r.h
ANALOG DEVICES INC AD7625 DRIVER
M: Michael Hennerich <Michael.Hennerich@analog.com>
M: Nuno Sá <nuno.sa@analog.com>
R: Trevor Gamblin <tgamblin@baylibre.com>
S: Supported
W: https://ez.analog.com/linux-software-drivers
W: http://analogdevicesinc.github.io/hdl/projects/pulsar_lvds/index.html
F: Documentation/devicetree/bindings/iio/adc/adi,ad7625.yaml
F: Documentation/iio/ad7625.rst
F: drivers/iio/adc/ad7625.c
ANALOG DEVICES INC AD7768-1 DRIVER
M: Michael Hennerich <Michael.Hennerich@analog.com>
L: linux-iio@vger.kernel.org
@ -1363,6 +1373,14 @@ F: Documentation/ABI/testing/debugfs-iio-ad9467
F: Documentation/devicetree/bindings/iio/adc/adi,ad9467.yaml
F: drivers/iio/adc/ad9467.c
ANALOG DEVICES INC AD8460 DRIVER
M: Mariel Tinaco <Mariel.Tinaco@analog.com>
L: linux-iio@vger.kernel.org
S: Supported
W: https://ez.analog.com/linux-software-drivers
F: Documentation/devicetree/bindings/iio/dac/adi,ad8460.yaml
F: drivers/iio/dac/ad8460.c
ANALOG DEVICES INC AD9739a DRIVER
M: Nuno Sa <nuno.sa@analog.com>
M: Dragos Bogdan <dragos.bogdan@analog.com>
@ -1563,6 +1581,7 @@ F: Documentation/ABI/testing/sysfs-bus-iio-frequency-adf4350
F: Documentation/devicetree/bindings/iio/*/adi,*
F: Documentation/devicetree/bindings/iio/adc/lltc,ltc2496.yaml
F: Documentation/devicetree/bindings/iio/adc/lltc,ltc2497.yaml
F: Documentation/iio/ad7606.rst
F: drivers/iio/*/ad*
F: drivers/iio/adc/ltc249*
F: drivers/iio/amplifiers/hmc425a.c
@ -2924,6 +2943,7 @@ Q: http://patchwork.kernel.org/project/linux-renesas-soc/list/
C: irc://irc.libera.chat/renesas-soc
T: git git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel.git next
F: Documentation/devicetree/bindings/hwinfo/renesas,prr.yaml
F: Documentation/devicetree/bindings/nvmem/renesas,*
F: Documentation/devicetree/bindings/soc/renesas/
F: arch/arm/boot/dts/renesas/
F: arch/arm/configs/shmobile_defconfig
@ -2931,6 +2951,7 @@ F: arch/arm/include/debug/renesas-scif.S
F: arch/arm/mach-shmobile/
F: arch/arm64/boot/dts/renesas/
F: arch/riscv/boot/dts/renesas/
F: drivers/nvmem/rcar-efuse.c
F: drivers/pmdomain/renesas/
F: drivers/soc/renesas/
F: include/linux/soc/renesas/
@ -4036,6 +4057,13 @@ S: Maintained
F: Documentation/devicetree/bindings/iio/accel/bosch,bma400.yaml
F: drivers/iio/accel/bma400*
BOSCH SENSORTEC BMI270 IMU IIO DRIVER
M: Alex Lanzano <lanzano.alex@gmail.com>
L: linux-iio@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/iio/imu/bosch,bmi270.yaml
F: drivers/iio/imu/bmi270/
BOSCH SENSORTEC BMI323 IMU IIO DRIVER
M: Jagath Jog J <jagathjog1996@gmail.com>
L: linux-iio@vger.kernel.org
@ -9483,6 +9511,14 @@ M: Kieran Bingham <kbingham@kernel.org>
S: Supported
F: scripts/gdb/
GE HEALTHCARE PMC ADC DRIVER
M: Herve Codina <herve.codina@bootlin.com>
L: linux-iio@vger.kernel.org
S: Maintained
F: Documentation/devicetree/bindings/iio/adc/gehc,pmc-adc.yaml
F: drivers/iio/adc/gehc-pmc-adc.c
F: include/dt-bindings/iio/adc/gehc,pmc-adc.h
GEMINI CRYPTO DRIVER
M: Corentin Labbe <clabbe@baylibre.com>
L: linux-crypto@vger.kernel.org
@ -11646,7 +11682,7 @@ F: drivers/usb/misc/usb-ljca.c
F: include/linux/usb/ljca.h
INTEL MANAGEMENT ENGINE (mei)
M: Tomas Winkler <tomas.winkler@intel.com>
M: Alexander Usyskin <alexander.usyskin@intel.com>
L: linux-kernel@vger.kernel.org
S: Supported
F: Documentation/driver-api/mei/*
@ -11927,7 +11963,7 @@ F: Documentation/devicetree/bindings/media/i2c/isil,isl79987.yaml
F: drivers/media/i2c/isl7998x.c
INVENSENSE ICM-426xx IMU DRIVER
M: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
M: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
L: linux-iio@vger.kernel.org
S: Maintained
W: https://invensense.tdk.com/
@ -11942,6 +11978,14 @@ S: Maintained
F: Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.yaml
F: drivers/iio/gyro/mpu3050*
INVENSENSE MPU-6050 IMU DRIVER
M: Jean-Baptiste Maneyrol <jean-baptiste.maneyrol@tdk.com>
L: linux-iio@vger.kernel.org
S: Maintained
W: https://invensense.tdk.com/
F: Documentation/devicetree/bindings/iio/imu/invensense,mpu6050.yaml
F: drivers/iio/imu/inv_mpu6050/
IOC3 ETHERNET DRIVER
M: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
L: linux-mips@vger.kernel.org
@ -24889,6 +24933,18 @@ S: Maintained
F: drivers/input/serio/userio.c
F: include/uapi/linux/userio.h
VISHAY VEML3235 AMBIENT LIGHT SENSOR DRIVER
M: Javier Carrasco <javier.carrasco.cruz@gmail.com>
S: Maintained
F: Documentation/devicetree/bindings/iio/light/vishay,veml6030.yaml
F: drivers/iio/light/veml3235.c
VISHAY VEML6030 AMBIENT LIGHT SENSOR DRIVER
M: Javier Carrasco <javier.carrasco.cruz@gmail.com>
S: Maintained
F: Documentation/devicetree/bindings/iio/light/vishay,veml6030.yaml
F: drivers/iio/light/veml6030.c
VISHAY VEML6075 UVA AND UVB LIGHT SENSOR DRIVER
M: Javier Carrasco <javier.carrasco.cruz@gmail.com>
S: Maintained

View File

@ -1225,6 +1225,12 @@ static void binder_cleanup_ref_olocked(struct binder_ref *ref)
binder_dequeue_work(ref->proc, &ref->death->work);
binder_stats_deleted(BINDER_STAT_DEATH);
}
if (ref->freeze) {
binder_dequeue_work(ref->proc, &ref->freeze->work);
binder_stats_deleted(BINDER_STAT_FREEZE);
}
binder_stats_deleted(BINDER_STAT_REF);
}
@ -3850,7 +3856,6 @@ binder_request_freeze_notification(struct binder_proc *proc,
{
struct binder_ref_freeze *freeze;
struct binder_ref *ref;
bool is_frozen;
freeze = kzalloc(sizeof(*freeze), GFP_KERNEL);
if (!freeze)
@ -3866,32 +3871,31 @@ binder_request_freeze_notification(struct binder_proc *proc,
}
binder_node_lock(ref->node);
if (ref->freeze || !ref->node->proc) {
binder_user_error("%d:%d invalid BC_REQUEST_FREEZE_NOTIFICATION %s\n",
proc->pid, thread->pid,
ref->freeze ? "already set" : "dead node");
if (ref->freeze) {
binder_user_error("%d:%d BC_REQUEST_FREEZE_NOTIFICATION already set\n",
proc->pid, thread->pid);
binder_node_unlock(ref->node);
binder_proc_unlock(proc);
kfree(freeze);
return -EINVAL;
}
binder_inner_proc_lock(ref->node->proc);
is_frozen = ref->node->proc->is_frozen;
binder_inner_proc_unlock(ref->node->proc);
binder_stats_created(BINDER_STAT_FREEZE);
INIT_LIST_HEAD(&freeze->work.entry);
freeze->cookie = handle_cookie->cookie;
freeze->work.type = BINDER_WORK_FROZEN_BINDER;
freeze->is_frozen = is_frozen;
ref->freeze = freeze;
binder_inner_proc_lock(proc);
binder_enqueue_work_ilocked(&ref->freeze->work, &proc->todo);
binder_wakeup_proc_ilocked(proc);
binder_inner_proc_unlock(proc);
if (ref->node->proc) {
binder_inner_proc_lock(ref->node->proc);
freeze->is_frozen = ref->node->proc->is_frozen;
binder_inner_proc_unlock(ref->node->proc);
binder_inner_proc_lock(proc);
binder_enqueue_work_ilocked(&freeze->work, &proc->todo);
binder_wakeup_proc_ilocked(proc);
binder_inner_proc_unlock(proc);
}
binder_node_unlock(ref->node);
binder_proc_unlock(proc);
@ -5151,6 +5155,16 @@ static void binder_release_work(struct binder_proc *proc,
} break;
case BINDER_WORK_NODE:
break;
case BINDER_WORK_CLEAR_FREEZE_NOTIFICATION: {
struct binder_ref_freeze *freeze;
freeze = container_of(w, struct binder_ref_freeze, work);
binder_debug(BINDER_DEBUG_DEAD_TRANSACTION,
"undelivered freeze notification, %016llx\n",
(u64)freeze->cookie);
kfree(freeze);
binder_stats_deleted(BINDER_STAT_FREEZE);
} break;
default:
pr_err("unexpected work type, %d, not freed\n",
wtype);
@ -5552,6 +5566,7 @@ static bool binder_txns_pending_ilocked(struct binder_proc *proc)
static void binder_add_freeze_work(struct binder_proc *proc, bool is_frozen)
{
struct binder_node *prev = NULL;
struct rb_node *n;
struct binder_ref *ref;
@ -5560,7 +5575,10 @@ static void binder_add_freeze_work(struct binder_proc *proc, bool is_frozen)
struct binder_node *node;
node = rb_entry(n, struct binder_node, rb_node);
binder_inc_node_tmpref_ilocked(node);
binder_inner_proc_unlock(proc);
if (prev)
binder_put_node(prev);
binder_node_lock(node);
hlist_for_each_entry(ref, &node->refs, node_entry) {
/*
@ -5586,10 +5604,15 @@ static void binder_add_freeze_work(struct binder_proc *proc, bool is_frozen)
}
binder_inner_proc_unlock(ref->proc);
}
prev = node;
binder_node_unlock(node);
binder_inner_proc_lock(proc);
if (proc->is_dead)
break;
}
binder_inner_proc_unlock(proc);
if (prev)
binder_put_node(prev);
}
static int binder_ioctl_freeze(struct binder_freeze_info *info,
@ -6260,6 +6283,7 @@ static void binder_deferred_release(struct binder_proc *proc)
binder_release_work(proc, &proc->todo);
binder_release_work(proc, &proc->delivered_death);
binder_release_work(proc, &proc->delivered_freeze);
binder_debug(BINDER_DEBUG_OPEN_CLOSE,
"%s: %d threads %d, nodes %d (ref %d), refs %d, active transactions %d\n",
@ -6393,6 +6417,12 @@ static void print_binder_work_ilocked(struct seq_file *m,
case BINDER_WORK_CLEAR_DEATH_NOTIFICATION:
seq_printf(m, "%shas cleared death notification\n", prefix);
break;
case BINDER_WORK_FROZEN_BINDER:
seq_printf(m, "%shas frozen binder\n", prefix);
break;
case BINDER_WORK_CLEAR_FREEZE_NOTIFICATION:
seq_printf(m, "%shas cleared freeze notification\n", prefix);
break;
default:
seq_printf(m, "%sunknown work: type %d\n", prefix, w->type);
break;
@ -6539,6 +6569,10 @@ static void print_binder_proc(struct seq_file *m,
seq_puts(m, " has delivered dead binder\n");
break;
}
list_for_each_entry(w, &proc->delivered_freeze, entry) {
seq_puts(m, " has delivered freeze binder\n");
break;
}
binder_inner_proc_unlock(proc);
if (!print_all && m->count == header_pos)
m->count = start_pos;

View File

@ -82,9 +82,9 @@ static int __mhi_download_rddm_in_panic(struct mhi_controller *mhi_cntrl)
* other cores to shutdown while we're collecting RDDM buffer. After
* returning from this function, we expect the device to reset.
*
* Normaly, we read/write pm_state only after grabbing the
* Normally, we read/write pm_state only after grabbing the
* pm_lock, since we're in a panic, skipping it. Also there is no
* gurantee that this state change would take effect since
* guarantee that this state change would take effect since
* we're setting it w/o grabbing pm_lock
*/
mhi_cntrl->pm_state = MHI_PM_LD_ERR_FATAL_DETECT;

View File

@ -255,7 +255,7 @@ struct mhi_chan {
/*
* Important: When consuming, increment tre_ring first and when
* releasing, decrement buf_ring first. If tre_ring has space, buf_ring
* is guranteed to have space so we do not need to check both rings.
* is guaranteed to have space so we do not need to check both rings.
*/
struct mhi_ring buf_ring;
struct mhi_ring tre_ring;

View File

@ -917,12 +917,12 @@ static int mhi_pci_claim(struct mhi_controller *mhi_cntrl,
return err;
}
err = pcim_iomap_regions(pdev, 1 << bar_num, pci_name(pdev));
if (err) {
mhi_cntrl->regs = pcim_iomap_region(pdev, 1 << bar_num, pci_name(pdev));
if (IS_ERR(mhi_cntrl->regs)) {
err = PTR_ERR(mhi_cntrl->regs);
dev_err(&pdev->dev, "failed to map pci region: %d\n", err);
return err;
}
mhi_cntrl->regs = pcim_iomap_table(pdev)[bar_num];
mhi_cntrl->reg_len = pci_resource_len(pdev, bar_num);
err = dma_set_mask_and_coherent(&pdev->dev, dma_mask);

View File

@ -9,6 +9,7 @@
#if !defined(_TRACE_EVENT_MHI_HOST_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_EVENT_MHI_HOST_H
#include <linux/byteorder/generic.h>
#include <linux/tracepoint.h>
#include <linux/trace_seq.h>
#include "../common.h"
@ -97,18 +98,18 @@ TRACE_EVENT(mhi_gen_tre,
__string(name, mhi_cntrl->mhi_dev->name)
__field(int, ch_num)
__field(void *, wp)
__field(__le64, tre_ptr)
__field(__le32, dword0)
__field(__le32, dword1)
__field(uint64_t, tre_ptr)
__field(uint32_t, dword0)
__field(uint32_t, dword1)
),
TP_fast_assign(
__assign_str(name);
__entry->ch_num = mhi_chan->chan;
__entry->wp = mhi_tre;
__entry->tre_ptr = mhi_tre->ptr;
__entry->dword0 = mhi_tre->dword[0];
__entry->dword1 = mhi_tre->dword[1];
__entry->tre_ptr = le64_to_cpu(mhi_tre->ptr);
__entry->dword0 = le32_to_cpu(mhi_tre->dword[0]);
__entry->dword1 = le32_to_cpu(mhi_tre->dword[1]);
),
TP_printk("%s: Chan: %d TRE: 0x%p TRE buf: 0x%llx DWORD0: 0x%08x DWORD1: 0x%08x\n",
@ -176,19 +177,19 @@ DECLARE_EVENT_CLASS(mhi_process_event_ring,
TP_STRUCT__entry(
__string(name, mhi_cntrl->mhi_dev->name)
__field(__le32, dword0)
__field(__le32, dword1)
__field(uint32_t, dword0)
__field(uint32_t, dword1)
__field(int, state)
__field(__le64, ptr)
__field(uint64_t, ptr)
__field(void *, rp)
),
TP_fast_assign(
__assign_str(name);
__entry->rp = rp;
__entry->ptr = rp->ptr;
__entry->dword0 = rp->dword[0];
__entry->dword1 = rp->dword[1];
__entry->ptr = le64_to_cpu(rp->ptr);
__entry->dword0 = le32_to_cpu(rp->dword[0]);
__entry->dword1 = le32_to_cpu(rp->dword[1]);
__entry->state = MHI_TRE_GET_EV_STATE(rp);
),

View File

@ -213,7 +213,7 @@ static struct platform_driver oppanel_driver = {
.of_match_table = oppanel_match,
},
.probe = oppanel_probe,
.remove_new = oppanel_remove,
.remove = oppanel_remove,
};
module_platform_driver(oppanel_driver);

View File

@ -1467,7 +1467,7 @@ static struct platform_driver sonypi_driver = {
.pm = SONYPI_PM,
},
.probe = sonypi_probe,
.remove_new = sonypi_remove,
.remove = sonypi_remove,
.shutdown = sonypi_shutdown,
};

View File

@ -738,7 +738,7 @@ MODULE_DEVICE_TABLE(of, hwicap_of_match);
static struct platform_driver hwicap_platform_driver = {
.probe = hwicap_drv_probe,
.remove_new = hwicap_drv_remove,
.remove = hwicap_drv_remove,
.driver = {
.name = DRIVER_NAME,
.of_match_table = hwicap_of_match,

View File

@ -74,7 +74,7 @@ static void xilly_drv_remove(struct platform_device *op)
static struct platform_driver xillybus_platform_driver = {
.probe = xilly_drv_probe,
.remove_new = xilly_drv_remove,
.remove = xilly_drv_remove,
.driver = {
.name = xillyname,
.of_match_table = xillybus_of_match,

View File

@ -2407,6 +2407,18 @@ static int comedi_mmap(struct file *file, struct vm_area_struct *vma)
start += PAGE_SIZE;
}
#ifdef CONFIG_MMU
/*
* Leaving behind a partial mapping of a buffer we're about to
* drop is unsafe, see remap_pfn_range_notrack().
* We need to zap the range here ourselves instead of relying
* on the automatic zapping in remap_pfn_range() because we call
* remap_pfn_range() in a loop.
*/
if (retval)
zap_vma_ptes(vma, vma->vm_start, size);
#endif
}
if (retval == 0) {

View File

@ -311,6 +311,7 @@ static const struct of_device_id ftm_quaddec_match[] = {
{ .compatible = "fsl,ftm-quaddec" },
{},
};
MODULE_DEVICE_TABLE(of, ftm_quaddec_match);
static struct platform_driver ftm_quaddec_driver = {
.driver = {

View File

@ -408,13 +408,9 @@ static int intel_qep_probe(struct pci_dev *pci, const struct pci_device_id *id)
pci_set_master(pci);
ret = pcim_iomap_regions(pci, BIT(0), pci_name(pci));
if (ret)
return ret;
regs = pcim_iomap_table(pci)[0];
if (!regs)
return -ENOMEM;
regs = pcim_iomap_region(pci, 0, pci_name(pci));
if (IS_ERR(regs))
return PTR_ERR(regs);
qep->dev = dev;
qep->regs = regs;

View File

@ -214,11 +214,17 @@ static int stm32_count_enable_write(struct counter_device *counter,
{
struct stm32_timer_cnt *const priv = counter_priv(counter);
u32 cr1;
int ret;
if (enable) {
regmap_read(priv->regmap, TIM_CR1, &cr1);
if (!(cr1 & TIM_CR1_CEN))
clk_enable(priv->clk);
if (!(cr1 & TIM_CR1_CEN)) {
ret = clk_enable(priv->clk);
if (ret) {
dev_err(counter->parent, "Cannot enable clock %d\n", ret);
return ret;
}
}
regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN,
TIM_CR1_CEN);
@ -694,6 +700,7 @@ static int stm32_timer_cnt_probe_encoder(struct device *dev,
}
ret = of_property_read_u32(tnode, "reg", &idx);
of_node_put(tnode);
if (ret) {
dev_err(dev, "Can't get index (%d)\n", ret);
return ret;
@ -816,7 +823,11 @@ static int __maybe_unused stm32_timer_cnt_resume(struct device *dev)
return ret;
if (priv->enabled) {
clk_enable(priv->clk);
ret = clk_enable(priv->clk);
if (ret) {
dev_err(dev, "Cannot enable clock %d\n", ret);
return ret;
}
/* Restore registers that may have been lost */
regmap_write(priv->regmap, TIM_SMCR, priv->bak.smcr);

View File

@ -574,8 +574,13 @@ static int ecap_cnt_resume(struct device *dev)
{
struct counter_device *counter_dev = dev_get_drvdata(dev);
struct ecap_cnt_dev *ecap_dev = counter_priv(counter_dev);
int ret;
clk_enable(ecap_dev->clk);
ret = clk_enable(ecap_dev->clk);
if (ret) {
dev_err(dev, "Cannot enable clock %d\n", ret);
return ret;
}
ecap_cnt_capture_set_evmode(counter_dev, ecap_dev->pm_ctx.ev_mode);

View File

@ -3333,7 +3333,7 @@ static struct platform_driver scmi_driver = {
.dev_groups = versions_groups,
},
.probe = scmi_probe,
.remove_new = scmi_remove,
.remove = scmi_remove,
};
static struct dentry *scmi_debugfs_init(void)

View File

@ -1049,7 +1049,7 @@ static struct platform_driver scpi_driver = {
.dev_groups = versions_groups,
},
.probe = scpi_probe,
.remove_new = scpi_remove,
.remove = scpi_remove,
};
module_platform_driver(scpi_driver);

View File

@ -220,7 +220,7 @@ MODULE_DEVICE_TABLE(of, coreboot_of_match);
static struct platform_driver coreboot_table_driver = {
.probe = coreboot_table_probe,
.remove_new = coreboot_table_remove,
.remove = coreboot_table_remove,
.driver = {
.name = "coreboot_table",
.acpi_match_table = ACPI_PTR(cros_coreboot_acpi_match),

View File

@ -180,7 +180,7 @@ static struct platform_driver imx_dsp_driver = {
.name = "imx-dsp",
},
.probe = imx_dsp_probe,
.remove_new = imx_dsp_remove,
.remove = imx_dsp_remove,
};
builtin_platform_driver(imx_dsp_driver);

View File

@ -116,7 +116,7 @@ static void __meminit release_firmware_map_entry(struct kobject *kobj)
kfree(entry);
}
static struct kobj_type __refdata memmap_ktype = {
static const struct kobj_type memmap_ktype = {
.release = release_firmware_map_entry,
.sysfs_ops = &memmap_attr_ops,
.default_groups = def_groups,

View File

@ -458,7 +458,7 @@ static struct platform_driver mpfs_auto_update_driver = {
.name = "mpfs-auto-update",
},
.probe = mpfs_auto_update_probe,
.remove_new = mpfs_auto_update_remove,
.remove = mpfs_auto_update_remove,
};
module_platform_driver(mpfs_auto_update_driver);

View File

@ -95,10 +95,9 @@ static int mtk_adsp_ipc_probe(struct platform_device *pdev)
adsp_chan->idx = i;
adsp_chan->ch = mbox_request_channel_byname(cl, adsp_mbox_ch_names[i]);
if (IS_ERR(adsp_chan->ch)) {
ret = PTR_ERR(adsp_chan->ch);
if (ret != -EPROBE_DEFER)
dev_err(dev, "Failed to request mbox chan %s ret %d\n",
adsp_mbox_ch_names[i], ret);
ret = dev_err_probe(dev, PTR_ERR(adsp_chan->ch),
"Failed to request mbox channel %s\n",
adsp_mbox_ch_names[i]);
for (j = 0; j < i; j++) {
adsp_chan = &adsp_ipc->chans[j];
@ -133,7 +132,7 @@ static struct platform_driver mtk_adsp_ipc_driver = {
.name = "mtk-adsp-ipc",
},
.probe = mtk_adsp_ipc_probe,
.remove_new = mtk_adsp_ipc_remove,
.remove = mtk_adsp_ipc_remove,
};
builtin_platform_driver(mtk_adsp_ipc_driver);

View File

@ -757,7 +757,7 @@ MODULE_DEVICE_TABLE(acpi, fw_cfg_sysfs_acpi_match);
static struct platform_driver fw_cfg_sysfs_driver = {
.probe = fw_cfg_sysfs_probe,
.remove_new = fw_cfg_sysfs_remove,
.remove = fw_cfg_sysfs_remove,
.driver = {
.name = "fw_cfg",
.of_match_table = fw_cfg_sysfs_mmio_match,

View File

@ -406,7 +406,7 @@ static struct platform_driver rpi_firmware_driver = {
},
.probe = rpi_firmware_probe,
.shutdown = rpi_firmware_shutdown,
.remove_new = rpi_firmware_remove,
.remove = rpi_firmware_remove,
};
module_platform_driver(rpi_firmware_driver);

View File

@ -802,7 +802,7 @@ static void stratix10_rsu_remove(struct platform_device *pdev)
static struct platform_driver stratix10_rsu_driver = {
.probe = stratix10_rsu_probe,
.remove_new = stratix10_rsu_remove,
.remove = stratix10_rsu_remove,
.driver = {
.name = "stratix10-rsu",
.dev_groups = rsu_groups,

View File

@ -1271,7 +1271,7 @@ static void stratix10_svc_drv_remove(struct platform_device *pdev)
static struct platform_driver stratix10_svc_driver = {
.probe = stratix10_svc_drv_probe,
.remove_new = stratix10_svc_drv_remove,
.remove = stratix10_svc_drv_remove,
.driver = {
.name = "stratix10-svc",
.of_match_table = stratix10_svc_drv_match,

View File

@ -2118,6 +2118,6 @@ static struct platform_driver zynqmp_firmware_driver = {
.dev_groups = zynqmp_firmware_groups,
},
.probe = zynqmp_firmware_probe,
.remove_new = zynqmp_firmware_remove,
.remove = zynqmp_firmware_remove,
};
module_platform_driver(zynqmp_firmware_driver);

View File

@ -152,7 +152,7 @@ MODULE_DEVICE_TABLE(of, altera_fpga_of_match);
static struct platform_driver altera_fpga_driver = {
.probe = alt_fpga_bridge_probe,
.remove_new = alt_fpga_bridge_remove,
.remove = alt_fpga_bridge_remove,
.driver = {
.name = "altera_fpga2sdram_bridge",
.of_match_table = of_match_ptr(altera_fpga_of_match),

View File

@ -262,7 +262,7 @@ static void altera_freeze_br_remove(struct platform_device *pdev)
static struct platform_driver altera_freeze_br_driver = {
.probe = altera_freeze_br_probe,
.remove_new = altera_freeze_br_remove,
.remove = altera_freeze_br_remove,
.driver = {
.name = "altera_freeze_br",
.of_match_table = altera_freeze_br_of_match,

View File

@ -205,7 +205,7 @@ MODULE_DEVICE_TABLE(of, altera_fpga_of_match);
static struct platform_driver alt_fpga_bridge_driver = {
.probe = alt_fpga_bridge_probe,
.remove_new = alt_fpga_bridge_remove,
.remove = alt_fpga_bridge_remove,
.driver = {
.name = "altera_hps2fpga_bridge",
.of_match_table = of_match_ptr(altera_fpga_of_match),

View File

@ -947,12 +947,12 @@ static const struct attribute_group *afu_dev_groups[] = {
};
static struct platform_driver afu_driver = {
.driver = {
.name = DFL_FPGA_FEATURE_DEV_PORT,
.driver = {
.name = DFL_FPGA_FEATURE_DEV_PORT,
.dev_groups = afu_dev_groups,
},
.probe = afu_probe,
.remove_new = afu_remove,
.probe = afu_probe,
.remove = afu_remove,
};
static int __init afu_init(void)

View File

@ -92,11 +92,11 @@ static void fme_br_remove(struct platform_device *pdev)
}
static struct platform_driver fme_br_driver = {
.driver = {
.name = DFL_FPGA_FME_BRIDGE,
.driver = {
.name = DFL_FPGA_FME_BRIDGE,
},
.probe = fme_br_probe,
.remove_new = fme_br_remove,
.probe = fme_br_probe,
.remove = fme_br_remove,
};
module_platform_driver(fme_br_driver);

View File

@ -742,12 +742,12 @@ static const struct attribute_group *fme_dev_groups[] = {
};
static struct platform_driver fme_driver = {
.driver = {
.name = DFL_FPGA_FEATURE_DEV_FME,
.driver = {
.name = DFL_FPGA_FEATURE_DEV_FME,
.dev_groups = fme_dev_groups,
},
.probe = fme_probe,
.remove_new = fme_remove,
.probe = fme_probe,
.remove = fme_remove,
};
module_platform_driver(fme_driver);

View File

@ -71,11 +71,11 @@ static void fme_region_remove(struct platform_device *pdev)
}
static struct platform_driver fme_region_driver = {
.driver = {
.name = DFL_FPGA_FME_REGION,
.driver = {
.name = DFL_FPGA_FME_REGION,
},
.probe = fme_region_probe,
.remove_new = fme_region_remove,
.probe = fme_region_probe,
.remove = fme_region_remove,
};
module_platform_driver(fme_region_driver);

View File

@ -759,7 +759,7 @@ MODULE_DEVICE_TABLE(platform, intel_m10bmc_sec_ids);
static struct platform_driver intel_m10bmc_sec_driver = {
.probe = m10bmc_sec_probe,
.remove_new = m10bmc_sec_remove,
.remove = m10bmc_sec_remove,
.driver = {
.name = "intel-m10bmc-sec-update",
.dev_groups = m10bmc_sec_attr_groups,

View File

@ -436,7 +436,7 @@ static void of_fpga_region_remove(struct platform_device *pdev)
static struct platform_driver of_fpga_region_driver = {
.probe = of_fpga_region_probe,
.remove_new = of_fpga_region_remove,
.remove = of_fpga_region_remove,
.driver = {
.name = "of-fpga-region",
.of_match_table = of_match_ptr(fpga_region_of_match),

View File

@ -535,7 +535,7 @@ MODULE_DEVICE_TABLE(of, socfpga_a10_fpga_of_match);
static struct platform_driver socfpga_a10_fpga_driver = {
.probe = socfpga_a10_fpga_probe,
.remove_new = socfpga_a10_fpga_remove,
.remove = socfpga_a10_fpga_remove,
.driver = {
.name = "socfpga_a10_fpga_manager",
.of_match_table = socfpga_a10_fpga_of_match,

View File

@ -455,7 +455,7 @@ MODULE_DEVICE_TABLE(of, s10_of_match);
static struct platform_driver s10_driver = {
.probe = s10_probe,
.remove_new = s10_remove,
.remove = s10_remove,
.driver = {
.name = "Stratix10 SoC FPGA manager",
.of_match_table = of_match_ptr(s10_of_match),

View File

@ -162,7 +162,7 @@ static void xlnx_pr_decoupler_remove(struct platform_device *pdev)
static struct platform_driver xlnx_pr_decoupler_driver = {
.probe = xlnx_pr_decoupler_probe,
.remove_new = xlnx_pr_decoupler_remove,
.remove = xlnx_pr_decoupler_remove,
.driver = {
.name = "xlnx_pr_decoupler",
.of_match_table = xlnx_pr_decoupler_of_match,

View File

@ -642,7 +642,7 @@ MODULE_DEVICE_TABLE(of, zynq_fpga_of_match);
static struct platform_driver zynq_fpga_driver = {
.probe = zynq_fpga_probe,
.remove_new = zynq_fpga_remove,
.remove = zynq_fpga_remove,
.driver = {
.name = "zynq_fpga_manager",
.of_match_table = of_match_ptr(zynq_fpga_of_match),

View File

@ -780,7 +780,7 @@ const struct device_type greybus_interface_type = {
* The position of interface within the Endo is encoded in "interface_id"
* argument.
*
* Returns a pointer to the new interfce or a null pointer if a
* Returns a pointer to the new interface or a null pointer if a
* failure occurs due to memory exhaustion.
*/
struct gb_interface *gb_interface_create(struct gb_module *module,

View File

@ -643,7 +643,7 @@ static irqreturn_t adxl355_trigger_handler(int irq, void *p)
* The acceleration data is 24 bits and big endian. It has to be saved
* in 32 bits, hence, it is saved in the 2nd byte of the 4 byte buffer.
* The buf array is 14 bytes as it includes 3x4=12 bytes for
* accelaration data of x, y, and z axis. It also includes 2 bytes for
* acceleration data of x, y, and z axis. It also includes 2 bytes for
* temperature data.
*/
ret = regmap_bulk_read(data->regmap, ADXL355_XDATA3_REG,

View File

@ -1073,7 +1073,7 @@ static int adxl367_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
int state)
bool state)
{
enum adxl367_activity_type act;

View File

@ -940,7 +940,7 @@ static int adxl372_read_event_config(struct iio_dev *indio_dev, const struct iio
static int adxl372_write_event_config(struct iio_dev *indio_dev, const struct iio_chan_spec *chan,
enum iio_event_type type, enum iio_event_direction dir,
int state)
bool state)
{
struct adxl372_state *st = iio_priv(indio_dev);

View File

@ -1181,7 +1181,7 @@ static int adxl380_read_raw(struct iio_dev *indio_dev,
ret = adxl380_read_chn(st, chan->address);
iio_device_release_direct_mode(indio_dev);
if (ret)
if (ret < 0)
return ret;
*val = sign_extend32(ret >> chan->scan_type.shift,
@ -1386,7 +1386,7 @@ static int adxl380_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
int state)
bool state)
{
struct adxl380_state *st = iio_priv(indio_dev);
enum adxl380_axis axis;
@ -1719,7 +1719,6 @@ static int adxl380_config_irq(struct iio_dev *indio_dev)
{
struct adxl380_state *st = iio_priv(indio_dev);
unsigned long irq_flag;
struct irq_data *desc;
u32 irq_type;
u8 polarity;
int ret;
@ -1737,11 +1736,7 @@ static int adxl380_config_irq(struct iio_dev *indio_dev)
st->int_map[1] = ADXL380_INT1_MAP1_REG;
}
desc = irq_get_irq_data(st->irq);
if (!desc)
return dev_err_probe(st->dev, -EINVAL, "Could not find IRQ %d\n", st->irq);
irq_type = irqd_get_trigger_type(desc);
irq_type = irq_get_trigger_type(st->irq);
if (irq_type == IRQ_TYPE_LEVEL_HIGH) {
polarity = 0;
irq_flag = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;

View File

@ -21,6 +21,7 @@
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/iio/iio.h>
#include <linux/iio/sysfs.h>
#include <linux/iio/buffer.h>
@ -144,7 +145,7 @@ struct bma180_data {
/* Ensure timestamp is naturally aligned */
struct {
s16 chan[4];
s64 timestamp __aligned(8);
aligned_s64 timestamp;
} scan;
};

View File

@ -9,6 +9,7 @@
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/spi/spi.h>
#include <linux/iio/buffer.h>

View File

@ -115,7 +115,7 @@ struct bma400_data {
struct {
__le16 buff[3];
u8 temperature;
s64 ts __aligned(8);
aligned_s64 ts;
} buffer __aligned(IIO_DMA_MINALIGN);
__le16 status;
__be16 duration;
@ -1293,7 +1293,7 @@ static int bma400_disable_adv_interrupt(struct bma400_data *data)
static int bma400_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir, int state)
enum iio_event_direction dir, bool state)
{
struct bma400_data *data = iio_priv(indio_dev);
int ret;

View File

@ -804,7 +804,7 @@ static int bmc150_accel_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
int state)
bool state)
{
struct bmc150_accel_data *data = iio_priv(indio_dev);
int ret;

View File

@ -6,6 +6,7 @@
#include <linux/iio/iio.h>
#include <linux/mutex.h>
#include <linux/regulator/consumer.h>
#include <linux/types.h>
#include <linux/workqueue.h>
struct regmap;
@ -69,7 +70,7 @@ struct bmc150_accel_data {
*/
struct {
__le16 channels[3];
s64 ts __aligned(8);
aligned_s64 ts;
} scan;
u8 bw_bits;
u32 slope_dur;

View File

@ -22,6 +22,7 @@
#include <linux/property.h>
#include <linux/regulator/consumer.h>
#include <linux/regmap.h>
#include <linux/types.h>
#include <linux/iio/buffer.h>
#include <linux/iio/events.h>
@ -163,7 +164,7 @@ struct fxls8962af_data {
const struct fxls8962af_chip_info *chip_info;
struct {
__le16 channels[3];
s64 ts __aligned(8);
aligned_s64 ts;
} scan;
int64_t timestamp, old_timestamp; /* Only used in hw fifo mode. */
struct iio_mount_matrix orientation;
@ -616,7 +617,7 @@ static int
fxls8962af_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir, int state)
enum iio_event_direction dir, bool state)
{
struct fxls8962af_data *data = iio_priv(indio_dev);
u8 enable_event, enable_bits;
@ -1103,8 +1104,7 @@ static int fxls8962af_irq_setup(struct iio_dev *indio_dev, int irq)
if (ret)
return ret;
irq_type = irqd_get_trigger_type(irq_get_irq_data(irq));
irq_type = irq_get_trigger_type(irq);
switch (irq_type) {
case IRQF_TRIGGER_HIGH:
case IRQF_TRIGGER_RISING:

View File

@ -28,7 +28,7 @@ struct accel_3d_state {
/* Ensure timestamp is naturally aligned */
struct {
u32 accel_val[3];
s64 timestamp __aligned(8);
aligned_s64 timestamp;
} scan;
int scale_pre_decml;
int scale_post_decml;
@ -328,6 +328,7 @@ static int accel_3d_parse_report(struct platform_device *pdev,
/* Function to initialize the processing for usage id */
static int hid_accel_3d_probe(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev);
int ret = 0;
const char *name;
struct iio_dev *indio_dev;
@ -335,8 +336,6 @@ static int hid_accel_3d_probe(struct platform_device *pdev)
const struct iio_chan_spec *channel_spec;
int channel_size;
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
indio_dev = devm_iio_device_alloc(&pdev->dev,
sizeof(struct accel_3d_state));
if (indio_dev == NULL)
@ -424,7 +423,7 @@ static int hid_accel_3d_probe(struct platform_device *pdev)
/* Function to deinitialize the processing for usage id */
static void hid_accel_3d_remove(struct platform_device *pdev)
{
struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
struct hid_sensor_hub_device *hsdev = dev_get_platdata(&pdev->dev);
struct iio_dev *indio_dev = platform_get_drvdata(pdev);
struct accel_3d_state *accel_state = iio_priv(indio_dev);
@ -452,7 +451,7 @@ static struct platform_driver hid_accel_3d_platform_driver = {
.pm = &hid_sensor_pm_ops,
},
.probe = hid_accel_3d_probe,
.remove_new = hid_accel_3d_remove,
.remove = hid_accel_3d_remove,
};
module_platform_driver(hid_accel_3d_platform_driver);

View File

@ -16,6 +16,7 @@
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
#include <linux/string_choices.h>
#include <linux/types.h>
#include <linux/units.h>
#include <linux/iio/iio.h>
@ -292,7 +293,7 @@ struct kx022a_data {
__le16 buffer[8] __aligned(IIO_DMA_MINALIGN);
struct {
__le16 channels[3];
s64 ts __aligned(8);
aligned_s64 ts;
} scan;
};
@ -594,7 +595,7 @@ static int kx022a_get_axis(struct kx022a_data *data,
if (ret)
return ret;
*val = le16_to_cpu(data->buffer[0]);
*val = (s16)le16_to_cpu(data->buffer[0]);
return IIO_VAL_INT;
}

View File

@ -4,13 +4,15 @@
* Copyright (c) 2014, Intel Corporation.
*/
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/bitops.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/acpi.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
@ -168,14 +170,73 @@
#define KXCJK1013_DEFAULT_WAKE_THRES 1
enum kx_chipset {
KXCJK1013,
KXCJ91008,
KXTJ21009,
KXTF9,
KX0221020,
KX0231025,
KX_MAX_CHIPS /* this must be last */
/* Refer to section 4 of the specification */
struct kx_odr_start_up_time {
int odr_bits;
int usec;
};
/* KXCJK-1013 */
static const struct kx_odr_start_up_time kxcjk1013_odr_start_up_times[] = {
{ 0x08, 100000 },
{ 0x09, 100000 },
{ 0x0A, 100000 },
{ 0x0B, 100000 },
{ 0x00, 80000 },
{ 0x01, 41000 },
{ 0x02, 21000 },
{ 0x03, 11000 },
{ 0x04, 6400 },
{ 0x05, 3900 },
{ 0x06, 2700 },
{ 0x07, 2100 },
{ }
};
/* KXCTJ2-1009 */
static const struct kx_odr_start_up_time kxtj21009_odr_start_up_times[] = {
{ 0x08, 1240000 },
{ 0x09, 621000 },
{ 0x0A, 309000 },
{ 0x0B, 151000 },
{ 0x00, 80000 },
{ 0x01, 41000 },
{ 0x02, 21000 },
{ 0x03, 11000 },
{ 0x04, 6000 },
{ 0x05, 4000 },
{ 0x06, 3000 },
{ 0x07, 2000 },
{ }
};
/* KXTF9 */
static const struct kx_odr_start_up_time kxtf9_odr_start_up_times[] = {
{ 0x01, 81000 },
{ 0x02, 41000 },
{ 0x03, 21000 },
{ 0x04, 11000 },
{ 0x05, 5100 },
{ 0x06, 2700 },
{ }
};
/* KX023-1025 */
static const struct kx_odr_start_up_time kx0231025_odr_start_up_times[] = {
/* First 4 are not in datasheet, taken from KXCTJ2-1009 */
{ 0x08, 1240000 },
{ 0x09, 621000 },
{ 0x0A, 309000 },
{ 0x0B, 151000 },
{ 0x00, 81000 },
{ 0x01, 40000 },
{ 0x02, 22000 },
{ 0x03, 12000 },
{ 0x04, 7000 },
{ 0x05, 4400 },
{ 0x06, 3000 },
{ 0x07, 3000 },
{ }
};
enum kx_acpi_type {
@ -234,6 +295,55 @@ static const struct kx_chipset_regs kx0231025_regs = {
.wake_thres = KX023_REG_ATH,
};
struct kx_chipset_info {
const struct kx_chipset_regs *regs;
const struct kx_odr_start_up_time *times;
enum kx_acpi_type acpi_type;
};
static const struct kx_chipset_info kxcjk1013_info = {
.regs = &kxcjk1013_regs,
.times = pm_ptr(kxcjk1013_odr_start_up_times),
};
static const struct kx_chipset_info kxcj91008_info = {
.regs = &kxcjk1013_regs,
.times = pm_ptr(kxcjk1013_odr_start_up_times),
};
static const struct kx_chipset_info kxcj91008_kiox010a_info = {
.regs = &kxcjk1013_regs,
.times = pm_ptr(kxcjk1013_odr_start_up_times),
.acpi_type = ACPI_KIOX010A,
};
static const struct kx_chipset_info kxcj91008_kiox020a_info = {
.regs = &kxcjk1013_regs,
.times = pm_ptr(kxcjk1013_odr_start_up_times),
.acpi_type = ACPI_GENERIC,
};
static const struct kx_chipset_info kxcj91008_smo8500_info = {
.regs = &kxcjk1013_regs,
.times = pm_ptr(kxcjk1013_odr_start_up_times),
.acpi_type = ACPI_SMO8500,
};
static const struct kx_chipset_info kxtj21009_info = {
.regs = &kxcjk1013_regs,
.times = pm_ptr(kxtj21009_odr_start_up_times),
};
static const struct kx_chipset_info kxtf9_info = {
.regs = &kxtf9_regs,
.times = pm_ptr(kxtf9_odr_start_up_times),
};
static const struct kx_chipset_info kx0231025_info = {
.regs = &kx0231025_regs,
.times = pm_ptr(kx0231025_odr_start_up_times),
};
enum kxcjk1013_axis {
AXIS_X,
AXIS_Y,
@ -250,7 +360,7 @@ struct kxcjk1013_data {
/* Ensure timestamp naturally aligned */
struct {
s16 chans[AXIS_MAX];
s64 timestamp __aligned(8);
aligned_s64 timestamp;
} scan;
u8 odr_bits;
u8 range;
@ -261,9 +371,7 @@ struct kxcjk1013_data {
int ev_enable_state;
bool motion_trigger_on;
int64_t timestamp;
enum kx_chipset chipset;
enum kx_acpi_type acpi_type;
const struct kx_chipset_regs *regs;
const struct kx_chipset_info *info;
};
enum kxcjk1013_mode {
@ -314,83 +422,6 @@ static const struct kx_odr_map kxtf9_samp_freq_table[] = {
static const char *const kxtf9_samp_freq_avail =
"25 50 100 200 400 800";
/* Refer to section 4 of the specification */
static __maybe_unused const struct {
int odr_bits;
int usec;
} odr_start_up_times[KX_MAX_CHIPS][12] = {
/* KXCJK-1013 */
{
{0x08, 100000},
{0x09, 100000},
{0x0A, 100000},
{0x0B, 100000},
{0, 80000},
{0x01, 41000},
{0x02, 21000},
{0x03, 11000},
{0x04, 6400},
{0x05, 3900},
{0x06, 2700},
{0x07, 2100},
},
/* KXCJ9-1008 */
{
{0x08, 100000},
{0x09, 100000},
{0x0A, 100000},
{0x0B, 100000},
{0, 80000},
{0x01, 41000},
{0x02, 21000},
{0x03, 11000},
{0x04, 6400},
{0x05, 3900},
{0x06, 2700},
{0x07, 2100},
},
/* KXCTJ2-1009 */
{
{0x08, 1240000},
{0x09, 621000},
{0x0A, 309000},
{0x0B, 151000},
{0, 80000},
{0x01, 41000},
{0x02, 21000},
{0x03, 11000},
{0x04, 6000},
{0x05, 4000},
{0x06, 3000},
{0x07, 2000},
},
/* KXTF9 */
{
{0x01, 81000},
{0x02, 41000},
{0x03, 21000},
{0x04, 11000},
{0x05, 5100},
{0x06, 2700},
},
/* KX023-1025 */
{
/* First 4 are not in datasheet, taken from KXCTJ2-1009 */
{0x08, 1240000},
{0x09, 621000},
{0x0A, 309000},
{0x0B, 151000},
{0, 81000},
{0x01, 40000},
{0x02, 22000},
{0x03, 12000},
{0x04, 7000},
{0x05, 4400},
{0x06, 3000},
{0x07, 3000},
},
};
static const struct {
u16 scale;
u8 gsel_0;
@ -424,30 +455,15 @@ static int kiox010a_dsm(struct device *dev, int fn_index)
return 0;
}
static const struct acpi_device_id kx_acpi_match[] = {
{"KXCJ1013", KXCJK1013},
{"KXCJ1008", KXCJ91008},
{"KXCJ9000", KXCJ91008},
{"KIOX0008", KXCJ91008},
{"KIOX0009", KXTJ21009},
{"KIOX000A", KXCJ91008},
{"KIOX010A", KXCJ91008}, /* KXCJ91008 in the display of a yoga 2-in-1 */
{"KIOX020A", KXCJ91008}, /* KXCJ91008 in the base of a yoga 2-in-1 */
{"KXTJ1009", KXTJ21009},
{"KXJ2109", KXTJ21009},
{"SMO8500", KXCJ91008},
{ }
};
MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
#endif
static int kxcjk1013_set_mode(struct kxcjk1013_data *data,
enum kxcjk1013_mode mode)
{
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
ret = i2c_smbus_read_byte_data(data->client, data->regs->ctrl1);
ret = i2c_smbus_read_byte_data(data->client, regs->ctrl1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_ctrl1\n");
return ret;
@ -458,7 +474,7 @@ static int kxcjk1013_set_mode(struct kxcjk1013_data *data,
else
ret |= KXCJK1013_REG_CTRL1_BIT_PC1;
ret = i2c_smbus_write_byte_data(data->client, data->regs->ctrl1, ret);
ret = i2c_smbus_write_byte_data(data->client, regs->ctrl1, ret);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing reg_ctrl1\n");
return ret;
@ -470,9 +486,10 @@ static int kxcjk1013_set_mode(struct kxcjk1013_data *data,
static int kxcjk1013_get_mode(struct kxcjk1013_data *data,
enum kxcjk1013_mode *mode)
{
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
ret = i2c_smbus_read_byte_data(data->client, data->regs->ctrl1);
ret = i2c_smbus_read_byte_data(data->client, regs->ctrl1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_ctrl1\n");
return ret;
@ -488,9 +505,10 @@ static int kxcjk1013_get_mode(struct kxcjk1013_data *data,
static int kxcjk1013_set_range(struct kxcjk1013_data *data, int range_index)
{
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
ret = i2c_smbus_read_byte_data(data->client, data->regs->ctrl1);
ret = i2c_smbus_read_byte_data(data->client, regs->ctrl1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_ctrl1\n");
return ret;
@ -501,7 +519,7 @@ static int kxcjk1013_set_range(struct kxcjk1013_data *data, int range_index)
ret |= (KXCJK1013_scale_table[range_index].gsel_0 << 3);
ret |= (KXCJK1013_scale_table[range_index].gsel_1 << 4);
ret = i2c_smbus_write_byte_data(data->client, data->regs->ctrl1, ret);
ret = i2c_smbus_write_byte_data(data->client, regs->ctrl1, ret);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing reg_ctrl1\n");
return ret;
@ -514,10 +532,11 @@ static int kxcjk1013_set_range(struct kxcjk1013_data *data, int range_index)
static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
{
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
#ifdef CONFIG_ACPI
if (data->acpi_type == ACPI_KIOX010A) {
if (data->info->acpi_type == ACPI_KIOX010A) {
/* Make sure the kbd and touchpad on 2-in-1s using 2 KXCJ91008-s work */
kiox010a_dsm(&data->client->dev, KIOX010A_SET_LAPTOP_MODE);
}
@ -535,7 +554,7 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
if (ret < 0)
return ret;
ret = i2c_smbus_read_byte_data(data->client, data->regs->ctrl1);
ret = i2c_smbus_read_byte_data(data->client, regs->ctrl1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_ctrl1\n");
return ret;
@ -544,7 +563,7 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
/* Set 12 bit mode */
ret |= KXCJK1013_REG_CTRL1_BIT_RES;
ret = i2c_smbus_write_byte_data(data->client, data->regs->ctrl1, ret);
ret = i2c_smbus_write_byte_data(data->client, regs->ctrl1, ret);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_ctrl\n");
return ret;
@ -555,7 +574,7 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
if (ret < 0)
return ret;
ret = i2c_smbus_read_byte_data(data->client, data->regs->data_ctrl);
ret = i2c_smbus_read_byte_data(data->client, regs->data_ctrl);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_data_ctrl\n");
return ret;
@ -564,7 +583,7 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
data->odr_bits = ret;
/* Set up INT polarity */
ret = i2c_smbus_read_byte_data(data->client, data->regs->int_ctrl1);
ret = i2c_smbus_read_byte_data(data->client, regs->int_ctrl1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_int_ctrl1\n");
return ret;
@ -575,14 +594,14 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
else
ret &= ~KXCJK1013_REG_INT_CTRL1_BIT_IEA;
ret = i2c_smbus_write_byte_data(data->client, data->regs->int_ctrl1, ret);
ret = i2c_smbus_write_byte_data(data->client, regs->int_ctrl1, ret);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing reg_int_ctrl1\n");
return ret;
}
/* On KX023 and KX022, route all used interrupts to INT1 for now */
if ((data->chipset == KX0231025 || data->chipset == KX0221020) && data->client->irq > 0) {
/* On KX023, route all used interrupts to INT1 for now */
if (data->info == &kx0231025_info && data->client->irq > 0) {
ret = i2c_smbus_write_byte_data(data->client, KX023_REG_INC4,
KX023_REG_INC4_DRDY1 |
KX023_REG_INC4_WUFI1);
@ -601,20 +620,17 @@ static int kxcjk1013_chip_init(struct kxcjk1013_data *data)
return 0;
}
#ifdef CONFIG_PM
static int kxcjk1013_get_startup_times(struct kxcjk1013_data *data)
{
int i;
int idx = data->chipset;
const struct kx_odr_start_up_time *times;
for (i = 0; i < ARRAY_SIZE(odr_start_up_times[idx]); ++i) {
if (odr_start_up_times[idx][i].odr_bits == data->odr_bits)
return odr_start_up_times[idx][i].usec;
for (times = data->info->times; times->usec; times++) {
if (times->odr_bits == data->odr_bits)
return times->usec;
}
return KXCJK1013_MAX_STARTUP_TIME_US;
}
#endif
static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool on)
{
@ -639,18 +655,17 @@ static int kxcjk1013_set_power_state(struct kxcjk1013_data *data, bool on)
static int kxcjk1013_chip_update_thresholds(struct kxcjk1013_data *data)
{
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
ret = i2c_smbus_write_byte_data(data->client, data->regs->wake_timer,
data->wake_dur);
ret = i2c_smbus_write_byte_data(data->client, regs->wake_timer, data->wake_dur);
if (ret < 0) {
dev_err(&data->client->dev,
"Error writing reg_wake_timer\n");
return ret;
}
ret = i2c_smbus_write_byte_data(data->client, data->regs->wake_thres,
data->wake_thres);
ret = i2c_smbus_write_byte_data(data->client, regs->wake_thres, data->wake_thres);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing reg_wake_thres\n");
return ret;
@ -662,6 +677,7 @@ static int kxcjk1013_chip_update_thresholds(struct kxcjk1013_data *data)
static int kxcjk1013_setup_any_motion_interrupt(struct kxcjk1013_data *data,
bool status)
{
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
enum kxcjk1013_mode store_mode;
@ -678,7 +694,7 @@ static int kxcjk1013_setup_any_motion_interrupt(struct kxcjk1013_data *data,
if (ret < 0)
return ret;
ret = i2c_smbus_read_byte_data(data->client, data->regs->int_ctrl1);
ret = i2c_smbus_read_byte_data(data->client, regs->int_ctrl1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_int_ctrl1\n");
return ret;
@ -689,13 +705,13 @@ static int kxcjk1013_setup_any_motion_interrupt(struct kxcjk1013_data *data,
else
ret &= ~KXCJK1013_REG_INT_CTRL1_BIT_IEN;
ret = i2c_smbus_write_byte_data(data->client, data->regs->int_ctrl1, ret);
ret = i2c_smbus_write_byte_data(data->client, regs->int_ctrl1, ret);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing reg_int_ctrl1\n");
return ret;
}
ret = i2c_smbus_read_byte_data(data->client, data->regs->ctrl1);
ret = i2c_smbus_read_byte_data(data->client, regs->ctrl1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_ctrl1\n");
return ret;
@ -706,7 +722,7 @@ static int kxcjk1013_setup_any_motion_interrupt(struct kxcjk1013_data *data,
else
ret &= ~KXCJK1013_REG_CTRL1_BIT_WUFE;
ret = i2c_smbus_write_byte_data(data->client, data->regs->ctrl1, ret);
ret = i2c_smbus_write_byte_data(data->client, regs->ctrl1, ret);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing reg_ctrl1\n");
return ret;
@ -724,6 +740,7 @@ static int kxcjk1013_setup_any_motion_interrupt(struct kxcjk1013_data *data,
static int kxcjk1013_setup_new_data_interrupt(struct kxcjk1013_data *data,
bool status)
{
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
enum kxcjk1013_mode store_mode;
@ -736,7 +753,7 @@ static int kxcjk1013_setup_new_data_interrupt(struct kxcjk1013_data *data,
if (ret < 0)
return ret;
ret = i2c_smbus_read_byte_data(data->client, data->regs->int_ctrl1);
ret = i2c_smbus_read_byte_data(data->client, regs->int_ctrl1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_int_ctrl1\n");
return ret;
@ -747,13 +764,13 @@ static int kxcjk1013_setup_new_data_interrupt(struct kxcjk1013_data *data,
else
ret &= ~KXCJK1013_REG_INT_CTRL1_BIT_IEN;
ret = i2c_smbus_write_byte_data(data->client, data->regs->int_ctrl1, ret);
ret = i2c_smbus_write_byte_data(data->client, regs->int_ctrl1, ret);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing reg_int_ctrl1\n");
return ret;
}
ret = i2c_smbus_read_byte_data(data->client, data->regs->ctrl1);
ret = i2c_smbus_read_byte_data(data->client, regs->ctrl1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_ctrl1\n");
return ret;
@ -764,7 +781,7 @@ static int kxcjk1013_setup_new_data_interrupt(struct kxcjk1013_data *data,
else
ret &= ~KXCJK1013_REG_CTRL1_BIT_DRDY;
ret = i2c_smbus_write_byte_data(data->client, data->regs->ctrl1, ret);
ret = i2c_smbus_write_byte_data(data->client, regs->ctrl1, ret);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing reg_ctrl1\n");
return ret;
@ -811,6 +828,7 @@ static int kxcjk1013_convert_odr_value(const struct kx_odr_map *map,
static int kxcjk1013_set_odr(struct kxcjk1013_data *data, int val, int val2)
{
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
enum kxcjk1013_mode store_mode;
const struct kx_odr_map *odr_setting;
@ -819,7 +837,7 @@ static int kxcjk1013_set_odr(struct kxcjk1013_data *data, int val, int val2)
if (ret < 0)
return ret;
if (data->chipset == KXTF9)
if (data->info == &kxtf9_info)
odr_setting = kxcjk1013_find_odr_value(kxtf9_samp_freq_table,
ARRAY_SIZE(kxtf9_samp_freq_table),
val, val2);
@ -836,7 +854,7 @@ static int kxcjk1013_set_odr(struct kxcjk1013_data *data, int val, int val2)
if (ret < 0)
return ret;
ret = i2c_smbus_write_byte_data(data->client, data->regs->data_ctrl,
ret = i2c_smbus_write_byte_data(data->client, regs->data_ctrl,
odr_setting->odr_bits);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing data_ctrl\n");
@ -845,7 +863,7 @@ static int kxcjk1013_set_odr(struct kxcjk1013_data *data, int val, int val2)
data->odr_bits = odr_setting->odr_bits;
ret = i2c_smbus_write_byte_data(data->client, data->regs->wuf_ctrl,
ret = i2c_smbus_write_byte_data(data->client, regs->wuf_ctrl,
odr_setting->wuf_bits);
if (ret < 0) {
dev_err(&data->client->dev, "Error writing reg_ctrl2\n");
@ -863,7 +881,7 @@ static int kxcjk1013_set_odr(struct kxcjk1013_data *data, int val, int val2)
static int kxcjk1013_get_odr(struct kxcjk1013_data *data, int *val, int *val2)
{
if (data->chipset == KXTF9)
if (data->info == &kxtf9_info)
return kxcjk1013_convert_odr_value(kxtf9_samp_freq_table,
ARRAY_SIZE(kxtf9_samp_freq_table),
data->odr_bits, val, val2);
@ -1063,7 +1081,7 @@ static int kxcjk1013_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
int state)
bool state)
{
struct kxcjk1013_data *data = iio_priv(indio_dev);
int ret;
@ -1130,7 +1148,7 @@ static ssize_t kxcjk1013_get_samp_freq_avail(struct device *dev,
struct kxcjk1013_data *data = iio_priv(indio_dev);
const char *str;
if (data->chipset == KXTF9)
if (data->info == &kxtf9_info)
str = kxtf9_samp_freq_avail;
else
str = kxcjk1013_samp_freq_avail;
@ -1207,7 +1225,7 @@ static const struct iio_buffer_setup_ops kxcjk1013_buffer_setup_ops = {
.postdisable = kxcjk1013_buffer_postdisable,
};
static const struct iio_info kxcjk1013_info = {
static const struct iio_info kxcjk1013_iio_info = {
.attrs = &kxcjk1013_attrs_group,
.read_raw = kxcjk1013_read_raw,
.write_raw = kxcjk1013_write_raw,
@ -1247,9 +1265,10 @@ static void kxcjk1013_trig_reen(struct iio_trigger *trig)
{
struct iio_dev *indio_dev = iio_trigger_get_drvdata(trig);
struct kxcjk1013_data *data = iio_priv(indio_dev);
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
ret = i2c_smbus_read_byte_data(data->client, data->regs->int_rel);
ret = i2c_smbus_read_byte_data(data->client, regs->int_rel);
if (ret < 0)
dev_err(&data->client->dev, "Error reading reg_int_rel\n");
}
@ -1301,8 +1320,9 @@ static const struct iio_trigger_ops kxcjk1013_trigger_ops = {
static void kxcjk1013_report_motion_event(struct iio_dev *indio_dev)
{
struct kxcjk1013_data *data = iio_priv(indio_dev);
const struct kx_chipset_regs *regs = data->info->regs;
int ret = i2c_smbus_read_byte_data(data->client, data->regs->int_src2);
int ret = i2c_smbus_read_byte_data(data->client, regs->int_src2);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_int_src2\n");
return;
@ -1367,16 +1387,17 @@ static irqreturn_t kxcjk1013_event_handler(int irq, void *private)
{
struct iio_dev *indio_dev = private;
struct kxcjk1013_data *data = iio_priv(indio_dev);
const struct kx_chipset_regs *regs = data->info->regs;
int ret;
ret = i2c_smbus_read_byte_data(data->client, data->regs->int_src1);
ret = i2c_smbus_read_byte_data(data->client, regs->int_src1);
if (ret < 0) {
dev_err(&data->client->dev, "Error reading reg_int_src1\n");
goto ack_intr;
}
if (ret & KXCJK1013_REG_INT_SRC1_BIT_WUFS) {
if (data->chipset == KXTF9)
if (data->info == &kxtf9_info)
iio_push_event(indio_dev,
IIO_MOD_EVENT_CODE(IIO_ACCEL,
0,
@ -1392,7 +1413,7 @@ static irqreturn_t kxcjk1013_event_handler(int irq, void *private)
if (data->dready_trigger_on)
return IRQ_HANDLED;
ret = i2c_smbus_read_byte_data(data->client, data->regs->int_rel);
ret = i2c_smbus_read_byte_data(data->client, regs->int_rel);
if (ret < 0)
dev_err(&data->client->dev, "Error reading reg_int_rel\n");
@ -1417,31 +1438,6 @@ static irqreturn_t kxcjk1013_data_rdy_trig_poll(int irq, void *private)
return IRQ_HANDLED;
}
static const char *kxcjk1013_match_acpi_device(struct device *dev,
enum kx_chipset *chipset,
enum kx_acpi_type *acpi_type,
const char **label)
{
const struct acpi_device_id *id;
id = acpi_match_device(dev->driver->acpi_match_table, dev);
if (!id)
return NULL;
if (strcmp(id->id, "SMO8500") == 0) {
*acpi_type = ACPI_SMO8500;
} else if (strcmp(id->id, "KIOX010A") == 0) {
*acpi_type = ACPI_KIOX010A;
*label = "accel-display";
} else if (strcmp(id->id, "KIOX020A") == 0) {
*label = "accel-base";
}
*chipset = (enum kx_chipset)id->driver_data;
return dev_name(dev);
}
static int kxcjk1013_probe(struct i2c_client *client)
{
const struct i2c_device_id *id = i2c_client_get_device_id(client);
@ -1449,6 +1445,7 @@ static int kxcjk1013_probe(struct i2c_client *client)
struct kxcjk1013_data *data;
struct iio_dev *indio_dev;
struct kxcjk_1013_platform_data *pdata;
const void *ddata = NULL;
const char *name;
int ret;
@ -1489,32 +1486,18 @@ static int kxcjk1013_probe(struct i2c_client *client)
msleep(20);
if (id) {
data->chipset = (enum kx_chipset)(id->driver_data);
name = id->name;
} else if (ACPI_HANDLE(&client->dev)) {
name = kxcjk1013_match_acpi_device(&client->dev,
&data->chipset,
&data->acpi_type,
&indio_dev->label);
} else
return -ENODEV;
switch (data->chipset) {
case KXCJK1013:
case KXCJ91008:
case KXTJ21009:
data->regs = &kxcjk1013_regs;
break;
case KXTF9:
data->regs = &kxtf9_regs;
break;
case KX0221020:
case KX0231025:
data->regs = &kx0231025_regs;
break;
default:
return -EINVAL;
data->info = (const struct kx_chipset_info *)(id->driver_data);
} else {
name = iio_get_acpi_device_name_and_data(&client->dev, &ddata);
data->info = ddata;
if (data->info == &kxcj91008_kiox010a_info)
indio_dev->label = "accel-display";
else if (data->info == &kxcj91008_kiox020a_info)
indio_dev->label = "accel-base";
}
if (!name)
return -ENODEV;
ret = kxcjk1013_chip_init(data);
if (ret < 0)
@ -1527,9 +1510,9 @@ static int kxcjk1013_probe(struct i2c_client *client)
indio_dev->available_scan_masks = kxcjk1013_scan_masks;
indio_dev->name = name;
indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &kxcjk1013_info;
indio_dev->info = &kxcjk1013_iio_info;
if (client->irq > 0 && data->acpi_type != ACPI_SMO8500) {
if (client->irq > 0 && data->info->acpi_type != ACPI_SMO8500) {
ret = devm_request_threaded_irq(&client->dev, client->irq,
kxcjk1013_data_rdy_trig_poll,
kxcjk1013_event_handler,
@ -1637,7 +1620,6 @@ static void kxcjk1013_remove(struct i2c_client *client)
mutex_unlock(&data->mutex);
}
#ifdef CONFIG_PM_SLEEP
static int kxcjk1013_suspend(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
@ -1665,9 +1647,7 @@ static int kxcjk1013_resume(struct device *dev)
return ret;
}
#endif
#ifdef CONFIG_PM
static int kxcjk1013_runtime_suspend(struct device *dev)
{
struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev));
@ -1701,44 +1681,56 @@ static int kxcjk1013_runtime_resume(struct device *dev)
return 0;
}
#endif
static const struct dev_pm_ops kxcjk1013_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(kxcjk1013_suspend, kxcjk1013_resume)
SET_RUNTIME_PM_OPS(kxcjk1013_runtime_suspend,
kxcjk1013_runtime_resume, NULL)
SYSTEM_SLEEP_PM_OPS(kxcjk1013_suspend, kxcjk1013_resume)
RUNTIME_PM_OPS(kxcjk1013_runtime_suspend, kxcjk1013_runtime_resume, NULL)
};
static const struct i2c_device_id kxcjk1013_id[] = {
{"kxcjk1013", KXCJK1013},
{"kxcj91008", KXCJ91008},
{"kxtj21009", KXTJ21009},
{"kxtf9", KXTF9},
{"kx022-1020", KX0221020},
{"kx023-1025", KX0231025},
{"SMO8500", KXCJ91008},
{}
{ "kxcjk1013", (kernel_ulong_t)&kxcjk1013_info },
{ "kxcj91008", (kernel_ulong_t)&kxcj91008_info },
{ "kxtj21009", (kernel_ulong_t)&kxtj21009_info },
{ "kxtf9", (kernel_ulong_t)&kxtf9_info },
{ "kx023-1025", (kernel_ulong_t)&kx0231025_info },
{ }
};
MODULE_DEVICE_TABLE(i2c, kxcjk1013_id);
static const struct of_device_id kxcjk1013_of_match[] = {
{ .compatible = "kionix,kxcjk1013", },
{ .compatible = "kionix,kxcj91008", },
{ .compatible = "kionix,kxtj21009", },
{ .compatible = "kionix,kxtf9", },
{ .compatible = "kionix,kx022-1020", },
{ .compatible = "kionix,kx023-1025", },
{ .compatible = "kionix,kxcjk1013", &kxcjk1013_info },
{ .compatible = "kionix,kxcj91008", &kxcj91008_info },
{ .compatible = "kionix,kxtj21009", &kxtj21009_info },
{ .compatible = "kionix,kxtf9", &kxtf9_info },
{ .compatible = "kionix,kx023-1025", &kx0231025_info },
{ }
};
MODULE_DEVICE_TABLE(of, kxcjk1013_of_match);
static const struct acpi_device_id kx_acpi_match[] = {
{ "KIOX0008", (kernel_ulong_t)&kxcj91008_info },
{ "KIOX0009", (kernel_ulong_t)&kxtj21009_info },
{ "KIOX000A", (kernel_ulong_t)&kxcj91008_info },
/* KXCJ91008 in the display of a yoga 2-in-1 */
{ "KIOX010A", (kernel_ulong_t)&kxcj91008_kiox010a_info },
/* KXCJ91008 in the base of a yoga 2-in-1 */
{ "KIOX020A", (kernel_ulong_t)&kxcj91008_kiox020a_info },
{ "KXCJ1008", (kernel_ulong_t)&kxcj91008_info },
{ "KXCJ1013", (kernel_ulong_t)&kxcjk1013_info },
{ "KXCJ9000", (kernel_ulong_t)&kxcj91008_info },
{ "KXJ2109", (kernel_ulong_t)&kxtj21009_info },
{ "KXTJ1009", (kernel_ulong_t)&kxtj21009_info },
{ "SMO8500", (kernel_ulong_t)&kxcj91008_smo8500_info },
{ }
};
MODULE_DEVICE_TABLE(acpi, kx_acpi_match);
static struct i2c_driver kxcjk1013_driver = {
.driver = {
.name = KXCJK1013_DRV_NAME,
.acpi_match_table = ACPI_PTR(kx_acpi_match),
.acpi_match_table = kx_acpi_match,
.of_match_table = kxcjk1013_of_match,
.pm = &kxcjk1013_pm_ops,
.pm = pm_ptr(&kxcjk1013_pm_ops),
},
.probe = kxcjk1013_probe,
.remove = kxcjk1013_remove,

View File

@ -15,6 +15,7 @@
#include <linux/kernel.h>
#include <linux/sysfs.h>
#include <linux/slab.h>
#include <linux/types.h>
#include <linux/module.h>
#include <linux/regmap.h>
#include <linux/bitops.h>
@ -215,7 +216,7 @@ static irqreturn_t kxsd9_trigger_handler(int irq, void *p)
*/
struct {
__be16 chan[4];
s64 ts __aligned(8);
aligned_s64 ts;
} hw_values;
int ret;

Some files were not shown because too many files have changed in this diff Show More