Skip to content

Commit

Permalink
Merge branch 'fix-lis3dh-dts' into 'dev'
Browse files Browse the repository at this point in the history
Fix: LIS3DH DTS support for the akita_gen2 BSP

Closes zephyrproject-rtos#24

See merge request blik/embedded/zephyr!27
  • Loading branch information
frasa committed Jun 26, 2018
2 parents a261bad + 9eff9f7 commit 4825f0f
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 13 deletions.
10 changes: 5 additions & 5 deletions boards/arm/akita_gen2/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,13 @@ endif # SPI
if LIS3DH

config LIS3DH_GPIO_NAME
default GPIO_MCUX_PORTA_NAME
default GPIO_MCUX_PORTC_NAME

config LIS3DH_GPIO_PIN
default 16
config LIS3DH_INT1_GPIO_PIN
default 4

config LIS3DH_DRDY_INT1
def_bool y
config LIS3DH_INT2_GPIO_PIN
default 5

endif # LIS3DH

Expand Down
4 changes: 2 additions & 2 deletions boards/arm/akita_gen2/akita_gen2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
&i2c1 {
status = "ok";

lis3dh@0f {
lis3dh@18 {
compatible = "st,lis3dh";
reg = <0x0f>;
reg = <0x18>;
label = "LIS3DH";
};
};
Expand Down
6 changes: 3 additions & 3 deletions boards/arm/akita_gen2/dts.fixup
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#define CONFIG_LIS3DH_NAME NXP_KINETIS_I2C_40067000_ST_LIS3DH_0F_LABEL
#define CONFIG_LIS3DH_I2C_NAME NXP_KINETIS_I2C_40067000_ST_LIS3DH_0F_BUS_NAME
#define CONFIG_LIS3DH_I2C_ADDRESS NXP_KINETIS_I2C_40067000_ST_LIS3DH_0F_BASE_ADDRESS
#define CONFIG_LIS3DH_NAME NXP_KINETIS_I2C_40067000_ST_LIS3DH_18_LABEL
#define CONFIG_LIS3DH_I2C_MASTER_DEV_NAME NXP_KINETIS_I2C_40067000_ST_LIS3DH_18_BUS_NAME
#define CONFIG_LIS3DH_I2C_ADDR NXP_KINETIS_I2C_40067000_ST_LIS3DH_18_BASE_ADDRESS
14 changes: 14 additions & 0 deletions boards/arm/akita_gen2_devboard/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,18 @@ config FXOS8700_DRDY_INT1

endif # FXOS8700


if LIS3DH

config LIS3DH_GPIO_NAME
default GPIO_MCUX_PORTC_NAME

config LIS3DH_INT1_GPIO_PIN
default 4

config LIS3DH_INT2_GPIO_PIN
default 5

endif # LIS3DH

endif # BOARD_FRDM_KW41Z
6 changes: 6 additions & 0 deletions boards/arm/akita_gen2_devboard/akita_gen2_devboard.dts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
reg = <0x1f>;
label = "FXOS8700";
};

lis3dh@18 {
compatible = "st,lis3dh";
reg = <0x18>;
label = "LIS3DH";
};
};

&lpuart0 {
Expand Down
4 changes: 4 additions & 0 deletions boards/arm/akita_gen2_devboard/dts.fixup
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#define CONFIG_FXOS8700_NAME NXP_KINETIS_I2C_40067000_NXP_FXOS8700_1F_LABEL
#define CONFIG_FXOS8700_I2C_NAME NXP_KINETIS_I2C_40067000_NXP_FXOS8700_1F_BUS_NAME
#define CONFIG_FXOS8700_I2C_ADDRESS NXP_KINETIS_I2C_40067000_NXP_FXOS8700_1F_BASE_ADDRESS

#define CONFIG_LIS3DH_NAME NXP_KINETIS_I2C_40067000_ST_LIS3DH_18_LABEL
#define CONFIG_LIS3DH_I2C_MASTER_DEV_NAME NXP_KINETIS_I2C_40067000_ST_LIS3DH_18_BUS_NAME
#define CONFIG_LIS3DH_I2C_ADDR NXP_KINETIS_I2C_40067000_ST_LIS3DH_18_BASE_ADDRESS
6 changes: 3 additions & 3 deletions drivers/sensor/lis3dh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ config LIS3DH_NAME
string
prompt "Driver name"
default "LIS3DH"
depends on LIS3DH
depends on LIS3DH && !HAS_DTS_I2C_DEVICE
help
Device name with which the LIS3DH sensor is identified.

config LIS3DH_I2C_ADDR
hex
prompt "LIS3DH I2C address"
depends on LIS3DH
depends on LIS3DH && !HAS_DTS_I2C_DEVICE
default 0x18
help
I2C address of the LIS3DH sensor.
Expand All @@ -36,7 +36,7 @@ config LIS3DH_I2C_ADDR
config LIS3DH_I2C_MASTER_DEV_NAME
string
prompt "I2C master where LIS3DH is connected"
depends on LIS3DH
depends on LIS3DH && !HAS_DTS_I2C_DEVICE
default "I2C_0"
help
Specify the device name of the I2C master device to which LIS3DH is
Expand Down
21 changes: 21 additions & 0 deletions dts/bindings/sensor/st,lis3dh.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#
# Copyright (c) 2018, blik GmbH
#
# SPDX-License-Identifier: Apache-2.0
#
---
title: STMicroelectronics MEMS sensors LIS3DH
id: st,lis3dh
version: 0.1

description: >
This binding gives a base representation of LIS3DH magnetometer
inherits:
!include i2c-device.yaml

properties:
compatible:
constraint: "st,lis3dh"

...

0 comments on commit 4825f0f

Please sign in to comment.