sharp,gp2ap002.yaml 2.3 KB

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