[PATCH v4 1/3] dt-bindings: iio: proximity: add Sharp GP2AP070S proximity sensor
Kaustabh Chakraborty <[email protected]>
| Newsgroups | org.kernel.vger.linux-iio,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.linux-samsung-soc |
|---|---|
| Message-ID | <[email protected]> |
The GP2AP070S is a proximity sensor designed and manufactured by Sharp Corporation. Unlike the other GP2AP* schemas, this is strictly a proximity sensor and NOT an ambient light sensor. For power supplies, it expects two voltage supplies, one for core and other for driving the infrared LED which is used to measure proximity distance. However, some variants may not explicitly require a separate regulator for the LED as they're able to draw power from the main supply. This chip has been used in production mobile devices such as the Samsung Galaxy J6. Signed-off-by: Kaustabh Chakraborty <[email protected]> --- .../bindings/iio/proximity/sharp,gp2ap070s.yaml | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/Documentation/devicetree/bindings/iio/proximity/sharp,gp2ap070s.yaml b/Documentation/devicetree/bindings/iio/proximity/sharp,gp2ap070s.yaml new file mode 100644 index 000000000000..73f0abc1f09c --- /dev/null +++ b/Documentation/devicetree/bindings/iio/proximity/sharp,gp2ap070s.yaml @@ -0,0 +1,60 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/proximity/sharp,gp2ap070s.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Sharp GP2AP070S Proximity sensor + +maintainers: + - Kaustabh Chakraborty <[email protected]> + +allOf: + - $ref: ../common.yaml# + +properties: + compatible: + const: sharp,gp2ap070s + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vdd-supply: + description: Voltage supply for the internal circuitry + + vled-supply: + description: Voltage supply for the IR LED + + proximity-near-level: true + +required: + - compatible + - reg + - interrupts + - vdd-supply + +additionalProperties: false + +examples: + - | + #include <dt-bindings/interrupt-controller/irq.h> + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + proximity@39 { + compatible = "sharp,gp2ap070s"; + reg = <0x39>; + interrupt-parent = <&gpio>; + interrupts = <1 IRQ_TYPE_EDGE_BOTH>; + vdd-supply = <&vdd_supply>; + vled-supply = <&vled_supply>; + proximity-near-level = <500>; + }; + }; + +... -- 2.54.0