Add device tree support for kxcjk1013 accelerometer
Subsystems (2)
v2 cover 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.
Changelog:
v2: - Remove SMO8500 because it's an ACPI binding.
.../bindings/iio/accel/kionix,kxcjk1013.txt | 17 +++++++++++++++++ .../devicetree/bindings/vendor-prefixes.txt | 1 + drivers/iio/accel/kxcjk-1013.c | 10 ++++++++++ 3 files changed, 28 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
Signature · 1 line
2.17.1
PATCH v2 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.
--- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -210,6 +210,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
Signature · 1 line
2.17.1
Re: [PATCH v2 1/3] dt-bindings: Add vendor prefix for Kionix, Inc.
Quoted 4 lines · On Mon, 4 Mar 2019 10:19:10 -0500 Robert Yang <[email protected]> wrote:
Kionix manufactured MEMs sensors. There are Kionix acceleromoter sensor drivers which can be used with device tree.
Signed-off-by Robert Yang <[email protected]>
I'll apply these now before I forget them but if a DT person wants to comment I won't be pushing out as non rebasing for at least a week so plenty of time!
Applied to the togreg branch of iio.git but pushed out for now as testing for the autobuilders to play with it.
Thanks,
Jonathan
Quoted 16 lines
--- Documentation/devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)Documentation/devicetree/bindings/vendor-prefixes.txt +1
-0@@ -210,6 +210,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
Re: [PATCH v2 1/3] dt-bindings: Add vendor prefix for Kionix, Inc.
In reply to Robert YangQuoted 8 lines · Robert Yang
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(+)
PATCH v2 2/3 dt-bindings: iio: accel: kxcjk1013: Add device tree binding documentation
In reply to Robert YangDocument device tree bindings for Kionix KXCJK-1013 Accelerometer driver.
--- .../bindings/iio/accel/kionix,kxcjk1013.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt new file +17 -0
@@ -0,0 +1,17 @@ +Kionix KXCJK-1013 Accelerometer device tree bindings + +Required properties: + +- compatible: Must be one of: + "kionix,kxcjk1013" + "kionix,kxcj91008" + "kionix,kxtj21009" + "kionix,kxtf9" + - reg: i2c slave address + +Example: + +kxtf9@f { + compatible = "kionix,kxtf9"; + reg = <0x0F>; +};
Signature · 1 line
2.17.1
Jonathan Cameron
maintainerRe: [PATCH v2 2/3] dt-bindings: iio: accel: kxcjk1013: Add device tree binding documentation
Quoted 3 lines · On Mon, 4 Mar 2019 10:19:11 -0500 Robert Yang <[email protected]> wrote:
Document device tree bindings for Kionix KXCJK-1013 Accelerometer driver.
Signed-off-by Robert Yang <[email protected]>
Applied to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.
thanks,
Jonathan
Quoted 28 lines
--- .../bindings/iio/accel/kionix,kxcjk1013.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txtDocumentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt new file +17
-0@@ -0,0 +1,17 @@ +Kionix KXCJK-1013 Accelerometer device tree bindings + +Required properties: + +- compatible: Must be one of: + "kionix,kxcjk1013" + "kionix,kxcj91008" + "kionix,kxtj21009" + "kionix,kxtf9" + - reg: i2c slave address + +Example: + +kxtf9@f { + compatible = "kionix,kxtf9"; + reg = <0x0F>; +};
Re: [PATCH v2 2/3] dt-bindings: iio: accel: kxcjk1013: Add device tree binding documentation
In reply to Robert YangQuoted 8 lines · Robert Yang
Document device tree bindings for Kionix KXCJK-1013 Accelerometer driver.
Signed-off-by Robert Yang <[email protected]>--- .../bindings/iio/accel/kionix,kxcjk1013.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kxcjk1013.txt
PATCH v2 3/3 iio: accel: kxcjk1013: Add device tree support
In reply to Robert YangAdd device tree support for kxcjk-1013 accelerometer sensors.
--- drivers/iio/accel/kxcjk-1013.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/iio/accel/kxcjk-1013.c +10 -0
@@ -1510,10 +1510,20 @@ 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" , }, + { } +}; +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,
Signature · 1 line
2.17.1
Jonathan Cameron
maintainerRe: [PATCH v2 3/3] iio: accel: kxcjk1013: Add device tree support
Quoted 3 lines · On Mon, 4 Mar 2019 10:19:12 -0500 Robert Yang <[email protected]> wrote:
Add device tree support for kxcjk-1013 accelerometer sensors.
Signed-off-by Robert Yang <[email protected]>
One comment below.
Applied with that minor tweak to the togreg branch of iio.git and pushed out as testing for the autobuilders to play with it.
Thanks,
Jonathan
Quoted 16 lines
--- drivers/iio/accel/kxcjk-1013.c | 10 ++++++++++ 1 file changed, 10 insertions(+)drivers/iio/accel/kxcjk-1013.c +4
-0@@ -1510,10 +1510,20 @@ 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" , },
drivers/iio/accel/kxcjk-1013.c static const struct i2c_device_id kxcjk1013_id[] = { · line 1526
Quoted 10 lines
drivers/iio/accel/kxcjk-1013.c +6
-0+ { .compatible = "kionix,kxtf9", }, + { } +}; +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),
Sorry. I'd missed this before, but general preference is to not use of_match_table any more because it stops people using the somewhat odd ACPI object that lets you used dt bindings via ACPI.
I'll drop it.
Quoted 3 lines
drivers/iio/accel/kxcjk-1013.c +0
-0.pm = &kxcjk1013_pm_ops, }, .probe = kxcjk1013_probe,