All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Weiss <luca.weiss@fairphone.com>
To: linux-input@vger.kernel.org
Cc: ~postmarketos/upstreaming@lists.sr.ht,
	phone-devel@vger.kernel.org,
	Luca Weiss <luca.weiss@fairphone.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] dt-bindings: input: Add bindings for Awinic AW8695 haptics
Date: Fri,  8 Apr 2022 13:53:08 +0200	[thread overview]
Message-ID: <20220408115311.237039-1-luca.weiss@fairphone.com> (raw)

Add a document describing the bindings for the AW8695 LRA Haptic Driver.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 .../bindings/input/awinic,aw8695-haptics.yaml | 133 ++++++++++++++++++
 1 file changed, 133 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/awinic,aw8695-haptics.yaml

diff --git a/Documentation/devicetree/bindings/input/awinic,aw8695-haptics.yaml b/Documentation/devicetree/bindings/input/awinic,aw8695-haptics.yaml
new file mode 100644
index 000000000000..9f573daaba0e
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/awinic,aw8695-haptics.yaml
@@ -0,0 +1,133 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/awinic,aw8695-haptics.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Awinic AW8695 LRA Haptic Driver
+
+maintainers:
+  - Luca Weiss <luca.weiss@fairphone.com>
+
+properties:
+  compatible:
+    const: awinic,aw8695
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+    description: GPIO connected to INTN pin (edge falling)
+
+  reset-gpios:
+    maxItems: 1
+    description: GPIO connected to RSTN pin (active high)
+
+  awinic,f0-preset:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Default value for the f0 of LRA
+
+  awinic,f0-coefficient:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Coefficient between actual f0 and the value in the registers
+
+  awinic,f0-calibration-percent:
+    maxItems: 1
+    description: Limit of f0 deviation from awinic,f0-preset
+
+  awinic,drive-level:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Level of drive waveform in normal driving
+
+  awinic,f0-detection-play-time:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Drive waveform play times in the first period in the f0 detection
+
+  awinic,f0-detection-wait-time:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Waveform wait times in the f0 detection
+
+  awinic,f0-detection-repeat:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Repeat times in the f0 detection
+
+  awinic,f0-detection-trace:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Drive waveform play times in the second period and later in the f0 detection
+
+  awinic,boost-debug:
+    $ref: /schemas/types.yaml#/definitions/uint8-array
+    minItems: 3
+    maxItems: 3
+    description: Values for BSTDBG1-3 registers
+
+  awinic,tset:
+    $ref: /schemas/types.yaml#/definitions/uint8
+    description: Value for TSET register
+
+  awinic,r-spare:
+    $ref: /schemas/types.yaml#/definitions/uint8
+    description: Value for R_SPARE register
+
+  awinic,bemf-upper-threshold:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Back EMF (electromotive force) upper threshold
+
+  awinic,bemf-lower-threshold:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: Back EMF (electromotive force) lower threshold
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - reset-gpios
+  - awinic,f0-preset
+  - awinic,f0-coefficient
+  - awinic,f0-calibration-percent
+  - awinic,drive-level
+  - awinic,f0-detection-play-time
+  - awinic,f0-detection-wait-time
+  - awinic,f0-detection-repeat
+  - awinic,f0-detection-trace
+  - awinic,boost-debug
+  - awinic,tset
+  - awinic,r-spare
+  - awinic,bemf-upper-threshold
+  - awinic,bemf-lower-threshold
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        haptics@5a {
+            compatible = "awinic,aw8695";
+            reg = <0x5a>;
+            interrupts-extended = <&tlmm 85 IRQ_TYPE_EDGE_FALLING>;
+            reset-gpios = <&tlmm 90 GPIO_ACTIVE_HIGH>;
+
+            awinic,f0-preset = <2350>;
+            awinic,f0-coefficient = <260>;
+            awinic,f0-calibration-percent = <7>;
+            awinic,drive-level = <125>;
+
+            awinic,f0-detection-play-time = <5>;
+            awinic,f0-detection-wait-time = <3>;
+            awinic,f0-detection-repeat = <2>;
+            awinic,f0-detection-trace = <15>;
+
+            awinic,boost-debug = /bits/ 8 <0x30 0xeb 0xd4>;
+            awinic,tset = /bits/ 8 <0x12>;
+            awinic,r-spare = /bits/ 8 <0x68>;
+
+            awinic,bemf-upper-threshold = <4104>;
+            awinic,bemf-lower-threshold = <1016>;
+        };
+    };
-- 
2.35.1


             reply	other threads:[~2022-04-08 11:53 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08 11:53 Luca Weiss [this message]
2022-04-08 11:53 ` [PATCH 2/3] Input - aw8695: Add driver for AW8695 haptics Luca Weiss
2022-04-08 17:25   ` kernel test robot
2022-04-09 21:15   ` Jeff LaBundy
2022-04-11  9:57     ` Luca Weiss
2022-04-12  2:44       ` Jeff LaBundy
2022-04-08 11:53 ` [PATCH 3/3] arm64: dts: qcom: sm7225-fairphone-fp4: Add " Luca Weiss
2022-04-08 19:49   ` kernel test robot
2022-04-08 15:05 ` [PATCH 1/3] dt-bindings: input: Add bindings for Awinic " Krzysztof Kozlowski
2022-04-11  8:15   ` Luca Weiss
2022-04-11 12:52     ` Krzysztof Kozlowski
2022-04-11 15:11       ` Luca Weiss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220408115311.237039-1-luca.weiss@fairphone.com \
    --to=luca.weiss@fairphone.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=phone-devel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.