2019-02-28 21:50:58

by r yang

[permalink] [raw]
Subject: [PATCH 0/3] Add device tree support for kxcjk1013 accelerometer

- Add a vendor prefix for Kionix Inc. to device tree bindings.
There is already one other Kionix accelerometer (kxsd9) with device tree
bindings but this vendor prefix hasn't been documented.
- Document the kxcjk1013 device tree bindings.
- Add device tree support for Kionix kxcjk1013 accelerometer sensors.

Robert Yang (3):
dt-bindings: Add vendor prefix for Kionix, Inc.
dt-bindings: iio: accel: kxcjk1013: Add device tree binding
documentation
iio: accel: kxcjk1013: Add device tree support

.../bindings/iio/accel/kionix,kxcjk1013.txt | 18 ++++++++++++++++++
.../devicetree/bindings/vendor-prefixes.txt | 1 +
drivers/iio/accel/kxcjk-1013.c | 11 +++++++++++
3 files changed, 30 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt

--
2.17.1



2019-02-28 21:52:42

by r yang

[permalink] [raw]
Subject: [PATCH 1/3] dt-bindings: Add vendor prefix for Kionix, Inc.

Kionix manufactured MEMs sensors. There are Kionix acceleromoter sensor
drivers which can be used with device tree.

Signed-off-by: Robert Yang <[email protected]>
---
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 01732c887521..e28583ebe5e8 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -208,6 +208,7 @@ kiebackpeter Kieback & Peter GmbH
kinetic Kinetic Technologies
kingdisplay King & Display Technology Co., Ltd.
kingnovel Kingnovel Technology Co., Ltd.
+kionix Kionix, Inc.
koe Kaohsiung Opto-Electronics Inc.
kosagi Sutajio Ko-Usagi PTE Ltd.
kyo Kyocera Corporation
--
2.17.1


2019-02-28 21:53:08

by r yang

[permalink] [raw]
Subject: [PATCH 3/3] iio: accel: kxcjk1013: Add device tree support

Add device tree support for kxcjk-1013 accelerometer sensors.

Signed-off-by: Robert Yang <[email protected]>
---
drivers/iio/accel/kxcjk-1013.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/iio/accel/kxcjk-1013.c b/drivers/iio/accel/kxcjk-1013.c
index 7096e577b23f..e7a00743cdcb 100644
--- a/drivers/iio/accel/kxcjk-1013.c
+++ b/drivers/iio/accel/kxcjk-1013.c
@@ -1510,10 +1510,21 @@ static const struct i2c_device_id kxcjk1013_id[] = {

MODULE_DEVICE_TABLE(i2c, kxcjk1013_id);

+static const struct of_device_id kxcjk1013_of_match[] = {
+ { .compatible = "kionix,kxcjk1013", },
+ { .compatible = "kionix,kxcj91008", },
+ { .compatible = "kionix,kxtj21009", },
+ { .compatible = "kionix,kxtf9", },
+ { .compatible = "kionix,SMO8500", },
+ { }
+};
+MODULE_DEVICE_TABLE(of, kxcjk1013_of_match);
+
static struct i2c_driver kxcjk1013_driver = {
.driver = {
.name = KXCJK1013_DRV_NAME,
.acpi_match_table = ACPI_PTR(kx_acpi_match),
+ .of_match_table = of_match_ptr(kxcjk1013_of_match),
.pm = &kxcjk1013_pm_ops,
},
.probe = kxcjk1013_probe,
--
2.17.1


2019-02-28 21:53:38

by r yang

[permalink] [raw]
Subject: [PATCH 2/3] dt-bindings: iio: accel: kxcjk1013: Add device tree binding documentation

Document device tree bindings for Kionix KXCJK-1013 Accelerometer driver.

Signed-off-by: Robert Yang <[email protected]>
---
.../bindings/iio/accel/kionix,kxcjk1013.txt | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
create mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt

diff --git a/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt b/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
new file mode 100644
index 000000000000..521c53799bc5
--- /dev/null
+++ b/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
@@ -0,0 +1,18 @@
+Kionix KXCJK-1013 Accelerometer device tree bindings
+
+Required properties:
+
+- compatible: Must be one of:
+ "kionix,kxcjk1013"
+ "kionix,kxcj91008"
+ "kionix,kxtj21009"
+ "kionix,kxtf9"
+ "kionix,SMO8500"
+ - reg: i2c slave address
+
+Example:
+
+kxtf9@f {
+ compatible = "kionix,kxtf9";
+ reg = <0x0F>;
+};
--
2.17.1


2019-03-02 18:57:16

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 2/3] dt-bindings: iio: accel: kxcjk1013: Add device tree binding documentation

On Thu, 28 Feb 2019 15:18:10 -0500
Robert Yang <[email protected]> wrote:

> Document device tree bindings for Kionix KXCJK-1013 Accelerometer driver.
>
> Signed-off-by: Robert Yang <[email protected]>
Hi Robert,

Thanks for this. One comment inline.

Jonathan

> ---
> .../bindings/iio/accel/kionix,kxcjk1013.txt | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
>
> diff --git a/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt b/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
> new file mode 100644
> index 000000000000..521c53799bc5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
> @@ -0,0 +1,18 @@
> +Kionix KXCJK-1013 Accelerometer device tree bindings
> +
> +Required properties:
> +
> +- compatible: Must be one of:
> + "kionix,kxcjk1013"
> + "kionix,kxcj91008"
> + "kionix,kxtj21009"
> + "kionix,kxtf9"
> + "kionix,SMO8500"
This looks like an ACPI binding rather than a device name. So
I'd drop this last one.

> + - reg: i2c slave address
> +
> +Example:
> +
> +kxtf9@f {
> + compatible = "kionix,kxtf9";
> + reg = <0x0F>;
> +};