xref: /freebsd-src/sys/contrib/device-tree/Bindings/iio/light/sharp,gp2ap002.yaml (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/iio/light/sharp,gp2ap002.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: Sharp GP2AP002A00F and GP2AP002S00F proximity and ambient light sensors
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Linus Walleij <linus.walleij@linaro.org>
11c66ec88fSEmmanuel Vadot
12c66ec88fSEmmanuel Vadotdescription: |
13c66ec88fSEmmanuel Vadot  Proximity and ambient light sensor with IR LED for the proximity
14c66ec88fSEmmanuel Vadot  sensing and an analog output for light intensity. The ambient light
15c66ec88fSEmmanuel Vadot  sensor output is not available on the GP2AP002S00F variant.
16c66ec88fSEmmanuel Vadot
17c66ec88fSEmmanuel Vadotproperties:
18c66ec88fSEmmanuel Vadot  compatible:
19c66ec88fSEmmanuel Vadot    enum:
20c66ec88fSEmmanuel Vadot      - sharp,gp2ap002a00f
21c66ec88fSEmmanuel Vadot      - sharp,gp2ap002s00f
22c66ec88fSEmmanuel Vadot
23c66ec88fSEmmanuel Vadot  reg:
24c66ec88fSEmmanuel Vadot    maxItems: 1
25c66ec88fSEmmanuel Vadot
26c66ec88fSEmmanuel Vadot  interrupts:
27c66ec88fSEmmanuel Vadot    maxItems: 1
28c66ec88fSEmmanuel Vadot    description: an interrupt for proximity, usually a GPIO line
29c66ec88fSEmmanuel Vadot
30c66ec88fSEmmanuel Vadot  vdd-supply:
31c66ec88fSEmmanuel Vadot    description: VDD power supply a phandle to a regulator
32c66ec88fSEmmanuel Vadot
33c66ec88fSEmmanuel Vadot  vio-supply:
34c66ec88fSEmmanuel Vadot    description: VIO power supply a phandle to a regulator
35c66ec88fSEmmanuel Vadot
36c66ec88fSEmmanuel Vadot  io-channels:
37c66ec88fSEmmanuel Vadot    maxItems: 1
38c66ec88fSEmmanuel Vadot    description: ALSOUT ADC channel to read the ambient light
39c66ec88fSEmmanuel Vadot
40c66ec88fSEmmanuel Vadot  io-channel-names:
41c66ec88fSEmmanuel Vadot    const: alsout
42c66ec88fSEmmanuel Vadot
43c66ec88fSEmmanuel Vadot  sharp,proximity-far-hysteresis:
44c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8
45c66ec88fSEmmanuel Vadot    description: |
46c66ec88fSEmmanuel Vadot      Hysteresis setting for "far" object detection, this setting is
47c66ec88fSEmmanuel Vadot      device-unique and adjust the optical setting for proximity detection
48c66ec88fSEmmanuel Vadot      of a "far away" object in front of the sensor.
49c66ec88fSEmmanuel Vadot
50c66ec88fSEmmanuel Vadot  sharp,proximity-close-hysteresis:
51c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint8
52c66ec88fSEmmanuel Vadot    description: |
53c66ec88fSEmmanuel Vadot      Hysteresis setting for "close" object detection, this setting is
54c66ec88fSEmmanuel Vadot      device-unique and adjust the optical setting for proximity detection
55c66ec88fSEmmanuel Vadot      of a "close" object in front of the sensor.
56c66ec88fSEmmanuel Vadot
57c66ec88fSEmmanuel Vadotrequired:
58c66ec88fSEmmanuel Vadot  - compatible
59c66ec88fSEmmanuel Vadot  - reg
60c66ec88fSEmmanuel Vadot  - interrupts
61c66ec88fSEmmanuel Vadot  - sharp,proximity-far-hysteresis
62c66ec88fSEmmanuel Vadot  - sharp,proximity-close-hysteresis
63c66ec88fSEmmanuel Vadot
64*6be33864SEmmanuel VadotadditionalProperties: false
65*6be33864SEmmanuel Vadot
66c66ec88fSEmmanuel Vadotexamples:
67c66ec88fSEmmanuel Vadot  - |
68c66ec88fSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
69c66ec88fSEmmanuel Vadot
70c66ec88fSEmmanuel Vadot    i2c {
71c66ec88fSEmmanuel Vadot      #address-cells = <1>;
72c66ec88fSEmmanuel Vadot      #size-cells = <0>;
73c66ec88fSEmmanuel Vadot
74c66ec88fSEmmanuel Vadot      light-sensor@44 {
75c66ec88fSEmmanuel Vadot        compatible = "sharp,gp2ap002a00f";
76c66ec88fSEmmanuel Vadot        reg = <0x44>;
77c66ec88fSEmmanuel Vadot        interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
78c66ec88fSEmmanuel Vadot        vdd-supply = <&vdd_regulator>;
79c66ec88fSEmmanuel Vadot        vio-supply = <&vio_regulator>;
80c66ec88fSEmmanuel Vadot        io-channels = <&adc_channel>;
81c66ec88fSEmmanuel Vadot        io-channel-names = "alsout";
82c66ec88fSEmmanuel Vadot        sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
83c66ec88fSEmmanuel Vadot        sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
84c66ec88fSEmmanuel Vadot      };
85c66ec88fSEmmanuel Vadot    };
86c66ec88fSEmmanuel Vadot
87c66ec88fSEmmanuel Vadot...
88