From fd8a9ae89c51a8ec35b5bb7514c8abac77317160 Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Tue, 16 Jan 2018 07:53:09 -0600 Subject: [PATCH] dts: sensor: Add dts yaml bindings for the fxas21002 sensor Adds dts yaml bindings for the fxas21002 sensor to allow the sensor driver name, i2c driver name, and i2c address to be extracted from dts instead of kconfig. Signed-off-by: Maureen Helm --- drivers/sensor/fxas21002/Kconfig | 5 ++++- dts/bindings/sensor/nxp,fxas21002.yaml | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 dts/bindings/sensor/nxp,fxas21002.yaml diff --git a/drivers/sensor/fxas21002/Kconfig b/drivers/sensor/fxas21002/Kconfig index 2e7f823efaa..59a18fb6a21 100644 --- a/drivers/sensor/fxas21002/Kconfig +++ b/drivers/sensor/fxas21002/Kconfig @@ -14,13 +14,14 @@ menuconfig FXAS21002 if FXAS21002 +if !HAS_DTS_I2C_DEVICE + config FXAS21002_NAME string "Device name" default "FXAS21002" config FXAS21002_I2C_NAME string "I2C device name" - depends on !HAS_DTS_I2C default I2C_0_NAME config FXAS21002_I2C_ADDRESS @@ -31,6 +32,8 @@ config FXAS21002_I2C_ADDRESS The I2C slave address can be configured by the SA0 input pin. This option should usually be set by the board defconfig. +endif # !HAS_DTS_I2C_DEVICE + config FXAS21002_WHOAMI hex "WHOAMI value" range 0x00 0xff diff --git a/dts/bindings/sensor/nxp,fxas21002.yaml b/dts/bindings/sensor/nxp,fxas21002.yaml new file mode 100644 index 00000000000..beaad2a8073 --- /dev/null +++ b/dts/bindings/sensor/nxp,fxas21002.yaml @@ -0,0 +1,21 @@ +# +# Copyright (c) 2018, NXP +# +# SPDX-License-Identifier: Apache-2.0 +# +--- +title: FXAS21002 3-axis gyroscope +id: nxp,fxas21002 +version: 0.1 + +description: > + This is a representation of the FXAS21002 3-axis gyroscope sensor + +inherits: + !include i2c-device.yaml + +properties: + compatible: + constraint: "nxp,fxas21002" + +...