1*5def4c47SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*5def4c47SEmmanuel Vadot%YAML 1.2
3*5def4c47SEmmanuel Vadot---
4*5def4c47SEmmanuel Vadot$id: http://devicetree.org/schemas/iio/light/capella,cm3605.yaml#
5*5def4c47SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*5def4c47SEmmanuel Vadot
7*5def4c47SEmmanuel Vadottitle:
8*5def4c47SEmmanuel Vadot  Capella Microsystems CM3605 Ambient Light and Short Distance Proximity Sensor
9*5def4c47SEmmanuel Vadot
10*5def4c47SEmmanuel Vadotmaintainers:
11*5def4c47SEmmanuel Vadot  - Linus Walleij <linus.walleij@linaro.org>
12*5def4c47SEmmanuel Vadot  - Kevin Tsai <ktsai@capellamicro.com>
13*5def4c47SEmmanuel Vadot
14*5def4c47SEmmanuel Vadotdescription: |
15*5def4c47SEmmanuel Vadot  The CM3605 is an entirely analog part. However, it requires quite a bit of
16*5def4c47SEmmanuel Vadot  software logic to interface a host operating system.
17*5def4c47SEmmanuel Vadot
18*5def4c47SEmmanuel Vadot  This ALS and proximity sensor was one of the very first deployed in mobile
19*5def4c47SEmmanuel Vadot  handsets, notably it is used in the very first Nexus One Android phone from
20*5def4c47SEmmanuel Vadot  2010.
21*5def4c47SEmmanuel Vadot
22*5def4c47SEmmanuel Vadotproperties:
23*5def4c47SEmmanuel Vadot  compatible:
24*5def4c47SEmmanuel Vadot    const: capella,cm3605
25*5def4c47SEmmanuel Vadot
26*5def4c47SEmmanuel Vadot  aset-gpios:
27*5def4c47SEmmanuel Vadot    maxItems: 1
28*5def4c47SEmmanuel Vadot    description:
29*5def4c47SEmmanuel Vadot      ASET line (drive low to activate the ALS, should be flagged
30*5def4c47SEmmanuel Vadot      GPIO_ACTIVE_LOW)
31*5def4c47SEmmanuel Vadot
32*5def4c47SEmmanuel Vadot  interrupts:
33*5def4c47SEmmanuel Vadot    maxItems: 1
34*5def4c47SEmmanuel Vadot    description:
35*5def4c47SEmmanuel Vadot      Connected to the POUT (proximity sensor out) line. The edge
36*5def4c47SEmmanuel Vadot      detection must be set to IRQ_TYPE_EDGE_BOTH so as to detect
37*5def4c47SEmmanuel Vadot      movements toward and away from the proximity sensor.
38*5def4c47SEmmanuel Vadot
39*5def4c47SEmmanuel Vadot  io-channels:
40*5def4c47SEmmanuel Vadot    maxItems: 1
41*5def4c47SEmmanuel Vadot    description:
42*5def4c47SEmmanuel Vadot      ADC channel used for converting the voltage from AOUT to a digital
43*5def4c47SEmmanuel Vadot      representation.
44*5def4c47SEmmanuel Vadot
45*5def4c47SEmmanuel Vadot  io-channel-names:
46*5def4c47SEmmanuel Vadot    const: aout
47*5def4c47SEmmanuel Vadot
48*5def4c47SEmmanuel Vadot  vdd-supply: true
49*5def4c47SEmmanuel Vadot
50*5def4c47SEmmanuel Vadot  capella,aset-resistance-ohms:
51*5def4c47SEmmanuel Vadot    enum: [50000, 100000, 300000, 600000]
52*5def4c47SEmmanuel Vadot    description: >
53*5def4c47SEmmanuel Vadot      Sensitivity calibration resistance. Note that calibration curves
54*5def4c47SEmmanuel Vadot      are only provided for specific allowed values. Default: 100 kOhms.
55*5def4c47SEmmanuel Vadot
56*5def4c47SEmmanuel Vadotrequired:
57*5def4c47SEmmanuel Vadot  - compatible
58*5def4c47SEmmanuel Vadot  - aset-gpios
59*5def4c47SEmmanuel Vadot  - interrupts
60*5def4c47SEmmanuel Vadot  - io-channels
61*5def4c47SEmmanuel Vadot  - io-channel-names
62*5def4c47SEmmanuel Vadot
63*5def4c47SEmmanuel VadotadditionalProperties: false
64*5def4c47SEmmanuel Vadot
65*5def4c47SEmmanuel Vadotexamples:
66*5def4c47SEmmanuel Vadot  - |
67*5def4c47SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
68*5def4c47SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
69*5def4c47SEmmanuel Vadot    light-sensor {
70*5def4c47SEmmanuel Vadot        compatible = "capella,cm3605";
71*5def4c47SEmmanuel Vadot        vdd-supply = <&foo_reg>;
72*5def4c47SEmmanuel Vadot        aset-gpios = <&foo_gpio 1 GPIO_ACTIVE_LOW>;
73*5def4c47SEmmanuel Vadot        capella,aset-resistance-ohms = <100000>;
74*5def4c47SEmmanuel Vadot        interrupts = <1 IRQ_TYPE_EDGE_BOTH>;
75*5def4c47SEmmanuel Vadot        io-channels = <&adc 0x01>;
76*5def4c47SEmmanuel Vadot        io-channel-names = "aout";
77*5def4c47SEmmanuel Vadot    };
78*5def4c47SEmmanuel Vadot...
79