Skip to content

Commit

Permalink
[WIP ]linux-iot2050: Add the support for the SM variant
Browse files Browse the repository at this point in the history
[Commit message need refine]
Add the support for the everlight pm16d17 sensor

This sensor is used to detect the distance of the cover, when the
cover of the iot2050 open or close, the emiter strength would change.
According this change to judge whether the cover open or close.

Add "wkup_gpio0-base" to let mraa get button gpio.

Remove arduino dts on iot2050 SM variants

Signed-off-by: chao zeng <[email protected]>
Signed-off-by: Li Hua Qian <[email protected]>
Signed-off-by: Baocheng Su <[email protected]>
  • Loading branch information
BaochengSu committed Nov 26, 2023
1 parent c4fbe75 commit 5eae23f
Show file tree
Hide file tree
Showing 5 changed files with 971 additions and 0 deletions.
18 changes: 18 additions & 0 deletions recipes-kernel/linux/files/iot2050_defconfig_extra.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -222,3 +222,21 @@ CONFIG_DRM_VIRTIO_GPU=y
CONFIG_VIRTIO_INPUT=y

CONFIG_WATCHDOG_SYSFS=y

CONFIG_IIO_ST_LSM6DSX=m
CONFIG_IIO_ST_LSM6DSX_I2C=m

CONFIG_IIO_BUFFER=y
CONFIG_IIO_BUFFER_CB=m
CONFIG_IIO_BUFFER_DMA=m
CONFIG_IIO_BUFFER_DMAENGINE=m
CONFIG_IIO_BUFFER_HW_CONSUMER=m
CONFIG_IIO_KFIFO_BUF=m
CONFIG_IIO_TRIGGERED_BUFFER=m
CONFIG_IIO_CONFIGFS=m
CONFIG_IIO_TRIGGER=y
CONFIG_IIO_CONSUMERS_PER_TRIGGER=2
CONFIG_IIO_SW_DEVICE=m
CONFIG_IIO_SW_TRIGGER=m
CONFIG_IIO_TRIGGERED_EVENT=m
CONFIG_PM16D17=m
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Baocheng Su <[email protected]>
Date: Fri, 24 Nov 2023 21:03:58 +0800
Subject: [PATCH] dt-bindings: vendor-prefixes: Add EVERLIGHT

Add vendor prefix for EVERLIGHT Electronics Co., Ltd.

Signed-off-by: Baocheng Su <[email protected]>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 309b94c328c8..727319d74540 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -456,6 +456,8 @@ patternProperties:
description: Eukréa Electromatique
"^everest,.*":
description: Everest Semiconductor Co. Ltd.
+ "^everlight,.*":
+ description: EVERLIGHT Electronics Co., Ltd.
"^everspin,.*":
description: Everspin Technologies, Inc.
"^evervision,.*":
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: chao zeng <[email protected]>
Date: Tue, 16 May 2023 21:10:47 +0800
Subject: [PATCH] dt-bindings: iio: Add everlight pm16d17 binding

Add the binding document for the everlight pm16d17 sensor.

Signed-off-by: Chao Zeng <[email protected]>
Co-developed-by: Baocheng Su <[email protected]>
Signed-off-by: Baocheng Su <[email protected]>
---
.../iio/proximity/everlight,pm16d17.yaml | 94 +++++++++++++++++++
1 file changed, 94 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/proximity/everlight,pm16d17.yaml

diff --git a/Documentation/devicetree/bindings/iio/proximity/everlight,pm16d17.yaml b/Documentation/devicetree/bindings/iio/proximity/everlight,pm16d17.yaml
new file mode 100644
index 000000000000..4b488d6cafa2
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/proximity/everlight,pm16d17.yaml
@@ -0,0 +1,94 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/iio/proximity/everlight,pm16d17.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Everlight PM-16D17 Ambient Light & Proximity Sensor
+
+maintainers:
+ - Chao Zeng <[email protected]>
+
+description: |
+ This sensor uses standard I2C interface. Interrupt function is not covered
+
+properties:
+ compatible:
+ enum:
+ - everlight,pm16d17
+
+ reg:
+ maxItems: 1
+
+ ps-gain:
+ description: Receiver gain of proximity sensor
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [1, 2, 4, 8]
+ default: 1
+
+ ps-itime:
+ description: Conversion time for proximity sensor [ms]
+ $ref: /schemas/types.yaml#/definitions/string
+ enum:
+ - "0.4"
+ - "0.8"
+ - "1.6"
+ - "3.2"
+ - "6.3"
+ - "12.6"
+ - "25.2"
+ default: "0.4"
+
+ ps-wtime:
+ description: Waiting time for proximity sensor [ms]
+ $ref: /schemas/types.yaml#/definitions/string
+ enum:
+ - "12.5"
+ - "25"
+ - "50"
+ - "100"
+ - "200"
+ - "400"
+ - "800"
+ - "1600"
+ default: "12.5"
+
+ ps-ir-led-pulse-count:
+ description: IR LED drive pulse count
+ $ref: /schemas/types.yaml#/definitions/uint32
+ minimum: 1
+ maximum: 256
+ default: 1
+
+ ps-offset-cancel:
+ description: |
+ When PS offset cancel function is enabled, the result of subtracting any
+ value specified by the PS offset cancel register from the internal PS
+ output data is written to the PS output data register.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ default: 0
+ maximum: 65535
+
+required:
+ - compatible
+ - reg
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ lightsensor: pm16d17@44 {
+ compatible = "everlight,pm16d17";
+ reg = <0x44>;
+
+ ps-gain = <1>;
+ ps-itime = "0.4";
+ ps-wtime = "12.5";
+ ps-ir-led-pulse-count = <1>;
+ ps-offset-cancel = <280>;
+ };
+ };
Loading

0 comments on commit 5eae23f

Please sign in to comment.