Skip to content

Commit a2ff6e0

Browse files
linuswjic23
authored andcommitted
iio: light: Add DT bindings for GP2AP002
This adds device tree bindings for the GP2AP002 light and proximity sensor. As with other early proximity sensors (~2010) the light sensor and proximity sensors were combined into a single component. Cc: Stephan Gerhold <[email protected]> Cc: Minkyu Kang <[email protected]> Cc: Paweł Chmiel <[email protected]> Cc: Jonathan Bakker <[email protected]> Cc: Oskar Andero <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: [email protected] Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 5de6570 commit a2ff6e0

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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+
7+
title: Sharp GP2AP002A00F and GP2AP002S00F proximity and ambient light sensors
8+
9+
maintainers:
10+
- Linus Walleij <[email protected]>
11+
12+
description: |
13+
Proximity and ambient light sensor with IR LED for the proximity
14+
sensing and an analog output for light intensity. The ambient light
15+
sensor output is not available on the GP2AP002S00F variant.
16+
17+
properties:
18+
compatible:
19+
enum:
20+
- sharp,gp2ap002a00f
21+
- sharp,gp2ap002s00f
22+
23+
reg:
24+
maxItems: 1
25+
26+
interrupts:
27+
maxItems: 1
28+
description: an interrupt for proximity, usually a GPIO line
29+
30+
vdd-supply:
31+
description: VDD power supply a phandle to a regulator
32+
33+
vio-supply:
34+
description: VIO power supply a phandle to a regulator
35+
36+
io-channels:
37+
maxItems: 1
38+
description: ALSOUT ADC channel to read the ambient light
39+
40+
io-channel-names:
41+
const: alsout
42+
43+
sharp,proximity-far-hysteresis:
44+
$ref: /schemas/types.yaml#/definitions/uint8
45+
description: |
46+
Hysteresis setting for "far" object detection, this setting is
47+
device-unique and adjust the optical setting for proximity detection
48+
of a "far away" object in front of the sensor.
49+
50+
sharp,proximity-close-hysteresis:
51+
$ref: /schemas/types.yaml#/definitions/uint8
52+
description: |
53+
Hysteresis setting for "close" object detection, this setting is
54+
device-unique and adjust the optical setting for proximity detection
55+
of a "close" object in front of the sensor.
56+
57+
required:
58+
- compatible
59+
- reg
60+
- interrupts
61+
- sharp,proximity-far-hysteresis
62+
- sharp,proximity-close-hysteresis
63+
64+
examples:
65+
- |
66+
#include <dt-bindings/interrupt-controller/irq.h>
67+
68+
i2c {
69+
#address-cells = <1>;
70+
#size-cells = <0>;
71+
72+
light-sensor@44 {
73+
compatible = "sharp,gp2ap002a00f";
74+
reg = <0x44>;
75+
interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
76+
vdd-supply = <&vdd_regulator>;
77+
vio-supply = <&vio_regulator>;
78+
io-channels = <&adc_channel>;
79+
io-channel-names = "alsout";
80+
sharp,proximity-far-hysteresis = /bits/ 8 <0x2f>;
81+
sharp,proximity-close-hysteresis = /bits/ 8 <0x0f>;
82+
};
83+
};
84+
85+
...

0 commit comments

Comments
 (0)