Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Jonathan writes:

First set of new device support, features and cleanups for IIO in the 5.11 cycle

Usual mixed bag of new drivers / device support + cleanups etc with the
addition of a fairly big set of yaml conversions.

Txt to yaml format conversions.
In some cases dropped separate binding and moved to trivial devices (drop).

Listed by manufacturer
- dht11 temperature(drop)
- adi,ad2s90 adi,ad5272 adi,ad5592r adi,ad5758 adi,ad5933 adi,ad7303
adi,adis16480 adi,adf4350
- ams,as3935
- asahi-kasei,ak8974
- atmel,sama5d2-adc
- avago,apds9300 avago,apds9960
- bosch,bma180 bosch,bmc150_magn bosch,bme680 bosch,bmg180
- brcm,iproc-static-adc
- capella,cm36651
- domintech,dmard06(drop)
- fsl,mag3110 fsl,mma8452 fsl,vf610-dac
- hoperf,hp03
- honeywell,hmc5843
- kionix,kxcjk1013
- maxim,ds1803(drop) maxim,ds4424 maxim,max30100 maxim,max30102
maxim,max31856 maxim,max31855k maxim,max44009
maxim,max5481 maxim,max5821
- meas,htu21(drop) meas,ms5367(drop) meas,ms5611 meas,tsys01(drop)
- mediatek,mt2701-auxadc
- melexis,mlx90614 melexis,mlx90632
- memsic,mmc35240(drop)
- microchip,mcp41010 microchip,mcp4131 microchip,mcp4725
- murata,zap2326
- nxp,fxas21002c nxp,lpc1850-dac
- pni,rm3100
- qcom,pm8018-adc qcom,spmi-iadc
- renesas,isl29501 renesas,rcar-gyroadc
- samsung,sensorhub-rinato
- sensiron,sgp30
- sentech,sx9500
- sharp,gp2ap020a00f
- st,hts221 st,lsm6dsx st,st-sensors(many!) st,uvis25 st,vcl53l0x st,vl6180
- ti,adc084s021 ti,ads124s08
ti,dac5571 ti,dac7311 ti,dac7512 ti,dac7612
ti,hdc1000(drop) ti,palmas-gpadc ti,opt3001 ti,tmp07
- upisemi,us51882
- vishay,vcnl4035
- x-powers,axp209

New device support
* adi,ad5685
- Add support for AD5338R dual output 10-bit DAC
- Add DT-binding doc.
* mediatek,mt6360
- New driver for this SoC ADC with bindings and using new channel label
support in the IIO core.
* st,lsm6dsx
- Add support for LSM6DST

Core:
* Add "label" to device channels, provided via a new core callback. Including
DT docs for when that is the source, and ABI docs.
* Add devm_iio_triggered_buffer_setup_ext to take extra attributes.
* dmaengine, unwrap use of iio_buffer_set_attrs()
* Drop iio_buffer_set_attrs()
* Centralize ioctl call handling. Later fix to ensure -EINVAL returned if
no handler has run.
* Fix an issue with IIO_VAL_FRACTIONAL and negative values - doesn't affect
any known existing drivers, but will impact a future one.
* kernel-doc fix in trigger.h
* file-ops ordering cleanup

Features
* semtech,sx9310
- Add control of hardware gain, proximity thresholds, hysteresis and
debounce.
- Increase what information on hardware configuration can be provided
via DT.

Cleanup and minor features
* adi,ad5685
- Add of_match_table
* adi,ad7292
- Drop pointless spi_set_drvdata() call
* adi,ad7298
- Drop platform data and tidy up external reference config.
* adi,ad7303
- Drop platform data handling as unused.
* adi,ad7768
- Add new label attribute for channels provided from dt.
* adi,ad7887
- devm_ usage in probe simplifying remove and error handling.
* adi,adis16201
- Drop pointless spi_set_drvdata() call
* adi,adis16209
- Drop pointless spi_set_drvdata() call
* adi,adis16240
- White space fixup
* adi,adxl372
- use new devm_iio_triggered-buffer_setup_ext()
* amlogic,meson-saradc
- Drop pointless semicolon.
* amstaos,tsl2563
- Put back i2c_device_id table as needed for greybus probing.
* atmel,at91_adc
- Use of_device_get_match_data() instead of open coding it.
- Constify some driver data
- Add KCONFIG dep on CONFIG_OF and drop of_match_ptr()
- Drop platform data as mostly dead code.
- Tidy up reference voltage logic
* atmel-sama5d2
- Drop a pointless semicolon
- Merge buffer and trigger init into a separate function
- Use new devm_iio_triggered_buff_setup_ext()
* avago,apds9960
- Drop a pointless semicolon
* bosch,bmc150
- Drop a pointless semicolon
- Use new iio_triggered_buffer_setup_ext()
* bosch,bmp280
- Drop a pointless semicolon
* fsl,mma8452
- Constification
* (google),cros_ec
- Use new devm_iio_triggered_buffer_setup_ext()
* hid-sensors
- Use new iio_triggered_buffer_setup_ext()
* ingenic,adc
- Drop a pointless semicolon
* invensense,icm426xx
- Fix MAINTAINERS entry missing :
* mediatek,mt6577_audxac
- Add binding doc for mt8516 compatible with mt8173
* motorola,cpcap-adc
- Fix an implicit fallthrough marking that clang needs to avoid warning.
* samsung,exynos-adc
- Stop relying on users counter form input device in ISR.
* st,lsm6dsx
- add vdd and vddio regulator control (including binding update)
* st,stm32-adc
- Tidy up code for dma transfers.
- Adapt clock duty cycle for proper functioning. Note no known problems
with existing boards.
* st,vl53l0x-i2c
- Put back i2c_device_id table as needed for greybus probing.
* vishay,vcnl4035
- Put back i2c_device_id table as needed for greybus probing.

* tag 'iio-for-5.11a' of https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio: (126 commits)
dt-bindings:iio:adc:x-powers,axp209-adc: txt to yaml conversion
dt-bindings:iio:adc:renesas,rcar-gyroadc: txt to yaml conversion.
dt-bindings:iio:adc:atmel,sama5d2-adc: txt to yaml conversion
dt-bindings:iio:magnetometer:pni,rm3100: txt to yaml conversion.
dt-bindings:iio:magnetometer:honeywell,hmc5843: txt to yaml format conversion
dt-bindings:iio:magnetometer:bosch,bmc150_magn: txt to yaml conversion.
dt-bindings:iio:magnetometer:asahi-kasei,ak8974: txt to yaml format conversion
dt-bindings:iio:magnetometer:fsl,mag3110: txt to yaml conversion
dt-bindings:iio:light:st,vl6180: txt to yaml format conversion.
dt-bindings:iio:light:vishay,vcnl4035: txt to yaml conversion
dt-bindings:iio:light:st,uvis25: txt to yaml conversion for this UV sensor
dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.
dt-bindings:iio:light:ti,opt3001: txt to yaml conversion
dt-bindings:iio:light:maxim,max44009: txt to yaml conversion.
dt-bindings:iio:light:sharp,gp2ap020a00f: txt to yaml conversion.
dt-bindings:iio:light:capella,cm36651: txt to yaml conversion.
dt-bindings:iio:light:avago,apds9960: txt to yaml conversion
dt-bindings:iio:light:avago,apds9300: txt to yaml conversion.
dt-bindings:iio:imu:st,lsm6dsx: txt to yaml conversion
dt-bindings:iio:imu:adi,adis16480: txt to yaml conversion
...

