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.

dt-bindings:iio:light:upisemi,us51882: txt to yaml conversion.

I don't have an up to date address for Adriana Reus so I've put myself
as the binding maintainer for this one. I'm happy to hand over to Adriana
or anyone else who wants take it on!

This has a lot of optional tuning parameters. The docs are modified to try
and put the default values in the description of each one rather than a
forwards reference to the example.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20201031184854.745828-20-jic23@kernel.org

+78 -45
+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 - };