0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/iio/light/upisemi,us5182.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: UPISEMI us5182d I2C ALS and Proximity sensor
0008
0009 maintainers:
0010 - Jonathan Cameron <jic23@kernel.org>
0011
0012 properties:
0013 compatible:
0014 const: upisemi,usd5182
0015
0016 reg:
0017 maxItems: 1
0018
0019 upisemi,glass-coef:
0020 $ref: /schemas/types.yaml#/definitions/uint32
0021 description: |
0022 glass attenuation factor - compensation factor of resolution 1000
0023 for material transmittance.
0024 default: 1000
0025
0026 upisemi,dark-ths:
0027 $ref: /schemas/types.yaml#/definitions/uint16-array
0028 minItems: 8
0029 maxItems: 8
0030 description:
0031 16-bit thresholds (adc counts) corresponding to every scale.
0032
0033 upisemi,upper-dark-gain:
0034 $ref: /schemas/types.yaml#/definitions/uint8
0035 description: |
0036 8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4)
0037 applied when light > threshold.
0038 default: 0
0039
0040 upisemi,lower-dark-gain:
0041 $ref: /schemas/types.yaml#/definitions/uint8
0042 description: |
0043 8-bit dark gain compensation factor(4 int and 4 fractional bits - Q4.4)
0044 applied when light < threshold.
0045 default: 0x16
0046
0047 upisemi,continuous:
0048 $ref: /schemas/types.yaml#/definitions/flag
0049 description: |
0050 This chip has two power modes: one-shot (chip takes one measurement and
0051 then shuts itself down) and continuous (chip takes continuous
0052 measurements). The one-shot mode is more power-friendly but the
0053 continuous mode may be more reliable. If this property is specified
0054 the continuous mode will be used instead of the default one-shot one for
0055 raw reads.
0056
0057 additionalProperties: false
0058
0059 required:
0060 - compatible
0061 - reg
0062
0063 examples:
0064 - |
0065 i2c {
0066 #address-cells = <1>;
0067 #size-cells = <0>;
0068
0069 light-sensor@39 {
0070 compatible = "upisemi,usd5182";
0071 reg = <0x39>;
0072 upisemi,glass-coef = < 1000 >;
0073 upisemi,dark-ths = /bits/ 16 <170 200 512 512 800 2000 4000 8000>;
0074 upisemi,upper-dark-gain = /bits/ 8 <0x00>;
0075 upisemi,lower-dark-gain = /bits/ 8 <0x16>;
0076 };
0077 };
0078 ...