+5191 -2209
+10
Documentation/ABI/testing/sysfs-bus-iio
··· 1743 1743 1744 1744 Raw counter device counters direction for channel Y. 1745 1745 1746 + What: /sys/bus/iio/devices/iio:deviceX/in_voltageY_label 1747 + What: /sys/bus/iio/devices/iio:deviceX/out_voltageY_label 1748 + KernelVersion: 5.8 1749 + Contact: linux-iio@vger.kernel.org 1750 + Description: 1751 + Optional symbolic label to a device channel. 1752 + If a label is defined for this channel add that to the channel 1753 + specific attributes. This is useful for userspace to be able to 1754 + better identify an individual channel. 1755 + 1746 1756 What: /sys/bus/iio/devices/iio:deviceX/in_phaseY_raw 1747 1757 KernelVersion: 4.18 1748 1758 Contact: linux-iio@vger.kernel.org
+78
Documentation/ABI/testing/sysfs-bus-iio-adc-mt6360
··· 1 + What: /sys/bus/iio/devices/iio:deviceX/in_voltage0_raw 2 + KernelVersion: 5.8.0 3 + Contact: gene_chen@richtek.com 4 + Description: 5 + Indicated MT6360 USBID ADC which connected to connector ID pin. 6 + Calculating with scale and offset returns voltage in uV 7 + 8 + What: /sys/bus/iio/devices/iio:deviceX/in_voltage1_raw 9 + KernelVersion: 5.8.0 10 + Contact: gene_chen@richtek.com 11 + Description: 12 + Indicated MT6360 VBUS ADC with lower accuracy(+-75mA) 13 + higher measure range(1~22mV) 14 + Calculating with scale and offset returns voltage in uV 15 + 16 + What: /sys/bus/iio/devices/iio:deviceX/in_voltage2_raw 17 + KernelVersion: 5.8.0 18 + Contact: gene_chen@richtek.com 19 + Description: 20 + Indicated MT6360 VBUS ADC with higher accuracy(+-30mA) 21 + lower measure range(1~9.76V) 22 + Calculating with scale and offset returns voltage in uV 23 + 24 + What: /sys/bus/iio/devices/iio:deviceX/in_voltage3_raw 25 + KernelVersion: 5.8.0 26 + Contact: gene_chen@richtek.com 27 + Description: 28 + Indicated MT6360 VSYS ADC 29 + Calculating with scale and offset returns voltage in uV 30 + 31 + What: /sys/bus/iio/devices/iio:deviceX/in_voltage4_raw 32 + KernelVersion: 5.8.0 33 + Contact: gene_chen@richtek.com 34 + Description: 35 + Indicated MT6360 VBAT ADC 36 + Calculating with scale and offset returns voltage in uV 37 + 38 + What: /sys/bus/iio/devices/iio:deviceX/in_current5_raw 39 + KernelVersion: 5.8.0 40 + Contact: gene_chen@richtek.com 41 + Description: 42 + Indicated MT6360 IBUS ADC 43 + Calculating with scale and offset returns voltage in uA 44 + 45 + What: /sys/bus/iio/devices/iio:deviceX/in_current6_raw 46 + KernelVersion: 5.8.0 47 + Contact: gene_chen@richtek.com 48 + Description: 49 + Indicated MT6360 IBAT ADC 50 + Calculating with scale and offset returns voltage in uA 51 + 52 + What: /sys/bus/iio/devices/iio:deviceX/in_current7_raw 53 + KernelVersion: 5.8.0 54 + Contact: gene_chen@richtek.com 55 + Description: 56 + Indicated MT6360 CHG_VDDP ADC 57 + Calculating with scale and offset returns voltage in uV 58 + 59 + What: /sys/bus/iio/devices/iio:deviceX/in_temp8_raw 60 + KernelVersion: 5.8.0 61 + Contact: gene_chen@richtek.com 62 + Description: 63 + Indicated MT6360 IC junction temperature 64 + Calculating with scale and offset returns temperature in degree 65 + 66 + What: /sys/bus/iio/devices/iio:deviceX/in_voltage9_raw 67 + KernelVersion: 5.8.0 68 + Contact: gene_chen@richtek.com 69 + Description: 70 + Indicated MT6360 VREF_TS ADC 71 + Calculating with scale and offset returns voltage in uV 72 + 73 + What: /sys/bus/iio/devices/iio:deviceX/in_voltage10_raw 74 + KernelVersion: 5.8.0 75 + Contact: gene_chen@richtek.com 76 + Description: 77 + Indicated MT6360 TS ADC 78 + Calculating with scale and offset returns voltage in uV
-19
Documentation/devicetree/bindings/iio/accel/dmard06.txt
··· 1 - Device tree bindings for Domintech DMARD05, DMARD06, DMARD07 accelerometers 2 - 3 - Required properties: 4 - - compatible : Should be "domintech,dmard05" 5 - or "domintech,dmard06" 6 - or "domintech,dmard07" 7 - - reg : I2C address of the chip. Should be 0x1c 8 - 9 - Example: 10 - &i2c1 { 11 - /* ... */ 12 - 13 - accelerometer@1c { 14 - compatible = "domintech,dmard06"; 15 - reg = <0x1c>; 16 - }; 17 - 18 - /* ... */ 19 - };
+6
Documentation/devicetree/bindings/iio/adc/adc.txt
··· 5 5 - diff-channels : Differential channels muxed for this ADC. The first value 6 6 specifies the positive input pin, the second value the negative 7 7 input pin. 8 + - reg: The channel number. 9 + - label: Unique name to identify which channel this is. 8 10 9 11 Example: 10 12 adc@0 { 11 13 compatible = "some,adc"; 12 14 ... 13 15 channel@0 { 16 + reg = <0>; 17 + label = "channel_0_name"; 14 18 bipolar; 15 19 diff-channels = <0 1>; 16 20 ... 17 21 }; 18 22 19 23 channel@1 { 24 + reg = <1>; 25 + label = "channel_1_name"; 20 26 diff-channels = <2 3>; 21 27 ... 22 28 };
+32
Documentation/devicetree/bindings/iio/adc/adi,ad7768-1.yaml
··· 29 29 interrupts: 30 30 maxItems: 1 31 31 32 + '#address-cells': 33 + const: 1 34 + 35 + '#size-cells': 36 + const: 0 37 + 32 38 vref-supply: 33 39 description: 34 40 ADC reference voltage supply ··· 68 62 - spi-cpha 69 63 - adi,sync-in-gpios 70 64 65 + patternProperties: 66 + "^channel@([0-9]|1[0-5])$": 67 + type: object 68 + description: | 69 + Represents the external channels which are connected to the device. 70 + 71 + properties: 72 + reg: 73 + description: | 74 + The channel number. 75 + 76 + label: 77 + description: | 78 + Unique name to identify which channel this is. 79 + required: 80 + - reg 81 + additionalProperties: false 82 + 71 83 additionalProperties: false 72 84 73 85 examples: ··· 109 85 reset-gpios = <&gpio 27 GPIO_ACTIVE_LOW>; 110 86 clocks = <&ad7768_mclk>; 111 87 clock-names = "mclk"; 88 + 89 + #address-cells = <1>; 90 + #size-cells = <0>; 91 + 92 + channel@0 { 93 + reg = <0>; 94 + label = "channel_0"; 95 + }; 112 96 }; 113 97 }; 114 98 ...
-50
Documentation/devicetree/bindings/iio/adc/at91-sama5d2_adc.txt
··· 1 - * AT91 SAMA5D2 Analog to Digital Converter (ADC) 2 - 3 - Required properties: 4 - - compatible: Should be "atmel,sama5d2-adc" or "microchip,sam9x60-adc". 5 - - reg: Should contain ADC registers location and length. 6 - - interrupts: Should contain the IRQ line for the ADC. 7 - - clocks: phandle to device clock. 8 - - clock-names: Must be "adc_clk". 9 - - vref-supply: Supply used as reference for conversions. 10 - - vddana-supply: Supply for the adc device. 11 - - atmel,min-sample-rate-hz: Minimum sampling rate, it depends on SoC. 12 - - atmel,max-sample-rate-hz: Maximum sampling rate, it depends on SoC. 13 - - atmel,startup-time-ms: Startup time expressed in ms, it depends on SoC. 14 - - atmel,trigger-edge-type: One of possible edge types for the ADTRG hardware 15 - trigger pin. When the specific edge type is detected, the conversion will 16 - start. Possible values are rising, falling, or both. 17 - This property uses the IRQ edge types values: IRQ_TYPE_EDGE_RISING , 18 - IRQ_TYPE_EDGE_FALLING or IRQ_TYPE_EDGE_BOTH 19 - 20 - Optional properties: 21 - - dmas: Phandle to dma channel for the ADC. 22 - - dma-names: Must be "rx" when dmas property is being used. 23 - See ../../dma/dma.txt for details. 24 - - #io-channel-cells: in case consumer drivers are attached, this must be 1. 25 - See <Documentation/devicetree/bindings/iio/iio-bindings.txt> for details. 26 - 27 - Properties for consumer drivers: 28 - - Consumer drivers can be connected to this producer device, as specified 29 - in <Documentation/devicetree/bindings/iio/iio-bindings.txt> 30 - - Channels exposed are specified in: 31 - <dt-bindings/iio/adc/at91-sama5d2_adc.txt> 32 - 33 - Example: 34 - 35 - adc: adc@fc030000 { 36 - compatible = "atmel,sama5d2-adc"; 37 - reg = <0xfc030000 0x100>; 38 - interrupts = <40 IRQ_TYPE_LEVEL_HIGH 7>; 39 - clocks = <&adc_clk>; 40 - clock-names = "adc_clk"; 41 - atmel,min-sample-rate-hz = <200000>; 42 - atmel,max-sample-rate-hz = <20000000>; 43 - atmel,startup-time-ms = <4>; 44 - vddana-supply = <&vdd_3v3_lp_reg>; 45 - vref-supply = <&vdd_3v3_lp_reg>; 46 - atmel,trigger-edge-type = <IRQ_TYPE_EDGE_BOTH>; 47 - dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(25))>; 48 - dma-names = "rx"; 49 - #io-channel-cells = <1>; 50 - }
+101
Documentation/devicetree/bindings/iio/adc/atmel,sama5d2-adc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/adc/atmel,sama5d2-adc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: AT91 SAMA5D2 Analog to Digital Converter (ADC) 8 + 9 + maintainers: 10 + - Ludovic Desroches <ludovic.desroches@atmel.com> 11 + - Eugen Hristev <eugen.hristev@microchip.com> 12 + 13 + properties: 14 + compatible: 15 + enum: 16 + - atmel,sama5d2-adc 17 + - microchip,sam9x60-adc 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + clocks: 26 + maxItems: 1 27 + 28 + clock-names: 29 + const: adc_clk 30 + 31 + vref-supply: true 32 + vddana-supply: true 33 + 34 + atmel,min-sample-rate-hz: 35 + description: Minimum sampling rate, it depends on SoC. 36 + 37 + atmel,max-sample-rate-hz: 38 + description: Maximum sampling rate, it depends on SoC. 39 + 40 + atmel,startup-time-ms: 41 + description: Startup time expressed in ms, it depends on SoC. 42 + 43 + atmel,trigger-edge-type: 44 + $ref: '/schemas/types.yaml#/definitions/uint32' 45 + description: 46 + One of possible edge types for the ADTRG hardware trigger pin. 47 + When the specific edge type is detected, the conversion will 48 + start. Should be one of IRQ_TYPE_EDGE_RISING, IRQ_TYPE_EDGE_FALLING 49 + or IRQ_TYPE_EDGE_BOTH. 50 + enum: [1, 2, 3] 51 + 52 + dmas: 53 + maxItems: 1 54 + 55 + dma-names: 56 + const: rx 57 + 58 + "#io-channel-cells": 59 + const: 1 60 + 61 + additionalProperties: false 62 + 63 + required: 64 + - compatible 65 + - reg 66 + - interrupts 67 + - clocks 68 + - clock-names 69 + - vref-supply 70 + - vddana-supply 71 + - atmel,min-sample-rate-hz 72 + - atmel,max-sample-rate-hz 73 + - atmel,startup-time-ms 74 + - atmel,trigger-edge-type 75 + 76 + examples: 77 + - | 78 + #include <dt-bindings/dma/at91.h> 79 + #include <dt-bindings/interrupt-controller/irq.h> 80 + soc { 81 + #address-cells = <1>; 82 + #size-cells = <1>; 83 + 84 + adc@fc030000 { 85 + compatible = "atmel,sama5d2-adc"; 86 + reg = <0xfc030000 0x100>; 87 + interrupts = <40 IRQ_TYPE_LEVEL_HIGH 7>; 88 + clocks = <&adc_clk>; 89 + clock-names = "adc_clk"; 90 + atmel,min-sample-rate-hz = <200000>; 91 + atmel,max-sample-rate-hz = <20000000>; 92 + atmel,startup-time-ms = <4>; 93 + vddana-supply = <&vdd_3v3_lp_reg>; 94 + vref-supply = <&vdd_3v3_lp_reg>; 95 + atmel,trigger-edge-type = <IRQ_TYPE_EDGE_BOTH>; 96 + dmas = <&dma0 (AT91_XDMAC_DT_MEM_IF(0) | AT91_XDMAC_DT_PER_IF(1) | AT91_XDMAC_DT_PERID(25))>; 97 + dma-names = "rx"; 98 + #io-channel-cells = <1>; 99 + }; 100 + }; 101 + ...
-48
Documentation/devicetree/bindings/iio/adc/axp20x_adc.txt
··· 1 - * X-Powers AXP ADC bindings 2 - 3 - Required properties: 4 - - compatible: should be one of: 5 - - "x-powers,axp209-adc", 6 - - "x-powers,axp221-adc", 7 - - "x-powers,axp813-adc", 8 - - #io-channel-cells: should be 1, 9 - 10 - Example: 11 - 12 - &axp22x { 13 - adc { 14 - compatible = "x-powers,axp221-adc"; 15 - #io-channel-cells = <1>; 16 - }; 17 - }; 18 - 19 - ADC channels and their indexes per variant: 20 - 21 - AXP209 22 - ------ 23 - 0 | acin_v 24 - 1 | acin_i 25 - 2 | vbus_v 26 - 3 | vbus_i 27 - 4 | pmic_temp 28 - 5 | gpio0_v 29 - 6 | gpio1_v 30 - 7 | ipsout_v 31 - 8 | batt_v 32 - 9 | batt_chrg_i 33 - 10 | batt_dischrg_i 34 - 35 - AXP22x 36 - ------ 37 - 0 | pmic_temp 38 - 1 | batt_v 39 - 2 | batt_chrg_i 40 - 3 | batt_dischrg_i 41 - 42 - AXP813 43 - ------ 44 - 0 | pmic_temp 45 - 1 | gpio0_v 46 - 2 | batt_v 47 - 3 | batt_chrg_i 48 - 4 | batt_dischrg_i
+31
Documentation/devicetree/bindings/iio/adc/mediatek,mt6360-adc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/adc/mediatek,mt6360-adc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Mediatek MT6360 and similar ADCs 8 + 9 + maintainers: 10 + - Gene Chen <gene_chen@richtek.com> 11 + 12 + properties: 13 + compatible: 14 + const: mediatek,mt6360-adc 15 + 16 + "#io-channel-cells": 17 + const: 1 18 + 19 + required: 20 + - compatible 21 + - "#io-channel-cells" 22 + 23 + additionalProperties: false 24 + 25 + examples: 26 + - | 27 + adc { 28 + compatible = "mediatek,mt6360-adc"; 29 + #io-channel-cells = <1>; 30 + }; 31 + ...
+1
Documentation/devicetree/bindings/iio/adc/mt6577_auxadc.txt
··· 17 17 - "mediatek,mt7622-auxadc": For MT7622 family of SoCs 18 18 - "mediatek,mt8173-auxadc": For MT8173 family of SoCs 19 19 - "mediatek,mt8183-auxadc", "mediatek,mt8173-auxadc": For MT8183 family of SoCs 20 + - "mediatek,mt8516-auxadc", "mediatek,mt8173-auxadc": For MT8516 family of SoCs 20 21 - reg: Address range of the AUXADC unit. 21 22 - clocks: Should contain a clock specifier for each entry in clock-names 22 23 - clock-names: Should contain "main".
-98
Documentation/devicetree/bindings/iio/adc/renesas,gyroadc.txt
··· 1 - * Renesas R-Car GyroADC device driver 2 - 3 - The GyroADC block is a reduced SPI block with up to 8 chipselect lines, 4 - which supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs 5 - are sampled by the GyroADC block in a round-robin fashion and the result 6 - presented in the GyroADC registers. 7 - 8 - Required properties: 9 - - compatible: Should be "<soc-specific>", "renesas,rcar-gyroadc". 10 - The <soc-specific> should be one of: 11 - renesas,r8a7791-gyroadc - for the GyroADC block present 12 - in r8a7791 SoC 13 - renesas,r8a7792-gyroadc - for the GyroADC with interrupt 14 - block present in r8a7792 SoC 15 - - reg: Address and length of the register set for the device 16 - - clocks: References to all the clocks specified in the clock-names 17 - property as specified in 18 - Documentation/devicetree/bindings/clock/clock-bindings.txt. 19 - - clock-names: Shall contain "fck". The "fck" is the GyroADC block clock. 20 - - power-domains: Must contain a reference to the PM domain, if available. 21 - - #address-cells: Should be <1> (setting for the subnodes) for all ADCs 22 - except for "fujitsu,mb88101a". Should be <0> (setting for 23 - only subnode) for "fujitsu,mb88101a". 24 - - #size-cells: Should be <0> (setting for the subnodes) 25 - 26 - Sub-nodes: 27 - You must define subnode(s) which select the connected ADC type and reference 28 - voltage for the GyroADC channels. 29 - 30 - Required properties for subnodes: 31 - - compatible: Should be either of: 32 - "fujitsu,mb88101a" 33 - - Fujitsu MB88101A compatible mode, 34 - 12bit sampling, up to 4 channels can be sampled in 35 - round-robin fashion. One Fujitsu chip supplies four 36 - GyroADC channels with data as it contains four ADCs 37 - on the chip and thus for 4-channel operation, single 38 - MB88101A is required. The Cx chipselect lines of the 39 - MB88101A connect directly to two CHS lines of the 40 - GyroADC, no demuxer is required. The data out line 41 - of each MB88101A connects to a shared input pin of 42 - the GyroADC. 43 - "ti,adcs7476" or "ti,adc121" or "adi,ad7476" 44 - - TI ADCS7476 / TI ADC121 / ADI AD7476 compatible mode, 45 - 15bit sampling, up to 8 channels can be sampled in 46 - round-robin fashion. One TI/ADI chip supplies single 47 - ADC channel with data, thus for 8-channel operation, 48 - 8 chips are required. A 3:8 chipselect demuxer is 49 - required to connect the nCS line of the TI/ADI chips 50 - to the GyroADC, while MISO line of each TI/ADI ADC 51 - connects to a shared input pin of the GyroADC. 52 - "maxim,max1162" or "maxim,max11100" 53 - - Maxim MAX1162 / Maxim MAX11100 compatible mode, 54 - 16bit sampling, up to 8 channels can be sampled in 55 - round-robin fashion. One Maxim chip supplies single 56 - ADC channel with data, thus for 8-channel operation, 57 - 8 chips are required. A 3:8 chipselect demuxer is 58 - required to connect the nCS line of the MAX chips 59 - to the GyroADC, while MISO line of each Maxim ADC 60 - connects to a shared input pin of the GyroADC. 61 - - reg: Should be the number of the analog input. Should be present 62 - for all ADCs except "fujitsu,mb88101a". 63 - - vref-supply: Reference to the channel reference voltage regulator. 64 - 65 - Example: 66 - vref_max1162: regulator-vref-max1162 { 67 - compatible = "regulator-fixed"; 68 - 69 - regulator-name = "MAX1162 Vref"; 70 - regulator-min-microvolt = <4096000>; 71 - regulator-max-microvolt = <4096000>; 72 - }; 73 - 74 - adc@e6e54000 { 75 - compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc"; 76 - reg = <0 0xe6e54000 0 64>; 77 - clocks = <&mstp9_clks R8A7791_CLK_GYROADC>; 78 - clock-names = "fck"; 79 - power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 80 - 81 - pinctrl-0 = <&adc_pins>; 82 - pinctrl-names = "default"; 83 - 84 - #address-cells = <1>; 85 - #size-cells = <0>; 86 - 87 - adc@0 { 88 - reg = <0>; 89 - compatible = "maxim,max1162"; 90 - vref-supply = <&vref_max1162>; 91 - }; 92 - 93 - adc@1 { 94 - reg = <1>; 95 - compatible = "maxim,max1162"; 96 - vref-supply = <&vref_max1162>; 97 - }; 98 - };
+143
Documentation/devicetree/bindings/iio/adc/renesas,rcar-gyroadc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/adc/renesas,rcar-gyroadc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Renesas R-Car GyroADC 8 + 9 + maintainers: 10 + - Marek Vasut <marek.vasut+renesas@gmail.com> 11 + 12 + description: | 13 + The GyroADC block is a reduced SPI block with up to 8 chipselect lines, 14 + which supports the SPI protocol of a selected few SPI ADCs. The SPI ADCs 15 + are sampled by the GyroADC block in a round-robin fashion and the result 16 + presented in the GyroADC registers. 17 + The ADC bindings should match with that of the devices connected to a 18 + full featured SPI bus. 19 + 20 + properties: 21 + compatible: 22 + items: 23 + - enum: 24 + - renesas,r8a7791-gyroadc 25 + - renesas,r8a7792-gyroadc 26 + - const: renesas,rcar-gyroadc 27 + 28 + reg: 29 + maxItems: 1 30 + 31 + clocks: 32 + maxItems: 1 33 + 34 + clock-names: 35 + const: fck 36 + 37 + power-domains: true 38 + 39 + resets: true 40 + 41 + "#address-cells": 42 + const: 1 43 + 44 + "#size-cells": 45 + const: 0 46 + 47 + additionalProperties: false 48 + 49 + required: 50 + - compatible 51 + - reg 52 + - clocks 53 + - clock-names 54 + - "#address-cells" 55 + - "#size-cells" 56 + 57 + patternProperties: 58 + "@[0-7]$": 59 + type: object 60 + properties: 61 + compatible: 62 + description: | 63 + fujitsu,mb88101a 64 + - Fujitsu MB88101A compatible mode, 65 + 12bit sampling, up to 4 channels can be sampled in round-robin 66 + fashion. One Fujitsu chip supplies four GyroADC channels with 67 + data as it contains four ADCs on the chip and thus for 4-channel 68 + operation, single MB88101A is required. The Cx chipselect lines 69 + of the MB88101A connect directly to two CHS lines of the GyroADC, 70 + no demuxer is required. The data out line of each MB88101A 71 + connects to a shared input pin of the GyroADC. 72 + ti,adcs7476 or ti,adc121 or adi,ad7476 73 + - TI ADCS7476 / TI ADC121 / ADI AD7476 compatible mode, 15bit 74 + sampling, up to 8 channels can be sampled in round-robin 75 + fashion. One TI/ADI chip supplies single ADC channel with data, 76 + thus for 8-channel operation, 8 chips are required. 77 + A 3:8 chipselect demuxer is required to connect the nCS line 78 + of the TI/ADI chips to the GyroADC, while MISO line of each 79 + TI/ADI ADC connects to a shared input pin of the GyroADC. 80 + maxim,max1162 or maxim,max11100 81 + - Maxim MAX1162 / Maxim MAX11100 compatible mode, 16bit sampling, 82 + up to 8 channels can be sampled in round-robin fashion. One 83 + Maxim chip supplies single ADC channel with data, thus for 84 + 8-channel operation, 8 chips are required. 85 + A 3:8 chipselect demuxer is required to connect the nCS line 86 + of the MAX chips to the GyroADC, while MISO line of each Maxim 87 + ADC connects to a shared input pin of the GyroADC. 88 + enum: 89 + - adi,7476 90 + - fujitsu,mb88101a 91 + - maxim,max1162 92 + - maxim,max11100 93 + - ti,adcs7476 94 + - ti,adc121 95 + 96 + reg: 97 + minimum: 0 98 + maximum: 7 99 + 100 + vref-supply: true 101 + 102 + additionalProperties: false 103 + 104 + required: 105 + - compatible 106 + - reg 107 + - vref-supply 108 + 109 + examples: 110 + - | 111 + #include <dt-bindings/clock/r8a7791-clock.h> 112 + #include <dt-bindings/power/r8a7791-sysc.h> 113 + soc { 114 + #address-cells = <2>; 115 + #size-cells = <2>; 116 + 117 + adc@e6e54000 { 118 + compatible = "renesas,r8a7791-gyroadc", "renesas,rcar-gyroadc"; 119 + reg = <0 0xe6e54000 0 64>; 120 + clocks = <&mstp9_clks R8A7791_CLK_GYROADC>; 121 + clock-names = "fck"; 122 + power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; 123 + 124 + pinctrl-0 = <&adc_pins>; 125 + pinctrl-names = "default"; 126 + 127 + #address-cells = <1>; 128 + #size-cells = <0>; 129 + 130 + adc@0 { 131 + reg = <0>; 132 + compatible = "maxim,max1162"; 133 + vref-supply = <&vref_max1162>; 134 + }; 135 + 136 + adc@1 { 137 + reg = <1>; 138 + compatible = "maxim,max1162"; 139 + vref-supply = <&vref_max1162>; 140 + }; 141 + }; 142 + }; 143 + ...
+58
Documentation/devicetree/bindings/iio/adc/ti,adc084s021.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/adc/ti,adc084s021.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments ADC084S021 ADC 8 + 9 + maintainers: 10 + - Mårten Lindahl <martenli@axis.com> 11 + 12 + description: | 13 + 8 bit ADC with 4 channels 14 + 15 + properties: 16 + compatible: 17 + const: ti,adc084s021 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + spi-max-frequency: true 23 + 24 + vref-supply: 25 + description: External reference, needed to establish input scaling 26 + 27 + spi-cpol: true 28 + spi-cpha: true 29 + 30 + "#io-channel-cells": 31 + const: 1 32 + 33 + required: 34 + - compatible 35 + - reg 36 + - vref-supply 37 + - spi-cpol 38 + - spi-cpha 39 + 40 + additionalProperties: false 41 + 42 + examples: 43 + - | 44 + spi { 45 + #address-cells = <1>; 46 + #size-cells = <0>; 47 + 48 + adc@0 { 49 + compatible = "ti,adc084s021"; 50 + reg = <0>; 51 + vref-supply = <&adc_vref>; 52 + spi-cpol; 53 + spi-cpha; 54 + spi-max-frequency = <16000000>; 55 + #io-channel-cells = <1>; 56 + }; 57 + }; 58 + ...
-19
Documentation/devicetree/bindings/iio/adc/ti-adc084s021.txt
··· 1 - * Texas Instruments' ADC084S021 2 - 3 - Required properties: 4 - - compatible : Must be "ti,adc084s021" 5 - - reg : SPI chip select number for the device 6 - - vref-supply : The regulator supply for ADC reference voltage 7 - - spi-cpol : Per spi-bus bindings 8 - - spi-cpha : Per spi-bus bindings 9 - - spi-max-frequency : Per spi-bus bindings 10 - 11 - Example: 12 - adc@0 { 13 - compatible = "ti,adc084s021"; 14 - reg = <0>; 15 - vref-supply = <&adc_vref>; 16 - spi-cpol; 17 - spi-cpha; 18 - spi-max-frequency = <16000000>; 19 - };
+67
Documentation/devicetree/bindings/iio/adc/x-powers,axp209-adc.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/adc/x-powers,axp209-adc.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: X-Powers AXP ADC bindings 8 + 9 + maintainers: 10 + - Chen-Yu Tsai <wens@csie.org> 11 + 12 + description: | 13 + ADC is frequently used as a provider to consumers of the ADC channels. 14 + Device is a child of an axp209 multifunction device 15 + ADC channels and their indexes per variant: 16 + 17 + AXP209 18 + ------ 19 + 0 | acin_v 20 + 1 | acin_i 21 + 2 | vbus_v 22 + 3 | vbus_i 23 + 4 | pmic_temp 24 + 5 | gpio0_v 25 + 6 | gpio1_v 26 + 7 | ipsout_v 27 + 8 | batt_v 28 + 9 | batt_chrg_i 29 + 10 | batt_dischrg_i 30 + 31 + AXP22x 32 + ------ 33 + 0 | pmic_temp 34 + 1 | batt_v 35 + 2 | batt_chrg_i 36 + 3 | batt_dischrg_i 37 + 38 + AXP813 39 + ------ 40 + 0 | pmic_temp 41 + 1 | gpio0_v 42 + 2 | batt_v 43 + 3 | batt_chrg_i 44 + 4 | batt_dischrg_i 45 + 46 + 47 + properties: 48 + compatible: 49 + enum: 50 + - x-powers,axp209-adc 51 + - x-powers,axp221-adc 52 + - x-powers,axp813-adc 53 + 54 + "#io-channel-cells": 55 + const: 1 56 + 57 + additionalProperties: false 58 + 59 + examples: 60 + - | 61 + axp221 { 62 + adc { 63 + compatible = "x-powers,axp221-adc"; 64 + #io-channel-cells = <1>; 65 + }; 66 + }; 67 + ...
-11
Documentation/devicetree/bindings/iio/chemical/bme680.txt
··· 1 - Bosch Sensortec BME680 pressure/temperature/humidity/voc sensors 2 - 3 - Required properties: 4 - - compatible: must be "bosch,bme680" 5 - 6 - Example: 7 - 8 - bme680@76 { 9 - compatible = "bosch,bme680"; 10 - reg = <0x76>; 11 - };
-15
Documentation/devicetree/bindings/iio/chemical/sensirion,sgp30.txt
··· 1 - * Sensirion SGP30/SGPC3 multi-pixel Gas Sensor 2 - 3 - Required properties: 4 - 5 - - compatible: must be one of 6 - "sensirion,sgp30" 7 - "sensirion,sgpc3" 8 - - reg: the I2C address of the sensor 9 - 10 - Example: 11 - 12 - gas@58 { 13 - compatible = "sensirion,sgp30"; 14 - reg = <0x58>; 15 - };
-83
Documentation/devicetree/bindings/iio/dac/ad5758.txt
··· 1 - Analog Devices AD5758 DAC device driver 2 - 3 - Required properties for the AD5758: 4 - - compatible: Must be "adi,ad5758" 5 - - reg: SPI chip select number for the device 6 - - spi-max-frequency: Max SPI frequency to use (< 50000000) 7 - - spi-cpha: is the only mode that is supported 8 - 9 - Required properties: 10 - 11 - - adi,dc-dc-mode: Mode of operation of the dc-to-dc converter 12 - Dynamic Power Control (DPC) 13 - In this mode, the AD5758 circuitry senses the output 14 - voltage and dynamically regulates the supply voltage, 15 - VDPC+, to meet compliance requirements plus an optimized 16 - headroom voltage for the output buffer. 17 - 18 - Programmable Power Control (PPC) 19 - In this mode, the VDPC+ voltage is user-programmable to 20 - a fixed level that needs to accommodate the maximum output 21 - load required. 22 - 23 - The output of the DAC core is either converted to a 24 - current or voltage output at the VIOUT pin. Only one mode 25 - can be enabled at any one time. 26 - 27 - The following values are currently supported: 28 - * 1: DPC current mode 29 - * 2: DPC voltage mode 30 - * 3: PPC current mode 31 - 32 - Depending on the selected output mode (voltage or current) one of the 33 - two properties must 34 - be present: 35 - 36 - - adi,range-microvolt: Voltage output range 37 - The array of voltage output ranges must contain two fields: 38 - * <0 5000000>: 0 V to 5 V voltage range 39 - * <0 10000000>: 0 V to 10 V voltage range 40 - * <(-5000000) 5000000>: ±5 V voltage range 41 - * <(-10000000) 10000000>: ±10 V voltage range 42 - - adi,range-microamp: Current output range 43 - The array of current output ranges must contain two fields: 44 - * <0 20000>: 0 mA to 20 mA current range 45 - * <0 24000>: 0 mA to 24 mA current range 46 - * <4 24000>: 4 mA to 20 mA current range 47 - * <(-20000) 20000>: ±20 mA current range 48 - * <(-24000) 24000>: ±24 mA current range 49 - * <(-1000) 22000>: −1 mA to +22 mA current range 50 - 51 - Optional properties: 52 - 53 - - reset-gpios : GPIO spec for the RESET pin. If specified, it will be 54 - asserted during driver probe. 55 - 56 - - adi,dc-dc-ilim-microamp: The dc-to-dc converter current limit 57 - The following values are currently supported [uA]: 58 - * 150000 59 - * 200000 60 - * 250000 61 - * 300000 62 - * 350000 63 - * 400000 64 - 65 - - adi,slew-time-us: The time it takes for the output to reach the 66 - full scale [uS] 67 - The supported range is between 133us up to 1023984375us 68 - 69 - AD5758 Example: 70 - 71 - dac@0 { 72 - compatible = "adi,ad5758"; 73 - reg = <0>; 74 - spi-max-frequency = <1000000>; 75 - spi-cpha; 76 - 77 - reset-gpios = <&gpio 22 0>; 78 - 79 - adi,dc-dc-mode = <2>; 80 - adi,range-microvolt = <0 10000000>; 81 - adi,dc-dc-ilim-microamp = <200000>; 82 - adi,slew-time-us = <125000>; 83 - };
-23
Documentation/devicetree/bindings/iio/dac/ad7303.txt
··· 1 - Analog Devices AD7303 DAC device driver 2 - 3 - Required properties: 4 - - compatible: Must be "adi,ad7303" 5 - - reg: SPI chip select number for the device 6 - - spi-max-frequency: Max SPI frequency to use (< 30000000) 7 - - Vdd-supply: Phandle to the Vdd power supply 8 - 9 - Optional properties: 10 - - REF-supply: Phandle to the external reference voltage supply. This should 11 - only be set if there is an external reference voltage connected to the REF 12 - pin. If the property is not set Vdd/2 is used as the reference voltage. 13 - 14 - Example: 15 - 16 - ad7303@4 { 17 - compatible = "adi,ad7303"; 18 - reg = <4>; 19 - spi-max-frequency = <10000000>; 20 - Vdd-supply = <&vdd_supply>; 21 - adi,use-external-reference; 22 - REF-supply = <&vref_supply>; 23 - };
+57
Documentation/devicetree/bindings/iio/dac/adi,ad5686.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/adi,ad5686.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices AD5686 and similar multi-channel DACs 8 + 9 + maintainers: 10 + - Michael Auchter <michael.auchter@ni.com> 11 + 12 + description: | 13 + Binding for Analog Devices AD5686 and similar multi-channel DACs 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - adi,ad5311r 19 + - adi,ad5338r 20 + - adi,ad5671r 21 + - adi,ad5675r 22 + - adi,ad5691r 23 + - adi,ad5692r 24 + - adi,ad5693 25 + - adi,ad5693r 26 + - adi,ad5694 27 + - adi,ad5694r 28 + - adi,ad5695r 29 + - adi,ad5696 30 + - adi,ad5696r 31 + 32 + reg: 33 + maxItems: 1 34 + 35 + vcc-supply: 36 + description: | 37 + The regulator supply for DAC reference voltage. 38 + 39 + required: 40 + - compatible 41 + - reg 42 + 43 + additionalProperties: false 44 + 45 + examples: 46 + - | 47 + i2c { 48 + #address-cells = <1>; 49 + #size-cells = <0>; 50 + 51 + ad5686: dac@0 { 52 + compatible = "adi,ad5686"; 53 + reg = <0>; 54 + vcc-supply = <&dac_vref>; 55 + }; 56 + }; 57 + ...
+129
Documentation/devicetree/bindings/iio/dac/adi,ad5758.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/adi,ad5758.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices AD5758 DAC 8 + 9 + maintainers: 10 + - Michael Hennerich <Michael.Hennerich@analog.com> 11 + 12 + properties: 13 + compatible: 14 + const: adi,ad5758 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + spi-max-frequency: true 20 + spi-cpha: true 21 + 22 + adi,dc-dc-mode: 23 + $ref: /schemas/types.yaml#/definitions/uint32 24 + enum: [1, 2, 3] 25 + description: | 26 + Mode of operation of the dc-to-dc converter 27 + Dynamic Power Control (DPC) 28 + In this mode, the AD5758 circuitry senses the output voltage and 29 + dynamically regulates the supply voltage, VDPC+, to meet compliance 30 + requirements plus an optimized headroom voltage for the output buffer. 31 + 32 + Programmable Power Control (PPC) 33 + In this mode, the VDPC+ voltage is user-programmable to a fixed level 34 + that needs to accommodate the maximum output load required. 35 + 36 + The output of the DAC core is either converted to a current or 37 + voltage output at the VIOUT pin. Only one mode can be enabled at 38 + any one time. 39 + 40 + The following values are currently supported: 41 + * 1: DPC current mode 42 + * 2: DPC voltage mode 43 + * 3: PPC current mode 44 + 45 + Depending on the selected output mode (voltage or current) one of the 46 + two properties must be present: 47 + 48 + adi,range-microvolt: 49 + $ref: /schemas/types.yaml#/definitions/int32-array 50 + description: | 51 + Voltage output range specified as <minimum, maximum> 52 + enum: 53 + - [[0, 5000000]] 54 + - [[0, 10000000]] 55 + - [[-5000000, 5000000]] 56 + - [[-10000000, 10000000]] 57 + 58 + adi,range-microamp: 59 + $ref: /schemas/types.yaml#/definitions/int32-array 60 + description: | 61 + Current output range specified as <minimum, maximum> 62 + enum: 63 + - [[0, 20000]] 64 + - [[0, 24000]] 65 + - [[4, 24000]] 66 + - [[-20000, 20000]] 67 + - [[-24000, 24000]] 68 + - [[-1000, 22000]] 69 + 70 + reset-gpios: true 71 + 72 + adi,dc-dc-ilim-microamp: 73 + $ref: /schemas/types.yaml#/definitions/uint32 74 + enum: [150000, 200000, 250000, 300000, 350000, 400000] 75 + description: | 76 + The dc-to-dc converter current limit. 77 + 78 + adi,slew-time-us: 79 + description: | 80 + The time it takes for the output to reach the full scale [uS] 81 + minimum: 133 82 + maximum: 1023984375 83 + 84 + required: 85 + - compatible 86 + - reg 87 + - spi-cpha 88 + - adi,dc-dc-mode 89 + 90 + allOf: 91 + - if: 92 + properties: 93 + adi,dc-dc-mode: 94 + contains: 95 + enum: [1, 3] 96 + then: 97 + properties: 98 + adi,range-microvolt: false 99 + required: 100 + - adi,range-microamp 101 + else: 102 + properties: 103 + adi,range-microamp: false 104 + required: 105 + - adi,range-microvolt 106 + 107 + additionalProperties: false 108 + 109 + examples: 110 + - | 111 + spi { 112 + #address-cells = <1>; 113 + #size-cells = <0>; 114 + 115 + dac@0 { 116 + compatible = "adi,ad5758"; 117 + reg = <0>; 118 + spi-max-frequency = <1000000>; 119 + spi-cpha; 120 + 121 + reset-gpios = <&gpio 22 0>; 122 + 123 + adi,dc-dc-mode = <2>; 124 + adi,range-microvolt = <0 10000000>; 125 + adi,dc-dc-ilim-microamp = <200000>; 126 + adi,slew-time-us = <125000>; 127 + }; 128 + }; 129 + ...
+50
Documentation/devicetree/bindings/iio/dac/adi,ad7303.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/adi,ad7303.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices AD7303 DAC 8 + 9 + maintainers: 10 + - Lars-Peter Clausen <lars@metafoo.de> 11 + 12 + properties: 13 + compatible: 14 + const: adi,ad7303 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + Vdd-supply: 20 + description: 21 + Used to calculate output channel scalling if REF-supply not specified. 22 + REF-supply: 23 + description: 24 + If not provided, Vdd/2 is used as the reference voltage. 25 + 26 + spi-max-frequency: 27 + maximum: 30000000 28 + 29 + required: 30 + - compatible 31 + - reg 32 + - Vdd-supply 33 + 34 + additionalProperties: false 35 + 36 + examples: 37 + - | 38 + spi { 39 + #address-cells = <1>; 40 + #size-cells = <0>; 41 + 42 + dac@4 { 43 + compatible = "adi,ad7303"; 44 + reg = <4>; 45 + spi-max-frequency = <10000000>; 46 + Vdd-supply = <&vdd_supply>; 47 + REF-supply = <&vref_supply>; 48 + }; 49 + }; 50 + ...
-20
Documentation/devicetree/bindings/iio/dac/ds4424.txt
··· 1 - Maxim Integrated DS4422/DS4424 7-bit Sink/Source Current DAC Device Driver 2 - 3 - Datasheet publicly available at: 4 - https://datasheets.maximintegrated.com/en/ds/DS4422-DS4424.pdf 5 - 6 - Required properties: 7 - - compatible: Should be one of 8 - maxim,ds4422 9 - maxim,ds4424 10 - - reg: Should contain the DAC I2C address 11 - 12 - Optional properties: 13 - - vcc-supply: Power supply is optional. If not defined, driver will ignore it. 14 - 15 - Example: 16 - ds4224@10 { 17 - compatible = "maxim,ds4424"; 18 - reg = <0x10>; /* When A0, A1 pins are ground */ 19 - vcc-supply = <&vcc_3v3>; 20 - };
+55
Documentation/devicetree/bindings/iio/dac/fsl,vf610-dac.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/fsl,vf610-dac.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Freescale vf610 Digital to Analog Converter 8 + 9 + maintainers: 10 + - Sanchayan Maity <maitysanchayan@gmail.com> 11 + 12 + properties: 13 + compatible: 14 + const: fsl,vf610-dac 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + interrupts: 20 + maxItems: 1 21 + 22 + clocks: 23 + maxItems: 1 24 + 25 + clock-names: 26 + const: dac 27 + 28 + required: 29 + - compatible 30 + - reg 31 + - interrupts 32 + - clocks 33 + - clock-names 34 + 35 + additionalProperties: false 36 + 37 + examples: 38 + - | 39 + #include <dt-bindings/interrupt-controller/irq.h> 40 + #include <dt-bindings/clock/vf610-clock.h> 41 + bus@40000000 { 42 + compatible = "fsl,aips-bus", "simple-bus"; 43 + reg = <0x40000000 0x00070000>; 44 + ranges; 45 + #address-cells = <1>; 46 + #size-cells = <1>; 47 + dac@400cc000 { 48 + compatible = "fsl,vf610-dac"; 49 + reg = <0x400cc000 0x1000>; 50 + interrupts = <55 IRQ_TYPE_LEVEL_HIGH>; 51 + clock-names = "dac"; 52 + clocks = <&clks VF610_CLK_DAC0>; 53 + }; 54 + }; 55 + ...
-19
Documentation/devicetree/bindings/iio/dac/lpc1850-dac.txt
··· 1 - NXP LPC1850 DAC bindings 2 - 3 - Required properties: 4 - - compatible: Should be "nxp,lpc1850-dac" 5 - - reg: Offset and length of the register set for the ADC device 6 - - interrupts: The interrupt number for the ADC device 7 - - clocks: The root clock of the ADC controller 8 - - vref-supply: The regulator supply ADC reference voltage 9 - - resets: phandle to reset controller and line specifier 10 - 11 - Example: 12 - dac: dac@400e1000 { 13 - compatible = "nxp,lpc1850-dac"; 14 - reg = <0x400e1000 0x1000>; 15 - interrupts = <0>; 16 - clocks = <&ccu1 CLK_APB3_DAC>; 17 - vref-supply = <&reg_vdda>; 18 - resets = <&rgu 42>; 19 - };
-14
Documentation/devicetree/bindings/iio/dac/max5821.txt
··· 1 - Maxim max5821 DAC device driver 2 - 3 - Required properties: 4 - - compatible: Must be "maxim,max5821" 5 - - reg: Should contain the DAC I2C address 6 - - vref-supply: Phandle to the vref power supply 7 - 8 - Example: 9 - 10 - max5821@38 { 11 - compatible = "maxim,max5821"; 12 - reg = <0x38>; 13 - vref-supply = <&reg_max5821>; 14 - };
+45
Documentation/devicetree/bindings/iio/dac/maxim,ds4424.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/maxim,ds4424.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Maxim Integrated DS4422/DS4424 7-bit Sink/Source Current DAC 8 + 9 + maintainers: 10 + - Ismail Kose <ihkose@gmail.com> 11 + 12 + description: | 13 + Datasheet publicly available at: 14 + https://datasheets.maximintegrated.com/en/ds/DS4422-DS4424.pdf 15 + 16 + properties: 17 + compatible: 18 + enum: 19 + - maxim,ds4422 20 + - maxim,ds4424 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + vcc-supply: true 26 + 27 + required: 28 + - compatible 29 + - reg 30 + 31 + additionalProperties: false 32 + 33 + examples: 34 + - | 35 + i2c { 36 + #address-cells = <1>; 37 + #size-cells = <0>; 38 + 39 + dac@10 { 40 + compatible = "maxim,ds4424"; 41 + reg = <0x10>; /* When A0, A1 pins are ground */ 42 + vcc-supply = <&vcc_3v3>; 43 + }; 44 + }; 45 + ...
+44
Documentation/devicetree/bindings/iio/dac/maxim,max5821.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/maxim,max5821.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Maxim max5821 dual 10-bit DAC 8 + 9 + maintainers: 10 + - Philippe Reynes <tremyfr@yahoo.fr> 11 + 12 + description: | 13 + Datasheet publicly available at: 14 + https://datasheets.maximintegrated.com/en/ds/MAX5821.pdf 15 + 16 + properties: 17 + compatible: 18 + const: maxim,max5821 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + vref-supply: true 24 + 25 + required: 26 + - compatible 27 + - reg 28 + - vref-supply 29 + 30 + additionalProperties: false 31 + 32 + examples: 33 + - | 34 + i2c { 35 + #address-cells = <1>; 36 + #size-cells = <0>; 37 + 38 + dac@38 { 39 + compatible = "maxim,max5821"; 40 + reg = <0x38>; 41 + vref-supply = <&reg_max5821>; 42 + }; 43 + }; 44 + ...
-35
Documentation/devicetree/bindings/iio/dac/mcp4725.txt
··· 1 - Microchip mcp4725 and mcp4726 DAC device driver 2 - 3 - Required properties: 4 - - compatible: Must be "microchip,mcp4725" or "microchip,mcp4726" 5 - - reg: Should contain the DAC I2C address 6 - - vdd-supply: Phandle to the Vdd power supply. This supply is used as a 7 - voltage reference on mcp4725. It is used as a voltage reference on 8 - mcp4726 if there is no vref-supply specified. 9 - 10 - Optional properties (valid only for mcp4726): 11 - - vref-supply: Optional phandle to the Vref power supply. Vref pin is 12 - used as a voltage reference when this supply is specified. 13 - - microchip,vref-buffered: Boolean to enable buffering of the external 14 - Vref pin. This boolean is not valid without the vref-supply. Quoting 15 - the datasheet: This is offered in cases where the reference voltage 16 - does not have the current capability not to drop its voltage when 17 - connected to the internal resistor ladder circuit. 18 - 19 - Examples: 20 - 21 - /* simple mcp4725 */ 22 - mcp4725@60 { 23 - compatible = "microchip,mcp4725"; 24 - reg = <0x60>; 25 - vdd-supply = <&vdac_vdd>; 26 - }; 27 - 28 - /* mcp4726 with the buffered external reference voltage */ 29 - mcp4726@60 { 30 - compatible = "microchip,mcp4726"; 31 - reg = <0x60>; 32 - vdd-supply = <&vdac_vdd>; 33 - vref-supply = <&vdac_vref>; 34 - microchip,vref-buffered; 35 - };
+71
Documentation/devicetree/bindings/iio/dac/microchip,mcp4725.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/microchip,mcp4725.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Microchip mcp4725 and mcp4726 DAC 8 + 9 + maintainers: 10 + - Tomas Novotny <tomas@novotny.cz> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - microchip,mcp4725 16 + - microchip,mcp4726 17 + 18 + reg: 19 + maxItems: 1 20 + 21 + vdd-supply: 22 + description: | 23 + Provides both power and acts as the reference supply on the mcp4725. 24 + For the mcp4726 it will be used as the reference voltage if vref-supply 25 + is not provided. 26 + 27 + vref-supply: 28 + description: 29 + Vref pin is used as a voltage reference when this supply is specified. 30 + 31 + microchip,vref-buffered: 32 + type: boolean 33 + description: | 34 + Enable buffering of the external Vref pin. This boolean is not valid 35 + without the vref-supply. Quoting the datasheet: This is offered in 36 + cases where the reference voltage does not have the current 37 + capability not to drop its voltage when connected to the internal 38 + resistor ladder circuit. 39 + 40 + allOf: 41 + - if: 42 + not: 43 + properties: 44 + compatible: 45 + contains: 46 + const: microchip,mcp4726 47 + then: 48 + properties: 49 + vref-supply: false 50 + microchip,vref-buffered: false 51 + 52 + required: 53 + - compatible 54 + - reg 55 + - vdd-supply 56 + 57 + additionalProperties: false 58 + 59 + examples: 60 + - | 61 + i2c { 62 + #address-cells = <1>; 63 + #size-cells = <0>; 64 + 65 + mcp4725@60 { 66 + compatible = "microchip,mcp4725"; 67 + reg = <0x60>; 68 + vdd-supply = <&vdac_vdd>; 69 + }; 70 + }; 71 + ...
+58
Documentation/devicetree/bindings/iio/dac/nxp,lpc1850-dac.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/nxp,lpc1850-dac.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NXP LPC1850 DAC bindings 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + description: 13 + Supports the DAC found on the LPC1850 SoC. 14 + 15 + properties: 16 + compatible: 17 + const: nxp,lpc1850-dac 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + clocks: 26 + maxItems: 1 27 + 28 + vref-supply: true 29 + 30 + resets: 31 + maxItems: 1 32 + 33 + required: 34 + - compatible 35 + - reg 36 + - interrupts 37 + - clocks 38 + - vref-supply 39 + - resets 40 + 41 + additionalProperties: false 42 + 43 + examples: 44 + - | 45 + #include <dt-bindings/clock/lpc18xx-ccu.h> 46 + soc { 47 + #address-cells = <1>; 48 + #size-cells = <1>; 49 + dac: dac@400e1000 { 50 + compatible = "nxp,lpc1850-dac"; 51 + reg = <0x400e1000 0x1000>; 52 + interrupts = <0>; 53 + clocks = <&ccu1 CLK_APB3_DAC>; 54 + vref-supply = <&reg_vdda>; 55 + resets = <&rgu 42>; 56 + }; 57 + }; 58 + ...
-24
Documentation/devicetree/bindings/iio/dac/ti,dac5571.txt
··· 1 - * Texas Instruments DAC5571 Family 2 - 3 - Required properties: 4 - - compatible: Should contain 5 - "ti,dac5571" 6 - "ti,dac6571" 7 - "ti,dac7571" 8 - "ti,dac5574" 9 - "ti,dac6574" 10 - "ti,dac7574" 11 - "ti,dac5573" 12 - "ti,dac6573" 13 - "ti,dac7573" 14 - - reg: Should contain the DAC I2C address 15 - 16 - Optional properties: 17 - - vref-supply: The regulator supply for DAC reference voltage 18 - 19 - Example: 20 - dac@0 { 21 - compatible = "ti,dac5571"; 22 - reg = <0x4C>; 23 - vref-supply = <&vdd_supply>; 24 - };
+52
Documentation/devicetree/bindings/iio/dac/ti,dac5571.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/ti,dac5571.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments DAC5571 Family 8 + 9 + maintainers: 10 + - Sean Nyekjaer <sean@geanix.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - ti,dac5571 16 + - ti,dac6571 17 + - ti,dac7571 18 + - ti,dac5574 19 + - ti,dac6574 20 + - ti,dac7574 21 + - ti,dac5573 22 + - ti,dac6573 23 + - ti,dac7573 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + vref-supply: 29 + description: 30 + Reference voltage must be supplied to establish the scaling of the 31 + output voltage. 32 + 33 + required: 34 + - compatible 35 + - reg 36 + - vref-supply 37 + 38 + additionalProperties: false 39 + 40 + examples: 41 + - | 42 + i2c { 43 + #address-cells = <1>; 44 + #size-cells = <0>; 45 + 46 + dac@4c { 47 + compatible = "ti,dac5571"; 48 + reg = <0x4C>; 49 + vref-supply = <&vdd_supply>; 50 + }; 51 + }; 52 + ...
-23
Documentation/devicetree/bindings/iio/dac/ti,dac7311.txt
··· 1 - TI DAC7311 device tree bindings 2 - 3 - Required properties: 4 - - compatible: must be set to: 5 - * "ti,dac7311" 6 - * "ti,dac6311" 7 - * "ti,dac5311" 8 - - reg: spi chip select number for the device 9 - - vref-supply: The regulator supply for ADC reference voltage 10 - 11 - Optional properties: 12 - - spi-max-frequency: Max SPI frequency to use 13 - 14 - Example: 15 - 16 - spi_master { 17 - dac@0 { 18 - compatible = "ti,dac7311"; 19 - reg = <0>; /* CS0 */ 20 - spi-max-frequency = <1000000>; 21 - vref-supply = <&vdd_supply>; 22 - }; 23 - };
+49
Documentation/devicetree/bindings/iio/dac/ti,dac7311.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/ti,dac7311.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments DAC5311 and similar SPI DACs 8 + 9 + maintainers: 10 + - Charles-Antoine Couret <charles-antoine.couret@essensium.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - ti,dac7311 16 + - ti,dac6311 17 + - ti,dac5311 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + vref-supply: 23 + description: 24 + Reference voltage must be supplied to establish the scaling of the 25 + output voltage. 26 + 27 + spi-max-frequency: true 28 + 29 + required: 30 + - compatible 31 + - reg 32 + - vref-supply 33 + 34 + additionalProperties: false 35 + 36 + examples: 37 + - | 38 + spi { 39 + #address-cells = <1>; 40 + #size-cells = <0>; 41 + 42 + dac@0 { 43 + compatible = "ti,dac7311"; 44 + reg = <0>; /* CS0 */ 45 + spi-max-frequency = <1000000>; 46 + vref-supply = <&vdd_supply>; 47 + }; 48 + }; 49 + ...
-20
Documentation/devicetree/bindings/iio/dac/ti,dac7512.txt
··· 1 - TI DAC7512 DEVICETREE BINDINGS 2 - 3 - Required properties: 4 - 5 - - "compatible" Must be set to "ti,dac7512" 6 - 7 - Property rules described in Documentation/devicetree/bindings/spi/spi-bus.txt 8 - apply. In particular, "reg" and "spi-max-frequency" properties must be given. 9 - 10 - 11 - Example: 12 - 13 - spi_master { 14 - dac7512: dac7512@0 { 15 - compatible = "ti,dac7512"; 16 - reg = <0>; /* CS0 */ 17 - spi-max-frequency = <1000000>; 18 - }; 19 - }; 20 -
+42
Documentation/devicetree/bindings/iio/dac/ti,dac7512.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/ti,dac7512.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments DAC7512 DAC 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + properties: 13 + compatible: 14 + const: ti,dac7512 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + spi-max-frequency: 20 + description: 21 + Maximum frequency is reduced for supply voltage of less than 3.6V 22 + maximum: 30000000 23 + 24 + required: 25 + - compatible 26 + - reg 27 + 28 + additionalProperties: false 29 + 30 + examples: 31 + - | 32 + spi { 33 + #address-cells = <1>; 34 + #size-cells = <0>; 35 + 36 + dac@0 { 37 + compatible = "ti,dac7512"; 38 + reg = <0>; /* CS0 */ 39 + spi-max-frequency = <1000000>; 40 + }; 41 + }; 42 + ...
-28
Documentation/devicetree/bindings/iio/dac/ti,dac7612.txt
··· 1 - * Texas Instruments Dual, 12-Bit Serial Input Digital-to-Analog Converter 2 - 3 - The DAC7612 is a dual, 12-bit digital-to-analog converter (DAC) with guaranteed 4 - 12-bit monotonicity performance over the industrial temperature range. 5 - Is is programmable through an SPI interface. 6 - 7 - The internal DACs are loaded when the LOADDACS pin is pulled down. 8 - 9 - https://www.ti.com/lit/ds/sbas106/sbas106.pdf 10 - 11 - Required Properties: 12 - - compatible: Should be one of: 13 - "ti,dac7612" 14 - "ti,dac7612u" 15 - "ti,dac7612ub" 16 - - reg: Definition as per Documentation/devicetree/bindings/spi/spi-bus.txt 17 - 18 - Optional Properties: 19 - - ti,loaddacs-gpios: GPIO descriptor for the LOADDACS pin. 20 - - spi-*: Definition as per Documentation/devicetree/bindings/spi/spi-bus.txt 21 - 22 - Example: 23 - 24 - dac@1 { 25 - compatible = "ti,dac7612"; 26 - reg = <0x1>; 27 - ti,loaddacs-gpios = <&msmgpio 25 GPIO_ACTIVE_LOW>; 28 - };
+53
Documentation/devicetree/bindings/iio/dac/ti,dac7612.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/dac/ti,dac7612.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments DAC7612 family of DACs 8 + 9 + description: 10 + The DAC7612 is a dual, 12-bit digital-to-analog converter (DAC) with 11 + guaranteed 12-bit monotonicity performance over the industrial temperature 12 + range. Is is programmable through an SPI interface. 13 + 14 + maintainers: 15 + - Ricardo Ribalda Delgado <ricardo@ribalda.com> 16 + 17 + properties: 18 + compatible: 19 + enum: 20 + - ti,dac7612 21 + - ti,dac7612u 22 + - ti,dac7612ub 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + ti,loaddacs-gpios: 28 + description: 29 + DACs are loaded when the pin connected to this GPIO is pulled low. 30 + maxItems: 1 31 + 32 + spi-max-frequency: true 33 + 34 + required: 35 + - compatible 36 + - reg 37 + 38 + additionalProperties: false 39 + 40 + examples: 41 + - | 42 + #include <dt-bindings/gpio/gpio.h> 43 + spi { 44 + #address-cells = <1>; 45 + #size-cells = <0>; 46 + 47 + dac@1 { 48 + compatible = "ti,dac7612"; 49 + reg = <0x1>; 50 + ti,loaddacs-gpios = <&msmgpio 25 GPIO_ACTIVE_LOW>; 51 + }; 52 + }; 53 + ...
-20
Documentation/devicetree/bindings/iio/dac/vf610-dac.txt
··· 1 - Freescale vf610 Digital to Analog Converter bindings 2 - 3 - The devicetree bindings are for the new DAC driver written for 4 - vf610 SoCs from Freescale. 5 - 6 - Required properties: 7 - - compatible: Should contain "fsl,vf610-dac" 8 - - reg: Offset and length of the register set for the device 9 - - interrupts: Should contain the interrupt for the device 10 - - clocks: The clock is needed by the DAC controller 11 - - clock-names: Must contain "dac" matching entry in the clocks property. 12 - 13 - Example: 14 - dac0: dac@400cc000 { 15 - compatible = "fsl,vf610-dac"; 16 - reg = <0x400cc000 0x1000>; 17 - interrupts = <55 IRQ_TYPE_LEVEL_HIGH>; 18 - clock-names = "dac"; 19 - clocks = <&clks VF610_CLK_DAC0>; 20 - };
-31
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt
··· 1 - * NXP FXAS21002C Gyroscope device tree bindings 2 - 3 - http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C 4 - 5 - Required properties: 6 - - compatible : should be "nxp,fxas21002c" 7 - - reg : the I2C address of the sensor or SPI chip select number for the 8 - device. 9 - - vdd-supply: phandle to the regulator that provides power to the sensor. 10 - - vddio-supply: phandle to the regulator that provides power to the bus. 11 - 12 - Optional properties: 13 - - reset-gpios : gpio used to reset the device, see gpio/gpio.txt 14 - - interrupts : device support 2 interrupts, INT1 and INT2, 15 - the interrupts can be triggered on rising or falling edges. 16 - See interrupt-controller/interrupts.txt 17 - - interrupt-names: should contain "INT1" or "INT2", the gyroscope interrupt 18 - line in use. 19 - - drive-open-drain: the interrupt/data ready line will be configured 20 - as open drain, which is useful if several sensors share 21 - the same interrupt line. This is a boolean property. 22 - (This binding is taken from pinctrl/pinctrl-bindings.txt) 23 - 24 - Example: 25 - 26 - gyroscope@20 { 27 - compatible = "nxp,fxas21002c"; 28 - reg = <0x20>; 29 - vdd-supply = <&reg_peri_3p15v>; 30 - vddio-supply = <&reg_peri_3p15v>; 31 - };
+95
Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/gyroscope/nxp,fxas21002c.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: NXP FXAS21002C Gyroscope 8 + 9 + maintainers: 10 + - Rui Miguel Silva <rmfrfs@gmail.com> 11 + 12 + description: | 13 + 3 axis digital gyroscope device with an I2C and SPI interface. 14 + http://www.nxp.com/products/sensors/gyroscopes/3-axis-digital-gyroscope:FXAS21002C 15 + 16 + properties: 17 + compatible: 18 + const: nxp,fxas21002c 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + vdd-supply: 24 + description: Regulator that provides power to the sensor 25 + 26 + vddio-supply: 27 + description: Regulator that provides power to the bus 28 + 29 + reset-gpios: 30 + maxItems: 1 31 + description: GPIO connected to reset 32 + 33 + interrupts: 34 + minItems: 1 35 + maxItems: 2 36 + description: Either interrupt may be triggered on rising or falling edges. 37 + 38 + interrupt-names: 39 + minItems: 1 40 + maxItems: 2 41 + items: 42 + enum: 43 + - INT1 44 + - INT2 45 + 46 + drive-open-drain: 47 + type: boolean 48 + description: the interrupt/data ready line will be configured as open drain, 49 + which is useful if several sensors share the same interrupt 50 + line. 51 + 52 + spi-max-frequency: 53 + maximum: 2000000 54 + 55 + required: 56 + - compatible 57 + - reg 58 + 59 + additionalProperties: false 60 + 61 + examples: 62 + - | 63 + #include <dt-bindings/interrupt-controller/irq.h> 64 + 65 + i2c0 { 66 + #address-cells = <1>; 67 + #size-cells = <0>; 68 + 69 + gyroscope@20 { 70 + compatible = "nxp,fxas21002c"; 71 + reg = <0x20>; 72 + 73 + vdd-supply = <&reg_peri_3p15v>; 74 + vddio-supply = <&reg_peri_3p15v>; 75 + 76 + interrupt-parent = <&gpio1>; 77 + interrupts = <7 IRQ_TYPE_EDGE_RISING>; 78 + interrupt-names = "INT1"; 79 + }; 80 + }; 81 + spi0 { 82 + #address-cells = <1>; 83 + #size-cells = <0>; 84 + 85 + gyroscope@0 { 86 + compatible = "nxp,fxas2102c"; 87 + reg = <0x0>; 88 + 89 + spi-max-frequency = <2000000>; 90 + 91 + interrupt-parent = <&gpio2>; 92 + interrupts = <7 IRQ_TYPE_EDGE_RISING>; 93 + interrupt-names = "INT2"; 94 + }; 95 + };
-28
Documentation/devicetree/bindings/iio/health/max30100.txt
··· 1 - Maxim MAX30100 heart rate and pulse oximeter sensor 2 - 3 - * https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf 4 - 5 - Required properties: 6 - - compatible: must be "maxim,max30100" 7 - - reg: the I2C address of the sensor 8 - - interrupts: the sole interrupt generated by the device 9 - 10 - Refer to interrupt-controller/interrupts.txt for generic 11 - interrupt client node bindings. 12 - 13 - Optional properties: 14 - - maxim,led-current-microamp: configuration for LED current in microamperes 15 - while the engine is running. First indexed value is the configuration for 16 - the RED LED, and second value is for the IR LED. 17 - 18 - Refer to the datasheet for the allowed current values. 19 - 20 - Example: 21 - 22 - max30100@57 { 23 - compatible = "maxim,max30100"; 24 - reg = <0x57>; 25 - maxim,led-current-microamp = <24000 50000>; 26 - interrupt-parent = <&gpio1>; 27 - interrupts = <16 2>; 28 - };
-33
Documentation/devicetree/bindings/iio/health/max30102.txt
··· 1 - Maxim MAX30102 heart rate and pulse oximeter sensor 2 - Maxim MAX30105 optical particle-sensing module 3 - 4 - * https://datasheets.maximintegrated.com/en/ds/MAX30102.pdf 5 - * https://datasheets.maximintegrated.com/en/ds/MAX30105.pdf 6 - 7 - Required properties: 8 - - compatible: must be "maxim,max30102" or "maxim,max30105" 9 - - reg: the I2C address of the sensor 10 - - interrupts: the sole interrupt generated by the device 11 - 12 - Refer to interrupt-controller/interrupts.txt for generic 13 - interrupt client node bindings. 14 - 15 - Optional properties: 16 - - maxim,red-led-current-microamp: configuration for red LED current 17 - - maxim,ir-led-current-microamp: configuration for IR LED current 18 - - maxim,green-led-current-microamp: configuration for green LED current 19 - (max30105 only) 20 - 21 - Note that each step is approximately 200 microamps, ranging from 0 uA to 22 - 50800 uA. 23 - 24 - Example: 25 - 26 - max30102@57 { 27 - compatible = "maxim,max30102"; 28 - reg = <0x57>; 29 - maxim,red-led-current-microamp = <7000>; 30 - maxim,ir-led-current-microamp = <7000>; 31 - interrupt-parent = <&gpio1>; 32 - interrupts = <16 2>; 33 - };
+52
Documentation/devicetree/bindings/iio/health/maxim,max30100.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/health/maxim,max30100.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Maxim MAX30100 heart rate and pulse oximeter sensor 8 + 9 + maintainers: 10 + - Matt Ranostay <matt.ranostay@konsulko.com> 11 + 12 + properties: 13 + compatible: 14 + const: maxim,max30100 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + interrupts: 20 + maxItems: 1 21 + description: Connected to ADC_RDY pin. 22 + 23 + maxim,led-current-microamp: 24 + $ref: /schemas/types.yaml#/definitions/uint32-array 25 + minItems: 2 26 + maxItems: 2 27 + description: | 28 + LED current whilst the engine is running. First indexed value is 29 + the configuration for the RED LED, and second value is for the IR LED. 30 + 31 + additionalProperties: false 32 + 33 + required: 34 + - compatible 35 + - reg 36 + - interrupts 37 + 38 + examples: 39 + - | 40 + i2c { 41 + #address-cells = <1>; 42 + #size-cells = <0>; 43 + 44 + heart-rate@57 { 45 + compatible = "maxim,max30100"; 46 + reg = <0x57>; 47 + maxim,led-current-microamp = <24000 50000>; 48 + interrupt-parent = <&gpio1>; 49 + interrupts = <16 2>; 50 + }; 51 + }; 52 + ...
+72
Documentation/devicetree/bindings/iio/health/maxim,max30102.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/health/maxim,max30102.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Maxim MAX30102 heart rate and pulse oximeter and MAX30105 particle-sensor 8 + 9 + maintainers: 10 + - Matt Ranostay <matt.ranostay@konsulko.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - maxim,max30102 16 + - maxim,max30105 17 + 18 + reg: 19 + maxItems: 1 20 + 21 + interrupts: 22 + maxItems: 1 23 + description: Connected to ADC_RDY pin. 24 + 25 + maxim,red-led-current-microamp: 26 + description: RED LED current. Each step is approximately 200 microamps. 27 + minimum: 0 28 + maximum: 50800 29 + 30 + maxim,ir-led-current-microamp: 31 + description: IR LED current. Each step is approximately 200 microamps. 32 + minimum: 0 33 + maximum: 50800 34 + 35 + maxim,green-led-current-microamp: 36 + description: Green LED current. Each step is approximately 200 microamps. 37 + minimum: 0 38 + maximum: 50800 39 + 40 + allOf: 41 + - if: 42 + properties: 43 + compatible: 44 + contains: 45 + const: maxim,max30100 46 + then: 47 + properties: 48 + maxim,green-led-current-microamp: false 49 + 50 + additionalProperties: false 51 + 52 + required: 53 + - compatible 54 + - reg 55 + - interrupts 56 + 57 + examples: 58 + - | 59 + i2c { 60 + #address-cells = <1>; 61 + #size-cells = <0>; 62 + 63 + heart-rate@57 { 64 + compatible = "maxim,max30102"; 65 + reg = <0x57>; 66 + maxim,red-led-current-microamp = <7000>; 67 + maxim,ir-led-current-microamp = <7000>; 68 + interrupt-parent = <&gpio1>; 69 + interrupts = <16 2>; 70 + }; 71 + }; 72 + ...
-14
Documentation/devicetree/bindings/iio/humidity/dht11.txt
··· 1 - * DHT11 humidity/temperature sensor (and compatibles like DHT22) 2 - 3 - Required properties: 4 - - compatible: Should be "dht11" 5 - - gpios: Should specify the GPIO connected to the sensor's data 6 - line, see "gpios property" in 7 - Documentation/devicetree/bindings/gpio/gpio.txt. 8 - 9 - Example: 10 - 11 - humidity_sensor { 12 - compatible = "dht11"; 13 - gpios = <&gpio0 6 0>; 14 - }
+41
Documentation/devicetree/bindings/iio/humidity/dht11.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/humidity/dht11.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: DHT11 humidity + temperature sensor 8 + 9 + maintainers: 10 + - Harald Geyer <harald@ccbib.org> 11 + 12 + description: | 13 + A simple and low cost module providing a non standard single GPIO based 14 + interface. It is believed the part is made by aosong but don't have 15 + absolute confirmation of this, or what the aosong part number is. 16 + 17 + properties: 18 + compatible: 19 + const: dht11 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + gpios: 25 + maxItems: 1 26 + description: 27 + Single, interrupt capable, GPIO used to communicate with the device. 28 + 29 + required: 30 + - compatible 31 + - gpios 32 + 33 + additionalProperties: false 34 + 35 + examples: 36 + - | 37 + humidity_sensor { 38 + compatible = "dht11"; 39 + gpios = <&gpio0 6 0>; 40 + }; 41 + ...
-17
Documentation/devicetree/bindings/iio/humidity/hdc100x.txt
··· 1 - * HDC100x temperature + humidity sensors 2 - 3 - Required properties: 4 - - compatible: Should contain one of the following: 5 - ti,hdc1000 6 - ti,hdc1008 7 - ti,hdc1010 8 - ti,hdc1050 9 - ti,hdc1080 10 - - reg: i2c address of the sensor 11 - 12 - Example: 13 - 14 - hdc100x@40 { 15 - compatible = "ti,hdc1000"; 16 - reg = <0x40>; 17 - };
-30
Documentation/devicetree/bindings/iio/humidity/hts221.txt
··· 1 - * HTS221 STM humidity + temperature sensor 2 - 3 - Required properties: 4 - - compatible: should be "st,hts221" 5 - - reg: i2c address of the sensor / spi cs line 6 - 7 - Optional properties: 8 - - drive-open-drain: the interrupt/data ready line will be configured 9 - as open drain, which is useful if several sensors share the same 10 - interrupt line. This is a boolean property. 11 - If the requested interrupt is configured as IRQ_TYPE_LEVEL_HIGH or 12 - IRQ_TYPE_EDGE_RISING a pull-down resistor is needed to drive the line 13 - when it is not active, whereas a pull-up one is needed when interrupt 14 - line is configured as IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_EDGE_FALLING. 15 - Refer to pinctrl/pinctrl-bindings.txt for the property description. 16 - - interrupts: interrupt mapping for IRQ. It should be configured with 17 - flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or 18 - IRQ_TYPE_EDGE_FALLING. 19 - 20 - Refer to interrupt-controller/interrupts.txt for generic interrupt 21 - client node bindings. 22 - 23 - Example: 24 - 25 - hts221@5f { 26 - compatible = "st,hts221"; 27 - reg = <0x5f>; 28 - interrupt-parent = <&gpio0>; 29 - interrupts = <0 IRQ_TYPE_EDGE_RISING>; 30 - };
-13
Documentation/devicetree/bindings/iio/humidity/htu21.txt
··· 1 - *HTU21 - Measurement-Specialties htu21 temperature & humidity sensor and humidity part of MS8607 sensor 2 - 3 - Required properties: 4 - 5 - - compatible: should be "meas,htu21" or "meas,ms8607-humidity" 6 - - reg: I2C address of the sensor 7 - 8 - Example: 9 - 10 - htu21@40 { 11 - compatible = "meas,htu21"; 12 - reg = <0x40>; 13 - };
+52
Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/humidity/st,hts221.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: HTS221 STM humidity + temperature sensor 8 + 9 + maintainers: 10 + - Lorenzo Bianconi <lorenzo@kernel.org> 11 + 12 + description: | 13 + Humidity and temperature sensor with I2C interface and data ready 14 + interrupt. 15 + 16 + properties: 17 + compatible: 18 + const: st,hts221 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + drive-open-drain: 24 + type: boolean 25 + description: 26 + The interrupt/data ready line will be configured as open drain, which 27 + is useful if several sensors share the same interrupt line. 28 + 29 + interrupts: 30 + maxItems: 1 31 + 32 + required: 33 + - compatible 34 + - reg 35 + 36 + additionalProperties: false 37 + 38 + examples: 39 + - | 40 + #include <dt-bindings/interrupt-controller/irq.h> 41 + i2c { 42 + #address-cells = <1>; 43 + #size-cells = <0>; 44 + 45 + hts221@5f { 46 + compatible = "st,hts221"; 47 + reg = <0x5f>; 48 + interrupt-parent = <&gpio0>; 49 + interrupts = <0 IRQ_TYPE_EDGE_RISING>; 50 + }; 51 + }; 52 + ...
-26
Documentation/devicetree/bindings/iio/impedance-analyzer/ad5933.txt
··· 1 - Analog Devices AD5933/AD5934 Impedance Converter, Network Analyzer 2 - 3 - https://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf 4 - https://www.analog.com/media/en/technical-documentation/data-sheets/AD5934.pdf 5 - 6 - Required properties: 7 - - compatible : should be one of 8 - "adi,ad5933" 9 - "adi,ad5934" 10 - - reg : the I2C address. 11 - - vdd-supply : The regulator supply for DVDD, AVDD1 and AVDD2 when they 12 - are connected together. 13 - 14 - Optional properties: 15 - - clocks : external clock reference. 16 - - clock-names : must be "mclk" if clocks is set. 17 - 18 - Example for a I2C device node: 19 - 20 - impedance-analyzer@0d { 21 - compatible = "adi,adxl345"; 22 - reg = <0x0d>; 23 - vdd-supply = <&vdd_supply>; 24 - clocks = <&ref_clk>; 25 - clock-names = "mclk"; 26 - };
+59
Documentation/devicetree/bindings/iio/impedance-analyzer/adi,ad5933.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/impedance-analyzer/adi,ad5933.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices AD5933/AD5934 Impedance Converter, Network Analyzer 8 + 9 + maintainers: 10 + - Marcelo Schmitt <marcelo.schmitt1@gmail.com> 11 + - Gabriel Capella <gabriel@capella.pro> 12 + 13 + description: | 14 + https://www.analog.com/media/en/technical-documentation/data-sheets/AD5933.pdf 15 + https://www.analog.com/media/en/technical-documentation/data-sheets/AD5934.pdf 16 + 17 + properties: 18 + compatible: 19 + enum: 20 + - adi,ad5933 21 + - adi,ad5934 22 + 23 + reg: 24 + maxItems: 1 25 + 26 + vdd-supply: 27 + description: | 28 + The regulator supply for DVDD, AVDD1 and AVDD2 when they 29 + are connected together. Used to calculate voltage scaling of measurement 30 + channels. 31 + 32 + clocks: 33 + maxItems: 1 34 + 35 + clock-names: 36 + const: mclk 37 + 38 + additionalProperties: false 39 + 40 + required: 41 + - compatible 42 + - reg 43 + - vdd-supply 44 + 45 + examples: 46 + - | 47 + i2c { 48 + #address-cells = <1>; 49 + #size-cells = <0>; 50 + 51 + impedance-analyzer@d { 52 + compatible = "adi,ad5933"; 53 + reg = <0x0d>; 54 + vdd-supply = <&vdd_supply>; 55 + clocks = <&ref_clk>; 56 + clock-names = "mclk"; 57 + }; 58 + }; 59 + ...
-86
Documentation/devicetree/bindings/iio/imu/adi,adis16480.txt
··· 1 - 2 - Analog Devices ADIS16480 and similar IMUs 3 - 4 - Required properties for the ADIS16480: 5 - 6 - - compatible: Must be one of 7 - * "adi,adis16375" 8 - * "adi,adis16480" 9 - * "adi,adis16485" 10 - * "adi,adis16488" 11 - * "adi,adis16490" 12 - * "adi,adis16495-1" 13 - * "adi,adis16495-2" 14 - * "adi,adis16495-3" 15 - * "adi,adis16497-1" 16 - * "adi,adis16497-2" 17 - * "adi,adis16497-3" 18 - - reg: SPI chip select number for the device 19 - - spi-max-frequency: Max SPI frequency to use 20 - see: Documentation/devicetree/bindings/spi/spi-bus.txt 21 - - spi-cpha: See Documentation/devicetree/bindings/spi/spi-bus.txt 22 - - spi-cpol: See Documentation/devicetree/bindings/spi/spi-bus.txt 23 - - interrupts: interrupt mapping for IRQ, accepted values are: 24 - * IRQF_TRIGGER_RISING 25 - * IRQF_TRIGGER_FALLING 26 - 27 - Optional properties: 28 - 29 - - interrupt-names: Data ready line selection. Valid values are: 30 - * DIO1 31 - * DIO2 32 - * DIO3 33 - * DIO4 34 - If this field is left empty, DIO1 is assigned as default data ready 35 - signal. 36 - - reset-gpios: must be the device tree identifier of the RESET pin. As the line 37 - is active low, it should be marked GPIO_ACTIVE_LOW. 38 - - clocks: phandle to the external clock. Should be set according to 39 - "clock-names". 40 - If this field is left empty together with the "clock-names" field, then 41 - the internal clock is used. 42 - - clock-names: The name of the external clock to be used. Valid values are: 43 - * sync: In sync mode, the internal clock is disabled and the frequency 44 - of the external clock signal establishes therate of data 45 - collection and processing. See Fig 14 and 15 in the datasheet. 46 - The clock-frequency must be: 47 - * 3000 to 4500 Hz for adis1649x devices. 48 - * 700 to 2400 Hz for adis1648x devices. 49 - * pps: In Pulse Per Second (PPS) Mode, the rate of data collection and 50 - production is equal to the product of the external clock 51 - frequency and the scale factor in the SYNC_SCALE register, see 52 - Table 154 in the datasheet. 53 - The clock-frequency must be: 54 - * 1 to 128 Hz for adis1649x devices. 55 - * This mode is not supported by adis1648x devices. 56 - If this field is left empty together with the "clocks" field, then the 57 - internal clock is used. 58 - - adi,ext-clk-pin: The DIOx line to be used as an external clock input. 59 - Valid values are: 60 - * DIO1 61 - * DIO2 62 - * DIO3 63 - * DIO4 64 - Each DIOx pin supports only one function at a time (data ready line 65 - selection or external clock input). When a single pin has two 66 - two assignments, the enable bit for the lower priority function 67 - automatically resets to zero (disabling the lower priority function). 68 - Data ready has highest priority. 69 - If this field is left empty, DIO2 is assigned as default external clock 70 - input pin. 71 - 72 - Example: 73 - 74 - imu@0 { 75 - compatible = "adi,adis16495-1"; 76 - reg = <0>; 77 - spi-max-frequency = <3200000>; 78 - spi-cpol; 79 - spi-cpha; 80 - interrupts = <25 IRQF_TRIGGER_FALLING>; 81 - interrupt-parent = <&gpio>; 82 - interrupt-names = "DIO2"; 83 - clocks = <&adis16495_sync>; 84 - clock-names = "sync"; 85 - adi,ext-clk-pin = "DIO1"; 86 - };
+130
Documentation/devicetree/bindings/iio/imu/adi,adis16480.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/imu/adi,adis16480.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices ADIS16480 and similar IMUs 8 + 9 + maintainers: 10 + - Alexandru Ardelean <alexandru.ardelean@analog.com> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - adi,adis16375 16 + - adi,adis16480 17 + - adi,adis16485 18 + - adi,adis16488 19 + - adi,adis16490 20 + - adi,adis16495-1 21 + - adi,adis16495-2 22 + - adi,adis16495-3 23 + - adi,adis16497-1 24 + - adi,adis16497-2 25 + - adi,adis16497-3 26 + 27 + reg: 28 + maxItems: 1 29 + 30 + interrupts: 31 + minItems: 1 32 + maxItems: 2 33 + description: | 34 + Accepted interrupt types are: 35 + * IRQ_TYPE_EDGE_RISING 36 + * IRQ_TYPE_EDGE_FALLING 37 + 38 + interrupt-names: 39 + minItems: 1 40 + maxItems: 2 41 + description: 42 + Default if not supplied is DIO1. 43 + items: 44 + enum: 45 + - DIO1 46 + - DIO2 47 + - DIO3 48 + - DIO4 49 + 50 + spi-max-frequency: true 51 + 52 + spi-cpha: true 53 + spi-cpol: true 54 + 55 + reset-gpios: 56 + maxItems: 1 57 + description: Connected to RESET pin which is active low. 58 + 59 + clocks: 60 + maxItems: 1 61 + description: If not provided, then the internal clock is used. 62 + 63 + clock-names: 64 + description: | 65 + sync: In sync mode, the internal clock is disabled and the frequency 66 + of the external clock signal establishes therate of data 67 + collection and processing. See Fig 14 and 15 in the datasheet. 68 + The clock-frequency must be: 69 + * 3000 to 4500 Hz for adis1649x devices. 70 + * 700 to 2400 Hz for adis1648x devices. 71 + pps: In Pulse Per Second (PPS) Mode, the rate of data collection and 72 + production is equal to the product of the external clock 73 + frequency and the scale factor in the SYNC_SCALE register, see 74 + Table 154 in the datasheet. 75 + The clock-frequency must be: 76 + * 1 to 128 Hz for adis1649x devices. 77 + * This mode is not supported by adis1648x devices. 78 + enum: 79 + - sync 80 + - pps 81 + 82 + adi,ext-clk-pin: 83 + $ref: /schemas/types.yaml#/definitions/string 84 + description: | 85 + The DIOx line to be used as an external clock input. 86 + Each DIOx pin supports only one function at a time (data ready line 87 + selection or external clock input). When a single pin has two 88 + two assignments, the enable bit for the lower priority function 89 + automatically resets to zero (disabling the lower priority function). 90 + Data ready has highest priority. 91 + If not provided then DIO2 is assigned as default external clock 92 + input pin. 93 + enum: 94 + - DIO1 95 + - DIO2 96 + - DIO3 97 + - DIO4 98 + 99 + additionalProperties: false 100 + 101 + required: 102 + - compatible 103 + - reg 104 + - interrupts 105 + - spi-cpha 106 + - spi-cpol 107 + - spi-max-frequency 108 + 109 + examples: 110 + - | 111 + #include <dt-bindings/interrupt-controller/irq.h> 112 + spi { 113 + #address-cells = <1>; 114 + #size-cells = <0>; 115 + 116 + imu@0 { 117 + compatible = "adi,adis16495-1"; 118 + reg = <0>; 119 + spi-max-frequency = <3200000>; 120 + spi-cpol; 121 + spi-cpha; 122 + interrupts = <25 IRQ_TYPE_EDGE_FALLING>; 123 + interrupt-parent = <&gpio>; 124 + interrupt-names = "DIO2"; 125 + clocks = <&adis16495_sync>; 126 + clock-names = "sync"; 127 + adi,ext-clk-pin = "DIO1"; 128 + }; 129 + }; 130 + ...
+86
Documentation/devicetree/bindings/iio/imu/st,lsm6dsx.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/imu/st,lsm6dsx.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: STM 6-axis (acc + gyro) IMU Mems sensors 8 + 9 + maintainers: 10 + - Lorenzo Bianconi <lorenzo@kernel.org> 11 + 12 + description: 13 + Devices have both I2C and SPI interfaces. 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - st,lsm6ds3 19 + - st,lsm6ds3h 20 + - st,lsm6dsl 21 + - st,lsm6dsm 22 + - st,ism330dlc 23 + - st,lsm6dso 24 + - st,asm330lhh 25 + - st,lsm6dsox 26 + - st,lsm6dsr 27 + - st,lsm6ds3tr-c 28 + - st,ism330dhcx 29 + - st,lsm9ds1-imu 30 + - st,lsm6ds0 31 + - st,lsm6dsrx 32 + - st,lsm6dst 33 + 34 + reg: 35 + maxItems: 1 36 + 37 + interrupts: 38 + minItems: 1 39 + maxItems: 2 40 + description: 41 + Supports up to 2 interrupt lines via the INT1 and INT2 pins. 42 + 43 + spi-max-frequency: true 44 + 45 + st,drdy-int-pin: 46 + $ref: '/schemas/types.yaml#/definitions/uint32' 47 + description: | 48 + The pin on the package that will be used to signal data ready 49 + enum: 50 + - 1 51 + - 2 52 + 53 + st,pullups: 54 + type: boolean 55 + description: enable/disable internal i2c controller pullup resistors. 56 + 57 + drive-open-drain: 58 + type: boolean 59 + description: 60 + The interrupt/data ready line will be configured as open drain, which 61 + is useful if several sensors share the same interrupt line. 62 + 63 + wakeup-source: 64 + $ref: /schemas/types.yaml#/definitions/flag 65 + 66 + additionalProperties: false 67 + 68 + required: 69 + - compatible 70 + - reg 71 + 72 + examples: 73 + - | 74 + #include <dt-bindings/interrupt-controller/irq.h> 75 + i2c { 76 + #address-cells = <1>; 77 + #size-cells = <0>; 78 + 79 + imu@6b { 80 + compatible = "st,lsm6dsm"; 81 + reg = <0x6b>; 82 + interrupt-parent = <&gpio0>; 83 + interrupts = <0 IRQ_TYPE_EDGE_RISING>; 84 + }; 85 + }; 86 + ...
-48
Documentation/devicetree/bindings/iio/imu/st_lsm6dsx.txt
··· 1 - * ST_LSM6DSx driver for STM 6-axis (acc + gyro) imu Mems sensors 2 - 3 - Required properties: 4 - - compatible: must be one of: 5 - "st,lsm6ds3" 6 - "st,lsm6ds3h" 7 - "st,lsm6dsl" 8 - "st,lsm6dsm" 9 - "st,ism330dlc" 10 - "st,lsm6dso" 11 - "st,asm330lhh" 12 - "st,lsm6dsox" 13 - "st,lsm6dsr" 14 - "st,lsm6ds3tr-c" 15 - "st,ism330dhcx" 16 - "st,lsm9ds1-imu" 17 - "st,lsm6ds0" 18 - "st,lsm6dsrx" 19 - - reg: i2c address of the sensor / spi cs line 20 - 21 - Optional properties: 22 - - st,drdy-int-pin: the pin on the package that will be used to signal 23 - "data ready" (valid values: 1 or 2). 24 - - st,pullups : enable/disable internal i2c controller pullup resistors. 25 - - drive-open-drain: the interrupt/data ready line will be configured 26 - as open drain, which is useful if several sensors share the same 27 - interrupt line. This is a boolean property. 28 - (This binding is taken from pinctrl/pinctrl-bindings.txt) 29 - If the requested interrupt is configured as IRQ_TYPE_LEVEL_HIGH or 30 - IRQ_TYPE_EDGE_RISING a pull-down resistor is needed to drive the line 31 - when it is not active, whereas a pull-up one is needed when interrupt 32 - line is configured as IRQ_TYPE_LEVEL_LOW or IRQ_TYPE_EDGE_FALLING. 33 - - interrupts: interrupt mapping for IRQ. It should be configured with 34 - flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or 35 - IRQ_TYPE_EDGE_FALLING. 36 - - wakeup-source: Enables wake up of host system on event. 37 - 38 - Refer to interrupt-controller/interrupts.txt for generic interrupt 39 - client node bindings. 40 - 41 - Example: 42 - 43 - lsm6dsm@6b { 44 - compatible = "st,lsm6dsm"; 45 - reg = <0x6b>; 46 - interrupt-parent = <&gpio0>; 47 - interrupts = <0 IRQ_TYPE_EDGE_RISING>; 48 - };
-21
Documentation/devicetree/bindings/iio/light/apds9300.txt
··· 1 - * Avago APDS9300 ambient light sensor 2 - 3 - https://www.avagotech.com/docs/AV02-1077EN 4 - 5 - Required properties: 6 - 7 - - compatible : should be "avago,apds9300" 8 - - reg : the I2C address of the sensor 9 - 10 - Optional properties: 11 - 12 - - interrupts : interrupt mapping for GPIO IRQ 13 - 14 - Example: 15 - 16 - apds9300@39 { 17 - compatible = "avago,apds9300"; 18 - reg = <0x39>; 19 - interrupt-parent = <&gpio2>; 20 - interrupts = <29 8>; 21 - };
-21
Documentation/devicetree/bindings/iio/light/apds9960.txt
··· 1 - * Avago APDS9960 gesture/RGB/ALS/proximity sensor 2 - 3 - https://www.avagotech.com/docs/AV02-4191EN 4 - 5 - Required properties: 6 - 7 - - compatible: must be "avago,apds9960" 8 - - reg: the I2c address of the sensor 9 - - interrupts : the sole interrupt generated by the device 10 - 11 - Refer to interrupt-controller/interrupts.txt for generic interrupt client 12 - node bindings. 13 - 14 - Example: 15 - 16 - apds9960@39 { 17 - compatible = "avago,apds9960"; 18 - reg = <0x39>; 19 - interrupt-parent = <&gpio1>; 20 - interrupts = <16 1>; 21 - };
+44
Documentation/devicetree/bindings/iio/light/avago,apds9300.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/avago,apds9300.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Avago APDS9300 ambient light sensor 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + description: | 13 + Datasheet at https://www.avagotech.com/docs/AV02-1077EN 14 + 15 + properties: 16 + compatible: 17 + const: avago,apds9300 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + additionalProperties: false 26 + 27 + required: 28 + - compatible 29 + - reg 30 + 31 + examples: 32 + - | 33 + i2c { 34 + #address-cells = <1>; 35 + #size-cells = <0>; 36 + 37 + light-sensor@39 { 38 + compatible = "avago,apds9300"; 39 + reg = <0x39>; 40 + interrupt-parent = <&gpio2>; 41 + interrupts = <29 8>; 42 + }; 43 + }; 44 + ...
+44
Documentation/devicetree/bindings/iio/light/avago,apds9960.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/avago,apds9960.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Avago APDS9960 gesture/RGB/ALS/proximity sensor 8 + 9 + maintainers: 10 + - Matt Ranostay <matt.ranostay@konsulko.com> 11 + 12 + description: | 13 + Datasheet at https://www.avagotech.com/docs/AV02-4191EN 14 + 15 + properties: 16 + compatible: 17 + const: avago,apds9960 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + additionalProperties: false 26 + 27 + required: 28 + - compatible 29 + - reg 30 + 31 + examples: 32 + - | 33 + i2c { 34 + #address-cells = <1>; 35 + #size-cells = <0>; 36 + 37 + light-sensor@39 { 38 + compatible = "avago,apds9960"; 39 + reg = <0x39>; 40 + interrupt-parent = <&gpio1>; 41 + interrupts = <16 1>; 42 + }; 43 + }; 44 + ...
+48
Documentation/devicetree/bindings/iio/light/capella,cm36651.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/capella,cm36651.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Capella CM36651 I2C Proximity and Color Light sensor 8 + 9 + maintainers: 10 + - Beomho Seo <beomho.seo@samsung.com> 11 + 12 + properties: 13 + compatible: 14 + const: capella,cm36651 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + interrupts: 20 + maxItems: 1 21 + 22 + vled-supply: 23 + description: | 24 + Supply for the IR_LED which is part of the cm36651 for proximity detection. 25 + 26 + additionalProperties: false 27 + 28 + required: 29 + - compatible 30 + - reg 31 + - interrupts 32 + - vled-supply 33 + 34 + examples: 35 + - | 36 + i2c { 37 + #address-cells = <1>; 38 + #size-cells = <0>; 39 + 40 + light-sensor@18 { 41 + compatible = "capella,cm36651"; 42 + reg = <0x18>; 43 + interrupt-parent = <&gpx0>; 44 + interrupts = <2 0>; 45 + vled-supply = <&ps_als_reg>; 46 + }; 47 + }; 48 + ...
-26
Documentation/devicetree/bindings/iio/light/cm36651.txt
··· 1 - * Capella CM36651 I2C Proximity and Color Light sensor 2 - 3 - Required properties: 4 - - compatible: must be "capella,cm36651" 5 - - reg: the I2C address of the device 6 - - interrupts: interrupt-specifier for the sole interrupt 7 - generated by the device 8 - - vled-supply: regulator for the IR LED. IR_LED is a part 9 - of the cm36651 for proximity detection. 10 - As covered in ../../regulator/regulator.txt 11 - 12 - Example: 13 - 14 - i2c_cm36651: i2c-gpio { 15 - /* ... */ 16 - 17 - cm36651@18 { 18 - compatible = "capella,cm36651"; 19 - reg = <0x18>; 20 - interrupt-parent = <&gpx0>; 21 - interrupts = <2 0>; 22 - vled-supply = <&ps_als_reg>; 23 - }; 24 - 25 - /* ... */ 26 - };
-21
Documentation/devicetree/bindings/iio/light/gp2ap020a00f.txt
··· 1 - * Sharp GP2AP020A00F I2C Proximity/ALS sensor 2 - 3 - The proximity detector sensor requires power supply 4 - for its built-in led. It is also defined by this binding. 5 - 6 - Required properties: 7 - 8 - - compatible : should be "sharp,gp2ap020a00f" 9 - - reg : the I2C slave address of the light sensor 10 - - interrupts : interrupt specifier for the sole interrupt generated 11 - by the device 12 - - vled-supply : VLED power supply, as covered in ../regulator/regulator.txt 13 - 14 - Example: 15 - 16 - gp2ap020a00f@39 { 17 - compatible = "sharp,gp2ap020a00f"; 18 - reg = <0x39>; 19 - interrupts = <2 0>; 20 - vled-supply = <...>; 21 - };
-24
Documentation/devicetree/bindings/iio/light/max44009.txt
··· 1 - * MAX44009 Ambient Light Sensor 2 - 3 - Required properties: 4 - 5 - - compatible: should be "maxim,max44009" 6 - - reg: the I2C address of the device (default is <0x4a>) 7 - 8 - Optional properties: 9 - 10 - - interrupts: interrupt mapping for GPIO IRQ. Should be configured with 11 - IRQ_TYPE_EDGE_FALLING. 12 - 13 - Refer to interrupt-controller/interrupts.txt for generic interrupt client 14 - node bindings. 15 - 16 - Example: 17 - 18 - light-sensor@4a { 19 - compatible = "maxim,max44009"; 20 - reg = <0x4a>; 21 - 22 - interrupt-parent = <&gpio1>; 23 - interrupts = <17 IRQ_TYPE_EDGE_FALLING>; 24 - };
+45
Documentation/devicetree/bindings/iio/light/maxim,max44009.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/maxim,max44009.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MAX44009 Ambient Light Sensor 8 + 9 + maintainers: 10 + - Robert Eshleman <bobbyeshleman@gmail.com> 11 + 12 + properties: 13 + compatible: 14 + const: maxim,max44009 15 + 16 + reg: 17 + maxItems: 1 18 + description: Default address is 0x4a 19 + 20 + interrupts: 21 + maxItems: 1 22 + description: Should be configured with type IRQ_TYPE_EDGE_FALLING 23 + 24 + additionalProperties: false 25 + 26 + required: 27 + - compatible 28 + - reg 29 + 30 + examples: 31 + - | 32 + #include <dt-bindings/interrupt-controller/irq.h> 33 + i2c { 34 + #address-cells = <1>; 35 + #size-cells = <0>; 36 + 37 + light-sensor@4a { 38 + compatible = "maxim,max44009"; 39 + reg = <0x4a>; 40 + 41 + interrupt-parent = <&gpio1>; 42 + interrupts = <17 IRQ_TYPE_EDGE_FALLING>; 43 + }; 44 + }; 45 + ...
-25
Documentation/devicetree/bindings/iio/light/opt3001.txt
··· 1 - * Texas Instruments OPT3001 Ambient Light Sensor 2 - 3 - The driver supports interrupt-driven and interrupt-less operation, depending 4 - on whether an interrupt property has been populated into the DT. Note that 5 - the optional generation of IIO events on rising/falling light threshold changes 6 - requires the use of interrupts. Without interrupts, only the simple reading 7 - of the current light value is supported through the IIO API. 8 - 9 - https://www.ti.com/product/opt3001 10 - 11 - Required properties: 12 - - compatible: should be "ti,opt3001" 13 - - reg: the I2C address of the sensor 14 - 15 - Optional properties: 16 - - interrupts: interrupt mapping for GPIO IRQ (configure for falling edge) 17 - 18 - Example: 19 - 20 - opt3001@44 { 21 - compatible = "ti,opt3001"; 22 - reg = <0x44>; 23 - interrupt-parent = <&gpio1>; 24 - interrupts = <28 IRQ_TYPE_EDGE_FALLING>; 25 - };
-13
Documentation/devicetree/bindings/iio/light/renesas,isl29501.txt
··· 1 - * ISL29501 Time-of-flight sensor. 2 - 3 - Required properties: 4 - 5 - - compatible : should be "renesas,isl29501" 6 - - reg : the I2C address of the sensor 7 - 8 - Example: 9 - 10 - isl29501@57 { 11 - compatible = "renesas,isl29501"; 12 - reg = <0x57>; 13 - };
+48
Documentation/devicetree/bindings/iio/light/sharp,gp2ap020a00f.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/sharp,gp2ap020a00f.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Sharp GP2AP020A00F I2C Proximity/ALS sensor 8 + 9 + maintainers: 10 + - Kyungmin Park <kyungmin.park@samsung.com> 11 + 12 + description: | 13 + The proximity detector sensor requires power supply for its built-in led. 14 + 15 + properties: 16 + compatible: 17 + const: sharp,gp2ap020a00f 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + vled-supply: true 26 + 27 + additionalProperties: false 28 + 29 + required: 30 + - compatible 31 + - reg 32 + - interrupts 33 + - vled-supply 34 + 35 + examples: 36 + - | 37 + i2c { 38 + #address-cells = <1>; 39 + #size-cells = <0>; 40 + 41 + light-sensor@39 { 42 + compatible = "sharp,gp2ap020a00f"; 43 + reg = <0x39>; 44 + interrupts = <2 0>; 45 + vled-supply = <&als_reg>; 46 + }; 47 + }; 48 + ...
+42
Documentation/devicetree/bindings/iio/light/st,uvis25.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/st,uvis25.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ST UVIS25 uv sensor 8 + 9 + maintainers: 10 + - Lorenzo Bianconi <lorenzo.bianconi83@gmail.com> 11 + 12 + properties: 13 + compatible: 14 + const: st,uvis25 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + interrupts: 20 + maxItems: 1 21 + 22 + additionalProperties: false 23 + 24 + required: 25 + - compatible 26 + - reg 27 + 28 + examples: 29 + - | 30 + #include <dt-bindings/interrupt-controller/irq.h> 31 + i2c { 32 + #address-cells = <1>; 33 + #size-cells = <0>; 34 + 35 + uv-sensor@47 { 36 + compatible = "st,uvis25"; 37 + reg = <0x47>; 38 + interrupt-parent = <&gpio0>; 39 + interrupts = <0 IRQ_TYPE_EDGE_RISING>; 40 + }; 41 + }; 42 + ...
+45
Documentation/devicetree/bindings/iio/light/st,vl6180.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/st,vl6180.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: STMicro VL6180 ALS, range and proximity sensor 8 + 9 + maintainers: 10 + - Manivannan Sadhasivam <manivannanece23@gmail.com> 11 + - Peter Meerwald-Stadler <pmeerw@pmeerw.net> 12 + 13 + description: | 14 + Proximity sensing module incorporating time of flight sensor 15 + Datasheet at https://www.st.com/resource/en/datasheet/vl6180x.pdf 16 + 17 + properties: 18 + compatible: 19 + const: st,vl6180 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + interrupts: 25 + maxItems: 1 26 + 27 + additionalProperties: false 28 + 29 + required: 30 + - compatible 31 + - reg 32 + 33 + examples: 34 + - | 35 + #include <dt-bindings/interrupt-controller/irq.h> 36 + i2c { 37 + #address-cells = <1>; 38 + #size-cells = <0>; 39 + 40 + proximity@29 { 41 + compatible = "st,vl6180"; 42 + reg = <0x29>; 43 + }; 44 + }; 45 + ...
+47
Documentation/devicetree/bindings/iio/light/ti,opt3001.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/ti,opt3001.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Texas Instruments OPT3001 Ambient Light Sensor 8 + 9 + maintainers: 10 + - Andreas Dannenberg <dannenberg@ti.com> 11 + 12 + description: | 13 + The device supports interrupt-driven and interrupt-less operation, depending 14 + on whether an interrupt property has been populated into the DT. 15 + 16 + properties: 17 + compatible: 18 + const: ti,opt3001 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + interrupts: 24 + maxItems: 1 25 + description: Should be configured with type IRQ_TYPE_EDGE_FALLING 26 + 27 + additionalProperties: false 28 + 29 + required: 30 + - compatible 31 + - reg 32 + 33 + examples: 34 + - | 35 + #include <dt-bindings/interrupt-controller/irq.h> 36 + i2c { 37 + #address-cells = <1>; 38 + #size-cells = <0>; 39 + 40 + light-sensor@44 { 41 + compatible = "ti,opt3001"; 42 + reg = <0x44>; 43 + interrupt-parent = <&gpio1>; 44 + interrupts = <28 IRQ_TYPE_EDGE_FALLING>; 45 + }; 46 + }; 47 + ...
+78
Documentation/devicetree/bindings/iio/light/upisemi,us5182.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/upisemi,us5182.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: UPISEMI us5182d I2C ALS and Proximity sensor 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + properties: 13 + compatible: 14 + const: upisemi,asd5182 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + upsemi,glass-coef: 20 + $ref: /schemas/types.yaml#/definitions/uint32 21 + description: | 22 + glass attenuation factor - compensation factor of resolution 1000 23 + for material transmittance. 24 + default: 1000 25 + 26 + upisemi,dark-ths: 27 + $ref: /schemas/types.yaml#/definitions/uint16-array 28 + minItems: 8 29 + maxItems: 8 30 + description: 31 + 16-bit thresholds (adc counts) corresponding to every scale. 32 + 33 + upisemi,upper-dark-gain: 34 + $ref: /schemas/types.yaml#/definitions/uint8 35 + description: | 36 + 8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4) 37 + applied when light > threshold. 38 + default: 0 39 + 40 + upisemi,lower-dark-gain: 41 + $ref: /schemas/types.yaml#/definitions/uint8 42 + description: | 43 + 8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4) 44 + applied when light < threshold. 45 + default: 0x16 46 + 47 + upisemi,continuous: 48 + $ref: /schemas/types.yaml#definitions/flag 49 + description: | 50 + This chip has two power modes: one-shot (chip takes one measurement and 51 + then shuts itself down) and continuous (chip takes continuous 52 + measurements). The one-shot mode is more power-friendly but the 53 + continuous mode may be more reliable. If this property is specified 54 + the continuous mode will be used instead of the default one-shot one for 55 + raw reads. 56 + 57 + additionalProperties: false 58 + 59 + required: 60 + - compatible 61 + - reg 62 + 63 + examples: 64 + - | 65 + i2c { 66 + #address-cells = <1>; 67 + #size-cells = <0>; 68 + 69 + light-sensor@39 { 70 + compatible = "upisemi,usd5182"; 71 + reg = <0x39>; 72 + upisemi,glass-coef = < 1000 >; 73 + upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>; 74 + upisemi,upper-dark-gain = /bits/ 8 <0x00>; 75 + upisemi,lower-dark-gain = /bits/ 8 <0x16>; 76 + }; 77 + }; 78 + ...
-45
Documentation/devicetree/bindings/iio/light/us5182d.txt
··· 1 - * UPISEMI us5182d I2C ALS and Proximity sensor 2 - 3 - Required properties: 4 - - compatible: must be "upisemi,usd5182" 5 - - reg: the I2C address of the device 6 - 7 - Optional properties: 8 - - upisemi,glass-coef: glass attenuation factor - compensation factor of 9 - resolution 1000 for material transmittance. 10 - 11 - - upisemi,dark-ths: array of 8 elements containing 16-bit thresholds (adc 12 - counts) corresponding to every scale. 13 - 14 - - upisemi,upper-dark-gain: 8-bit dark gain compensation factor(4 int and 4 15 - fractional bits - Q4.4) applied when light > threshold 16 - 17 - - upisemi,lower-dark-gain: 8-bit dark gain compensation factor(4 int and 4 18 - fractional bits - Q4.4) applied when light < threshold 19 - 20 - - upisemi,continuous: This chip has two power modes: one-shot (chip takes one 21 - measurement and then shuts itself down) and continuous ( 22 - chip takes continuous measurements). The one-shot mode is 23 - more power-friendly but the continuous mode may be more 24 - reliable. If this property is specified the continuous 25 - mode will be used instead of the default one-shot one for 26 - raw reads. 27 - 28 - If the optional properties are not specified these factors will default to the 29 - values in the below example. 30 - The glass-coef defaults to no compensation for the covering material. 31 - The threshold array defaults to experimental values that work with US5182D 32 - sensor on evaluation board - roughly between 12-32 lux. 33 - There will be no dark-gain compensation by default when ALS > thresh 34 - (0 * dark-gain), and a 1.35 compensation factor when ALS < thresh. 35 - 36 - Example: 37 - 38 - usd5182@39 { 39 - compatible = "upisemi,usd5182"; 40 - reg = <0x39>; 41 - upisemi,glass-coef = < 1000 >; 42 - upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>; 43 - upisemi,upper-dark-gain = /bits/ 8 <0x00>; 44 - upisemi,lower-dark-gain = /bits/ 8 <0x16>; 45 - };
-22
Documentation/devicetree/bindings/iio/light/uvis25.txt
··· 1 - * ST UVIS25 uv sensor 2 - 3 - Required properties: 4 - - compatible: should be "st,uvis25" 5 - - reg: i2c address of the sensor / spi cs line 6 - 7 - Optional properties: 8 - - interrupts: interrupt mapping for IRQ. It should be configured with 9 - flags IRQ_TYPE_LEVEL_HIGH, IRQ_TYPE_EDGE_RISING, IRQ_TYPE_LEVEL_LOW or 10 - IRQ_TYPE_EDGE_FALLING. 11 - 12 - Refer to interrupt-controller/interrupts.txt for generic interrupt 13 - client node bindings. 14 - 15 - Example: 16 - 17 - uvis25@47 { 18 - compatible = "st,uvis25"; 19 - reg = <0x47>; 20 - interrupt-parent = <&gpio0>; 21 - interrupts = <0 IRQ_TYPE_EDGE_RISING>; 22 - };
-18
Documentation/devicetree/bindings/iio/light/vcnl4035.txt
··· 1 - VISHAY VCNL4035 - Ambient Light and proximity sensor 2 - 3 - Link to datasheet: https://www.vishay.com/docs/84251/vcnl4035x01.pdf 4 - 5 - Required properties: 6 - 7 - -compatible: should be "vishay,vcnl4035" 8 - -reg: I2C address of the sensor, should be 0x60 9 - -interrupts: interrupt mapping for GPIO IRQ (level active low) 10 - 11 - Example: 12 - 13 - light-sensor@60 { 14 - compatible = "vishay,vcnl4035"; 15 - reg = <0x60>; 16 - interrupt-parent = <&gpio4>; 17 - interrupts = <11 IRQ_TYPE_LEVEL_LOW>; 18 - };
+45
Documentation/devicetree/bindings/iio/light/vishay,vcnl4035.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/light/vishay,vcnl4035.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: VISHAY VCNL4035 ambient Light and proximity sensor 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + description: | 13 + Datasheet at https://www.vishay.com/docs/84251/vcnl4035x01.pdf 14 + 15 + properties: 16 + compatible: 17 + const: vishay,vcnl4035 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + interrupts: 23 + maxItems: 1 24 + 25 + additionalProperties: false 26 + 27 + required: 28 + - compatible 29 + - reg 30 + 31 + examples: 32 + - | 33 + #include <dt-bindings/interrupt-controller/irq.h> 34 + i2c { 35 + #address-cells = <1>; 36 + #size-cells = <0>; 37 + 38 + light-sensor@60 { 39 + compatible = "vishay,vcnl4035"; 40 + reg = <0x60>; 41 + interrupt-parent = <&gpio4>; 42 + interrupts = <11 IRQ_TYPE_LEVEL_LOW>; 43 + }; 44 + }; 45 + ...
-15
Documentation/devicetree/bindings/iio/light/vl6180.txt
··· 1 - STMicro VL6180 - ALS, range and proximity sensor 2 - 3 - Link to datasheet: https://www.st.com/resource/en/datasheet/vl6180x.pdf 4 - 5 - Required properties: 6 - 7 - -compatible: should be "st,vl6180" 8 - -reg: the I2C address of the sensor 9 - 10 - Example: 11 - 12 - vl6180@29 { 13 - compatible = "st,vl6180"; 14 - reg = <0x29>; 15 - };
-31
Documentation/devicetree/bindings/iio/magnetometer/ak8974.txt
··· 1 - * Asahi Kasei AK8974 magnetometer sensor 2 - 3 - Required properties: 4 - 5 - - compatible: 6 - * "asahi-kasei,ak8974" 7 - * "alps,hscdtd008a" 8 - - reg : the I2C address of the magnetometer 9 - 10 - Optional properties: 11 - 12 - - avdd-supply: regulator supply for the analog voltage 13 - (see regulator/regulator.txt) 14 - - dvdd-supply: regulator supply for the digital voltage 15 - (see regulator/regulator.txt) 16 - - interrupts: data ready (DRDY) and interrupt (INT1) lines 17 - from the chip, the DRDY interrupt must be placed first. 18 - The interrupts can be triggered on rising or falling 19 - edges alike. 20 - - mount-matrix: an optional 3x3 mounting rotation matrix 21 - 22 - Example: 23 - 24 - ak8974@f { 25 - compatible = "asahi-kasei,ak8974"; 26 - reg = <0x0f>; 27 - avdd-supply = <&foo_reg>; 28 - dvdd-supply = <&bar_reg>; 29 - interrupts = <0 IRQ_TYPE_EDGE_RISING>, 30 - <1 IRQ_TYPE_EDGE_RISING>; 31 - };
+57
Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8974.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/magnetometer/asahi-kasei,ak8974.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Asahi Kasei AK8974 magnetometer sensor 8 + 9 + maintainers: 10 + - Linus Walleij <linus.walleij@linaro.org> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - alps,hscdtd008a 16 + - asahi-kasei,ak8974 17 + 18 + reg: 19 + maxItems: 1 20 + 21 + interrupts: 22 + minItems: 1 23 + maxItems: 2 24 + description: | 25 + Data ready (DRDY) and interrupt (INT1) lines from the chip. The DRDY 26 + interrupt must be placed first. The interrupts can be triggered on 27 + rising or falling edges. 28 + 29 + avdd-supply: true 30 + 31 + dvdd-supply: true 32 + 33 + mount-matrix: true 34 + 35 + additionalProperties: false 36 + 37 + required: 38 + - compatible 39 + - reg 40 + 41 + examples: 42 + - | 43 + #include <dt-bindings/interrupt-controller/irq.h> 44 + i2c { 45 + #address-cells = <1>; 46 + #size-cells = <0>; 47 + 48 + magnetometer@f { 49 + compatible = "asahi-kasei,ak8974"; 50 + reg = <0x0f>; 51 + avdd-supply = <&foo_reg>; 52 + dvdd-supply = <&bar_reg>; 53 + interrupts = <0 IRQ_TYPE_EDGE_RISING>, 54 + <1 IRQ_TYPE_EDGE_RISING>; 55 + }; 56 + }; 57 + ...
-25
Documentation/devicetree/bindings/iio/magnetometer/bmc150_magn.txt
··· 1 - * Bosch BMC150 magnetometer sensor 2 - 3 - http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf 4 - 5 - Required properties: 6 - 7 - - compatible : should be one of: 8 - "bosch,bmc150_magn" 9 - "bosch,bmc156_magn" 10 - "bosch,bmm150" 11 - "bosch,bmm150_magn" (DEPRECATED, use bosch,bmm150) 12 - - reg : the I2C address of the magnetometer 13 - 14 - Optional properties: 15 - 16 - - interrupts : interrupt mapping for GPIO IRQ 17 - 18 - Example: 19 - 20 - bmc150_magn@12 { 21 - compatible = "bosch,bmc150_magn"; 22 - reg = <0x12>; 23 - interrupt-parent = <&gpio1>; 24 - interrupts = <0 1>; 25 - };
+55
Documentation/devicetree/bindings/iio/magnetometer/bosch,bmc150_magn.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/magnetometer/bosch,bmc150_magn.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Bosch BMC150 magnetometer sensor 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + description: | 13 + Supports a range of parts, some of which form part of a multi die 14 + package that also contains other sensors. The interface is independent 15 + however, so a separate driver is used to support the magnetometer part. 16 + Datasheet at: 17 + http://ae-bst.resource.bosch.com/media/products/dokumente/bmc150/BST-BMC150-DS000-04.pdf 18 + 19 + properties: 20 + compatible: 21 + description: 22 + Note the bmm150_magn is a deprecated compatible as this part contains only 23 + a magnetometer. 24 + enum: 25 + - bosch,bmc150_magn 26 + - bosch,bmc156_magn 27 + - bosch,bmm150 28 + - bosch,bmm150_magn 29 + 30 + reg: 31 + maxItems: 1 32 + 33 + interrupts: 34 + maxItems: 1 35 + 36 + additionalProperties: false 37 + 38 + required: 39 + - compatible 40 + - reg 41 + 42 + examples: 43 + - | 44 + i2c { 45 + #address-cells = <1>; 46 + #size-cells = <0>; 47 + 48 + magnetometer@12 { 49 + compatible = "bosch,bmc150_magn"; 50 + reg = <0x12>; 51 + interrupt-parent = <&gpio1>; 52 + interrupts = <0 1>; 53 + }; 54 + }; 55 + ...
+48
Documentation/devicetree/bindings/iio/magnetometer/fsl,mag3110.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/magnetometer/fsl,mag3110.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Freescale MAG3110 magnetometer sensor 8 + 9 + maintainers: 10 + - Anson Huang <Anson.Huang@nxp.com> 11 + 12 + properties: 13 + compatible: 14 + const: fsl,mag3110 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + interrupts: 20 + maxItems: 1 21 + 22 + vdd-supply: true 23 + 24 + vddio-supply: true 25 + 26 + additionalProperties: false 27 + 28 + required: 29 + - compatible 30 + - reg 31 + 32 + examples: 33 + - | 34 + #include <dt-bindings/interrupt-controller/irq.h> 35 + i2c { 36 + #address-cells = <1>; 37 + #size-cells = <0>; 38 + 39 + magnetometer@e { 40 + compatible = "fsl,mag3110"; 41 + reg = <0x0e>; 42 + pinctrl-names = "default"; 43 + pinctrl-0 = <&pinctrl_i2c3_mag3110_int>; 44 + interrupt-parent = <&gpio3>; 45 + interrupts = <16 IRQ_TYPE_EDGE_RISING>; 46 + }; 47 + }; 48 + ...
-21
Documentation/devicetree/bindings/iio/magnetometer/hmc5843.txt
··· 1 - * Honeywell HMC5843 magnetometer sensor 2 - 3 - Required properties: 4 - 5 - - compatible : should be "honeywell,hmc5843" 6 - Other models which are supported with driver are: 7 - "honeywell,hmc5883" 8 - "honeywell,hmc5883l" 9 - "honeywell,hmc5983" 10 - - reg : the I2C address of the magnetometer - typically 0x1e 11 - 12 - Optional properties: 13 - 14 - - gpios : should be device tree identifier of the magnetometer DRDY pin 15 - 16 - Example: 17 - 18 - hmc5843@1e { 19 - compatible = "honeywell,hmc5843" 20 - reg = <0x1e>; 21 - };
+43
Documentation/devicetree/bindings/iio/magnetometer/honeywell,hmc5843.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/magnetometer/honeywell,hmc5843.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Honeywell HMC5843 magnetometer sensor 8 + 9 + maintainers: 10 + - Neil Brown <neilb@suse.de> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - honeywell,hmc5843 16 + - honeywell,hmc5883 17 + - honeywell,hmc5883l 18 + - honeywell,hmc5983 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + interrupts: 24 + maxItems: 1 25 + 26 + additionalProperties: false 27 + 28 + required: 29 + - compatible 30 + - reg 31 + 32 + examples: 33 + - | 34 + i2c { 35 + #address-cells = <1>; 36 + #size-cells = <0>; 37 + 38 + magnetometer@1e { 39 + compatible = "honeywell,hmc5843"; 40 + reg = <0x1e>; 41 + }; 42 + }; 43 + ...
-27
Documentation/devicetree/bindings/iio/magnetometer/mag3110.txt
··· 1 - * FREESCALE MAG3110 magnetometer sensor 2 - 3 - Required properties: 4 - 5 - - compatible : should be "fsl,mag3110" 6 - - reg : the I2C address of the magnetometer 7 - 8 - Optional properties: 9 - 10 - - interrupts: the sole interrupt generated by the device 11 - 12 - Refer to interrupt-controller/interrupts.txt for generic interrupt client 13 - node bindings. 14 - 15 - - vdd-supply: phandle to the regulator that provides power to the sensor. 16 - - vddio-supply: phandle to the regulator that provides power to the sensor's IO. 17 - 18 - Example: 19 - 20 - magnetometer@e { 21 - compatible = "fsl,mag3110"; 22 - reg = <0x0e>; 23 - pinctrl-names = "default"; 24 - pinctrl-0 = <&pinctrl_i2c3_mag3110_int>; 25 - interrupt-parent = <&gpio3>; 26 - interrupts = <16 IRQ_TYPE_EDGE_RISING>; 27 - };
-13
Documentation/devicetree/bindings/iio/magnetometer/mmc35240.txt
··· 1 - * MEMSIC MMC35240 magnetometer sensor 2 - 3 - Required properties: 4 - 5 - - compatible : should be "memsic,mmc35240" 6 - - reg : the I2C address of the magnetometer 7 - 8 - Example: 9 - 10 - mmc35240@30 { 11 - compatible = "memsic,mmc35240"; 12 - reg = <0x30>; 13 - };
-20
Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.txt
··· 1 - * PNI RM3100 3-axis magnetometer sensor 2 - 3 - Required properties: 4 - 5 - - compatible : should be "pni,rm3100" 6 - - reg : the I2C address or SPI chip select number of the sensor. 7 - 8 - Optional properties: 9 - 10 - - interrupts: data ready (DRDY) from the chip. 11 - The interrupts can be triggered on level high. 12 - 13 - Example: 14 - 15 - rm3100: rm3100@20 { 16 - compatible = "pni,rm3100"; 17 - reg = <0x20>; 18 - interrupt-parent = <&gpio0>; 19 - interrupts = <4 IRQ_TYPE_LEVEL_HIGH>; 20 - };
+42
Documentation/devicetree/bindings/iio/magnetometer/pni,rm3100.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/magnetometer/pni,rm3100.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: PNI RM3100 3-axis magnetometer sensor 8 + 9 + maintainers: 10 + - Song Qiang <songqiang1304521@gmail.com> 11 + 12 + properties: 13 + compatible: 14 + const: pni,rm3100 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + interrupts: 20 + maxItems: 1 21 + 22 + additionalProperties: false 23 + 24 + required: 25 + - compatible 26 + - reg 27 + 28 + examples: 29 + - | 30 + #include <dt-bindings/interrupt-controller/irq.h> 31 + i2c { 32 + #address-cells = <1>; 33 + #size-cells = <0>; 34 + 35 + magnetometer@20 { 36 + compatible = "pni,rm3100"; 37 + reg = <0x20>; 38 + interrupt-parent = <&gpio0>; 39 + interrupts = <4 IRQ_TYPE_LEVEL_HIGH>; 40 + }; 41 + }; 42 + ...
-27
Documentation/devicetree/bindings/iio/potentiometer/ad5272.txt
··· 1 - * Analog Devices AD5272 digital potentiometer 2 - 3 - The node for this device must be a child node of a I2C controller, hence 4 - all mandatory properties for your controller must be specified. See directory: 5 - 6 - Documentation/devicetree/bindings/i2c 7 - 8 - for more details. 9 - 10 - Required properties: 11 - - compatible: Must be one of the following, depending on the model: 12 - adi,ad5272-020 13 - adi,ad5272-050 14 - adi,ad5272-100 15 - adi,ad5274-020 16 - adi,ad5274-100 17 - 18 - Optional properties: 19 - - reset-gpios: GPIO specification for the RESET input. This is an 20 - active low signal to the AD5272. 21 - 22 - Example: 23 - ad5272: potentiometer@2f { 24 - reg = <0x2F>; 25 - compatible = "adi,ad5272-020"; 26 - reset-gpios = <&gpio3 6 GPIO_ACTIVE_HIGH>; 27 - };
+50
Documentation/devicetree/bindings/iio/potentiometer/adi,ad5272.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/potentiometer/adi,ad5272.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices AD5272 digital potentiometer 8 + 9 + maintainers: 10 + - Phil Reid <preid@electromag.com.au> 11 + 12 + description: | 13 + Datasheet: https://www.analog.com/en/products/ad5272.html 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - adi,ad5272-020 19 + - adi,ad5272-050 20 + - adi,ad5272-100 21 + - adi,ad5274-020 22 + - adi,ad5274-100 23 + 24 + reg: 25 + maxItems: 1 26 + 27 + reset-gpios: 28 + description: 29 + Active low signal to the AD5272 RESET input. 30 + 31 + additionalProperties: false 32 + 33 + required: 34 + - compatible 35 + - reg 36 + 37 + examples: 38 + - | 39 + #include <dt-bindings/gpio/gpio.h> 40 + i2c { 41 + #address-cells = <1>; 42 + #size-cells = <0>; 43 + 44 + potentiometer@2f { 45 + compatible = "adi,ad5272-020"; 46 + reg = <0x2F>; 47 + reset-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>; 48 + }; 49 + }; 50 + ...
-21
Documentation/devicetree/bindings/iio/potentiometer/ds1803.txt
··· 1 - * Maxim Integrated DS1803 digital potentiometer driver 2 - 3 - The node for this driver must be a child node of a I2C controller, hence 4 - all mandatory properties for your controller must be specified. See directory: 5 - 6 - Documentation/devicetree/bindings/i2c 7 - 8 - for more details. 9 - 10 - Required properties: 11 - - compatible: Must be one of the following, depending on the 12 - model: 13 - "maxim,ds1803-010", 14 - "maxim,ds1803-050", 15 - "maxim,ds1803-100" 16 - 17 - Example: 18 - ds1803: ds1803@1 { 19 - reg = <0x28>; 20 - compatible = "maxim,ds1803-010"; 21 - };
-23
Documentation/devicetree/bindings/iio/potentiometer/max5481.txt
··· 1 - * Maxim Linear-Taper Digital Potentiometer MAX5481-MAX5484 2 - 3 - The node for this driver must be a child node of a SPI controller, hence 4 - all mandatory properties described in 5 - 6 - Documentation/devicetree/bindings/spi/spi-bus.txt 7 - 8 - must be specified. 9 - 10 - Required properties: 11 - - compatible: Must be one of the following, depending on the 12 - model: 13 - "maxim,max5481" 14 - "maxim,max5482" 15 - "maxim,max5483" 16 - "maxim,max5484" 17 - 18 - Example: 19 - max548x: max548x@0 { 20 - compatible = "maxim,max5482"; 21 - spi-max-frequency = <7000000>; 22 - reg = <0>; /* chip-select */ 23 - };
-28
Documentation/devicetree/bindings/iio/potentiometer/mcp41010.txt
··· 1 - * Microchip MCP41010/41050/41100/42010/42050/42100 Digital Potentiometer 2 - 3 - Datasheet publicly available at: 4 - https://ww1.microchip.com/downloads/en/devicedoc/11195c.pdf 5 - 6 - The node for this driver must be a child node of a SPI controller, hence 7 - all mandatory properties described in 8 - 9 - Documentation/devicetree/bindings/spi/spi-bus.txt 10 - 11 - must be specified. 12 - 13 - Required properties: 14 - - compatible: Must be one of the following, depending on the 15 - model: 16 - "microchip,mcp41010" 17 - "microchip,mcp41050" 18 - "microchip,mcp41100" 19 - "microchip,mcp42010" 20 - "microchip,mcp42050" 21 - "microchip,mcp42100" 22 - 23 - Example: 24 - potentiometer@0 { 25 - compatible = "microchip,mcp41010"; 26 - reg = <0>; 27 - spi-max-frequency = <500000>; 28 - };
-84
Documentation/devicetree/bindings/iio/potentiometer/mcp4131.txt
··· 1 - * Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X Digital Potentiometer 2 - driver 3 - 4 - The node for this driver must be a child node of a SPI controller, hence 5 - all mandatory properties described in 6 - 7 - Documentation/devicetree/bindings/spi/spi-bus.txt 8 - 9 - must be specified. 10 - 11 - Required properties: 12 - - compatible: Must be one of the following, depending on the 13 - model: 14 - "microchip,mcp4131-502" 15 - "microchip,mcp4131-103" 16 - "microchip,mcp4131-503" 17 - "microchip,mcp4131-104" 18 - "microchip,mcp4132-502" 19 - "microchip,mcp4132-103" 20 - "microchip,mcp4132-503" 21 - "microchip,mcp4132-104" 22 - "microchip,mcp4141-502" 23 - "microchip,mcp4141-103" 24 - "microchip,mcp4141-503" 25 - "microchip,mcp4141-104" 26 - "microchip,mcp4142-502" 27 - "microchip,mcp4142-103" 28 - "microchip,mcp4142-503" 29 - "microchip,mcp4142-104" 30 - "microchip,mcp4151-502" 31 - "microchip,mcp4151-103" 32 - "microchip,mcp4151-503" 33 - "microchip,mcp4151-104" 34 - "microchip,mcp4152-502" 35 - "microchip,mcp4152-103" 36 - "microchip,mcp4152-503" 37 - "microchip,mcp4152-104" 38 - "microchip,mcp4161-502" 39 - "microchip,mcp4161-103" 40 - "microchip,mcp4161-503" 41 - "microchip,mcp4161-104" 42 - "microchip,mcp4162-502" 43 - "microchip,mcp4162-103" 44 - "microchip,mcp4162-503" 45 - "microchip,mcp4162-104" 46 - "microchip,mcp4231-502" 47 - "microchip,mcp4231-103" 48 - "microchip,mcp4231-503" 49 - "microchip,mcp4231-104" 50 - "microchip,mcp4232-502" 51 - "microchip,mcp4232-103" 52 - "microchip,mcp4232-503" 53 - "microchip,mcp4232-104" 54 - "microchip,mcp4241-502" 55 - "microchip,mcp4241-103" 56 - "microchip,mcp4241-503" 57 - "microchip,mcp4241-104" 58 - "microchip,mcp4242-502" 59 - "microchip,mcp4242-103" 60 - "microchip,mcp4242-503" 61 - "microchip,mcp4242-104" 62 - "microchip,mcp4251-502" 63 - "microchip,mcp4251-103" 64 - "microchip,mcp4251-503" 65 - "microchip,mcp4251-104" 66 - "microchip,mcp4252-502" 67 - "microchip,mcp4252-103" 68 - "microchip,mcp4252-503" 69 - "microchip,mcp4252-104" 70 - "microchip,mcp4261-502" 71 - "microchip,mcp4261-103" 72 - "microchip,mcp4261-503" 73 - "microchip,mcp4261-104" 74 - "microchip,mcp4262-502" 75 - "microchip,mcp4262-103" 76 - "microchip,mcp4262-503" 77 - "microchip,mcp4262-104" 78 - 79 - Example: 80 - mcp4131: mcp4131@0 { 81 - compatible = "mcp4131-502"; 82 - reg = <0>; 83 - spi-max-frequency = <500000>; 84 - };
+48
Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp41010.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/potentiometer/microchip,mcp41010.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Microchip MCP41010/41050/41100/42010/42050/42100 Digital Potentiometer 8 + 9 + maintainers: 10 + - Chris Coffey <cmc@babblebit.net> 11 + 12 + description: | 13 + Datasheet: https://ww1.microchip.com/downloads/en/devicedoc/11195c.pdf 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - microchip,mcp41010 19 + - microchip,mcp41050 20 + - microchip,mcp41100 21 + - microchip,mcp42010 22 + - microchip,mcp42050 23 + - microchip,mcp42100 24 + 25 + reg: 26 + maxItems: 1 27 + 28 + spi-max-frequency: true 29 + 30 + additionalProperties: false 31 + 32 + required: 33 + - compatible 34 + - reg 35 + 36 + examples: 37 + - | 38 + spi { 39 + #address-cells = <1>; 40 + #size-cells = <0>; 41 + 42 + potentiometer@0 { 43 + compatible = "microchip,mcp41010"; 44 + reg = <0>; 45 + spi-max-frequency = <500000>; 46 + }; 47 + }; 48 + ...
+103
Documentation/devicetree/bindings/iio/potentiometer/microchip,mcp4131.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/potentiometer/microchip,mcp4131.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Microchip MCP413X/414X/415X/416X/423X/424X/425X/426X Digital Potentiometer 8 + 9 + maintainers: 10 + - Slawomir Stepien <sst@poczta.fm> 11 + 12 + properties: 13 + compatible: 14 + enum: 15 + - microchip,mcp4131-103 16 + - microchip,mcp4131-104 17 + - microchip,mcp4131-502 18 + - microchip,mcp4131-503 19 + - microchip,mcp4132-103 20 + - microchip,mcp4132-104 21 + - microchip,mcp4132-502 22 + - microchip,mcp4132-503 23 + - microchip,mcp4141-103 24 + - microchip,mcp4141-104 25 + - microchip,mcp4141-502 26 + - microchip,mcp4141-503 27 + - microchip,mcp4142-103 28 + - microchip,mcp4142-104 29 + - microchip,mcp4142-502 30 + - microchip,mcp4142-503 31 + - microchip,mcp4151-103 32 + - microchip,mcp4151-104 33 + - microchip,mcp4151-502 34 + - microchip,mcp4151-503 35 + - microchip,mcp4152-103 36 + - microchip,mcp4152-104 37 + - microchip,mcp4152-502 38 + - microchip,mcp4152-503 39 + - microchip,mcp4161-103 40 + - microchip,mcp4161-104 41 + - microchip,mcp4161-502 42 + - microchip,mcp4161-503 43 + - microchip,mcp4162-103 44 + - microchip,mcp4162-104 45 + - microchip,mcp4162-502 46 + - microchip,mcp4162-503 47 + - microchip,mcp4231-103 48 + - microchip,mcp4231-104 49 + - microchip,mcp4231-502 50 + - microchip,mcp4231-503 51 + - microchip,mcp4232-103 52 + - microchip,mcp4232-104 53 + - microchip,mcp4232-502 54 + - microchip,mcp4232-503 55 + - microchip,mcp4241-103 56 + - microchip,mcp4241-104 57 + - microchip,mcp4241-502 58 + - microchip,mcp4241-503 59 + - microchip,mcp4242-103 60 + - microchip,mcp4242-104 61 + - microchip,mcp4242-502 62 + - microchip,mcp4242-503 63 + - microchip,mcp4251-103 64 + - microchip,mcp4251-104 65 + - microchip,mcp4251-502 66 + - microchip,mcp4251-503 67 + - microchip,mcp4252-103 68 + - microchip,mcp4252-104 69 + - microchip,mcp4252-502 70 + - microchip,mcp4252-503 71 + - microchip,mcp4261-103 72 + - microchip,mcp4261-104 73 + - microchip,mcp4261-502 74 + - microchip,mcp4261-503 75 + - microchip,mcp4262-103 76 + - microchip,mcp4262-104 77 + - microchip,mcp4262-502 78 + - microchip,mcp4262-503 79 + 80 + reg: 81 + maxItems: 1 82 + 83 + spi-max-frequency: true 84 + 85 + additionalProperties: false 86 + 87 + required: 88 + - compatible 89 + - reg 90 + 91 + examples: 92 + - | 93 + spi { 94 + #address-cells = <1>; 95 + #size-cells = <0>; 96 + 97 + potentiometer@0 { 98 + compatible = "mcp4131-502"; 99 + reg = <0>; 100 + spi-max-frequency = <500000>; 101 + }; 102 + }; 103 + ...
+47
Documentation/devicetree/bindings/iio/pressure/hoperf,hp03.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/pressure/hoperf,hp03.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: HopeRF HP03 digital pressure/temperature sensors 8 + 9 + maintainers: 10 + - Marek Vasut <marex@denx.de> 11 + 12 + description: | 13 + Digital pressure and temperature sensor with an I2C interface. 14 + 15 + properties: 16 + compatible: 17 + const: hoperf,hp03 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + xclr-gpios: 23 + description: 24 + The XCLR pin is a reset of the ADC in the chip, it must be pulled 25 + HI before the conversion and readout of the value from the ADC 26 + registers and pulled LO afterward. 27 + maxItems: 1 28 + 29 + required: 30 + - compatible 31 + - reg 32 + 33 + additionalProperties: false 34 + 35 + examples: 36 + - | 37 + i2c { 38 + #address-cells = <1>; 39 + #size-cells = <0>; 40 + 41 + pressure@77 { 42 + compatible = "hoperf,hp03"; 43 + reg = <0x77>; 44 + xclr-gpios = <&portc 0 0x0>; 45 + }; 46 + }; 47 + ...
-17
Documentation/devicetree/bindings/iio/pressure/hp03.txt
··· 1 - HopeRF HP03 digital pressure/temperature sensors 2 - 3 - Required properties: 4 - - compatible: must be "hoperf,hp03" 5 - - xclr-gpio: must be device tree identifier of the XCLR pin. 6 - The XCLR pin is a reset of the ADC in the chip, 7 - it must be pulled HI before the conversion and 8 - readout of the value from the ADC registers and 9 - pulled LO afterward. 10 - 11 - Example: 12 - 13 - hp03@77 { 14 - compatible = "hoperf,hp03"; 15 - reg = <0x77>; 16 - xclr-gpio = <&portc 0 0x0>; 17 - };
+57
Documentation/devicetree/bindings/iio/pressure/meas,ms5611.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/pressure/meas,ms5611.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Measurement Specialities ms5611 and similar pressure sensors 8 + 9 + maintainers: 10 + - Tomasz Duszynski <tduszyns@gmail.com> 11 + 12 + description: | 13 + Pressure sensors from MEAS Switzerland with SPI and I2C bus interfaces. 14 + 15 + properties: 16 + compatible: 17 + enum: 18 + - meas,ms5607 19 + - meas,ms5611 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + vdd-supply: true 25 + 26 + spi-max-frequency: 27 + maximum: 20000000 28 + 29 + required: 30 + - compatible 31 + - reg 32 + 33 + additionalProperties: false 34 + 35 + examples: 36 + - | 37 + i2c { 38 + #address-cells = <1>; 39 + #size-cells = <0>; 40 + 41 + pressure@77 { 42 + compatible = "meas,ms5607"; 43 + reg = <0x77>; 44 + vdd-supply = <&ldo_3v3_gnss>; 45 + }; 46 + }; 47 + - | 48 + spi { 49 + #address-cells = <1>; 50 + #size-cells = <0>; 51 + pressure@0 { 52 + compatible = "meas,ms5611"; 53 + reg = <0>; 54 + vdd-supply = <&ldo_3v3_gnss>; 55 + }; 56 + }; 57 + ...
-19
Documentation/devicetree/bindings/iio/pressure/ms5611.txt
··· 1 - MEAS ms5611 family pressure sensors 2 - 3 - Pressure sensors from MEAS Switzerland with SPI and I2C bus interfaces. 4 - 5 - Required properties: 6 - - compatible: "meas,ms5611" or "meas,ms5607" 7 - - reg: the I2C address or SPI chip select the device will respond to 8 - 9 - Optional properties: 10 - - vdd-supply: an optional regulator that needs to be on to provide VDD 11 - power to the sensor. 12 - 13 - Example: 14 - 15 - ms5607@77 { 16 - compatible = "meas,ms5607"; 17 - reg = <0x77>; 18 - vdd-supply = <&ldo_3v3_gnss>; 19 - };
-17
Documentation/devicetree/bindings/iio/pressure/ms5637.txt
··· 1 - * MS5637 - Measurement-Specialties MS5637, MS5805, MS5837 and MS8607 pressure & temperature sensor 2 - 3 - Required properties: 4 - 5 - -compatible: should be one of the following 6 - meas,ms5637 7 - meas,ms5805 8 - meas,ms5837 9 - meas,ms8607-temppressure 10 - -reg: I2C address of the sensor 11 - 12 - Example: 13 - 14 - ms5637@76 { 15 - compatible = "meas,ms5637"; 16 - reg = <0x76>; 17 - };
+62
Documentation/devicetree/bindings/iio/pressure/murata,zpa2326.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/pressure/murata,zpa2326.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Murata ZPA2326 pressure sensor 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + description: | 13 + Pressure sensor from Murata with SPI and I2C bus interfaces. 14 + 15 + 16 + properties: 17 + compatible: 18 + const: murata,zpa2326 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + vdd-supply: true 24 + vref-supply: true 25 + 26 + interrupts: 27 + maxItems: 1 28 + 29 + spi-max-frequency: 30 + maximum: 1000000 31 + 32 + required: 33 + - compatible 34 + - reg 35 + 36 + additionalProperties: false 37 + 38 + examples: 39 + - | 40 + i2c { 41 + #address-cells = <1>; 42 + #size-cells = <0>; 43 + 44 + pressure@5c { 45 + compatible = "murata,zpa2326"; 46 + reg = <0x5c>; 47 + interrupt-parent = <&gpio>; 48 + interrupts = <12>; 49 + vdd-supply = <&ldo_1v8_gnss>; 50 + }; 51 + }; 52 + - | 53 + spi { 54 + #address-cells = <1>; 55 + #size-cells = <0>; 56 + pressure@0 { 57 + compatible = "murata,zpa2326"; 58 + reg = <0>; 59 + spi-max-frequency = <500000>; 60 + }; 61 + }; 62 + ...
-29
Documentation/devicetree/bindings/iio/pressure/zpa2326.txt
··· 1 - Murata ZPA2326 pressure sensor 2 - 3 - Pressure sensor from Murata with SPI and I2C bus interfaces. 4 - 5 - Required properties: 6 - - compatible: "murata,zpa2326" 7 - - reg: the I2C address or SPI chip select the device will respond to 8 - 9 - Recommended properties for SPI bus usage: 10 - - spi-max-frequency: maximum SPI bus frequency as documented in 11 - Documentation/devicetree/bindings/spi/spi-bus.txt 12 - 13 - Optional properties: 14 - - vref-supply: an optional regulator that needs to be on to provide VREF 15 - power to the sensor 16 - - vdd-supply: an optional regulator that needs to be on to provide VDD 17 - power to the sensor 18 - - interrupts: interrupt mapping for IRQ as documented in 19 - Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 20 - 21 - Example: 22 - 23 - zpa2326@5c { 24 - compatible = "murata,zpa2326"; 25 - reg = <0x5c>; 26 - interrupt-parent = <&gpio>; 27 - interrupts = <12>; 28 - vdd-supply = <&ldo_1v8_gnss>; 29 - };
+71
Documentation/devicetree/bindings/iio/proximity/ams,as3935.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/proximity/ams,as3935.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Austrian Microsystems AS3935 Franklin lightning sensor 8 + 9 + maintainers: 10 + - Matt Ranostay <matt.ranostay@konsulko.com> 11 + 12 + description: 13 + This lightening distance sensor uses an I2C or SPI interface. The 14 + binding currently only covers the SPI option. 15 + 16 + properties: 17 + compatible: 18 + const: ams,as3935 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + spi-max-frequency: 24 + maximum: 2000000 25 + 26 + spi-cpha: true 27 + 28 + interrupts: 29 + maxItems: 1 30 + 31 + ams,tuning-capacitor-pf: 32 + $ref: /schemas/types.yaml#/definitions/uint32 33 + description: 34 + Calibration tuning capacitor stepping value. This will require using 35 + the calibration data from the manufacturer. 36 + minimum: 0 37 + maximum: 120 38 + 39 + ams,nflwdth: 40 + $ref: /schemas/types.yaml#/definitions/uint32 41 + description: 42 + Set the noise and watchdog threshold register on startup. This will 43 + need to set according to the noise from the MCU board, and possibly 44 + the local environment. Refer to the datasheet for the threshold settings. 45 + 46 + required: 47 + - compatible 48 + - reg 49 + - spi-cpha 50 + - interrupts 51 + 52 + additionalProperties: false 53 + 54 + examples: 55 + - | 56 + spi { 57 + #address-cells = <1>; 58 + #size-cells = <0>; 59 + 60 + lightning@0 { 61 + compatible = "ams,as3935"; 62 + reg = <0>; 63 + spi-max-frequency = <400000>; 64 + spi-cpha; 65 + interrupt-parent = <&gpio1>; 66 + interrupts = <16 1>; 67 + ams,tuning-capacitor-pf = <80>; 68 + ams,nflwdth = <0x44>; 69 + }; 70 + }; 71 + ...
-34
Documentation/devicetree/bindings/iio/proximity/as3935.txt
··· 1 - Austrian Microsystems AS3935 Franklin lightning sensor device driver 2 - 3 - Required properties: 4 - - compatible: must be "ams,as3935" 5 - - reg: SPI chip select number for the device 6 - - spi-max-frequency: specifies maximum SPI clock frequency 7 - - spi-cpha: SPI Mode 1. Refer to spi/spi-bus.txt for generic SPI 8 - slave node bindings. 9 - - interrupts : the sole interrupt generated by the device 10 - 11 - Refer to interrupt-controller/interrupts.txt for generic 12 - interrupt client node bindings. 13 - 14 - Optional properties: 15 - - ams,tuning-capacitor-pf: Calibration tuning capacitor stepping 16 - value 0 - 120pF. This will require using the calibration data from 17 - the manufacturer. 18 - - ams,nflwdth: Set the noise and watchdog threshold register on 19 - startup. This will need to set according to the noise from the 20 - MCU board, and possibly the local environment. Refer to the 21 - datasheet for the threshold settings. 22 - 23 - Example: 24 - 25 - as3935@0 { 26 - compatible = "ams,as3935"; 27 - reg = <0>; 28 - spi-max-frequency = <400000>; 29 - spi-cpha; 30 - interrupt-parent = <&gpio1>; 31 - interrupts = <16 1>; 32 - ams,tuning-capacitor-pf = <80>; 33 - ams,nflwdth = <0x44>; 34 - };
+63
Documentation/devicetree/bindings/iio/proximity/semtech,sx9310.yaml
··· 40 40 "#io-channel-cells": 41 41 const: 1 42 42 43 + semtech,cs0-ground: 44 + description: Indicates the CS0 sensor is connected to ground. 45 + type: boolean 46 + 47 + semtech,combined-sensors: 48 + $ref: /schemas/types.yaml#/definitions/uint32-array 49 + description: | 50 + List of which sensors are combined and represented by CS3. 51 + Possible values are - 52 + 3 - CS3 (internal) 53 + 0 1 - CS0 + CS1 54 + 1 2 - CS1 + CS2 (default) 55 + 0 1 2 3 - CS0 + CS1 + CS2 + CS3 56 + items: 57 + enum: [ 0, 1, 2, 3 ] 58 + minItems: 1 59 + maxItems: 4 60 + 61 + semtech,resolution: 62 + description: 63 + Capacitance measure resolution. Refer to datasheet for more details. 64 + enum: 65 + - coarsest 66 + - very-coarse 67 + - coarse 68 + - medium-coarse 69 + - medium 70 + - fine 71 + - very-fine 72 + - finest 73 + 74 + semtech,startup-sensor: 75 + $ref: /schemas/types.yaml#definitions/uint32 76 + enum: [0, 1, 2, 3] 77 + default: 0 78 + description: 79 + Sensor used for start-up proximity detection. The combined 80 + sensor is represented by the value 3. This is used for initial 81 + compensation. 82 + 83 + semtech,proxraw-strength: 84 + $ref: /schemas/types.yaml#definitions/uint32 85 + enum: [0, 2, 4, 8] 86 + default: 2 87 + description: 88 + PROXRAW filter strength. A value of 0 represents off, and other values 89 + represent 1-1/N. 90 + 91 + semtech,avg-pos-strength: 92 + $ref: /schemas/types.yaml#definitions/uint32 93 + enum: [0, 16, 64, 128, 256, 512, 1024, 4294967295] 94 + default: 16 95 + description: 96 + Average positive filter strength. A value of 0 represents off and 97 + UINT_MAX (4294967295) represents infinite. Other values 98 + represent 1-1/N. 99 + 43 100 required: 44 101 - compatible 45 102 - reg ··· 118 61 vdd-supply = <&pp3300_a>; 119 62 svdd-supply = <&pp1800_prox>; 120 63 #io-channel-cells = <1>; 64 + semtech,cs0-ground; 65 + semtech,combined-sensors = <1 2 3>; 66 + semtech,resolution = "fine"; 67 + semtech,startup-sensor = <1>; 68 + semtech,proxraw-strength = <2>; 69 + semtech,avg-pos-strength = <64>; 121 70 }; 122 71 };
+50
Documentation/devicetree/bindings/iio/proximity/semtech,sx9500.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/proximity/semtech,sx9500.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Semtech's SX9500 capacitive proximity button device 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + properties: 13 + compatible: 14 + const: semtech,sx9500 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + interrupts: 20 + maxItems: 1 21 + 22 + reset-gpios: 23 + description: 24 + GPIO connected to the active low reset pin. 25 + maxItems: 1 26 + 27 + required: 28 + - compatible 29 + - reg 30 + - interrupts 31 + 32 + additionalProperties: false 33 + 34 + examples: 35 + - | 36 + #include <dt-bindings/interrupt-controller/irq.h> 37 + #include <dt-bindings/gpio/gpio.h> 38 + i2c { 39 + #address-cells = <1>; 40 + #size-cells = <0>; 41 + 42 + proximity@28 { 43 + compatible = "semtech,sx9500"; 44 + reg = <0x28>; 45 + interrupt-parent = <&gpio2>; 46 + interrupts = <16 IRQ_TYPE_LEVEL_LOW>; 47 + reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; 48 + }; 49 + }; 50 + ...
+42
Documentation/devicetree/bindings/iio/proximity/st,vl53l0x.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/proximity/st,vl53l0x.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: ST VL53L0X ToF ranging sensor 8 + 9 + maintainers: 10 + - Song Qiang <songqiang1304521@gmail.com> 11 + 12 + properties: 13 + compatible: 14 + const: st,vl53l0x 15 + 16 + reg: 17 + maxItems: 1 18 + 19 + interrupts: 20 + maxItems: 1 21 + 22 + required: 23 + - compatible 24 + - reg 25 + 26 + additionalProperties: false 27 + 28 + examples: 29 + - | 30 + #include <dt-bindings/interrupt-controller/irq.h> 31 + i2c { 32 + #address-cells = <1>; 33 + #size-cells = <0>; 34 + 35 + proximity@29 { 36 + compatible = "st,vl53l0x"; 37 + reg = <0x29>; 38 + interrupt-parent = <&gpio>; 39 + interrupts = <23 IRQ_TYPE_EDGE_FALLING>; 40 + }; 41 + }; 42 + ...
-23
Documentation/devicetree/bindings/iio/proximity/sx9500.txt
··· 1 - Semtech's SX9500 capacitive proximity button device driver 2 - 3 - Required properties: 4 - - compatible: must be "semtech,sx9500" 5 - - reg: i2c address where to find the device 6 - - interrupts : the sole interrupt generated by the device 7 - 8 - Refer to interrupt-controller/interrupts.txt for generic 9 - interrupt client node bindings. 10 - 11 - Optional properties: 12 - - reset-gpios: Reference to the GPIO connected to the device's active 13 - low reset pin. 14 - 15 - Example: 16 - 17 - sx9500@28 { 18 - compatible = "semtech,sx9500"; 19 - reg = <0x28>; 20 - interrupt-parent = <&gpio2>; 21 - interrupts = <16 IRQ_TYPE_LEVEL_LOW>; 22 - reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>; 23 - };
-18
Documentation/devicetree/bindings/iio/proximity/vl53l0x.txt
··· 1 - ST VL53L0X ToF ranging sensor 2 - 3 - Required properties: 4 - - compatible: must be "st,vl53l0x" 5 - - reg: i2c address where to find the device 6 - 7 - Optional properties: 8 - - interrupts: Interrupt for notifying that new measurement is ready. 9 - If no interrupt is specified, polling is used. 10 - 11 - Example: 12 - 13 - vl53l0x@29 { 14 - compatible = "st,vl53l0x"; 15 - reg = <0x29>; 16 - interrupt-parent = <&gpio>; 17 - interrupts = <23 IRQ_TYPE_EDGE_FALLING>; 18 - };
-31
Documentation/devicetree/bindings/iio/resolver/ad2s90.txt
··· 1 - Analog Devices AD2S90 Resolver-to-Digital Converter 2 - 3 - https://www.analog.com/en/products/ad2s90.html 4 - 5 - Required properties: 6 - - compatible: should be "adi,ad2s90" 7 - - reg: SPI chip select number for the device 8 - - spi-max-frequency: set maximum clock frequency, must be 830000 9 - - spi-cpol and spi-cpha: 10 - Either SPI mode (0,0) or (1,1) must be used, so specify none or both of 11 - spi-cpha, spi-cpol. 12 - 13 - See for more details: 14 - Documentation/devicetree/bindings/spi/spi-bus.txt 15 - 16 - Note about max frequency: 17 - Chip's max frequency, as specified in its datasheet, is 2Mhz. But a 600ns 18 - delay is expected between the application of a logic LO to CS and the 19 - application of SCLK, as also specified. And since the delay is not 20 - implemented in the spi code, to satisfy it, SCLK's period should be at most 21 - 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which gives 22 - roughly 830000Hz. 23 - 24 - Example: 25 - resolver@0 { 26 - compatible = "adi,ad2s90"; 27 - reg = <0>; 28 - spi-max-frequency = <830000>; 29 - spi-cpol; 30 - spi-cpha; 31 - };
+60
Documentation/devicetree/bindings/iio/resolver/adi,ad2s90.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/resolver/adi,ad2s90.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices AD2S90 Resolver-to-Digital Converter 8 + 9 + maintainers: 10 + - Matheus Tavares <matheus.bernardino@usp.br> 11 + 12 + description: | 13 + Datasheet: https://www.analog.com/en/products/ad2s90.html 14 + 15 + properties: 16 + compatible: 17 + const: adi,ad2s90 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + spi-max-frequency: 23 + maximum: 830000 24 + description: | 25 + Chip's max frequency, as specified in its datasheet, is 2Mhz. But a 600ns 26 + delay is expected between the application of a logic LO to CS and the 27 + application of SCLK, as also specified. And since the delay is not 28 + implemented in the spi code, to satisfy it, SCLK's period should be at 29 + most 2 * 600ns, so the max frequency should be 1 / (2 * 6e-7), which gives 30 + roughly 830000Hz. 31 + 32 + spi-cpol: true 33 + 34 + spi-cpha: true 35 + 36 + additionalProperties: false 37 + 38 + required: 39 + - compatible 40 + - reg 41 + 42 + dependencies: 43 + spi-cpol: [ spi-cpha ] 44 + spi-cpha: [ spi-cpol ] 45 + 46 + examples: 47 + - | 48 + spi { 49 + #address-cells = <1>; 50 + #size-cells = <0>; 51 + 52 + resolver@0 { 53 + compatible = "adi,ad2s90"; 54 + reg = <0>; 55 + spi-max-frequency = <830000>; 56 + spi-cpol; 57 + spi-cpha; 58 + }; 59 + }; 60 + ...
+72
Documentation/devicetree/bindings/iio/samsung,sensorhub-rinato.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/samsung,sensorhub-rinato.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Samsung Sensorhub driver 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + description: | 13 + Sensorhub is a MCU which manages several sensors and also plays the role 14 + of a virtual sensor device. 15 + 16 + properties: 17 + compatible: 18 + enum: 19 + - samsung,sensorhub-rinato 20 + - samsung,sensorhub-thermostat 21 + 22 + reg: 23 + maxItems: 1 24 + 25 + interrupts: 26 + maxItems: 1 27 + 28 + ap-mcu-gpios: 29 + maxItems: 1 30 + description: 31 + Application Processor to sensorhub line - used during communication 32 + 33 + mcu-ap-gpios: 34 + maxItems: 1 35 + description: 36 + Sensorhub to Application Processor - used during communication 37 + 38 + mcu-reset-gpios: 39 + maxItems: 1 40 + description: 41 + Reset the sensorhub. 42 + 43 + spi-max-frequency: true 44 + 45 + additionalProperties: false 46 + 47 + required: 48 + - compatible 49 + - reg 50 + - interrupts 51 + - ap-mcu-gpios 52 + - mcu-ap-gpios 53 + - mcu-reset-gpios 54 + 55 + examples: 56 + - | 57 + spi { 58 + #address-cells = <1>; 59 + #size-cells = <0>; 60 + 61 + sensorhub@0 { 62 + compatible = "samsung,sensorhub-rinato"; 63 + reg = <0>; 64 + spi-max-frequency = <5000000>; 65 + interrupt-parent = <&gpx0>; 66 + interrupts = <2 0>; 67 + ap-mcu-gpios = <&gpx0 0 0>; 68 + mcu-ap-gpios = <&gpx0 4 0>; 69 + mcu-reset-gpios = <&gpx0 5 0>; 70 + }; 71 + }; 72 + ...
-24
Documentation/devicetree/bindings/iio/sensorhub.txt
··· 1 - Samsung Sensorhub driver 2 - 3 - Sensorhub is a MCU which manages several sensors and also plays the role 4 - of a virtual sensor device. 5 - 6 - Required properties: 7 - - compatible: "samsung,sensorhub-rinato" or "samsung,sensorhub-thermostat" 8 - - spi-max-frequency: max SPI clock frequency 9 - - interrupts: communication interrupt 10 - - ap-mcu-gpios: [out] ap to sensorhub line - used during communication 11 - - mcu-ap-gpios: [in] sensorhub to ap - used during communication 12 - - mcu-reset-gpios: [out] sensorhub reset 13 - 14 - Example: 15 - 16 - shub_spi: shub { 17 - compatible = "samsung,sensorhub-rinato"; 18 - spi-max-frequency = <5000000>; 19 - interrupt-parent = <&gpx0>; 20 - interrupts = <2 0>; 21 - ap-mcu-gpios = <&gpx0 0 0>; 22 - mcu-ap-gpios = <&gpx0 4 0>; 23 - mcu-reset-gpios = <&gpx0 5 0>; 24 - };
-24
Documentation/devicetree/bindings/iio/temperature/max31856.txt
··· 1 - Maxim MAX31856 thermocouple support 2 - 3 - https://datasheets.maximintegrated.com/en/ds/MAX31856.pdf 4 - 5 - Optional property: 6 - - thermocouple-type: Type of thermocouple (THERMOCOUPLE_TYPE_K if 7 - omitted). Supported types are B, E, J, K, N, R, S, T. 8 - 9 - Required properties: 10 - - compatible: must be "maxim,max31856" 11 - - reg: SPI chip select number for the device 12 - - spi-max-frequency: As per datasheet max. supported freq is 5000000 13 - - spi-cpha: must be defined for max31856 to enable SPI mode 1 14 - 15 - Refer to spi/spi-bus.txt for generic SPI slave bindings. 16 - 17 - Example: 18 - temp-sensor@0 { 19 - compatible = "maxim,max31856"; 20 - reg = <0>; 21 - spi-max-frequency = <5000000>; 22 - spi-cpha; 23 - thermocouple-type = <THERMOCOUPLE_TYPE_K>; 24 - };
+76
Documentation/devicetree/bindings/iio/temperature/maxim,max31855k.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/temperature/maxim,max31855k.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Maxim MAX31855 and similar thermocouples 8 + 9 + maintainers: 10 + - Matt Ranostay <matt.ranostay@konsulko.com> 11 + 12 + description: | 13 + https://datasheets.maximintegrated.com/en/ds/MAX6675.pdf 14 + https://datasheets.maximintegrated.com/en/ds/MAX31855.pdf 15 + 16 + properties: 17 + compatible: 18 + description: 19 + The generic maxim,max31855 compatible is deprecated in favour of 20 + the thermocouple type specific variants. 21 + enum: 22 + - maxim,max6675 23 + - maxim,max31855 24 + - maxim,max31855k 25 + - maxim,max31855j 26 + - maxim,max31855n 27 + - maxim,max31855s 28 + - maxim,max31855t 29 + - maxim,max31855e 30 + - maxim,max31855r 31 + 32 + reg: 33 + maxItems: 1 34 + 35 + spi-max-frequency: true 36 + spi-cpha: true 37 + 38 + required: 39 + - compatible 40 + - reg 41 + 42 + allOf: 43 + - if: 44 + properties: 45 + compatible: 46 + contains: 47 + enum: 48 + - maxim,max6675 49 + then: 50 + required: 51 + - spi-cpha 52 + else: 53 + properties: 54 + spi-cpha: false 55 + 56 + additionalProperties: false 57 + 58 + examples: 59 + - | 60 + spi { 61 + #address-cells = <1>; 62 + #size-cells = <0>; 63 + 64 + temp-sensor@0 { 65 + compatible = "maxim,max31855k"; 66 + reg = <0>; 67 + spi-max-frequency = <4300000>; 68 + }; 69 + temp-sensor@1 { 70 + compatible = "maxim,max6675"; 71 + reg = <1>; 72 + spi-max-frequency = <4300000>; 73 + spi-cpha; 74 + }; 75 + }; 76 + ...
+54
Documentation/devicetree/bindings/iio/temperature/maxim,max31856.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/temperature/maxim,max31856.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Maxim MAX31856 thermocouple support 8 + 9 + maintainers: 10 + - Jonathan Cameron <jic23@kernel.org> 11 + 12 + description: | 13 + https://datasheets.maximintegrated.com/en/ds/MAX31856.pdf 14 + 15 + properties: 16 + compatible: 17 + const: maxim,max31856 18 + 19 + reg: 20 + maxItems: 1 21 + 22 + spi-max-frequency: true 23 + spi-cpha: true 24 + 25 + thermocouple-type: 26 + $ref: /schemas/types.yaml#/definitions/uint32 27 + description: 28 + Type of thermocouple (THERMOCOUPLE_TYPE_K if omitted). 29 + Use defines in dt-bindings/iio/temperature/thermocouple.h. 30 + Supported types are B, E, J, K, N, R, S, T. 31 + 32 + required: 33 + - compatible 34 + - reg 35 + - spi-cpha 36 + 37 + additionalProperties: false 38 + 39 + examples: 40 + - | 41 + #include <dt-bindings/iio/temperature/thermocouple.h> 42 + spi { 43 + #address-cells = <1>; 44 + #size-cells = <0>; 45 + 46 + temp-sensor@0 { 47 + compatible = "maxim,max31856"; 48 + reg = <0>; 49 + spi-max-frequency = <5000000>; 50 + spi-cpha; 51 + thermocouple-type = <THERMOCOUPLE_TYPE_K>; 52 + }; 53 + }; 54 + ...
-24
Documentation/devicetree/bindings/iio/temperature/maxim_thermocouple.txt
··· 1 - Maxim thermocouple support 2 - 3 - * https://datasheets.maximintegrated.com/en/ds/MAX6675.pdf 4 - * https://datasheets.maximintegrated.com/en/ds/MAX31855.pdf 5 - 6 - Required properties: 7 - 8 - - compatible: must be "maxim,max6675" or one of the following: 9 - "maxim,max31855k", "maxim,max31855j", "maxim,max31855n", 10 - "maxim,max31855s", "maxim,max31855t", "maxim,max31855e", 11 - "maxim,max31855r"; the generic "max,max31855" is deprecated. 12 - - reg: SPI chip select number for the device 13 - - spi-max-frequency: must be 4300000 14 - - spi-cpha: must be defined for max6675 to enable SPI mode 1 15 - 16 - Refer to spi/spi-bus.txt for generic SPI slave bindings. 17 - 18 - Example: 19 - 20 - max31855@0 { 21 - compatible = "maxim,max31855k"; 22 - reg = <0>; 23 - spi-max-frequency = <4300000>; 24 - };
+50
Documentation/devicetree/bindings/iio/temperature/melexis,mlx90614.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/temperature/melexis,mlx90614.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Melexis MLX90614 contactless IR temperature sensor 8 + 9 + maintainers: 10 + - Peter Meerwald <pmeerw@pmeerw.net> 11 + - Crt Mori <cmo@melexis.com> 12 + 13 + description: | 14 + http://melexis.com/Infrared-Thermometer-Sensors/Infrared-Thermometer-Sensors/MLX90614-615.aspx 15 + 16 + properties: 17 + compatible: 18 + const: melexis,mlx90614 19 + 20 + reg: 21 + maxItems: 1 22 + 23 + wakeup-gpios: 24 + description: 25 + GPIO connected to the SDA line to hold low in order to wake up the 26 + device. In normal operation, the GPIO is set as input and will 27 + not interfere in I2C communication. There is no need for a GPIO 28 + driving the SCL line. If no GPIO is given, power management is disabled. 29 + maxItems: 1 30 + 31 + required: 32 + - compatible 33 + - reg 34 + 35 + additionalProperties: false 36 + 37 + examples: 38 + - | 39 + #include <dt-bindings/gpio/gpio.h> 40 + i2c { 41 + #address-cells = <1>; 42 + #size-cells = <0>; 43 + 44 + temp-sensor@5a { 45 + compatible = "melexis,mlx90614"; 46 + reg = <0x5a>; 47 + wakeup-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; 48 + }; 49 + }; 50 + ...
+55
Documentation/devicetree/bindings/iio/temperature/melexis,mlx90632.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/temperature/melexis,mlx90632.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Melexis MLX90632 contactless Infra Red temperature sensor 8 + 9 + maintainers: 10 + - Crt Mori <cmo@melexis.com> 11 + 12 + description: | 13 + https://www.melexis.com/en/documents/documentation/datasheets/datasheet-mlx90632 14 + 15 + There are various applications for the Infra Red contactless temperature 16 + sensor and MLX90632 is most suitable for consumer applications where 17 + measured object temperature is in range between -20 to 200 degrees 18 + Celsius with relative error of measurement below 1 degree Celsius in 19 + object temperature range for industrial applications. Since it can 20 + operate and measure ambient temperature in range of -20 to 85 degrees 21 + Celsius it is suitable also for outdoor use. 22 + 23 + Be aware that electronics surrounding the sensor can increase ambient 24 + temperature. MLX90632 can be calibrated to reduce the housing effect via 25 + already existing EEPROM parameters. 26 + 27 + Since measured object emissivity effects Infra Red energy emitted, 28 + emissivity should be set before requesting the object temperature. 29 + 30 + properties: 31 + compatible: 32 + const: melexis,mlx90632 33 + 34 + reg: 35 + maxItems: 1 36 + description: Default is 0x3a, but can be reprogrammed. 37 + 38 + required: 39 + - compatible 40 + - reg 41 + 42 + additionalProperties: false 43 + 44 + examples: 45 + - | 46 + i2c { 47 + #address-cells = <1>; 48 + #size-cells = <0>; 49 + 50 + temp-sensor@3a { 51 + compatible = "melexis,mlx90632"; 52 + reg = <0x3a>; 53 + }; 54 + }; 55 + ...
-24
Documentation/devicetree/bindings/iio/temperature/mlx90614.txt
··· 1 - * Melexis MLX90614 contactless IR temperature sensor 2 - 3 - http://melexis.com/Infrared-Thermometer-Sensors/Infrared-Thermometer-Sensors/MLX90614-615.aspx 4 - 5 - Required properties: 6 - 7 - - compatible: should be "melexis,mlx90614" 8 - - reg: the I2C address of the sensor 9 - 10 - Optional properties: 11 - 12 - - wakeup-gpios: device tree identifier of the GPIO connected to the SDA line 13 - to hold low in order to wake up the device. In normal operation, the 14 - GPIO is set as input and will not interfere in I2C communication. There 15 - is no need for a GPIO driving the SCL line. If no GPIO is given, power 16 - management is disabled. 17 - 18 - Example: 19 - 20 - mlx90614@5a { 21 - compatible = "melexis,mlx90614"; 22 - reg = <0x5a>; 23 - wakeup-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>; 24 - };
-28
Documentation/devicetree/bindings/iio/temperature/mlx90632.txt
··· 1 - * Melexis MLX90632 contactless Infra Red temperature sensor 2 - 3 - Link to datasheet: https://www.melexis.com/en/documents/documentation/datasheets/datasheet-mlx90632 4 - 5 - There are various applications for the Infra Red contactless temperature sensor 6 - and MLX90632 is most suitable for consumer applications where measured object 7 - temperature is in range between -20 to 200 degrees Celsius with relative error 8 - of measurement below 1 degree Celsius in object temperature range for 9 - industrial applications. Since it can operate and measure ambient temperature 10 - in range of -20 to 85 degrees Celsius it is suitable also for outdoor use. 11 - 12 - Be aware that electronics surrounding the sensor can increase ambient 13 - temperature. MLX90632 can be calibrated to reduce the housing effect via 14 - already existing EEPROM parameters. 15 - 16 - Since measured object emissivity effects Infra Red energy emitted, emissivity 17 - should be set before requesting the object temperature. 18 - 19 - Required properties: 20 - - compatible: should be "melexis,mlx90632" 21 - - reg: the I2C address of the sensor (default 0x3a) 22 - 23 - Example: 24 - 25 - mlx90632@3a { 26 - compatible = "melexis,mlx90632"; 27 - reg = <0x3a>; 28 - };
+57
Documentation/devicetree/bindings/iio/temperature/ti,tmp007.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/iio/temperature/ti,tmp007.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: IR thermopile sensor with integrated math engine 8 + 9 + maintainers: 10 + - Manivannan Sadhasivam <manivannanece23@gmail.com> 11 + 12 + description: | 13 + http://www.ti.com/lit/ds/symlink/tmp007.pdf 14 + 15 + properties: 16 + compatible: 17 + const: ti,tmp007 18 + 19 + reg: 20 + description: | 21 + The I2C address of the sensor (changeable via ADR pins) 22 + ------------------------------ 23 + |ADR1 | ADR0 | Device Address| 24 + ------------------------------ 25 + 0 0 0x40 26 + 0 1 0x41 27 + 0 SDA 0x42 28 + 0 SCL 0x43 29 + 1 0 0x44 30 + 1 1 0x45 31 + 1 SDA 0x46 32 + 1 SCL 0x47 33 + maxItems: 1 34 + 35 + interrupts: 36 + maxItems: 1 37 + 38 + required: 39 + - compatible 40 + - reg 41 + 42 + additionalProperties: false 43 + 44 + examples: 45 + - | 46 + i2c { 47 + #address-cells = <1>; 48 + #size-cells = <0>; 49 + 50 + temp-sensor@40 { 51 + compatible = "ti,tmp007"; 52 + reg = <0x40>; 53 + interrupt-parent = <&gpio0>; 54 + interrupts = <5 0x08>; 55 + }; 56 + }; 57 + ...
-33
Documentation/devicetree/bindings/iio/temperature/tmp007.txt
··· 1 - * TI TMP007 - IR thermopile sensor with integrated math engine 2 - 3 - Link to datasheet: http://www.ti.com/lit/ds/symlink/tmp007.pdf 4 - 5 - Required properties: 6 - 7 - - compatible: should be "ti,tmp007" 8 - - reg: the I2C address of the sensor (changeable via ADR pins) 9 - ------------------------------ 10 - |ADR1 | ADR0 | Device Address| 11 - ------------------------------ 12 - 0 0 0x40 13 - 0 1 0x41 14 - 0 SDA 0x42 15 - 0 SCL 0x43 16 - 1 0 0x44 17 - 1 1 0x45 18 - 1 SDA 0x46 19 - 1 SCL 0x47 20 - 21 - Optional properties: 22 - 23 - - interrupts: interrupt mapping for GPIO IRQ (level active low) 24 - 25 - Example: 26 - 27 - tmp007@40 { 28 - compatible = "ti,tmp007"; 29 - reg = <0x40>; 30 - interrupt-parent = <&gpio0>; 31 - interrupts = <5 0x08>; 32 - }; 33 -
-19
Documentation/devicetree/bindings/iio/temperature/tsys01.txt
··· 1 - * TSYS01 - Measurement Specialties temperature sensor 2 - 3 - Required properties: 4 - 5 - - compatible: should be "meas,tsys01" 6 - - reg: I2C address of the sensor (changeable via CSB pin) 7 - 8 - ------------------------ 9 - | CSB | Device Address | 10 - ------------------------ 11 - 1 0x76 12 - 0 0x77 13 - 14 - Example: 15 - 16 - tsys01@76 { 17 - compatible = "meas,tsys01"; 18 - reg = <0x76>; 19 - };
+54
Documentation/devicetree/bindings/trivial-devices.yaml
··· 44 44 - atmel,atsha204a 45 45 # i2c h/w elliptic curve crypto module 46 46 - atmel,atecc508a 47 + # Bosch Sensortec pressure, temperature, humididty and VOC sensor 48 + - bosch,bme680 47 49 # CM32181: Ambient Light Sensor 48 50 - capella,cm32181 49 51 # CM3232: Ambient Light Sensor ··· 72 70 - dlg,da9053 73 71 # DA9063: system PMIC for quad-core application processors 74 72 - dlg,da9063 73 + # DMARD05: 3-axis I2C Accelerometer 74 + - domintech,dmard05 75 + # DMARD06: 3-axis I2C Accelerometer 76 + - domintech,dmard06 77 + # DMARD05: 3-axis I2C Accelerometer 78 + - domintech,dmard07 75 79 # DMARD09: 3-axis Accelerometer 76 80 - domintech,dmard09 77 81 # DMARD10: 3-axis Accelerometer ··· 116 108 - isil,isl68137 117 109 # 5 Bit Programmable, Pulse-Width Modulator 118 110 - maxim,ds1050 111 + # 10 kOhm digital potentiometer with I2C interface 112 + - maxim,ds1803-010 113 + # 50 kOhm digital potentiometer with I2C interface 114 + - maxim,ds1803-050 115 + # 100 kOhm digital potentiometer with I2C interface 116 + - maxim,ds1803-100 119 117 # 10-bit 8 channels 300ks/s SPI ADC with temperature sensor 120 118 - maxim,max1027 121 119 # 10-bit 12 channels 300ks/s SPI ADC with temperature sensor ··· 136 122 - maxim,max1231 137 123 # Low-Power, 4-/12-Channel, 2-Wire Serial, 12-Bit ADCs 138 124 - maxim,max1237 125 + # 10-bit 10 kOhm linear programable voltage divider 126 + - maxim,max5481 127 + # 10-bit 50 kOhm linear programable voltage divider 128 + - maxim,max5482 129 + # 10-bit 10 kOhm linear programable variable resistor 130 + - maxim,max5483 131 + # 10-bit 50 kOhm linear programable variable resistor 132 + - maxim,max5484 139 133 # PECI-to-I2C translator for PECI-to-SMBus/I2C protocol conversion 140 134 - maxim,max6621 141 135 # 9-Bit/12-Bit Temperature Sensors with I²C-Compatible Serial Interface ··· 152 130 - maxim,max31730 153 131 # mCube 3-axis 8-bit digital accelerometer 154 132 - mcube,mc3230 133 + # MEMSIC magnetometer 134 + - memsic,mmc35240 155 135 # MEMSIC 2-axis 8-bit digital accelerometer 156 136 - memsic,mxc6225 137 + # Measurement Specialities I2C temperature and humidity sensor 138 + - meas,htu21 139 + # Measurement Specialities I2C pressure and temperature sensor 140 + - meas,ms5637 141 + # Measurement Specialities I2C pressure and temperature sensor 142 + - meas,ms5805 143 + # Measurement Specialities I2C pressure and temperature sensor 144 + - meas,ms5837 145 + # Measurement Specialities temp and humidity part of ms8607 device 146 + - meas,ms8607-humidity 147 + # Measurement Specialities temp and pressure part of ms8607 device 148 + - meas,ms8607-temppressure 149 + # Measurement Specialties temperature sensor 150 + - meas,tsys01 157 151 # Microchip differential I2C ADC, 1 Channel, 18 bit 158 152 - microchip,mcp3421 159 153 # Microchip differential I2C ADC, 2 Channel, 18 bit ··· 374 336 - plx,pex8648 375 337 # Pulsedlight LIDAR range-finding sensor 376 338 - pulsedlight,lidar-lite-v2 339 + # Renesas ISL29501 time-of-flight sensor 340 + - renesas,isl29501 377 341 # S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power) 378 342 - samsung,24ad0xd1 343 + # Sensirion low power multi-pixel gas sensor with I2C interface 344 + - sensirion,sgpc3 345 + # Sensirion multi-pixel gas sensor with I2C interface 346 + - sensirion,sgp30 379 347 # SGX Sensortech VZ89X Sensors 380 348 - sgx,vz89x 381 349 # Relative Humidity and Temperature Sensors ··· 400 356 - ti,ads7830 401 357 # Temperature Monitoring and Fan Control 402 358 - ti,amc6821 359 + # Temperature and humidity sensor with i2c interface 360 + - ti,hdc1000 361 + # Temperature and humidity sensor with i2c interface 362 + - ti,hdc1008 363 + # Temperature and humidity sensor with i2c interface 364 + - ti,hdc1010 365 + # Temperature and humidity sensor with i2c interface 366 + - ti,hdc1050 367 + # Temperature and humidity sensor with i2c interface 368 + - ti,hdc1080 403 369 # Temperature sensor with 2-wire interface 404 370 - ti,lm73 405 371 # Temperature sensor with integrated fan control
+2 -2
MAINTAINERS
··· 9111 9111 M: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> 9112 9112 L: linux-iio@vger.kernel.org 9113 9113 S: Maintained 9114 - W https://invensense.tdk.com/ 9114 + W: https://invensense.tdk.com/ 9115 9115 F: Documentation/devicetree/bindings/iio/imu/invensense,icm42600.yaml 9116 9116 F: drivers/iio/imu/inv_icm42600/ 9117 9117 ··· 12510 12510 M: Rui Miguel Silva <rmfrfs@gmail.com> 12511 12511 L: linux-iio@vger.kernel.org 12512 12512 S: Maintained 12513 - F: Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.txt 12513 + F: Documentation/devicetree/bindings/iio/gyroscope/nxp,fxas21002c.yaml 12514 12514 F: drivers/iio/gyro/fxas21002c.h 12515 12515 F: drivers/iio/gyro/fxas21002c_core.c 12516 12516 F: drivers/iio/gyro/fxas21002c_i2c.c
-1
drivers/iio/accel/adis16201.c
··· 268 268 return -ENOMEM; 269 269 270 270 st = iio_priv(indio_dev); 271 - spi_set_drvdata(spi, indio_dev); 272 271 273 272 indio_dev->name = spi->dev.driver->name; 274 273 indio_dev->info = &adis16201_info;
-1
drivers/iio/accel/adis16209.c
··· 279 279 return -ENOMEM; 280 280 281 281 st = iio_priv(indio_dev); 282 - spi_set_drvdata(spi, indio_dev); 283 282 284 283 indio_dev->name = spi->dev.driver->name; 285 284 indio_dev->info = &adis16209_info;
+5 -6
drivers/iio/accel/adxl372.c
··· 1211 1211 return ret; 1212 1212 } 1213 1213 1214 - ret = devm_iio_triggered_buffer_setup(dev, 1215 - indio_dev, NULL, 1216 - adxl372_trigger_handler, 1217 - &adxl372_buffer_ops); 1214 + ret = devm_iio_triggered_buffer_setup_ext(dev, 1215 + indio_dev, NULL, 1216 + adxl372_trigger_handler, 1217 + &adxl372_buffer_ops, 1218 + adxl372_fifo_attributes); 1218 1219 if (ret < 0) 1219 1220 return ret; 1220 - 1221 - iio_buffer_set_attrs(indio_dev->buffer, adxl372_fifo_attributes); 1222 1221 1223 1222 if (st->irq) { 1224 1223 st->dready_trig = devm_iio_trigger_alloc(dev,
+14 -11
drivers/iio/accel/bmc150-accel-core.c
··· 1558 1558 int bmc150_accel_core_probe(struct device *dev, struct regmap *regmap, int irq, 1559 1559 const char *name, bool block_supported) 1560 1560 { 1561 + const struct attribute **fifo_attrs; 1561 1562 struct bmc150_accel_data *data; 1562 1563 struct iio_dev *indio_dev; 1563 1564 int ret; ··· 1591 1590 indio_dev->modes = INDIO_DIRECT_MODE; 1592 1591 indio_dev->info = &bmc150_accel_info; 1593 1592 1594 - ret = iio_triggered_buffer_setup(indio_dev, 1595 - &iio_pollfunc_store_time, 1596 - bmc150_accel_trigger_handler, 1597 - &bmc150_accel_buffer_ops); 1593 + if (block_supported) { 1594 + indio_dev->modes |= INDIO_BUFFER_SOFTWARE; 1595 + indio_dev->info = &bmc150_accel_info_fifo; 1596 + fifo_attrs = bmc150_accel_fifo_attributes; 1597 + } else { 1598 + fifo_attrs = NULL; 1599 + } 1600 + 1601 + ret = iio_triggered_buffer_setup_ext(indio_dev, 1602 + &iio_pollfunc_store_time, 1603 + bmc150_accel_trigger_handler, 1604 + &bmc150_accel_buffer_ops, 1605 + fifo_attrs); 1598 1606 if (ret < 0) { 1599 1607 dev_err(dev, "Failed: iio triggered buffer setup\n"); 1600 1608 return ret; ··· 1638 1628 ret = bmc150_accel_triggers_setup(indio_dev, data); 1639 1629 if (ret) 1640 1630 goto err_buffer_cleanup; 1641 - 1642 - if (block_supported) { 1643 - indio_dev->modes |= INDIO_BUFFER_SOFTWARE; 1644 - indio_dev->info = &bmc150_accel_info_fifo; 1645 - iio_buffer_set_attrs(indio_dev->buffer, 1646 - bmc150_accel_fifo_attributes); 1647 - } 1648 1631 } 1649 1632 1650 1633 ret = pm_runtime_set_active(dev);
+1 -1
drivers/iio/accel/mma8452.c
··· 1187 1187 NULL, 1188 1188 }; 1189 1189 1190 - static struct attribute_group mma8452_event_attribute_group = { 1190 + static const struct attribute_group mma8452_event_attribute_group = { 1191 1191 .attrs = mma8452_event_attributes, 1192 1192 }; 1193 1193
+12 -1
drivers/iio/adc/Kconfig
··· 295 295 config AT91_ADC 296 296 tristate "Atmel AT91 ADC" 297 297 depends on ARCH_AT91 || COMPILE_TEST 298 - depends on INPUT && SYSFS 298 + depends on INPUT && SYSFS && OF 299 299 select IIO_BUFFER 300 300 select IIO_TRIGGERED_BUFFER 301 301 help ··· 702 702 703 703 This driver can also be built as a module. If so, the module will be 704 704 called mcp3911. 705 + 706 + config MEDIATEK_MT6360_ADC 707 + tristate "Mediatek MT6360 ADC driver" 708 + depends on MFD_MT6360 709 + select IIO_BUFFER 710 + select IIO_TRIGGERED_BUFFER 711 + help 712 + Say Y here to enable MT6360 ADC support. 713 + Integrated for System Monitoring includes 714 + is used in smartphones and tablets and supports a 11 channel 715 + general purpose ADC. 705 716 706 717 config MEDIATEK_MT6577_AUXADC 707 718 tristate "MediaTek AUXADC driver"
+1
drivers/iio/adc/Makefile
··· 65 65 obj-$(CONFIG_MCP320X) += mcp320x.o 66 66 obj-$(CONFIG_MCP3422) += mcp3422.o 67 67 obj-$(CONFIG_MCP3911) += mcp3911.o 68 + obj-$(CONFIG_MEDIATEK_MT6360_ADC) += mt6360-adc.o 68 69 obj-$(CONFIG_MEDIATEK_MT6577_AUXADC) += mt6577_auxadc.o 69 70 obj-$(CONFIG_MEN_Z188_ADC) += men_z188_adc.o 70 71 obj-$(CONFIG_MESON_SARADC) += meson_saradc.o
-2
drivers/iio/adc/ad7292.c
··· 276 276 return -EINVAL; 277 277 } 278 278 279 - spi_set_drvdata(spi, indio_dev); 280 - 281 279 st->reg = devm_regulator_get_optional(&spi->dev, "vref"); 282 280 if (!IS_ERR(st->reg)) { 283 281 ret = regulator_enable(st->reg);
+9 -8
drivers/iio/adc/ad7298.c
··· 23 23 #include <linux/iio/trigger_consumer.h> 24 24 #include <linux/iio/triggered_buffer.h> 25 25 26 - #include <linux/platform_data/ad7298.h> 27 - 28 26 #define AD7298_WRITE BIT(15) /* write to the control register */ 29 27 #define AD7298_REPEAT BIT(14) /* repeated conversion enable */ 30 28 #define AD7298_CH(x) BIT(13 - (x)) /* channel select */ ··· 281 283 282 284 static int ad7298_probe(struct spi_device *spi) 283 285 { 284 - struct ad7298_platform_data *pdata = spi->dev.platform_data; 285 286 struct ad7298_state *st; 286 287 struct iio_dev *indio_dev; 287 288 int ret; ··· 291 294 292 295 st = iio_priv(indio_dev); 293 296 294 - if (pdata && pdata->ext_ref) 297 + st->reg = devm_regulator_get_optional(&spi->dev, "vref"); 298 + if (!IS_ERR(st->reg)) { 295 299 st->ext_ref = AD7298_EXTREF; 300 + } else { 301 + ret = PTR_ERR(st->reg); 302 + if (ret != -ENODEV) 303 + return ret; 296 304 297 - if (st->ext_ref) { 298 - st->reg = devm_regulator_get(&spi->dev, "vref"); 299 - if (IS_ERR(st->reg)) 300 - return PTR_ERR(st->reg); 305 + st->reg = NULL; 306 + } 301 307 308 + if (st->reg) { 302 309 ret = regulator_enable(st->reg); 303 310 if (ret) 304 311 return ret;
+41
drivers/iio/adc/ad7768-1.c
··· 161 161 struct completion completion; 162 162 struct iio_trigger *trig; 163 163 struct gpio_desc *gpio_sync_in; 164 + const char *labels[ARRAY_SIZE(ad7768_channels)]; 164 165 /* 165 166 * DMA (thus cache coherency maintenance) requires the 166 167 * transfer buffers to live in their own cache lines. ··· 408 407 } 409 408 } 410 409 410 + static int ad7768_read_label(struct iio_dev *indio_dev, 411 + const struct iio_chan_spec *chan, char *label) 412 + { 413 + struct ad7768_state *st = iio_priv(indio_dev); 414 + 415 + return sprintf(label, "%s\n", st->labels[chan->channel]); 416 + } 417 + 411 418 static struct attribute *ad7768_attributes[] = { 412 419 &iio_dev_attr_sampling_frequency_available.dev_attr.attr, 413 420 NULL ··· 429 420 .attrs = &ad7768_group, 430 421 .read_raw = &ad7768_read_raw, 431 422 .write_raw = &ad7768_write_raw, 423 + .read_label = ad7768_read_label, 432 424 .debugfs_reg_access = &ad7768_reg_access, 433 425 }; 434 426 ··· 542 532 clk_disable_unprepare(st->mclk); 543 533 } 544 534 535 + static int ad7768_set_channel_label(struct iio_dev *indio_dev, 536 + int num_channels) 537 + { 538 + struct ad7768_state *st = iio_priv(indio_dev); 539 + struct device *device = indio_dev->dev.parent; 540 + struct fwnode_handle *fwnode; 541 + struct fwnode_handle *child; 542 + const char *label; 543 + int crt_ch = 0; 544 + 545 + fwnode = dev_fwnode(device); 546 + fwnode_for_each_child_node(fwnode, child) { 547 + if (fwnode_property_read_u32(child, "reg", &crt_ch)) 548 + continue; 549 + 550 + if (crt_ch >= num_channels) 551 + continue; 552 + 553 + if (fwnode_property_read_string(child, "label", &label)) 554 + continue; 555 + 556 + st->labels[crt_ch] = label; 557 + } 558 + 559 + return 0; 560 + } 561 + 545 562 static int ad7768_probe(struct spi_device *spi) 546 563 { 547 564 struct ad7768_state *st; ··· 640 603 indio_dev->trig = iio_trigger_get(st->trig); 641 604 642 605 init_completion(&st->completion); 606 + 607 + ret = ad7768_set_channel_label(indio_dev, ARRAY_SIZE(ad7768_channels)); 608 + if (ret) 609 + return ret; 643 610 644 611 ret = devm_request_irq(&spi->dev, spi->irq, 645 612 &ad7768_interrupt,
+23 -32
drivers/iio/adc/ad7887.c
··· 232 232 .read_raw = &ad7887_read_raw, 233 233 }; 234 234 235 + static void ad7887_reg_disable(void *data) 236 + { 237 + struct regulator *reg = data; 238 + 239 + regulator_disable(reg); 240 + } 241 + 235 242 static int ad7887_probe(struct spi_device *spi) 236 243 { 237 244 struct ad7887_platform_data *pdata = spi->dev.platform_data; ··· 253 246 254 247 st = iio_priv(indio_dev); 255 248 256 - if (!pdata || !pdata->use_onchip_ref) { 257 - st->reg = devm_regulator_get(&spi->dev, "vref"); 258 - if (IS_ERR(st->reg)) 249 + st->reg = devm_regulator_get_optional(&spi->dev, "vref"); 250 + if (IS_ERR(st->reg)) { 251 + if (PTR_ERR(st->reg) != -ENODEV) 259 252 return PTR_ERR(st->reg); 260 253 254 + st->reg = NULL; 255 + } 256 + 257 + if (st->reg) { 261 258 ret = regulator_enable(st->reg); 259 + if (ret) 260 + return ret; 261 + 262 + ret = devm_add_action_or_reset(&spi->dev, ad7887_reg_disable, st->reg); 262 263 if (ret) 263 264 return ret; 264 265 } ··· 284 269 /* Setup default message */ 285 270 286 271 mode = AD7887_PM_MODE4; 287 - if (!pdata || !pdata->use_onchip_ref) 272 + if (!st->reg) 288 273 mode |= AD7887_REF_DIS; 289 274 if (pdata && pdata->en_dual) 290 275 mode |= AD7887_DUAL; ··· 327 312 indio_dev->num_channels = st->chip_info->num_channels; 328 313 } 329 314 330 - ret = iio_triggered_buffer_setup(indio_dev, &iio_pollfunc_store_time, 315 + ret = devm_iio_triggered_buffer_setup(&spi->dev, indio_dev, 316 + &iio_pollfunc_store_time, 331 317 &ad7887_trigger_handler, &ad7887_ring_setup_ops); 332 318 if (ret) 333 - goto error_disable_reg; 319 + return ret; 334 320 335 - ret = iio_device_register(indio_dev); 336 - if (ret) 337 - goto error_unregister_ring; 338 - 339 - return 0; 340 - error_unregister_ring: 341 - iio_triggered_buffer_cleanup(indio_dev); 342 - error_disable_reg: 343 - if (st->reg) 344 - regulator_disable(st->reg); 345 - 346 - return ret; 347 - } 348 - 349 - static int ad7887_remove(struct spi_device *spi) 350 - { 351 - struct iio_dev *indio_dev = spi_get_drvdata(spi); 352 - struct ad7887_state *st = iio_priv(indio_dev); 353 - 354 - iio_device_unregister(indio_dev); 355 - iio_triggered_buffer_cleanup(indio_dev); 356 - if (st->reg) 357 - regulator_disable(st->reg); 358 - 359 - return 0; 321 + return devm_iio_device_register(&spi->dev, indio_dev); 360 322 } 361 323 362 324 static const struct spi_device_id ad7887_id[] = { ··· 347 355 .name = "ad7887", 348 356 }, 349 357 .probe = ad7887_probe, 350 - .remove = ad7887_remove, 351 358 .id_table = ad7887_id, 352 359 }; 353 360 module_spi_driver(ad7887_driver);
+41 -43
drivers/iio/adc/at91-sama5d2_adc.c
··· 1013 1013 1014 1014 return trig; 1015 1015 } 1016 - 1017 - static int at91_adc_trigger_init(struct iio_dev *indio) 1018 - { 1019 - struct at91_adc_state *st = iio_priv(indio); 1020 - 1021 - st->trig = at91_adc_allocate_trigger(indio, st->selected_trig->name); 1022 - if (IS_ERR(st->trig)) { 1023 - dev_err(&indio->dev, 1024 - "could not allocate trigger\n"); 1025 - return PTR_ERR(st->trig); 1026 - } 1027 - 1028 - return 0; 1029 - } 1030 - 1031 1016 static void at91_adc_trigger_handler_nodma(struct iio_dev *indio_dev, 1032 1017 struct iio_poll_func *pf) 1033 1018 { ··· 1138 1153 iio_trigger_notify_done(indio_dev->trig); 1139 1154 1140 1155 return IRQ_HANDLED; 1141 - } 1142 - 1143 - static int at91_adc_buffer_init(struct iio_dev *indio) 1144 - { 1145 - return devm_iio_triggered_buffer_setup(&indio->dev, indio, 1146 - &iio_pollfunc_store_time, 1147 - &at91_adc_trigger_handler, &at91_buffer_setup_ops); 1148 1156 } 1149 1157 1150 1158 static unsigned at91_adc_startup_time(unsigned startup_time_min, ··· 1450 1472 return 0; 1451 1473 default: 1452 1474 return -EINVAL; 1453 - }; 1475 + } 1454 1476 } 1455 1477 1456 1478 static void at91_adc_dma_init(struct platform_device *pdev) ··· 1669 1691 .hwfifo_set_watermark = &at91_adc_set_watermark, 1670 1692 }; 1671 1693 1694 + static int at91_adc_buffer_and_trigger_init(struct device *dev, 1695 + struct iio_dev *indio) 1696 + { 1697 + struct at91_adc_state *st = iio_priv(indio); 1698 + const struct attribute **fifo_attrs; 1699 + int ret; 1700 + 1701 + if (st->selected_trig->hw_trig) 1702 + fifo_attrs = at91_adc_fifo_attributes; 1703 + else 1704 + fifo_attrs = NULL; 1705 + 1706 + ret = devm_iio_triggered_buffer_setup_ext(&indio->dev, indio, 1707 + &iio_pollfunc_store_time, 1708 + &at91_adc_trigger_handler, &at91_buffer_setup_ops, fifo_attrs); 1709 + if (ret < 0) { 1710 + dev_err(dev, "couldn't initialize the buffer.\n"); 1711 + return ret; 1712 + } 1713 + 1714 + if (!st->selected_trig->hw_trig) 1715 + return 0; 1716 + 1717 + st->trig = at91_adc_allocate_trigger(indio, st->selected_trig->name); 1718 + if (IS_ERR(st->trig)) { 1719 + dev_err(dev, "could not allocate trigger\n"); 1720 + return PTR_ERR(st->trig); 1721 + } 1722 + 1723 + /* 1724 + * Initially the iio buffer has a length of 2 and 1725 + * a watermark of 1 1726 + */ 1727 + st->dma_st.watermark = 1; 1728 + 1729 + return 0; 1730 + } 1731 + 1672 1732 static int at91_adc_probe(struct platform_device *pdev) 1673 1733 { 1674 1734 struct iio_dev *indio_dev; ··· 1842 1826 1843 1827 platform_set_drvdata(pdev, indio_dev); 1844 1828 1845 - ret = at91_adc_buffer_init(indio_dev); 1846 - if (ret < 0) { 1847 - dev_err(&pdev->dev, "couldn't initialize the buffer.\n"); 1829 + ret = at91_adc_buffer_and_trigger_init(&pdev->dev, indio_dev); 1830 + if (ret < 0) 1848 1831 goto per_clk_disable_unprepare; 1849 - } 1850 - 1851 - if (st->selected_trig->hw_trig) { 1852 - ret = at91_adc_trigger_init(indio_dev); 1853 - if (ret < 0) { 1854 - dev_err(&pdev->dev, "couldn't setup the triggers.\n"); 1855 - goto per_clk_disable_unprepare; 1856 - } 1857 - /* 1858 - * Initially the iio buffer has a length of 2 and 1859 - * a watermark of 1 1860 - */ 1861 - st->dma_st.watermark = 1; 1862 - 1863 - iio_buffer_set_attrs(indio_dev->buffer, 1864 - at91_adc_fifo_attributes); 1865 - } 1866 1832 1867 1833 if (dma_coerce_mask_and_coherent(&indio_dev->dev, DMA_BIT_MASK(32))) 1868 1834 dev_info(&pdev->dev, "cannot set DMA mask to 32-bit\n");
+27 -46
drivers/iio/adc/at91_adc.c
··· 22 22 #include <linux/slab.h> 23 23 #include <linux/wait.h> 24 24 25 - #include <linux/platform_data/at91_adc.h> 26 - 27 25 #include <linux/iio/iio.h> 28 26 #include <linux/iio/buffer.h> 29 27 #include <linux/iio/trigger.h> ··· 151 153 #define TOUCH_SHTIM 0xa 152 154 #define TOUCH_SCTIM_US 10 /* 10us for the Touchscreen Switches Closure Time */ 153 155 156 + enum atmel_adc_ts_type { 157 + ATMEL_ADC_TOUCHSCREEN_NONE = 0, 158 + ATMEL_ADC_TOUCHSCREEN_4WIRE = 4, 159 + ATMEL_ADC_TOUCHSCREEN_5WIRE = 5, 160 + }; 161 + 162 + /** 163 + * struct at91_adc_trigger - description of triggers 164 + * @name: name of the trigger advertised to the user 165 + * @value: value to set in the ADC's trigger setup register 166 + * to enable the trigger 167 + * @is_external: Does the trigger rely on an external pin? 168 + */ 169 + struct at91_adc_trigger { 170 + const char *name; 171 + u8 value; 172 + bool is_external; 173 + }; 174 + 154 175 /** 155 176 * struct at91_adc_reg_desc - Various informations relative to registers 156 177 * @channel_base: Base offset for the channel data registers ··· 219 202 struct mutex lock; 220 203 u8 num_channels; 221 204 void __iomem *reg_base; 222 - struct at91_adc_reg_desc *registers; 205 + const struct at91_adc_reg_desc *registers; 223 206 u32 startup_time; 224 207 u8 sample_hold_time; 225 208 bool sleep_mode; ··· 231 214 u32 res; /* resolution used for convertions */ 232 215 bool low_res; /* the resolution corresponds to the lowest one */ 233 216 wait_queue_head_t wq_data_avail; 234 - struct at91_adc_caps *caps; 217 + const struct at91_adc_caps *caps; 235 218 236 219 /* 237 220 * Following ADC channels are shared by touchscreen: ··· 567 550 { 568 551 struct iio_dev *idev = iio_trigger_get_drvdata(trig); 569 552 struct at91_adc_state *st = iio_priv(idev); 570 - struct at91_adc_reg_desc *reg = st->registers; 553 + const struct at91_adc_reg_desc *reg = st->registers; 571 554 u32 status = at91_adc_readl(st, reg->trigger_register); 572 555 int value; 573 556 u8 bit; ··· 846 829 return ticks; 847 830 } 848 831 849 - static const struct of_device_id at91_adc_dt_ids[]; 850 - 851 832 static int at91_adc_probe_dt_ts(struct device_node *node, 852 833 struct at91_adc_state *st, struct device *dev) 853 834 { ··· 890 875 int i = 0, ret; 891 876 u32 prop; 892 877 893 - if (!node) 894 - return -EINVAL; 895 - 896 - st->caps = (struct at91_adc_caps *) 897 - of_match_device(at91_adc_dt_ids, &pdev->dev)->data; 878 + st->caps = of_device_get_match_data(&pdev->dev); 898 879 899 880 st->use_external = of_property_read_bool(node, "atmel,adc-use-external-triggers"); 900 881 ··· 969 958 970 959 error_ret: 971 960 return ret; 972 - } 973 - 974 - static int at91_adc_probe_pdata(struct at91_adc_state *st, 975 - struct platform_device *pdev) 976 - { 977 - struct at91_adc_data *pdata = pdev->dev.platform_data; 978 - 979 - if (!pdata) 980 - return -EINVAL; 981 - 982 - st->caps = (struct at91_adc_caps *) 983 - platform_get_device_id(pdev)->driver_data; 984 - 985 - st->use_external = pdata->use_external_triggers; 986 - st->vref_mv = pdata->vref; 987 - st->channels_mask = pdata->channels_used; 988 - st->num_channels = st->caps->num_channels; 989 - st->startup_time = pdata->startup_time; 990 - st->trigger_number = pdata->trigger_number; 991 - st->trigger_list = pdata->trigger_list; 992 - st->registers = &st->caps->registers; 993 - st->touchscreen_type = pdata->touchscreen_type; 994 - 995 - return 0; 996 961 } 997 962 998 963 static const struct iio_info at91_adc_info = { ··· 1147 1160 1148 1161 st = iio_priv(idev); 1149 1162 1150 - if (pdev->dev.of_node) 1151 - ret = at91_adc_probe_dt(idev, pdev); 1152 - else 1153 - ret = at91_adc_probe_pdata(st, pdev); 1154 - 1155 - if (ret) { 1156 - dev_err(&pdev->dev, "No platform data available.\n"); 1157 - return -EINVAL; 1158 - } 1163 + ret = at91_adc_probe_dt(idev, pdev); 1164 + if (ret) 1165 + return ret; 1159 1166 1160 1167 platform_set_drvdata(pdev, idev); 1161 1168 ··· 1450 1469 .id_table = at91_adc_ids, 1451 1470 .driver = { 1452 1471 .name = DRIVER_NAME, 1453 - .of_match_table = of_match_ptr(at91_adc_dt_ids), 1472 + .of_match_table = at91_adc_dt_ids, 1454 1473 .pm = &at91_adc_pm_ops, 1455 1474 }, 1456 1475 };
+1
drivers/iio/adc/cpcap-adc.c
··· 557 557 break; 558 558 case CPCAP_ADC_BATTP_PI16 ... CPCAP_ADC_BATTI_PI17: 559 559 value1 |= CPCAP_BIT_RAND1; 560 + break; 560 561 default: 561 562 break; 562 563 }
+6 -1
drivers/iio/adc/exynos_adc.c
··· 7 7 * Copyright (C) 2013 Naveen Krishna Chatradhi <ch.naveen@samsung.com> 8 8 */ 9 9 10 + #include <linux/compiler.h> 10 11 #include <linux/module.h> 11 12 #include <linux/platform_device.h> 12 13 #include <linux/interrupt.h> ··· 135 134 136 135 u32 value; 137 136 unsigned int version; 137 + 138 + bool ts_enabled; 138 139 139 140 bool read_ts; 140 141 u32 ts_x; ··· 654 651 bool pressed; 655 652 int ret; 656 653 657 - while (info->input->users) { 654 + while (READ_ONCE(info->ts_enabled)) { 658 655 ret = exynos_read_s3c64xx_ts(dev, &x, &y); 659 656 if (ret == -ETIMEDOUT) 660 657 break; ··· 734 731 { 735 732 struct exynos_adc *info = input_get_drvdata(dev); 736 733 734 + WRITE_ONCE(info->ts_enabled, true); 737 735 enable_irq(info->tsirq); 738 736 739 737 return 0; ··· 744 740 { 745 741 struct exynos_adc *info = input_get_drvdata(dev); 746 742 743 + WRITE_ONCE(info->ts_enabled, false); 747 744 disable_irq(info->tsirq); 748 745 } 749 746
+1 -1
drivers/iio/adc/ingenic-adc.c
··· 562 562 return IIO_AVAIL_LIST; 563 563 default: 564 564 return -EINVAL; 565 - }; 565 + } 566 566 } 567 567 568 568 static int ingenic_adc_read_chan_info_raw(struct iio_dev *iio_dev,
-2
drivers/iio/adc/meson_saradc.c
··· 593 593 case IIO_CHAN_INFO_RAW: 594 594 return meson_sar_adc_get_sample(indio_dev, chan, NO_AVERAGING, 595 595 ONE_SAMPLE, val); 596 - break; 597 596 598 597 case IIO_CHAN_INFO_AVERAGE_RAW: 599 598 return meson_sar_adc_get_sample(indio_dev, chan, 600 599 MEAN_AVERAGING, EIGHT_SAMPLES, 601 600 val); 602 - break; 603 601 604 602 case IIO_CHAN_INFO_SCALE: 605 603 if (chan->type == IIO_VOLTAGE) {
+372
drivers/iio/adc/mt6360-adc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + 3 + #include <linux/bits.h> 4 + #include <linux/delay.h> 5 + #include <linux/irq.h> 6 + #include <linux/kernel.h> 7 + #include <linux/ktime.h> 8 + #include <linux/module.h> 9 + #include <linux/mutex.h> 10 + #include <linux/platform_device.h> 11 + #include <linux/regmap.h> 12 + #include <linux/unaligned/be_byteshift.h> 13 + 14 + #include <linux/iio/buffer.h> 15 + #include <linux/iio/iio.h> 16 + #include <linux/iio/trigger_consumer.h> 17 + #include <linux/iio/triggered_buffer.h> 18 + 19 + #define MT6360_REG_PMUCHGCTRL3 0x313 20 + #define MT6360_REG_PMUADCCFG 0x356 21 + #define MT6360_REG_PMUADCIDLET 0x358 22 + #define MT6360_REG_PMUADCRPT1 0x35A 23 + 24 + /* PMUCHGCTRL3 0x313 */ 25 + #define MT6360_AICR_MASK GENMASK(7, 2) 26 + #define MT6360_AICR_SHFT 2 27 + #define MT6360_AICR_400MA 0x6 28 + /* PMUADCCFG 0x356 */ 29 + #define MT6360_ADCEN_MASK BIT(15) 30 + /* PMUADCRPT1 0x35A */ 31 + #define MT6360_PREFERCH_MASK GENMASK(7, 4) 32 + #define MT6360_PREFERCH_SHFT 4 33 + #define MT6360_RPTCH_MASK GENMASK(3, 0) 34 + #define MT6360_NO_PREFER 15 35 + 36 + /* Time in ms */ 37 + #define ADC_WAIT_TIME_MS 25 38 + #define ADC_CONV_TIMEOUT_MS 100 39 + #define ADC_LOOP_TIME_US 2000 40 + 41 + enum { 42 + MT6360_CHAN_USBID = 0, 43 + MT6360_CHAN_VBUSDIV5, 44 + MT6360_CHAN_VBUSDIV2, 45 + MT6360_CHAN_VSYS, 46 + MT6360_CHAN_VBAT, 47 + MT6360_CHAN_IBUS, 48 + MT6360_CHAN_IBAT, 49 + MT6360_CHAN_CHG_VDDP, 50 + MT6360_CHAN_TEMP_JC, 51 + MT6360_CHAN_VREF_TS, 52 + MT6360_CHAN_TS, 53 + MT6360_CHAN_MAX 54 + }; 55 + 56 + struct mt6360_adc_data { 57 + struct device *dev; 58 + struct regmap *regmap; 59 + /* Due to only one set of ADC control, this lock is used to prevent the race condition */ 60 + struct mutex adc_lock; 61 + ktime_t last_off_timestamps[MT6360_CHAN_MAX]; 62 + }; 63 + 64 + static int mt6360_adc_read_channel(struct mt6360_adc_data *mad, int channel, int *val) 65 + { 66 + __be16 adc_enable; 67 + u8 rpt[3]; 68 + ktime_t predict_end_t, timeout; 69 + unsigned int pre_wait_time; 70 + int ret; 71 + 72 + mutex_lock(&mad->adc_lock); 73 + 74 + /* Select the preferred ADC channel */ 75 + ret = regmap_update_bits(mad->regmap, MT6360_REG_PMUADCRPT1, MT6360_PREFERCH_MASK, 76 + channel << MT6360_PREFERCH_SHFT); 77 + if (ret) 78 + goto out_adc_lock; 79 + 80 + adc_enable = cpu_to_be16(MT6360_ADCEN_MASK | BIT(channel)); 81 + ret = regmap_raw_write(mad->regmap, MT6360_REG_PMUADCCFG, &adc_enable, sizeof(adc_enable)); 82 + if (ret) 83 + goto out_adc_lock; 84 + 85 + predict_end_t = ktime_add_ms(mad->last_off_timestamps[channel], 2 * ADC_WAIT_TIME_MS); 86 + 87 + if (ktime_after(ktime_get(), predict_end_t)) 88 + pre_wait_time = ADC_WAIT_TIME_MS; 89 + else 90 + pre_wait_time = 3 * ADC_WAIT_TIME_MS; 91 + 92 + if (msleep_interruptible(pre_wait_time)) { 93 + ret = -ERESTARTSYS; 94 + goto out_adc_conv; 95 + } 96 + 97 + timeout = ktime_add_ms(ktime_get(), ADC_CONV_TIMEOUT_MS); 98 + while (true) { 99 + ret = regmap_raw_read(mad->regmap, MT6360_REG_PMUADCRPT1, rpt, sizeof(rpt)); 100 + if (ret) 101 + goto out_adc_conv; 102 + 103 + /* 104 + * There are two functions, ZCV and TypeC OTP, running ADC VBAT and TS in 105 + * background, and ADC samples are taken on a fixed frequency no matter read the 106 + * previous one or not. 107 + * To avoid conflict, We set minimum time threshold after enable ADC and 108 + * check report channel is the same. 109 + * The worst case is run the same ADC twice and background function is also running, 110 + * ADC conversion sequence is desire channel before start ADC, background ADC, 111 + * desire channel after start ADC. 112 + * So the minimum correct data is three times of typical conversion time. 113 + */ 114 + if ((rpt[0] & MT6360_RPTCH_MASK) == channel) 115 + break; 116 + 117 + if (ktime_compare(ktime_get(), timeout) > 0) { 118 + ret = -ETIMEDOUT; 119 + goto out_adc_conv; 120 + } 121 + 122 + usleep_range(ADC_LOOP_TIME_US / 2, ADC_LOOP_TIME_US); 123 + } 124 + 125 + *val = rpt[1] << 8 | rpt[2]; 126 + ret = IIO_VAL_INT; 127 + 128 + out_adc_conv: 129 + /* Only keep ADC enable */ 130 + adc_enable = cpu_to_be16(MT6360_ADCEN_MASK); 131 + regmap_raw_write(mad->regmap, MT6360_REG_PMUADCCFG, &adc_enable, sizeof(adc_enable)); 132 + mad->last_off_timestamps[channel] = ktime_get(); 133 + /* Config prefer channel to NO_PREFER */ 134 + regmap_update_bits(mad->regmap, MT6360_REG_PMUADCRPT1, MT6360_PREFERCH_MASK, 135 + MT6360_NO_PREFER << MT6360_PREFERCH_SHFT); 136 + out_adc_lock: 137 + mutex_unlock(&mad->adc_lock); 138 + 139 + return ret; 140 + } 141 + 142 + static int mt6360_adc_read_scale(struct mt6360_adc_data *mad, int channel, int *val, int *val2) 143 + { 144 + unsigned int regval; 145 + int ret; 146 + 147 + switch (channel) { 148 + case MT6360_CHAN_USBID: 149 + case MT6360_CHAN_VSYS: 150 + case MT6360_CHAN_VBAT: 151 + case MT6360_CHAN_CHG_VDDP: 152 + case MT6360_CHAN_VREF_TS: 153 + case MT6360_CHAN_TS: 154 + *val = 1250; 155 + return IIO_VAL_INT; 156 + case MT6360_CHAN_VBUSDIV5: 157 + *val = 6250; 158 + return IIO_VAL_INT; 159 + case MT6360_CHAN_VBUSDIV2: 160 + case MT6360_CHAN_IBUS: 161 + case MT6360_CHAN_IBAT: 162 + *val = 2500; 163 + 164 + if (channel == MT6360_CHAN_IBUS) { 165 + /* IBUS will be affected by input current limit for the different Ron */ 166 + /* Check whether the config is <400mA or not */ 167 + ret = regmap_read(mad->regmap, MT6360_REG_PMUCHGCTRL3, &regval); 168 + if (ret) 169 + return ret; 170 + 171 + regval = (regval & MT6360_AICR_MASK) >> MT6360_AICR_SHFT; 172 + if (regval < MT6360_AICR_400MA) 173 + *val = 1900; 174 + } 175 + 176 + return IIO_VAL_INT; 177 + case MT6360_CHAN_TEMP_JC: 178 + *val = 105; 179 + *val2 = 100; 180 + return IIO_VAL_FRACTIONAL; 181 + } 182 + 183 + return -EINVAL; 184 + } 185 + 186 + static int mt6360_adc_read_offset(struct mt6360_adc_data *mad, int channel, int *val) 187 + { 188 + *val = (channel == MT6360_CHAN_TEMP_JC) ? -80 : 0; 189 + return IIO_VAL_INT; 190 + } 191 + 192 + static int mt6360_adc_read_raw(struct iio_dev *iio_dev, const struct iio_chan_spec *chan, 193 + int *val, int *val2, long mask) 194 + { 195 + struct mt6360_adc_data *mad = iio_priv(iio_dev); 196 + 197 + switch (mask) { 198 + case IIO_CHAN_INFO_RAW: 199 + return mt6360_adc_read_channel(mad, chan->channel, val); 200 + case IIO_CHAN_INFO_SCALE: 201 + return mt6360_adc_read_scale(mad, chan->channel, val, val2); 202 + case IIO_CHAN_INFO_OFFSET: 203 + return mt6360_adc_read_offset(mad, chan->channel, val); 204 + } 205 + 206 + return -EINVAL; 207 + } 208 + 209 + static const char *mt6360_channel_labels[MT6360_CHAN_MAX] = { 210 + "usbid", "vbusdiv5", "vbusdiv2", "vsys", "vbat", "ibus", "ibat", "chg_vddp", 211 + "temp_jc", "vref_ts", "ts", 212 + }; 213 + 214 + static int mt6360_adc_read_label(struct iio_dev *iio_dev, const struct iio_chan_spec *chan, 215 + char *label) 216 + { 217 + return snprintf(label, PAGE_SIZE, "%s\n", mt6360_channel_labels[chan->channel]); 218 + } 219 + 220 + static const struct iio_info mt6360_adc_iio_info = { 221 + .read_raw = mt6360_adc_read_raw, 222 + .read_label = mt6360_adc_read_label, 223 + }; 224 + 225 + #define MT6360_ADC_CHAN(_idx, _type) { \ 226 + .type = _type, \ 227 + .channel = MT6360_CHAN_##_idx, \ 228 + .scan_index = MT6360_CHAN_##_idx, \ 229 + .datasheet_name = #_idx, \ 230 + .scan_type = { \ 231 + .sign = 'u', \ 232 + .realbits = 16, \ 233 + .storagebits = 16, \ 234 + .endianness = IIO_CPU, \ 235 + }, \ 236 + .indexed = 1, \ 237 + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ 238 + BIT(IIO_CHAN_INFO_SCALE) | \ 239 + BIT(IIO_CHAN_INFO_OFFSET), \ 240 + } 241 + 242 + static const struct iio_chan_spec mt6360_adc_channels[] = { 243 + MT6360_ADC_CHAN(USBID, IIO_VOLTAGE), 244 + MT6360_ADC_CHAN(VBUSDIV5, IIO_VOLTAGE), 245 + MT6360_ADC_CHAN(VBUSDIV2, IIO_VOLTAGE), 246 + MT6360_ADC_CHAN(VSYS, IIO_VOLTAGE), 247 + MT6360_ADC_CHAN(VBAT, IIO_VOLTAGE), 248 + MT6360_ADC_CHAN(IBUS, IIO_CURRENT), 249 + MT6360_ADC_CHAN(IBAT, IIO_CURRENT), 250 + MT6360_ADC_CHAN(CHG_VDDP, IIO_VOLTAGE), 251 + MT6360_ADC_CHAN(TEMP_JC, IIO_TEMP), 252 + MT6360_ADC_CHAN(VREF_TS, IIO_VOLTAGE), 253 + MT6360_ADC_CHAN(TS, IIO_VOLTAGE), 254 + IIO_CHAN_SOFT_TIMESTAMP(MT6360_CHAN_MAX), 255 + }; 256 + 257 + static irqreturn_t mt6360_adc_trigger_handler(int irq, void *p) 258 + { 259 + struct iio_poll_func *pf = p; 260 + struct iio_dev *indio_dev = pf->indio_dev; 261 + struct mt6360_adc_data *mad = iio_priv(indio_dev); 262 + struct { 263 + u16 values[MT6360_CHAN_MAX]; 264 + int64_t timestamp; 265 + } data __aligned(8); 266 + int i = 0, bit, val, ret; 267 + 268 + memset(&data, 0, sizeof(data)); 269 + for_each_set_bit(bit, indio_dev->active_scan_mask, indio_dev->masklength) { 270 + ret = mt6360_adc_read_channel(mad, bit, &val); 271 + if (ret < 0) { 272 + dev_warn(&indio_dev->dev, "Failed to get channel %d conversion val\n", bit); 273 + goto out; 274 + } 275 + 276 + data.values[i++] = val; 277 + } 278 + iio_push_to_buffers_with_timestamp(indio_dev, &data, iio_get_time_ns(indio_dev)); 279 + out: 280 + iio_trigger_notify_done(indio_dev->trig); 281 + 282 + return IRQ_HANDLED; 283 + } 284 + 285 + static inline int mt6360_adc_reset(struct mt6360_adc_data *info) 286 + { 287 + __be16 adc_enable; 288 + ktime_t all_off_time; 289 + int i, ret; 290 + 291 + /* Clear ADC idle wait time to 0 */ 292 + ret = regmap_write(info->regmap, MT6360_REG_PMUADCIDLET, 0); 293 + if (ret) 294 + return ret; 295 + 296 + /* Only keep ADC enable, but keep all channels off */ 297 + adc_enable = cpu_to_be16(MT6360_ADCEN_MASK); 298 + ret = regmap_raw_write(info->regmap, MT6360_REG_PMUADCCFG, &adc_enable, sizeof(adc_enable)); 299 + if (ret) 300 + return ret; 301 + 302 + /* Reset all channel off time to the current one */ 303 + all_off_time = ktime_get(); 304 + for (i = 0; i < MT6360_CHAN_MAX; i++) 305 + info->last_off_timestamps[i] = all_off_time; 306 + 307 + return 0; 308 + } 309 + 310 + static int mt6360_adc_probe(struct platform_device *pdev) 311 + { 312 + struct mt6360_adc_data *mad; 313 + struct regmap *regmap; 314 + struct iio_dev *indio_dev; 315 + int ret; 316 + 317 + regmap = dev_get_regmap(pdev->dev.parent, NULL); 318 + if (!regmap) { 319 + dev_err(&pdev->dev, "Failed to get parent regmap\n"); 320 + return -ENODEV; 321 + } 322 + 323 + indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*mad)); 324 + if (!indio_dev) 325 + return -ENOMEM; 326 + 327 + mad = iio_priv(indio_dev); 328 + mad->dev = &pdev->dev; 329 + mad->regmap = regmap; 330 + mutex_init(&mad->adc_lock); 331 + 332 + ret = mt6360_adc_reset(mad); 333 + if (ret < 0) { 334 + dev_err(&pdev->dev, "Failed to reset adc\n"); 335 + return ret; 336 + } 337 + 338 + indio_dev->name = dev_name(&pdev->dev); 339 + indio_dev->dev.parent = &pdev->dev; 340 + indio_dev->info = &mt6360_adc_iio_info; 341 + indio_dev->modes = INDIO_DIRECT_MODE; 342 + indio_dev->channels = mt6360_adc_channels; 343 + indio_dev->num_channels = ARRAY_SIZE(mt6360_adc_channels); 344 + 345 + ret = devm_iio_triggered_buffer_setup(&pdev->dev, indio_dev, NULL, 346 + mt6360_adc_trigger_handler, NULL); 347 + if (ret) { 348 + dev_err(&pdev->dev, "Failed to allocate iio trigger buffer\n"); 349 + return ret; 350 + } 351 + 352 + return devm_iio_device_register(&pdev->dev, indio_dev); 353 + } 354 + 355 + static const struct of_device_id __maybe_unused mt6360_adc_of_id[] = { 356 + { .compatible = "mediatek,mt6360-adc", }, 357 + {} 358 + }; 359 + MODULE_DEVICE_TABLE(of, mt6360_adc_of_id); 360 + 361 + static struct platform_driver mt6360_adc_driver = { 362 + .driver = { 363 + .name = "mt6360-adc", 364 + .of_match_table = mt6360_adc_of_id, 365 + }, 366 + .probe = mt6360_adc_probe, 367 + }; 368 + module_platform_driver(mt6360_adc_driver); 369 + 370 + MODULE_AUTHOR("Gene Chen <gene_chen@richtek.com>"); 371 + MODULE_DESCRIPTION("MT6360 ADC Driver"); 372 + MODULE_LICENSE("GPL v2");
+20 -1
drivers/iio/adc/stm32-adc-core.c
··· 200 200 { 201 201 u32 ckmode, presc, val; 202 202 unsigned long rate; 203 - int i, div; 203 + int i, div, duty; 204 204 205 205 /* stm32h7 bus clock is common for all ADC instances (mandatory) */ 206 206 if (!priv->bclk) { ··· 224 224 return -EINVAL; 225 225 } 226 226 227 + /* If duty is an error, kindly use at least /2 divider */ 228 + duty = clk_get_scaled_duty_cycle(priv->aclk, 100); 229 + if (duty < 0) 230 + dev_warn(&pdev->dev, "adc clock duty: %d\n", duty); 231 + 227 232 for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) { 228 233 ckmode = stm32h7_adc_ckmodes_spec[i].ckmode; 229 234 presc = stm32h7_adc_ckmodes_spec[i].presc; 230 235 div = stm32h7_adc_ckmodes_spec[i].div; 231 236 232 237 if (ckmode) 238 + continue; 239 + 240 + /* 241 + * For proper operation, clock duty cycle range is 49% 242 + * to 51%. Apply at least /2 prescaler otherwise. 243 + */ 244 + if (div == 1 && (duty < 49 || duty > 51)) 233 245 continue; 234 246 235 247 if ((rate / div) <= priv->max_clk_rate) ··· 256 244 return -EINVAL; 257 245 } 258 246 247 + duty = clk_get_scaled_duty_cycle(priv->bclk, 100); 248 + if (duty < 0) 249 + dev_warn(&pdev->dev, "bus clock duty: %d\n", duty); 250 + 259 251 for (i = 0; i < ARRAY_SIZE(stm32h7_adc_ckmodes_spec); i++) { 260 252 ckmode = stm32h7_adc_ckmodes_spec[i].ckmode; 261 253 presc = stm32h7_adc_ckmodes_spec[i].presc; 262 254 div = stm32h7_adc_ckmodes_spec[i].div; 263 255 264 256 if (!ckmode) 257 + continue; 258 + 259 + if (div == 1 && (duty < 49 || duty > 51)) 265 260 continue; 266 261 267 262 if ((rate / div) <= priv->max_clk_rate)
+6 -23
drivers/iio/adc/stm32-adc.c
··· 1353 1353 * dma cyclic transfers are used, buffer is split into two periods. 1354 1354 * There should be : 1355 1355 * - always one buffer (period) dma is working on 1356 - * - one buffer (period) driver can push with iio_trigger_poll(). 1356 + * - one buffer (period) driver can push data. 1357 1357 */ 1358 1358 watermark = min(watermark, val * (unsigned)(sizeof(u16))); 1359 1359 adc->rx_buf_sz = min(rx_buf_sz, watermark * 2 * adc->num_conv); ··· 1616 1616 1617 1617 dev_dbg(&indio_dev->dev, "%s bufi=%d\n", __func__, adc->bufi); 1618 1618 1619 - if (!adc->dma_chan) { 1620 - /* reset buffer index */ 1621 - adc->bufi = 0; 1622 - iio_push_to_buffers_with_timestamp(indio_dev, adc->buffer, 1623 - pf->timestamp); 1624 - } else { 1625 - int residue = stm32_adc_dma_residue(adc); 1626 - 1627 - while (residue >= indio_dev->scan_bytes) { 1628 - u16 *buffer = (u16 *)&adc->rx_buf[adc->bufi]; 1629 - 1630 - iio_push_to_buffers_with_timestamp(indio_dev, buffer, 1631 - pf->timestamp); 1632 - residue -= indio_dev->scan_bytes; 1633 - adc->bufi += indio_dev->scan_bytes; 1634 - if (adc->bufi >= adc->rx_buf_sz) 1635 - adc->bufi = 0; 1636 - } 1637 - } 1638 - 1619 + /* reset buffer index */ 1620 + adc->bufi = 0; 1621 + iio_push_to_buffers_with_timestamp(indio_dev, adc->buffer, 1622 + pf->timestamp); 1639 1623 iio_trigger_notify_done(indio_dev->trig); 1640 1624 1641 1625 /* re-enable eoc irq */ 1642 - if (!adc->dma_chan) 1643 - stm32_adc_conv_irq_enable(adc); 1626 + stm32_adc_conv_irq_enable(adc); 1644 1627 1645 1628 return IRQ_HANDLED; 1646 1629 }
+1 -2
drivers/iio/buffer/industrialio-buffer-dmaengine.c
··· 200 200 201 201 iio_dma_buffer_init(&dmaengine_buffer->queue, chan->device->dev, 202 202 &iio_dmaengine_default_ops); 203 - iio_buffer_set_attrs(&dmaengine_buffer->queue.buffer, 204 - iio_dmaengine_buffer_attrs); 205 203 204 + dmaengine_buffer->queue.buffer.attrs = iio_dmaengine_buffer_attrs; 206 205 dmaengine_buffer->queue.buffer.access = &iio_dmaengine_buffer_ops; 207 206 208 207 return &dmaengine_buffer->queue.buffer;
+19 -12
drivers/iio/buffer/industrialio-triggered-buffer.c
··· 9 9 #include <linux/module.h> 10 10 #include <linux/iio/iio.h> 11 11 #include <linux/iio/buffer.h> 12 + #include <linux/iio/buffer_impl.h> 12 13 #include <linux/iio/kfifo_buf.h> 13 14 #include <linux/iio/triggered_buffer.h> 14 15 #include <linux/iio/trigger_consumer.h> 15 16 16 17 /** 17 - * iio_triggered_buffer_setup() - Setup triggered buffer and pollfunc 18 + * iio_triggered_buffer_setup_ext() - Setup triggered buffer and pollfunc 18 19 * @indio_dev: IIO device structure 19 20 * @h: Function which will be used as pollfunc top half 20 21 * @thread: Function which will be used as pollfunc bottom half 21 22 * @setup_ops: Buffer setup functions to use for this device. 22 23 * If NULL the default setup functions for triggered 23 24 * buffers will be used. 25 + * @buffer_attrs: Extra sysfs buffer attributes for this IIO buffer 24 26 * 25 27 * This function combines some common tasks which will normally be performed 26 28 * when setting up a triggered buffer. It will allocate the buffer and the ··· 35 33 * To free the resources allocated by this function call 36 34 * iio_triggered_buffer_cleanup(). 37 35 */ 38 - int iio_triggered_buffer_setup(struct iio_dev *indio_dev, 36 + int iio_triggered_buffer_setup_ext(struct iio_dev *indio_dev, 39 37 irqreturn_t (*h)(int irq, void *p), 40 38 irqreturn_t (*thread)(int irq, void *p), 41 - const struct iio_buffer_setup_ops *setup_ops) 39 + const struct iio_buffer_setup_ops *setup_ops, 40 + const struct attribute **buffer_attrs) 42 41 { 43 42 struct iio_buffer *buffer; 44 43 int ret; ··· 70 67 /* Flag that polled ring buffering is possible */ 71 68 indio_dev->modes |= INDIO_BUFFER_TRIGGERED; 72 69 70 + buffer->attrs = buffer_attrs; 71 + 73 72 return 0; 74 73 75 74 error_kfifo_free: ··· 79 74 error_ret: 80 75 return ret; 81 76 } 82 - EXPORT_SYMBOL(iio_triggered_buffer_setup); 77 + EXPORT_SYMBOL(iio_triggered_buffer_setup_ext); 83 78 84 79 /** 85 - * iio_triggered_buffer_cleanup() - Free resources allocated by iio_triggered_buffer_setup() 80 + * iio_triggered_buffer_cleanup() - Free resources allocated by iio_triggered_buffer_setup_ext() 86 81 * @indio_dev: IIO device structure 87 82 */ 88 83 void iio_triggered_buffer_cleanup(struct iio_dev *indio_dev) ··· 97 92 iio_triggered_buffer_cleanup(*(struct iio_dev **)res); 98 93 } 99 94 100 - int devm_iio_triggered_buffer_setup(struct device *dev, 101 - struct iio_dev *indio_dev, 102 - irqreturn_t (*h)(int irq, void *p), 103 - irqreturn_t (*thread)(int irq, void *p), 104 - const struct iio_buffer_setup_ops *ops) 95 + int devm_iio_triggered_buffer_setup_ext(struct device *dev, 96 + struct iio_dev *indio_dev, 97 + irqreturn_t (*h)(int irq, void *p), 98 + irqreturn_t (*thread)(int irq, void *p), 99 + const struct iio_buffer_setup_ops *ops, 100 + const struct attribute **buffer_attrs) 105 101 { 106 102 struct iio_dev **ptr; 107 103 int ret; ··· 114 108 115 109 *ptr = indio_dev; 116 110 117 - ret = iio_triggered_buffer_setup(indio_dev, h, thread, ops); 111 + ret = iio_triggered_buffer_setup_ext(indio_dev, h, thread, ops, 112 + buffer_attrs); 118 113 if (!ret) 119 114 devres_add(dev, ptr); 120 115 else ··· 123 116 124 117 return ret; 125 118 } 126 - EXPORT_SYMBOL_GPL(devm_iio_triggered_buffer_setup); 119 + EXPORT_SYMBOL_GPL(devm_iio_triggered_buffer_setup_ext); 127 120 128 121 MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>"); 129 122 MODULE_DESCRIPTION("IIO helper functions for setting up triggered buffers");
+9 -6
drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
··· 359 359 if (ret) 360 360 return ret; 361 361 } else { 362 + const struct attribute **fifo_attrs; 363 + 364 + if (has_hw_fifo) 365 + fifo_attrs = cros_ec_sensor_fifo_attributes; 366 + else 367 + fifo_attrs = NULL; 368 + 362 369 /* 363 370 * The only way to get samples in buffer is to set a 364 371 * software trigger (systrig, hrtimer). 365 372 */ 366 - ret = devm_iio_triggered_buffer_setup( 373 + ret = devm_iio_triggered_buffer_setup_ext( 367 374 dev, indio_dev, NULL, trigger_capture, 368 - NULL); 375 + NULL, fifo_attrs); 369 376 if (ret) 370 377 return ret; 371 - 372 - if (has_hw_fifo) 373 - iio_buffer_set_attrs(indio_dev->buffer, 374 - cros_ec_sensor_fifo_attributes); 375 378 } 376 379 } 377 380
+9 -13
drivers/iio/common/hid-sensors/hid-sensor-trigger.c
··· 84 84 NULL, 85 85 }; 86 86 87 - static void hid_sensor_setup_batch_mode(struct iio_dev *indio_dev, 88 - struct hid_sensor_common *st) 89 - { 90 - if (!hid_sensor_batch_mode_supported(st)) 91 - return; 92 - 93 - iio_buffer_set_attrs(indio_dev->buffer, hid_sensor_fifo_attributes); 94 - } 95 - 96 87 static int _hid_sensor_power_state(struct hid_sensor_common *st, bool state) 97 88 { 98 89 int state_val; ··· 238 247 int hid_sensor_setup_trigger(struct iio_dev *indio_dev, const char *name, 239 248 struct hid_sensor_common *attrb) 240 249 { 250 + const struct attribute **fifo_attrs; 241 251 int ret; 242 252 struct iio_trigger *trig; 243 253 244 - ret = iio_triggered_buffer_setup(indio_dev, &iio_pollfunc_store_time, 245 - NULL, NULL); 254 + if (hid_sensor_batch_mode_supported(attrb)) 255 + fifo_attrs = hid_sensor_fifo_attributes; 256 + else 257 + fifo_attrs = NULL; 258 + 259 + ret = iio_triggered_buffer_setup_ext(indio_dev, 260 + &iio_pollfunc_store_time, 261 + NULL, NULL, fifo_attrs); 246 262 if (ret) { 247 263 dev_err(&indio_dev->dev, "Triggered Buffer Setup Failed\n"); 248 264 return ret; ··· 273 275 } 274 276 attrb->trigger = trig; 275 277 indio_dev->trig = iio_trigger_get(trig); 276 - 277 - hid_sensor_setup_batch_mode(indio_dev, attrb); 278 278 279 279 ret = pm_runtime_set_active(&indio_dev->dev); 280 280 if (ret)
+4 -3
drivers/iio/dac/Kconfig
··· 141 141 depends on I2C 142 142 select AD5686 143 143 help 144 - Say yes here to build support for Analog Devices AD5671R, AD5675R, 145 - AD5694, AD5694R, AD5695R, AD5696, AD5696R Voltage Output Digital to 146 - Analog Converter. 144 + Say yes here to build support for Analog Devices AD5311R, AD5338R, 145 + AD5671R, AD5675R, AD5691R, AD5692R, AD5693, AD5693R, AD5694, AD5694R, 146 + AD5695R, AD5696, and AD5696R Digital to Analog converters. 147 + 147 148 To compile this driver as a module, choose M here: the module will be 148 149 called ad5696. 149 150
+13
drivers/iio/dac/ad5686.c
··· 210 210 AD5868_CHANNEL(0, 0, bits, _shift), \ 211 211 } 212 212 213 + #define DECLARE_AD5338_CHANNELS(name, bits, _shift) \ 214 + static const struct iio_chan_spec name[] = { \ 215 + AD5868_CHANNEL(0, 1, bits, _shift), \ 216 + AD5868_CHANNEL(1, 8, bits, _shift), \ 217 + } 218 + 213 219 #define DECLARE_AD5686_CHANNELS(name, bits, _shift) \ 214 220 static const struct iio_chan_spec name[] = { \ 215 221 AD5868_CHANNEL(0, 1, bits, _shift), \ ··· 258 252 259 253 DECLARE_AD5693_CHANNELS(ad5310r_channels, 10, 2); 260 254 DECLARE_AD5693_CHANNELS(ad5311r_channels, 10, 6); 255 + DECLARE_AD5338_CHANNELS(ad5338r_channels, 10, 6); 261 256 DECLARE_AD5676_CHANNELS(ad5672_channels, 12, 4); 262 257 DECLARE_AD5679_CHANNELS(ad5674r_channels, 12, 4); 263 258 DECLARE_AD5676_CHANNELS(ad5676_channels, 16, 0); ··· 282 275 .int_vref_mv = 2500, 283 276 .num_channels = 1, 284 277 .regmap_type = AD5693_REGMAP, 278 + }, 279 + [ID_AD5338R] = { 280 + .channels = ad5338r_channels, 281 + .int_vref_mv = 2500, 282 + .num_channels = 2, 283 + .regmap_type = AD5686_REGMAP, 285 284 }, 286 285 [ID_AD5671R] = { 287 286 .channels = ad5672_channels,
+1
drivers/iio/dac/ad5686.h
··· 52 52 enum ad5686_supported_device_ids { 53 53 ID_AD5310R, 54 54 ID_AD5311R, 55 + ID_AD5338R, 55 56 ID_AD5671R, 56 57 ID_AD5672R, 57 58 ID_AD5674R,
+20
drivers/iio/dac/ad5696-i2c.c
··· 72 72 73 73 static const struct i2c_device_id ad5686_i2c_id[] = { 74 74 {"ad5311r", ID_AD5311R}, 75 + {"ad5338r", ID_AD5338R}, 75 76 {"ad5671r", ID_AD5671R}, 76 77 {"ad5675r", ID_AD5675R}, 77 78 {"ad5691r", ID_AD5691R}, ··· 88 87 }; 89 88 MODULE_DEVICE_TABLE(i2c, ad5686_i2c_id); 90 89 90 + static const struct of_device_id ad5686_of_match[] = { 91 + { .compatible = "adi,ad5311r" }, 92 + { .compatible = "adi,ad5338r" }, 93 + { .compatible = "adi,ad5671r" }, 94 + { .compatible = "adi,ad5675r" }, 95 + { .compatible = "adi,ad5691r" }, 96 + { .compatible = "adi,ad5692r" }, 97 + { .compatible = "adi,ad5693" }, 98 + { .compatible = "adi,ad5693r" }, 99 + { .compatible = "adi,ad5694" }, 100 + { .compatible = "adi,ad5694r" }, 101 + { .compatible = "adi,ad5695r" }, 102 + { .compatible = "adi,ad5696" }, 103 + { .compatible = "adi,ad5696r" }, 104 + {} 105 + }; 106 + MODULE_DEVICE_TABLE(of, ad5686_of_match); 107 + 91 108 static struct i2c_driver ad5686_i2c_driver = { 92 109 .driver = { 93 110 .name = "ad5696", 111 + .of_match_table = ad5686_of_match, 94 112 }, 95 113 .probe = ad5686_i2c_probe, 96 114 .remove = ad5686_i2c_remove,
-2
drivers/iio/dac/ad7303.c
··· 17 17 #include <linux/iio/iio.h> 18 18 #include <linux/iio/sysfs.h> 19 19 20 - #include <linux/platform_data/ad7303.h> 21 - 22 20 #define AD7303_CFG_EXTERNAL_VREF BIT(15) 23 21 #define AD7303_CFG_POWER_DOWN(ch) BIT(11 + (ch)) 24 22 #define AD7303_CFG_ADDR_OFFSET 10
+14 -1
drivers/iio/iio_core.h
··· 17 17 18 18 extern struct device_type iio_device_type; 19 19 20 + #define IIO_IOCTL_UNHANDLED 1 21 + struct iio_ioctl_handler { 22 + struct list_head entry; 23 + long (*ioctl)(struct iio_dev *indio_dev, struct file *filp, 24 + unsigned int cmd, unsigned long arg); 25 + }; 26 + 27 + long iio_device_ioctl(struct iio_dev *indio_dev, struct file *filp, 28 + unsigned int cmd, unsigned long arg); 29 + 30 + void iio_device_ioctl_handler_register(struct iio_dev *indio_dev, 31 + struct iio_ioctl_handler *h); 32 + void iio_device_ioctl_handler_unregister(struct iio_ioctl_handler *h); 33 + 20 34 int __iio_add_chan_devattr(const char *postfix, 21 35 struct iio_chan_spec const *chan, 22 36 ssize_t (*func)(struct device *dev, ··· 88 74 int iio_device_register_eventset(struct iio_dev *indio_dev); 89 75 void iio_device_unregister_eventset(struct iio_dev *indio_dev); 90 76 void iio_device_wakeup_eventset(struct iio_dev *indio_dev); 91 - int iio_event_getfd(struct iio_dev *indio_dev); 92 77 93 78 struct iio_event_interface; 94 79 bool iio_event_enabled(const struct iio_event_interface *ev_int);
-1
drivers/iio/imu/bmi160/bmi160_core.c
··· 486 486 case IIO_CHAN_INFO_SCALE: 487 487 return bmi160_set_scale(data, 488 488 bmi160_to_sensor(chan->type), val2); 489 - break; 490 489 case IIO_CHAN_INFO_SAMP_FREQ: 491 490 return bmi160_set_odr(data, bmi160_to_sensor(chan->type), 492 491 val, val2);
+2 -2
drivers/iio/imu/st_lsm6dsx/Kconfig
··· 12 12 Say yes here to build support for STMicroelectronics LSM6DSx imu 13 13 sensor. Supported devices: lsm6ds3, lsm6ds3h, lsm6dsl, lsm6dsm, 14 14 ism330dlc, lsm6dso, lsm6dsox, asm330lhh, lsm6dsr, lsm6ds3tr-c, 15 - ism330dhcx, lsm6dsrx, lsm6ds0 and the accelerometer/gyroscope 16 - of lsm9ds1. 15 + ism330dhcx, lsm6dsrx, lsm6ds0, the accelerometer/gyroscope 16 + of lsm9ds1 and lsm6dst. 17 17 18 18 To compile this driver as a module, choose M here: the module 19 19 will be called st_lsm6dsx.
+2
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx.h
··· 28 28 #define ST_LSM9DS1_DEV_NAME "lsm9ds1-imu" 29 29 #define ST_LSM6DS0_DEV_NAME "lsm6ds0" 30 30 #define ST_LSM6DSRX_DEV_NAME "lsm6dsrx" 31 + #define ST_LSM6DST_DEV_NAME "lsm6dst" 31 32 32 33 enum st_lsm6dsx_hw_id { 33 34 ST_LSM6DS3_ID, ··· 45 44 ST_LSM9DS1_ID, 46 45 ST_LSM6DS0_ID, 47 46 ST_LSM6DSRX_ID, 47 + ST_LSM6DST_ID, 48 48 ST_LSM6DSX_MAX_ID, 49 49 }; 50 50
+1 -1
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_buffer.c
··· 14 14 * (e.g. Gx, Gy, Gz, Ax, Ay, Az), then data are repeated depending on the 15 15 * value of the decimation factor and ODR set for each FIFO data set. 16 16 * 17 - * LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/LSM6DSRX/ISM330DHCX: 17 + * LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/LSM6DSRX/ISM330DHCX/LSM6DST: 18 18 * The FIFO buffer can be configured to store data from gyroscope and 19 19 * accelerometer. Each sample is queued with a tag (1B) indicating data 20 20 * source (gyroscope, accelerometer, hw timer).
+206 -1
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
··· 26 26 * - Gyroscope supported full-scale [dps]: +-125/+-245/+-500/+-1000/+-2000 27 27 * - FIFO size: 4KB 28 28 * 29 - * - LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/ISM330DHCX: 29 + * - LSM6DSO/LSM6DSOX/ASM330LHH/LSM6DSR/ISM330DHCX/LSM6DST: 30 30 * - Accelerometer/Gyroscope supported ODR [Hz]: 13, 26, 52, 104, 208, 416, 31 31 * 833 32 32 * - Accelerometer supported full-scale [g]: +-2/+-4/+-8/+-16 ··· 1333 1333 .wakeup_src_y_mask = BIT(1), 1334 1334 .wakeup_src_x_mask = BIT(2), 1335 1335 } 1336 + }, 1337 + { 1338 + .wai = 0x6d, 1339 + .reset = { 1340 + .addr = 0x12, 1341 + .mask = BIT(0), 1342 + }, 1343 + .boot = { 1344 + .addr = 0x12, 1345 + .mask = BIT(7), 1346 + }, 1347 + .bdu = { 1348 + .addr = 0x12, 1349 + .mask = BIT(6), 1350 + }, 1351 + .max_fifo_size = 512, 1352 + .id = { 1353 + { 1354 + .hw_id = ST_LSM6DST_ID, 1355 + .name = ST_LSM6DST_DEV_NAME, 1356 + }, 1357 + }, 1358 + .channels = { 1359 + [ST_LSM6DSX_ID_ACC] = { 1360 + .chan = st_lsm6dsx_acc_channels, 1361 + .len = ARRAY_SIZE(st_lsm6dsx_acc_channels), 1362 + }, 1363 + [ST_LSM6DSX_ID_GYRO] = { 1364 + .chan = st_lsm6dsx_gyro_channels, 1365 + .len = ARRAY_SIZE(st_lsm6dsx_gyro_channels), 1366 + }, 1367 + }, 1368 + .drdy_mask = { 1369 + .addr = 0x13, 1370 + .mask = BIT(3), 1371 + }, 1372 + .odr_table = { 1373 + [ST_LSM6DSX_ID_ACC] = { 1374 + .reg = { 1375 + .addr = 0x10, 1376 + .mask = GENMASK(7, 4), 1377 + }, 1378 + .odr_avl[0] = { 12500, 0x01 }, 1379 + .odr_avl[1] = { 26000, 0x02 }, 1380 + .odr_avl[2] = { 52000, 0x03 }, 1381 + .odr_avl[3] = { 104000, 0x04 }, 1382 + .odr_avl[4] = { 208000, 0x05 }, 1383 + .odr_avl[5] = { 416000, 0x06 }, 1384 + .odr_avl[6] = { 833000, 0x07 }, 1385 + .odr_len = 7, 1386 + }, 1387 + [ST_LSM6DSX_ID_GYRO] = { 1388 + .reg = { 1389 + .addr = 0x11, 1390 + .mask = GENMASK(7, 4), 1391 + }, 1392 + .odr_avl[0] = { 12500, 0x01 }, 1393 + .odr_avl[1] = { 26000, 0x02 }, 1394 + .odr_avl[2] = { 52000, 0x03 }, 1395 + .odr_avl[3] = { 104000, 0x04 }, 1396 + .odr_avl[4] = { 208000, 0x05 }, 1397 + .odr_avl[5] = { 416000, 0x06 }, 1398 + .odr_avl[6] = { 833000, 0x07 }, 1399 + .odr_len = 7, 1400 + }, 1401 + }, 1402 + .fs_table = { 1403 + [ST_LSM6DSX_ID_ACC] = { 1404 + .reg = { 1405 + .addr = 0x10, 1406 + .mask = GENMASK(3, 2), 1407 + }, 1408 + .fs_avl[0] = { IIO_G_TO_M_S_2(61000), 0x0 }, 1409 + .fs_avl[1] = { IIO_G_TO_M_S_2(122000), 0x2 }, 1410 + .fs_avl[2] = { IIO_G_TO_M_S_2(244000), 0x3 }, 1411 + .fs_avl[3] = { IIO_G_TO_M_S_2(488000), 0x1 }, 1412 + .fs_len = 4, 1413 + }, 1414 + [ST_LSM6DSX_ID_GYRO] = { 1415 + .reg = { 1416 + .addr = 0x11, 1417 + .mask = GENMASK(3, 2), 1418 + }, 1419 + .fs_avl[0] = { IIO_DEGREE_TO_RAD(8750000), 0x0 }, 1420 + .fs_avl[1] = { IIO_DEGREE_TO_RAD(17500000), 0x1 }, 1421 + .fs_avl[2] = { IIO_DEGREE_TO_RAD(35000000), 0x2 }, 1422 + .fs_avl[3] = { IIO_DEGREE_TO_RAD(70000000), 0x3 }, 1423 + .fs_len = 4, 1424 + }, 1425 + }, 1426 + .irq_config = { 1427 + .irq1 = { 1428 + .addr = 0x0d, 1429 + .mask = BIT(3), 1430 + }, 1431 + .irq2 = { 1432 + .addr = 0x0e, 1433 + .mask = BIT(3), 1434 + }, 1435 + .lir = { 1436 + .addr = 0x56, 1437 + .mask = BIT(0), 1438 + }, 1439 + .clear_on_read = { 1440 + .addr = 0x56, 1441 + .mask = BIT(6), 1442 + }, 1443 + .irq1_func = { 1444 + .addr = 0x5e, 1445 + .mask = BIT(5), 1446 + }, 1447 + .irq2_func = { 1448 + .addr = 0x5f, 1449 + .mask = BIT(5), 1450 + }, 1451 + .hla = { 1452 + .addr = 0x12, 1453 + .mask = BIT(5), 1454 + }, 1455 + .od = { 1456 + .addr = 0x12, 1457 + .mask = BIT(4), 1458 + }, 1459 + }, 1460 + .batch = { 1461 + [ST_LSM6DSX_ID_ACC] = { 1462 + .addr = 0x09, 1463 + .mask = GENMASK(3, 0), 1464 + }, 1465 + [ST_LSM6DSX_ID_GYRO] = { 1466 + .addr = 0x09, 1467 + .mask = GENMASK(7, 4), 1468 + }, 1469 + }, 1470 + .fifo_ops = { 1471 + .update_fifo = st_lsm6dsx_update_fifo, 1472 + .read_fifo = st_lsm6dsx_read_tagged_fifo, 1473 + .fifo_th = { 1474 + .addr = 0x07, 1475 + .mask = GENMASK(8, 0), 1476 + }, 1477 + .fifo_diff = { 1478 + .addr = 0x3a, 1479 + .mask = GENMASK(9, 0), 1480 + }, 1481 + .th_wl = 1, 1482 + }, 1483 + .ts_settings = { 1484 + .timer_en = { 1485 + .addr = 0x19, 1486 + .mask = BIT(5), 1487 + }, 1488 + .decimator = { 1489 + .addr = 0x0a, 1490 + .mask = GENMASK(7, 6), 1491 + }, 1492 + .freq_fine = 0x63, 1493 + }, 1494 + .shub_settings = { 1495 + .page_mux = { 1496 + .addr = 0x01, 1497 + .mask = BIT(6), 1498 + }, 1499 + .master_en = { 1500 + .sec_page = true, 1501 + .addr = 0x14, 1502 + .mask = BIT(2), 1503 + }, 1504 + .pullup_en = { 1505 + .sec_page = true, 1506 + .addr = 0x14, 1507 + .mask = BIT(3), 1508 + }, 1509 + .aux_sens = { 1510 + .addr = 0x14, 1511 + .mask = GENMASK(1, 0), 1512 + }, 1513 + .wr_once = { 1514 + .addr = 0x14, 1515 + .mask = BIT(6), 1516 + }, 1517 + .num_ext_dev = 3, 1518 + .shub_out = { 1519 + .sec_page = true, 1520 + .addr = 0x02, 1521 + }, 1522 + .slv0_addr = 0x15, 1523 + .dw_slv0_addr = 0x21, 1524 + .batch_en = BIT(3), 1525 + }, 1526 + .event_settings = { 1527 + .enable_reg = { 1528 + .addr = 0x58, 1529 + .mask = BIT(7), 1530 + }, 1531 + .wakeup_reg = { 1532 + .addr = 0x5b, 1533 + .mask = GENMASK(5, 0), 1534 + }, 1535 + .wakeup_src_reg = 0x1b, 1536 + .wakeup_src_status_mask = BIT(3), 1537 + .wakeup_src_z_mask = BIT(0), 1538 + .wakeup_src_y_mask = BIT(1), 1539 + .wakeup_src_x_mask = BIT(2), 1540 + }, 1336 1541 }, 1337 1542 }; 1338 1543
+5
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_i2c.c
··· 94 94 .compatible = "st,lsm6dsrx", 95 95 .data = (void *)ST_LSM6DSRX_ID, 96 96 }, 97 + { 98 + .compatible = "st,lsm6dst", 99 + .data = (void *)ST_LSM6DST_ID, 100 + }, 97 101 {}, 98 102 }; 99 103 MODULE_DEVICE_TABLE(of, st_lsm6dsx_i2c_of_match); ··· 117 113 { ST_LSM9DS1_DEV_NAME, ST_LSM9DS1_ID }, 118 114 { ST_LSM6DS0_DEV_NAME, ST_LSM6DS0_ID }, 119 115 { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID }, 116 + { ST_LSM6DST_DEV_NAME, ST_LSM6DST_ID }, 120 117 {}, 121 118 }; 122 119 MODULE_DEVICE_TABLE(i2c, st_lsm6dsx_i2c_id_table);
+5
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_spi.c
··· 94 94 .compatible = "st,lsm6dsrx", 95 95 .data = (void *)ST_LSM6DSRX_ID, 96 96 }, 97 + { 98 + .compatible = "st,lsm6dst", 99 + .data = (void *)ST_LSM6DST_ID, 100 + }, 97 101 {}, 98 102 }; 99 103 MODULE_DEVICE_TABLE(of, st_lsm6dsx_spi_of_match); ··· 117 113 { ST_LSM9DS1_DEV_NAME, ST_LSM9DS1_ID }, 118 114 { ST_LSM6DS0_DEV_NAME, ST_LSM6DS0_ID }, 119 115 { ST_LSM6DSRX_DEV_NAME, ST_LSM6DSRX_ID }, 116 + { ST_LSM6DST_DEV_NAME, ST_LSM6DST_ID }, 120 117 {}, 121 118 }; 122 119 MODULE_DEVICE_TABLE(spi, st_lsm6dsx_spi_id_table);
-12
drivers/iio/industrialio-buffer.c
··· 210 210 } 211 211 EXPORT_SYMBOL(iio_buffer_init); 212 212 213 - /** 214 - * iio_buffer_set_attrs - Set buffer specific attributes 215 - * @buffer: The buffer for which we are setting attributes 216 - * @attrs: Pointer to a null terminated list of pointers to attributes 217 - */ 218 - void iio_buffer_set_attrs(struct iio_buffer *buffer, 219 - const struct attribute **attrs) 220 - { 221 - buffer->attrs = attrs; 222 - } 223 - EXPORT_SYMBOL_GPL(iio_buffer_set_attrs); 224 - 225 213 static ssize_t iio_show_scan_index(struct device *dev, 226 214 struct device_attribute *attr, 227 215 char *buf)
+96 -20
drivers/iio/industrialio-core.c
··· 594 594 { 595 595 unsigned long long tmp; 596 596 int tmp0, tmp1; 597 + s64 tmp2; 597 598 bool scale_db = false; 598 599 599 600 switch (type) { ··· 617 616 else 618 617 return scnprintf(buf, len, "%d.%09u", vals[0], vals[1]); 619 618 case IIO_VAL_FRACTIONAL: 620 - tmp = div_s64((s64)vals[0] * 1000000000LL, vals[1]); 619 + tmp2 = div_s64((s64)vals[0] * 1000000000LL, vals[1]); 621 620 tmp1 = vals[1]; 622 - tmp0 = (int)div_s64_rem(tmp, 1000000000, &tmp1); 623 - return scnprintf(buf, len, "%d.%09u", tmp0, abs(tmp1)); 621 + tmp0 = (int)div_s64_rem(tmp2, 1000000000, &tmp1); 622 + if ((tmp2 < 0) && (tmp0 == 0)) 623 + return snprintf(buf, len, "-0.%09u", abs(tmp1)); 624 + else 625 + return snprintf(buf, len, "%d.%09u", tmp0, abs(tmp1)); 624 626 case IIO_VAL_FRACTIONAL_LOG2: 625 627 tmp = shift_right((s64)vals[0] * 1000000000LL, vals[1]); 626 628 tmp0 = (int)div_s64_rem(tmp, 1000000000LL, &tmp1); ··· 672 668 return len + sprintf(buf + len, "\n"); 673 669 } 674 670 EXPORT_SYMBOL_GPL(iio_format_value); 671 + 672 + static ssize_t iio_read_channel_label(struct device *dev, 673 + struct device_attribute *attr, 674 + char *buf) 675 + { 676 + struct iio_dev *indio_dev = dev_to_iio_dev(dev); 677 + struct iio_dev_attr *this_attr = to_iio_dev_attr(attr); 678 + 679 + if (!indio_dev->info->read_label) 680 + return -EINVAL; 681 + 682 + return indio_dev->info->read_label(indio_dev, this_attr->c, buf); 683 + } 675 684 676 685 static ssize_t iio_read_channel_info(struct device *dev, 677 686 struct device_attribute *attr, ··· 1154 1137 return ret; 1155 1138 } 1156 1139 1140 + static int iio_device_add_channel_label(struct iio_dev *indio_dev, 1141 + struct iio_chan_spec const *chan) 1142 + { 1143 + struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); 1144 + int ret; 1145 + 1146 + if (!indio_dev->info->read_label) 1147 + return 0; 1148 + 1149 + ret = __iio_add_chan_devattr("label", 1150 + chan, 1151 + &iio_read_channel_label, 1152 + NULL, 1153 + 0, 1154 + IIO_SEPARATE, 1155 + &indio_dev->dev, 1156 + &iio_dev_opaque->channel_attr_list); 1157 + if (ret < 0) 1158 + return ret; 1159 + 1160 + return 1; 1161 + } 1162 + 1157 1163 static int iio_device_add_info_mask_type(struct iio_dev *indio_dev, 1158 1164 struct iio_chan_spec const *chan, 1159 1165 enum iio_shared_by shared_by, ··· 1306 1266 ret = iio_device_add_info_mask_type_avail(indio_dev, chan, 1307 1267 IIO_SHARED_BY_ALL, 1308 1268 &chan->info_mask_shared_by_all_available); 1269 + if (ret < 0) 1270 + return ret; 1271 + attrcount += ret; 1272 + 1273 + ret = iio_device_add_channel_label(indio_dev, chan); 1309 1274 if (ret < 0) 1310 1275 return ret; 1311 1276 attrcount += ret; ··· 1612 1567 } 1613 1568 dev_set_name(&dev->dev, "iio:device%d", dev->id); 1614 1569 INIT_LIST_HEAD(&iio_dev_opaque->buffer_list); 1570 + INIT_LIST_HEAD(&iio_dev_opaque->ioctl_handlers); 1615 1571 1616 1572 return dev; 1617 1573 } ··· 1706 1660 return 0; 1707 1661 } 1708 1662 1709 - /* Somewhat of a cross file organization violation - ioctls here are actually 1710 - * event related */ 1663 + void iio_device_ioctl_handler_register(struct iio_dev *indio_dev, 1664 + struct iio_ioctl_handler *h) 1665 + { 1666 + struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); 1667 + 1668 + list_add_tail(&h->entry, &iio_dev_opaque->ioctl_handlers); 1669 + } 1670 + 1671 + void iio_device_ioctl_handler_unregister(struct iio_ioctl_handler *h) 1672 + { 1673 + list_del(&h->entry); 1674 + } 1675 + 1711 1676 static long iio_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 1712 1677 { 1713 1678 struct iio_dev *indio_dev = filp->private_data; 1714 - int __user *ip = (int __user *)arg; 1715 - int fd; 1679 + struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); 1680 + struct iio_ioctl_handler *h; 1681 + int ret = -ENODEV; 1716 1682 1683 + mutex_lock(&indio_dev->info_exist_lock); 1684 + 1685 + /** 1686 + * The NULL check here is required to prevent crashing when a device 1687 + * is being removed while userspace would still have open file handles 1688 + * to try to access this device. 1689 + */ 1717 1690 if (!indio_dev->info) 1718 - return -ENODEV; 1691 + goto out_unlock; 1719 1692 1720 - if (cmd == IIO_GET_EVENT_FD_IOCTL) { 1721 - fd = iio_event_getfd(indio_dev); 1722 - if (fd < 0) 1723 - return fd; 1724 - if (copy_to_user(ip, &fd, sizeof(fd))) 1725 - return -EFAULT; 1726 - return 0; 1693 + ret = -EINVAL; 1694 + list_for_each_entry(h, &iio_dev_opaque->ioctl_handlers, entry) { 1695 + ret = h->ioctl(indio_dev, filp, cmd, arg); 1696 + if (ret != IIO_IOCTL_UNHANDLED) 1697 + break; 1727 1698 } 1728 - return -EINVAL; 1699 + 1700 + if (ret == IIO_IOCTL_UNHANDLED) 1701 + ret = -EINVAL; 1702 + 1703 + out_unlock: 1704 + mutex_unlock(&indio_dev->info_exist_lock); 1705 + 1706 + return ret; 1729 1707 } 1730 1708 1731 1709 static const struct file_operations iio_buffer_fileops = { 1732 - .read = iio_buffer_read_outer_addr, 1733 - .release = iio_chrdev_release, 1734 - .open = iio_chrdev_open, 1735 - .poll = iio_buffer_poll_addr, 1736 1710 .owner = THIS_MODULE, 1737 1711 .llseek = noop_llseek, 1712 + .read = iio_buffer_read_outer_addr, 1713 + .poll = iio_buffer_poll_addr, 1738 1714 .unlocked_ioctl = iio_ioctl, 1739 1715 .compat_ioctl = compat_ptr_ioctl, 1716 + .open = iio_chrdev_open, 1717 + .release = iio_chrdev_release, 1740 1718 }; 1741 1719 1742 1720 static int iio_check_unique_scan_index(struct iio_dev *indio_dev) ··· 1866 1796 **/ 1867 1797 void iio_device_unregister(struct iio_dev *indio_dev) 1868 1798 { 1799 + struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); 1800 + struct iio_ioctl_handler *h, *t; 1801 + 1869 1802 cdev_device_del(&indio_dev->chrdev, &indio_dev->dev); 1870 1803 1871 1804 mutex_lock(&indio_dev->info_exist_lock); ··· 1878 1805 iio_disable_all_buffers(indio_dev); 1879 1806 1880 1807 indio_dev->info = NULL; 1808 + 1809 + list_for_each_entry_safe(h, t, &iio_dev_opaque->ioctl_handlers, entry) 1810 + list_del(&h->entry); 1881 1811 1882 1812 iio_device_wakeup_eventset(indio_dev); 1883 1813 iio_buffer_wakeup_poll(indio_dev);
+27 -1
drivers/iio/industrialio-event.c
··· 31 31 * @flags: file operations related flags including busy flag. 32 32 * @group: event interface sysfs attribute group 33 33 * @read_lock: lock to protect kfifo read operations 34 + * @ioctl_handler: handler for event ioctl() calls 34 35 */ 35 36 struct iio_event_interface { 36 37 wait_queue_head_t wait; ··· 41 40 unsigned long flags; 42 41 struct attribute_group group; 43 42 struct mutex read_lock; 43 + struct iio_ioctl_handler ioctl_handler; 44 44 }; 45 45 46 46 bool iio_event_enabled(const struct iio_event_interface *ev_int) ··· 189 187 .llseek = noop_llseek, 190 188 }; 191 189 192 - int iio_event_getfd(struct iio_dev *indio_dev) 190 + static int iio_event_getfd(struct iio_dev *indio_dev) 193 191 { 194 192 struct iio_dev_opaque *iio_dev_opaque = to_iio_dev_opaque(indio_dev); 195 193 struct iio_event_interface *ev_int = iio_dev_opaque->event_interface; ··· 475 473 mutex_init(&ev_int->read_lock); 476 474 } 477 475 476 + static long iio_event_ioctl(struct iio_dev *indio_dev, struct file *filp, 477 + unsigned int cmd, unsigned long arg) 478 + { 479 + int __user *ip = (int __user *)arg; 480 + int fd; 481 + 482 + if (cmd == IIO_GET_EVENT_FD_IOCTL) { 483 + fd = iio_event_getfd(indio_dev); 484 + if (fd < 0) 485 + return fd; 486 + if (copy_to_user(ip, &fd, sizeof(fd))) 487 + return -EFAULT; 488 + return 0; 489 + } 490 + 491 + return IIO_IOCTL_UNHANDLED; 492 + } 493 + 478 494 static const char *iio_event_group_name = "events"; 479 495 int iio_device_register_eventset(struct iio_dev *indio_dev) 480 496 { ··· 546 526 ev_int->group.attrs[attrn++] = &p->dev_attr.attr; 547 527 indio_dev->groups[indio_dev->groupcounter++] = &ev_int->group; 548 528 529 + ev_int->ioctl_handler.ioctl = iio_event_ioctl; 530 + iio_device_ioctl_handler_register(&iio_dev_opaque->indio_dev, 531 + &ev_int->ioctl_handler); 532 + 549 533 return 0; 550 534 551 535 error_free_setup_event_lines: ··· 582 558 583 559 if (ev_int == NULL) 584 560 return; 561 + 562 + iio_device_ioctl_handler_unregister(&ev_int->ioctl_handler); 585 563 iio_free_chan_devattr_list(&ev_int->dev_attr_list); 586 564 kfree(ev_int->group.attrs); 587 565 kfree(ev_int);
+1 -1
drivers/iio/light/apds9960.c
··· 561 561 } 562 562 default: 563 563 return -EINVAL; 564 - }; 564 + } 565 565 566 566 return 0; 567 567 }
+9 -7
drivers/iio/light/tsl2563.c
··· 12 12 */ 13 13 14 14 #include <linux/module.h> 15 + #include <linux/mod_devicetable.h> 16 + #include <linux/property.h> 15 17 #include <linux/i2c.h> 16 18 #include <linux/interrupt.h> 17 19 #include <linux/irq.h> ··· 705 703 struct iio_dev *indio_dev; 706 704 struct tsl2563_chip *chip; 707 705 struct tsl2563_platform_data *pdata = client->dev.platform_data; 708 - struct device_node *np = client->dev.of_node; 709 706 int err = 0; 710 707 u8 id = 0; 711 708 ··· 739 738 chip->calib0 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS); 740 739 chip->calib1 = tsl2563_calib_from_sysfs(CALIB_BASE_SYSFS); 741 740 742 - if (pdata) 741 + if (pdata) { 743 742 chip->cover_comp_gain = pdata->cover_comp_gain; 744 - else if (np) 745 - of_property_read_u32(np, "amstaos,cover-comp-gain", 746 - &chip->cover_comp_gain); 747 - else 748 - chip->cover_comp_gain = 1; 743 + } else { 744 + err = device_property_read_u32(&client->dev, "amstaos,cover-comp-gain", 745 + &chip->cover_comp_gain); 746 + if (err) 747 + chip->cover_comp_gain = 1; 748 + } 749 749 750 750 dev_info(&client->dev, "model %d, rev. %d\n", id >> 4, id & 0x0f); 751 751 indio_dev->name = client->name;
+7
drivers/iio/light/vcnl4035.c
··· 652 652 vcnl4035_runtime_resume, NULL) 653 653 }; 654 654 655 + static const struct i2c_device_id vcnl4035_id[] = { 656 + { "vcnl4035", 0}, 657 + { } 658 + }; 659 + MODULE_DEVICE_TABLE(i2c, vcnl4035_id); 660 + 655 661 static const struct of_device_id vcnl4035_of_match[] = { 656 662 { .compatible = "vishay,vcnl4035", }, 657 663 { } ··· 672 666 }, 673 667 .probe = vcnl4035_probe, 674 668 .remove = vcnl4035_remove, 669 + .id_table = vcnl4035_id, 675 670 }; 676 671 677 672 module_i2c_driver(vcnl4035_driver);
+1 -1
drivers/iio/magnetometer/bmc150_magn.c
··· 190 190 return true; 191 191 default: 192 192 return false; 193 - }; 193 + } 194 194 } 195 195 196 196 static bool bmc150_magn_is_volatile_reg(struct device *dev, unsigned int reg)
+2 -2
drivers/iio/pressure/bmp280-regmap.c
··· 13 13 return true; 14 14 default: 15 15 return false; 16 - }; 16 + } 17 17 } 18 18 19 19 static bool bmp180_is_volatile_reg(struct device *dev, unsigned int reg) ··· 51 51 return true; 52 52 default: 53 53 return false; 54 - }; 54 + } 55 55 } 56 56 57 57 static bool bmp280_is_volatile_reg(struct device *dev, unsigned int reg)
+502 -6
drivers/iio/proximity/sx9310.c
··· 16 16 #include <linux/i2c.h> 17 17 #include <linux/irq.h> 18 18 #include <linux/kernel.h> 19 + #include <linux/log2.h> 19 20 #include <linux/mod_devicetable.h> 20 21 #include <linux/module.h> 21 22 #include <linux/pm.h> ··· 49 48 #define SX9310_REG_PROX_CTRL0_SCANPERIOD_15MS 0x01 50 49 #define SX9310_REG_PROX_CTRL1 0x11 51 50 #define SX9310_REG_PROX_CTRL2 0x12 51 + #define SX9310_REG_PROX_CTRL2_COMBMODE_MASK GENMASK(7, 6) 52 + #define SX9310_REG_PROX_CTRL2_COMBMODE_CS0_CS1_CS2_CS3 (0x03 << 6) 52 53 #define SX9310_REG_PROX_CTRL2_COMBMODE_CS1_CS2 (0x02 << 6) 54 + #define SX9310_REG_PROX_CTRL2_COMBMODE_CS0_CS1 (0x01 << 6) 55 + #define SX9310_REG_PROX_CTRL2_COMBMODE_CS3 (0x00 << 6) 56 + #define SX9310_REG_PROX_CTRL2_SHIELDEN_MASK GENMASK(3, 2) 53 57 #define SX9310_REG_PROX_CTRL2_SHIELDEN_DYNAMIC (0x01 << 2) 58 + #define SX9310_REG_PROX_CTRL2_SHIELDEN_GROUND (0x02 << 2) 54 59 #define SX9310_REG_PROX_CTRL3 0x13 60 + #define SX9310_REG_PROX_CTRL3_GAIN0_MASK GENMASK(3, 2) 55 61 #define SX9310_REG_PROX_CTRL3_GAIN0_X8 (0x03 << 2) 62 + #define SX9310_REG_PROX_CTRL3_GAIN12_MASK GENMASK(1, 0) 56 63 #define SX9310_REG_PROX_CTRL3_GAIN12_X4 0x02 57 64 #define SX9310_REG_PROX_CTRL4 0x14 65 + #define SX9310_REG_PROX_CTRL4_RESOLUTION_MASK GENMASK(2, 0) 58 66 #define SX9310_REG_PROX_CTRL4_RESOLUTION_FINEST 0x07 67 + #define SX9310_REG_PROX_CTRL4_RESOLUTION_VERY_FINE 0x06 68 + #define SX9310_REG_PROX_CTRL4_RESOLUTION_FINE 0x05 69 + #define SX9310_REG_PROX_CTRL4_RESOLUTION_MEDIUM 0x04 70 + #define SX9310_REG_PROX_CTRL4_RESOLUTION_MEDIUM_COARSE 0x03 71 + #define SX9310_REG_PROX_CTRL4_RESOLUTION_COARSE 0x02 72 + #define SX9310_REG_PROX_CTRL4_RESOLUTION_VERY_COARSE 0x01 73 + #define SX9310_REG_PROX_CTRL4_RESOLUTION_COARSEST 0x00 59 74 #define SX9310_REG_PROX_CTRL5 0x15 60 75 #define SX9310_REG_PROX_CTRL5_RANGE_SMALL (0x03 << 6) 76 + #define SX9310_REG_PROX_CTRL5_STARTUPSENS_MASK GENMASK(3, 2) 61 77 #define SX9310_REG_PROX_CTRL5_STARTUPSENS_CS1 (0x01 << 2) 78 + #define SX9310_REG_PROX_CTRL5_RAWFILT_MASK GENMASK(1, 0) 79 + #define SX9310_REG_PROX_CTRL5_RAWFILT_SHIFT 0 62 80 #define SX9310_REG_PROX_CTRL5_RAWFILT_1P25 0x02 63 81 #define SX9310_REG_PROX_CTRL6 0x16 64 82 #define SX9310_REG_PROX_CTRL6_AVGTHRESH_DEFAULT 0x20 65 83 #define SX9310_REG_PROX_CTRL7 0x17 66 84 #define SX9310_REG_PROX_CTRL7_AVGNEGFILT_2 (0x01 << 3) 85 + #define SX9310_REG_PROX_CTRL7_AVGPOSFILT_MASK GENMASK(2, 0) 86 + #define SX9310_REG_PROX_CTRL7_AVGPOSFILT_SHIFT 0 67 87 #define SX9310_REG_PROX_CTRL7_AVGPOSFILT_512 0x05 68 88 #define SX9310_REG_PROX_CTRL8 0x18 89 + #define SX9310_REG_PROX_CTRL8_9_PTHRESH_MASK GENMASK(7, 3) 69 90 #define SX9310_REG_PROX_CTRL9 0x19 70 91 #define SX9310_REG_PROX_CTRL8_9_PTHRESH_28 (0x08 << 3) 71 92 #define SX9310_REG_PROX_CTRL8_9_PTHRESH_96 (0x11 << 3) 72 93 #define SX9310_REG_PROX_CTRL8_9_BODYTHRESH_900 0x03 73 94 #define SX9310_REG_PROX_CTRL8_9_BODYTHRESH_1500 0x05 74 95 #define SX9310_REG_PROX_CTRL10 0x1a 96 + #define SX9310_REG_PROX_CTRL10_HYST_MASK GENMASK(5, 4) 75 97 #define SX9310_REG_PROX_CTRL10_HYST_6PCT (0x01 << 4) 98 + #define SX9310_REG_PROX_CTRL10_CLOSE_DEBOUNCE_MASK GENMASK(3, 2) 99 + #define SX9310_REG_PROX_CTRL10_FAR_DEBOUNCE_MASK GENMASK(1, 0) 76 100 #define SX9310_REG_PROX_CTRL10_FAR_DEBOUNCE_2 0x01 77 101 #define SX9310_REG_PROX_CTRL11 0x1b 78 102 #define SX9310_REG_PROX_CTRL12 0x1c ··· 170 144 static const struct iio_event_spec sx9310_events[] = { 171 145 { 172 146 .type = IIO_EV_TYPE_THRESH, 147 + .dir = IIO_EV_DIR_RISING, 148 + .mask_shared_by_all = BIT(IIO_EV_INFO_PERIOD), 149 + }, 150 + { 151 + .type = IIO_EV_TYPE_THRESH, 152 + .dir = IIO_EV_DIR_FALLING, 153 + .mask_shared_by_all = BIT(IIO_EV_INFO_PERIOD), 154 + }, 155 + { 156 + .type = IIO_EV_TYPE_THRESH, 173 157 .dir = IIO_EV_DIR_EITHER, 174 - .mask_separate = BIT(IIO_EV_INFO_ENABLE), 158 + .mask_separate = BIT(IIO_EV_INFO_ENABLE) | 159 + BIT(IIO_EV_INFO_HYSTERESIS) | 160 + BIT(IIO_EV_INFO_VALUE), 175 161 }, 176 162 }; 177 163 178 164 #define SX9310_NAMED_CHANNEL(idx, name) \ 179 165 { \ 180 166 .type = IIO_PROXIMITY, \ 181 - .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ 167 + .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \ 168 + BIT(IIO_CHAN_INFO_HARDWAREGAIN), \ 182 169 .info_mask_shared_by_all = BIT(IIO_CHAN_INFO_SAMP_FREQ), \ 170 + .info_mask_separate_available = \ 171 + BIT(IIO_CHAN_INFO_HARDWAREGAIN), \ 183 172 .indexed = 1, \ 184 173 .channel = idx, \ 185 174 .extend_name = name, \ ··· 467 426 return ret; 468 427 } 469 428 429 + static int sx9310_read_gain(struct sx9310_data *data, 430 + const struct iio_chan_spec *chan, int *val) 431 + { 432 + unsigned int regval, gain; 433 + int ret; 434 + 435 + ret = regmap_read(data->regmap, SX9310_REG_PROX_CTRL3, &regval); 436 + if (ret) 437 + return ret; 438 + 439 + switch (chan->channel) { 440 + case 0: 441 + case 3: 442 + gain = FIELD_GET(SX9310_REG_PROX_CTRL3_GAIN0_MASK, regval); 443 + break; 444 + case 1: 445 + case 2: 446 + gain = FIELD_GET(SX9310_REG_PROX_CTRL3_GAIN12_MASK, regval); 447 + break; 448 + default: 449 + return -EINVAL; 450 + } 451 + 452 + *val = 1 << gain; 453 + 454 + return IIO_VAL_INT; 455 + } 456 + 470 457 static int sx9310_read_samp_freq(struct sx9310_data *data, int *val, int *val2) 471 458 { 472 459 unsigned int regval; ··· 530 461 ret = sx9310_read_proximity(data, chan, val); 531 462 iio_device_release_direct_mode(indio_dev); 532 463 return ret; 464 + case IIO_CHAN_INFO_HARDWAREGAIN: 465 + ret = iio_device_claim_direct_mode(indio_dev); 466 + if (ret) 467 + return ret; 468 + 469 + ret = sx9310_read_gain(data, chan, val); 470 + iio_device_release_direct_mode(indio_dev); 471 + return ret; 533 472 case IIO_CHAN_INFO_SAMP_FREQ: 534 473 return sx9310_read_samp_freq(data, val, val2); 474 + default: 475 + return -EINVAL; 476 + } 477 + } 478 + 479 + static const int sx9310_gain_vals[] = { 1, 2, 4, 8 }; 480 + 481 + static int sx9310_read_avail(struct iio_dev *indio_dev, 482 + struct iio_chan_spec const *chan, 483 + const int **vals, int *type, int *length, 484 + long mask) 485 + { 486 + if (chan->type != IIO_PROXIMITY) 487 + return -EINVAL; 488 + 489 + switch (mask) { 490 + case IIO_CHAN_INFO_HARDWAREGAIN: 491 + *type = IIO_VAL_INT; 492 + *length = ARRAY_SIZE(sx9310_gain_vals); 493 + *vals = sx9310_gain_vals; 494 + return IIO_AVAIL_LIST; 495 + } 496 + 497 + return -EINVAL; 498 + } 499 + 500 + static const unsigned int sx9310_pthresh_codes[] = { 501 + 2, 4, 6, 8, 12, 16, 20, 24, 28, 32, 40, 48, 56, 64, 72, 80, 88, 96, 112, 502 + 128, 144, 160, 192, 224, 256, 320, 384, 512, 640, 768, 1024, 1536 503 + }; 504 + 505 + static int sx9310_get_thresh_reg(unsigned int channel) 506 + { 507 + switch (channel) { 508 + case 0: 509 + case 3: 510 + return SX9310_REG_PROX_CTRL8; 511 + case 1: 512 + case 2: 513 + return SX9310_REG_PROX_CTRL9; 514 + } 515 + 516 + return -EINVAL; 517 + } 518 + 519 + static int sx9310_read_thresh(struct sx9310_data *data, 520 + const struct iio_chan_spec *chan, int *val) 521 + { 522 + unsigned int reg; 523 + unsigned int regval; 524 + int ret; 525 + 526 + reg = ret = sx9310_get_thresh_reg(chan->channel); 527 + if (ret < 0) 528 + return ret; 529 + 530 + ret = regmap_read(data->regmap, reg, &regval); 531 + if (ret) 532 + return ret; 533 + 534 + regval = FIELD_GET(SX9310_REG_PROX_CTRL8_9_PTHRESH_MASK, regval); 535 + if (regval > ARRAY_SIZE(sx9310_pthresh_codes)) 536 + return -EINVAL; 537 + 538 + *val = sx9310_pthresh_codes[regval]; 539 + return IIO_VAL_INT; 540 + } 541 + 542 + static int sx9310_read_hysteresis(struct sx9310_data *data, 543 + const struct iio_chan_spec *chan, int *val) 544 + { 545 + unsigned int regval, pthresh; 546 + int ret; 547 + 548 + ret = sx9310_read_thresh(data, chan, &pthresh); 549 + if (ret < 0) 550 + return ret; 551 + 552 + ret = regmap_read(data->regmap, SX9310_REG_PROX_CTRL10, &regval); 553 + if (ret) 554 + return ret; 555 + 556 + regval = FIELD_GET(SX9310_REG_PROX_CTRL10_HYST_MASK, regval); 557 + if (!regval) 558 + regval = 5; 559 + 560 + /* regval is at most 5 */ 561 + *val = pthresh >> (5 - regval); 562 + 563 + return IIO_VAL_INT; 564 + } 565 + 566 + static int sx9310_read_far_debounce(struct sx9310_data *data, int *val) 567 + { 568 + unsigned int regval; 569 + int ret; 570 + 571 + ret = regmap_read(data->regmap, SX9310_REG_PROX_CTRL10, &regval); 572 + if (ret) 573 + return ret; 574 + 575 + regval = FIELD_GET(SX9310_REG_PROX_CTRL10_FAR_DEBOUNCE_MASK, regval); 576 + if (regval) 577 + *val = 1 << regval; 578 + else 579 + *val = 0; 580 + 581 + return IIO_VAL_INT; 582 + } 583 + 584 + static int sx9310_read_close_debounce(struct sx9310_data *data, int *val) 585 + { 586 + unsigned int regval; 587 + int ret; 588 + 589 + ret = regmap_read(data->regmap, SX9310_REG_PROX_CTRL10, &regval); 590 + if (ret) 591 + return ret; 592 + 593 + regval = FIELD_GET(SX9310_REG_PROX_CTRL10_CLOSE_DEBOUNCE_MASK, regval); 594 + if (regval) 595 + *val = 1 << regval; 596 + else 597 + *val = 0; 598 + 599 + return IIO_VAL_INT; 600 + } 601 + 602 + static int sx9310_read_event_val(struct iio_dev *indio_dev, 603 + const struct iio_chan_spec *chan, 604 + enum iio_event_type type, 605 + enum iio_event_direction dir, 606 + enum iio_event_info info, int *val, int *val2) 607 + { 608 + struct sx9310_data *data = iio_priv(indio_dev); 609 + 610 + if (chan->type != IIO_PROXIMITY) 611 + return -EINVAL; 612 + 613 + switch (info) { 614 + case IIO_EV_INFO_VALUE: 615 + return sx9310_read_thresh(data, chan, val); 616 + case IIO_EV_INFO_PERIOD: 617 + switch (dir) { 618 + case IIO_EV_DIR_RISING: 619 + return sx9310_read_far_debounce(data, val); 620 + case IIO_EV_DIR_FALLING: 621 + return sx9310_read_close_debounce(data, val); 622 + default: 623 + return -EINVAL; 624 + } 625 + case IIO_EV_INFO_HYSTERESIS: 626 + return sx9310_read_hysteresis(data, chan, val); 627 + default: 628 + return -EINVAL; 629 + } 630 + } 631 + 632 + static int sx9310_write_thresh(struct sx9310_data *data, 633 + const struct iio_chan_spec *chan, int val) 634 + { 635 + unsigned int reg; 636 + unsigned int regval; 637 + int ret, i; 638 + 639 + reg = ret = sx9310_get_thresh_reg(chan->channel); 640 + if (ret < 0) 641 + return ret; 642 + 643 + for (i = 0; i < ARRAY_SIZE(sx9310_pthresh_codes); i++) { 644 + if (sx9310_pthresh_codes[i] == val) { 645 + regval = i; 646 + break; 647 + } 648 + } 649 + 650 + if (i == ARRAY_SIZE(sx9310_pthresh_codes)) 651 + return -EINVAL; 652 + 653 + regval = FIELD_PREP(SX9310_REG_PROX_CTRL8_9_PTHRESH_MASK, regval); 654 + mutex_lock(&data->mutex); 655 + ret = regmap_update_bits(data->regmap, reg, 656 + SX9310_REG_PROX_CTRL8_9_PTHRESH_MASK, regval); 657 + mutex_unlock(&data->mutex); 658 + 659 + return ret; 660 + } 661 + 662 + static int sx9310_write_hysteresis(struct sx9310_data *data, 663 + const struct iio_chan_spec *chan, int _val) 664 + { 665 + unsigned int hyst, val = _val; 666 + int ret, pthresh; 667 + 668 + ret = sx9310_read_thresh(data, chan, &pthresh); 669 + if (ret < 0) 670 + return ret; 671 + 672 + if (val == 0) 673 + hyst = 0; 674 + else if (val == pthresh >> 2) 675 + hyst = 3; 676 + else if (val == pthresh >> 3) 677 + hyst = 2; 678 + else if (val == pthresh >> 4) 679 + hyst = 1; 680 + else 681 + return -EINVAL; 682 + 683 + hyst = FIELD_PREP(SX9310_REG_PROX_CTRL10_HYST_MASK, hyst); 684 + mutex_lock(&data->mutex); 685 + ret = regmap_update_bits(data->regmap, SX9310_REG_PROX_CTRL10, 686 + SX9310_REG_PROX_CTRL10_HYST_MASK, hyst); 687 + mutex_unlock(&data->mutex); 688 + 689 + return ret; 690 + } 691 + 692 + static int sx9310_write_far_debounce(struct sx9310_data *data, int val) 693 + { 694 + int ret; 695 + unsigned int regval; 696 + 697 + val = ilog2(val); 698 + regval = FIELD_PREP(SX9310_REG_PROX_CTRL10_FAR_DEBOUNCE_MASK, val); 699 + 700 + mutex_lock(&data->mutex); 701 + ret = regmap_update_bits(data->regmap, SX9310_REG_PROX_CTRL10, 702 + SX9310_REG_PROX_CTRL10_FAR_DEBOUNCE_MASK, 703 + regval); 704 + mutex_unlock(&data->mutex); 705 + 706 + return ret; 707 + } 708 + 709 + static int sx9310_write_close_debounce(struct sx9310_data *data, int val) 710 + { 711 + int ret; 712 + unsigned int regval; 713 + 714 + val = ilog2(val); 715 + regval = FIELD_PREP(SX9310_REG_PROX_CTRL10_CLOSE_DEBOUNCE_MASK, val); 716 + 717 + mutex_lock(&data->mutex); 718 + ret = regmap_update_bits(data->regmap, SX9310_REG_PROX_CTRL10, 719 + SX9310_REG_PROX_CTRL10_CLOSE_DEBOUNCE_MASK, 720 + regval); 721 + mutex_unlock(&data->mutex); 722 + 723 + return ret; 724 + } 725 + 726 + static int sx9310_write_event_val(struct iio_dev *indio_dev, 727 + const struct iio_chan_spec *chan, 728 + enum iio_event_type type, 729 + enum iio_event_direction dir, 730 + enum iio_event_info info, int val, int val2) 731 + { 732 + struct sx9310_data *data = iio_priv(indio_dev); 733 + 734 + if (chan->type != IIO_PROXIMITY) 735 + return -EINVAL; 736 + 737 + switch (info) { 738 + case IIO_EV_INFO_VALUE: 739 + return sx9310_write_thresh(data, chan, val); 740 + case IIO_EV_INFO_PERIOD: 741 + switch (dir) { 742 + case IIO_EV_DIR_RISING: 743 + return sx9310_write_far_debounce(data, val); 744 + case IIO_EV_DIR_FALLING: 745 + return sx9310_write_close_debounce(data, val); 746 + default: 747 + return -EINVAL; 748 + } 749 + case IIO_EV_INFO_HYSTERESIS: 750 + return sx9310_write_hysteresis(data, chan, val); 535 751 default: 536 752 return -EINVAL; 537 753 } ··· 846 492 return ret; 847 493 } 848 494 495 + static int sx9310_write_gain(struct sx9310_data *data, 496 + const struct iio_chan_spec *chan, int val) 497 + { 498 + unsigned int gain, mask; 499 + int ret; 500 + 501 + gain = ilog2(val); 502 + 503 + switch (chan->channel) { 504 + case 0: 505 + case 3: 506 + mask = SX9310_REG_PROX_CTRL3_GAIN0_MASK; 507 + gain = FIELD_PREP(SX9310_REG_PROX_CTRL3_GAIN0_MASK, gain); 508 + break; 509 + case 1: 510 + case 2: 511 + mask = SX9310_REG_PROX_CTRL3_GAIN12_MASK; 512 + gain = FIELD_PREP(SX9310_REG_PROX_CTRL3_GAIN12_MASK, gain); 513 + break; 514 + default: 515 + return -EINVAL; 516 + } 517 + 518 + mutex_lock(&data->mutex); 519 + ret = regmap_update_bits(data->regmap, SX9310_REG_PROX_CTRL3, mask, 520 + gain); 521 + mutex_unlock(&data->mutex); 522 + 523 + return ret; 524 + } 525 + 849 526 static int sx9310_write_raw(struct iio_dev *indio_dev, 850 527 const struct iio_chan_spec *chan, int val, int val2, 851 528 long mask) ··· 886 501 if (chan->type != IIO_PROXIMITY) 887 502 return -EINVAL; 888 503 889 - if (mask != IIO_CHAN_INFO_SAMP_FREQ) 890 - return -EINVAL; 504 + switch (mask) { 505 + case IIO_CHAN_INFO_SAMP_FREQ: 506 + return sx9310_set_samp_freq(data, val, val2); 507 + case IIO_CHAN_INFO_HARDWAREGAIN: 508 + return sx9310_write_gain(data, chan, val); 509 + } 891 510 892 - return sx9310_set_samp_freq(data, val, val2); 511 + return -EINVAL; 893 512 } 894 513 895 514 static irqreturn_t sx9310_irq_handler(int irq, void *private) ··· 1034 645 static const struct iio_info sx9310_info = { 1035 646 .attrs = &sx9310_attribute_group, 1036 647 .read_raw = sx9310_read_raw, 648 + .read_avail = sx9310_read_avail, 649 + .read_event_value = sx9310_read_event_val, 650 + .write_event_value = sx9310_write_event_val, 1037 651 .write_raw = sx9310_write_raw, 1038 652 .read_event_config = sx9310_read_event_config, 1039 653 .write_event_config = sx9310_write_event_config, ··· 1212 820 return ret; 1213 821 } 1214 822 823 + static const struct sx9310_reg_default * 824 + sx9310_get_default_reg(struct sx9310_data *data, int i, 825 + struct sx9310_reg_default *reg_def) 826 + { 827 + int ret; 828 + const struct device_node *np = data->client->dev.of_node; 829 + u32 combined[SX9310_NUM_CHANNELS] = { 4, 4, 4, 4 }; 830 + unsigned long comb_mask = 0; 831 + const char *res; 832 + u32 start = 0, raw = 0, pos = 0; 833 + 834 + memcpy(reg_def, &sx9310_default_regs[i], sizeof(*reg_def)); 835 + if (!np) 836 + return reg_def; 837 + 838 + switch (reg_def->reg) { 839 + case SX9310_REG_PROX_CTRL2: 840 + if (of_property_read_bool(np, "semtech,cs0-ground")) { 841 + reg_def->def &= ~SX9310_REG_PROX_CTRL2_SHIELDEN_MASK; 842 + reg_def->def |= SX9310_REG_PROX_CTRL2_SHIELDEN_GROUND; 843 + } 844 + 845 + reg_def->def &= ~SX9310_REG_PROX_CTRL2_COMBMODE_MASK; 846 + of_property_read_u32_array(np, "semtech,combined-sensors", 847 + combined, ARRAY_SIZE(combined)); 848 + for (i = 0; i < ARRAY_SIZE(combined); i++) { 849 + if (combined[i] <= SX9310_NUM_CHANNELS) 850 + comb_mask |= BIT(combined[i]); 851 + } 852 + 853 + comb_mask &= 0xf; 854 + if (comb_mask == (BIT(3) | BIT(2) | BIT(1) | BIT(0))) 855 + reg_def->def |= SX9310_REG_PROX_CTRL2_COMBMODE_CS0_CS1_CS2_CS3; 856 + else if (comb_mask == (BIT(1) | BIT(2))) 857 + reg_def->def |= SX9310_REG_PROX_CTRL2_COMBMODE_CS1_CS2; 858 + else if (comb_mask == (BIT(0) | BIT(1))) 859 + reg_def->def |= SX9310_REG_PROX_CTRL2_COMBMODE_CS0_CS1; 860 + else if (comb_mask == BIT(3)) 861 + reg_def->def |= SX9310_REG_PROX_CTRL2_COMBMODE_CS3; 862 + 863 + break; 864 + case SX9310_REG_PROX_CTRL4: 865 + ret = of_property_read_string(np, "semtech,resolution", &res); 866 + if (ret) 867 + break; 868 + 869 + reg_def->def &= ~SX9310_REG_PROX_CTRL4_RESOLUTION_MASK; 870 + if (!strcmp(res, "coarsest")) 871 + reg_def->def |= SX9310_REG_PROX_CTRL4_RESOLUTION_COARSEST; 872 + else if (!strcmp(res, "very-coarse")) 873 + reg_def->def |= SX9310_REG_PROX_CTRL4_RESOLUTION_VERY_COARSE; 874 + else if (!strcmp(res, "coarse")) 875 + reg_def->def |= SX9310_REG_PROX_CTRL4_RESOLUTION_COARSE; 876 + else if (!strcmp(res, "medium-coarse")) 877 + reg_def->def |= SX9310_REG_PROX_CTRL4_RESOLUTION_MEDIUM_COARSE; 878 + else if (!strcmp(res, "medium")) 879 + reg_def->def |= SX9310_REG_PROX_CTRL4_RESOLUTION_MEDIUM; 880 + else if (!strcmp(res, "fine")) 881 + reg_def->def |= SX9310_REG_PROX_CTRL4_RESOLUTION_FINE; 882 + else if (!strcmp(res, "very-fine")) 883 + reg_def->def |= SX9310_REG_PROX_CTRL4_RESOLUTION_VERY_FINE; 884 + else if (!strcmp(res, "finest")) 885 + reg_def->def |= SX9310_REG_PROX_CTRL4_RESOLUTION_FINEST; 886 + 887 + break; 888 + case SX9310_REG_PROX_CTRL5: 889 + ret = of_property_read_u32(np, "semtech,startup-sensor", &start); 890 + if (ret) { 891 + start = FIELD_GET(SX9310_REG_PROX_CTRL5_STARTUPSENS_MASK, 892 + reg_def->def); 893 + } 894 + 895 + reg_def->def &= ~SX9310_REG_PROX_CTRL5_STARTUPSENS_MASK; 896 + reg_def->def |= FIELD_PREP(SX9310_REG_PROX_CTRL5_STARTUPSENS_MASK, 897 + start); 898 + 899 + ret = of_property_read_u32(np, "semtech,proxraw-strength", &raw); 900 + if (ret) { 901 + raw = FIELD_GET(SX9310_REG_PROX_CTRL5_RAWFILT_MASK, 902 + reg_def->def); 903 + } else { 904 + raw = ilog2(raw); 905 + } 906 + 907 + reg_def->def &= ~SX9310_REG_PROX_CTRL5_RAWFILT_MASK; 908 + reg_def->def |= FIELD_PREP(SX9310_REG_PROX_CTRL5_RAWFILT_MASK, 909 + raw); 910 + break; 911 + case SX9310_REG_PROX_CTRL7: 912 + ret = of_property_read_u32(np, "semtech,avg-pos-strength", &pos); 913 + if (ret) 914 + break; 915 + 916 + pos = min(max(ilog2(pos), 3), 10) - 3; 917 + reg_def->def &= ~SX9310_REG_PROX_CTRL7_AVGPOSFILT_MASK; 918 + reg_def->def |= FIELD_PREP(SX9310_REG_PROX_CTRL7_AVGPOSFILT_MASK, 919 + pos); 920 + break; 921 + } 922 + 923 + return reg_def; 924 + } 925 + 1215 926 static int sx9310_init_device(struct iio_dev *indio_dev) 1216 927 { 1217 928 struct sx9310_data *data = iio_priv(indio_dev); 929 + struct sx9310_reg_default tmp; 1218 930 const struct sx9310_reg_default *initval; 1219 931 int ret; 1220 932 unsigned int i, val; ··· 1336 840 1337 841 /* Program some sane defaults. */ 1338 842 for (i = 0; i < ARRAY_SIZE(sx9310_default_regs); i++) { 1339 - initval = &sx9310_default_regs[i]; 843 + initval = sx9310_get_default_reg(data, i, &tmp); 1340 844 ret = regmap_write(data->regmap, initval->reg, initval->def); 1341 845 if (ret) 1342 846 return ret;
+7
drivers/iio/proximity/vl53l0x-i2c.c
··· 225 225 return devm_iio_device_register(&client->dev, indio_dev); 226 226 } 227 227 228 + static const struct i2c_device_id vl53l0x_id[] = { 229 + { "vl53l0x", 0}, 230 + { } 231 + }; 232 + MODULE_DEVICE_TABLE(i2c, vl53l0x_id); 233 + 228 234 static const struct of_device_id st_vl53l0x_dt_match[] = { 229 235 { .compatible = "st,vl53l0x", }, 230 236 { } ··· 243 237 .of_match_table = st_vl53l0x_dt_match, 244 238 }, 245 239 .probe_new = vl53l0x_probe, 240 + .id_table = vl53l0x_id, 246 241 }; 247 242 module_i2c_driver(vl53l0x_driver); 248 243
-3
include/linux/iio/buffer.h
··· 11 11 12 12 struct iio_buffer; 13 13 14 - void iio_buffer_set_attrs(struct iio_buffer *buffer, 15 - const struct attribute **attrs); 16 - 17 14 int iio_push_to_buffers(struct iio_dev *indio_dev, const void *data); 18 15 19 16 /**
+2
include/linux/iio/iio-opaque.h
··· 11 11 * @channel_attr_list: keep track of automatically created channel 12 12 * attributes 13 13 * @chan_attr_group: group for all attrs in base directory 14 + * @ioctl_handlers: ioctl handlers registered with the core handler 14 15 * @debugfs_dentry: device specific debugfs dentry 15 16 * @cached_reg_addr: cached register address for debugfs reads 16 17 * @read_buf: read buffer to be used for the initial reg read ··· 23 22 struct list_head buffer_list; 24 23 struct list_head channel_attr_list; 25 24 struct attribute_group chan_attr_group; 25 + struct list_head ioctl_handlers; 26 26 #if defined(CONFIG_DEBUG_FS) 27 27 struct dentry *debugfs_dentry; 28 28 unsigned cached_reg_addr;
+6
include/linux/iio/iio.h
··· 362 362 * and max. For lists, all possible values are enumerated. 363 363 * @write_raw: function to write a value to the device. 364 364 * Parameters are the same as for read_raw. 365 + * @read_label: function to request label name for a specified label, 366 + * for better channel identification. 365 367 * @write_raw_get_fmt: callback function to query the expected 366 368 * format/precision. If not set by the driver, write_raw 367 369 * returns IIO_VAL_INT_PLUS_MICRO. ··· 421 419 int val, 422 420 int val2, 423 421 long mask); 422 + 423 + int (*read_label)(struct iio_dev *indio_dev, 424 + struct iio_chan_spec const *chan, 425 + char *label); 424 426 425 427 int (*write_raw_get_fmt)(struct iio_dev *indio_dev, 426 428 struct iio_chan_spec const *chan,
+1 -1
include/linux/iio/trigger.h
··· 97 97 } 98 98 99 99 /** 100 - * iio_device_set_drvdata() - Set trigger driver data 100 + * iio_trigger_set_drvdata() - Set trigger driver data 101 101 * @trig: IIO trigger structure 102 102 * @data: Driver specific data 103 103 *
+16 -7
include/linux/iio/triggered_buffer.h
··· 4 4 5 5 #include <linux/interrupt.h> 6 6 7 + struct attribute; 7 8 struct iio_dev; 8 9 struct iio_buffer_setup_ops; 9 10 10 - int iio_triggered_buffer_setup(struct iio_dev *indio_dev, 11 + int iio_triggered_buffer_setup_ext(struct iio_dev *indio_dev, 11 12 irqreturn_t (*h)(int irq, void *p), 12 13 irqreturn_t (*thread)(int irq, void *p), 13 - const struct iio_buffer_setup_ops *setup_ops); 14 + const struct iio_buffer_setup_ops *setup_ops, 15 + const struct attribute **buffer_attrs); 14 16 void iio_triggered_buffer_cleanup(struct iio_dev *indio_dev); 15 17 16 - int devm_iio_triggered_buffer_setup(struct device *dev, 17 - struct iio_dev *indio_dev, 18 - irqreturn_t (*h)(int irq, void *p), 19 - irqreturn_t (*thread)(int irq, void *p), 20 - const struct iio_buffer_setup_ops *ops); 18 + #define iio_triggered_buffer_setup(indio_dev, h, thread, setup_ops) \ 19 + iio_triggered_buffer_setup_ext((indio_dev), (h), (thread), (setup_ops), NULL) 20 + 21 + int devm_iio_triggered_buffer_setup_ext(struct device *dev, 22 + struct iio_dev *indio_dev, 23 + irqreturn_t (*h)(int irq, void *p), 24 + irqreturn_t (*thread)(int irq, void *p), 25 + const struct iio_buffer_setup_ops *ops, 26 + const struct attribute **buffer_attrs); 27 + 28 + #define devm_iio_triggered_buffer_setup(dev, indio_dev, h, thread, setup_ops) \ 29 + devm_iio_triggered_buffer_setup_ext((dev), (indio_dev), (h), (thread), (setup_ops), NULL) 21 30 22 31 #endif
-19
include/linux/platform_data/ad7298.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * AD7298 SPI ADC driver 4 - * 5 - * Copyright 2011 Analog Devices Inc. 6 - */ 7 - 8 - #ifndef __LINUX_PLATFORM_DATA_AD7298_H__ 9 - #define __LINUX_PLATFORM_DATA_AD7298_H__ 10 - 11 - /** 12 - * struct ad7298_platform_data - Platform data for the ad7298 ADC driver 13 - * @ext_ref: Whether to use an external reference voltage. 14 - **/ 15 - struct ad7298_platform_data { 16 - bool ext_ref; 17 - }; 18 - 19 - #endif /* IIO_ADC_AD7298_H_ */
-20
include/linux/platform_data/ad7303.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Analog Devices AD7303 DAC driver 4 - * 5 - * Copyright 2013 Analog Devices Inc. 6 - */ 7 - 8 - #ifndef __IIO_ADC_AD7303_H__ 9 - #define __IIO_ADC_AD7303_H__ 10 - 11 - /** 12 - * struct ad7303_platform_data - AD7303 platform data 13 - * @use_external_ref: If set to true use an external voltage reference connected 14 - * to the REF pin, otherwise use the internal reference derived from Vdd. 15 - */ 16 - struct ad7303_platform_data { 17 - bool use_external_ref; 18 - }; 19 - 20 - #endif
-4
include/linux/platform_data/ad7887.h
··· 13 13 * second input channel, and Vref is internally connected to Vdd. If set to 14 14 * false the device is used in single channel mode and AIN1/Vref is used as 15 15 * VREF input. 16 - * @use_onchip_ref: Whether to use the onchip reference. If set to true the 17 - * internal 2.5V reference is used. If set to false a external reference is 18 - * used. 19 16 */ 20 17 struct ad7887_platform_data { 21 18 bool en_dual; 22 - bool use_onchip_ref; 23 19 }; 24 20 25 21 #endif /* IIO_ADC_AD7887_H_ */
-49
include/linux/platform_data/at91_adc.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (C) 2011 Free Electrons 4 - */ 5 - 6 - #ifndef _AT91_ADC_H_ 7 - #define _AT91_ADC_H_ 8 - 9 - enum atmel_adc_ts_type { 10 - ATMEL_ADC_TOUCHSCREEN_NONE = 0, 11 - ATMEL_ADC_TOUCHSCREEN_4WIRE = 4, 12 - ATMEL_ADC_TOUCHSCREEN_5WIRE = 5, 13 - }; 14 - 15 - /** 16 - * struct at91_adc_trigger - description of triggers 17 - * @name: name of the trigger advertised to the user 18 - * @value: value to set in the ADC's trigger setup register 19 - to enable the trigger 20 - * @is_external: Does the trigger rely on an external pin? 21 - */ 22 - struct at91_adc_trigger { 23 - const char *name; 24 - u8 value; 25 - bool is_external; 26 - }; 27 - 28 - /** 29 - * struct at91_adc_data - platform data for ADC driver 30 - * @channels_used: channels in use on the board as a bitmask 31 - * @startup_time: startup time of the ADC in microseconds 32 - * @trigger_list: Triggers available in the ADC 33 - * @trigger_number: Number of triggers available in the ADC 34 - * @use_external_triggers: does the board has external triggers availables 35 - * @vref: Reference voltage for the ADC in millivolts 36 - * @touchscreen_type: If a touchscreen is connected, its type (4 or 5 wires) 37 - */ 38 - struct at91_adc_data { 39 - unsigned long channels_used; 40 - u8 startup_time; 41 - struct at91_adc_trigger *trigger_list; 42 - u8 trigger_number; 43 - bool use_external_triggers; 44 - u16 vref; 45 - enum atmel_adc_ts_type touchscreen_type; 46 - }; 47 - 48 - extern void __init at91_add_device_adc(struct at91_adc_data *data); 49 - #endif