0001 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/iio/light/sharp,gp2ap002.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Sharp GP2AP002A00F and GP2AP002S00F proximity and ambient light sensors
0008
0009 maintainers:
0010 - Linus Walleij <linus.walleij@linaro.org>
0011
0012 description: |
0013 Proximity and ambient light sensor with IR LED for the proximity
0014 sensing and an analog output for light intensity. The ambient light
0015 sensor output is not available on the GP2AP002S00F variant.
0016
0017 properties:
0018 compatible:
0019 enum:
0020 - sharp,gp2ap002a00f
0021 - sharp,gp2ap002s00f
0022
0023 reg:
0024 maxItems: 1
0025
0026 interrupts:
0027 maxItems: 1
0028 description: an interrupt for proximity, usually a GPIO line
0029
0030 vdd-supply:
0031 description: VDD power supply a phandle to a regulator
0032
0033 vio-supply:
0034 description: VIO power supply a phandle to a regulator
0035
0036 io-channels:
0037 maxItems: 1
0038 description: ALSOUT ADC channel to read the ambient light
0039
0040 io-channel-names:
0041 const: alsout
0042
0043 sharp,proximity-far-hysteresis:
0044 $ref: /schemas/types.yaml#/definitions/uint8
0045 description: |
0046 Hysteresis setting for "far" object detection, this setting is
0047 device-unique and adjust the optical setting for proximity detection
0048 of a "far away" object in front of the sensor.
0049
0050 sharp,proximity-close-hysteresis:
0051 $ref: /schemas/types.yaml#/definitions/uint8
0052 description: |
0053 Hysteresis setting for "close" object detection, this setting is
0054 device-unique and adjust the optical setting for proximity detection
0055 of a "close" object in front of the sensor.
0056
0057 required:
0058 - compatible
0059 - reg
0060 - interrupts
0061 - sharp,proximity-far-hysteresis
0062 - sharp,proximity-close-hysteresis
0063
0064 additionalProperties: false
0065
0066 examples:
0067 - |
0068 #include <dt-bindings/interrupt-controller/irq.h>
0069
0070 i2c {
0071 #address-cells = <1>;
0072 #size-cells = <0>;
0073
0074 light-sensor@44 {
0075 compatible = "sharp,gp2ap002a00f";
0076 reg = <0x44>;
0077 interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
0078 vdd-supply = <&vdd_regulator>;
0079 vio-supply = <&vio_regulator>;
0080 io-channels = <&adc_channel>;
0081 io-channel-names = "alsout";
0082 sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
0083 sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
0084 };
0085 };
0086
0087 ...