Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion boards/shields/x_nucleo_iks01a2/x_nucleo_iks01a2.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
};

lsm303agr-magn@1e {
compatible = "st,lis2mdl-magn","st,lsm303agr-magn";
compatible = "st,lis2mdl","st,lsm303agr-magn";
reg = <0x1e>;
label = "LSM303AGR-MAGN";
irq-gpios = <&arduino_header 3 0>; /* A3 */
Expand Down
2 changes: 1 addition & 1 deletion boards/shields/x_nucleo_iks01a3/x_nucleo_iks01a3.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
};

lis2mdl@1e {
compatible = "st,lis2mdl-magn";
compatible = "st,lis2mdl";
reg = <0x1e>;
label = "LIS2MDL";
};
Expand Down
10 changes: 5 additions & 5 deletions drivers/sensor/lis2mdl/lis2mdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ static int lis2mdl_init_interface(struct device *dev)
}

static const struct lis2mdl_device_config lis2mdl_dev_config = {
.master_dev_name = DT_INST_0_ST_LIS2MDL_MAGN_BUS_NAME,
.master_dev_name = DT_INST_0_ST_LIS2MDL_BUS_NAME,
#ifdef CONFIG_LIS2MDL_TRIGGER
.gpio_name = DT_INST_0_ST_LIS2MDL_MAGN_IRQ_GPIOS_CONTROLLER,
.gpio_pin = DT_INST_0_ST_LIS2MDL_MAGN_IRQ_GPIOS_PIN,
.gpio_name = DT_INST_0_ST_LIS2MDL_IRQ_GPIOS_CONTROLLER,
.gpio_pin = DT_INST_0_ST_LIS2MDL_IRQ_GPIOS_PIN,
#endif /* CONFIG_LIS2MDL_TRIGGER */
.i2c_addr_config = DT_INST_0_ST_LIS2MDL_MAGN_BASE_ADDRESS,
.i2c_addr_config = DT_INST_0_ST_LIS2MDL_BASE_ADDRESS,
};

static int lis2mdl_init(struct device *dev)
Expand Down Expand Up @@ -374,6 +374,6 @@ static int lis2mdl_init(struct device *dev)
return 0;
}

DEVICE_AND_API_INIT(lis2mdl, DT_INST_0_ST_LIS2MDL_MAGN_LABEL, lis2mdl_init,
DEVICE_AND_API_INIT(lis2mdl, DT_INST_0_ST_LIS2MDL_LABEL, lis2mdl_init,
&lis2mdl_device_data, &lis2mdl_dev_config, POST_KERNEL,
CONFIG_SENSOR_INIT_PRIORITY, &lis2mdl_driver_api);
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Copyright (c) 2018 STMicroelectronics
# SPDX-License-Identifier: Apache-2.0

title: STMicroelectronics MEMS sensors LIS2MDL
title: STMicroelectronics MEMS sensors LIS2MDL I2C

description: >
This binding gives a base representation of LIS2MDL magnetometer
accessed through I2C bus

compatible: "st,lis2mdl-magn"
compatible: "st,lis2mdl"

include: i2c-device.yaml

Expand Down
17 changes: 17 additions & 0 deletions dts/bindings/sensor/st,lis2mdl-spi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2019 STMicroelectronics
# SPDX-License-Identifier: Apache-2.0

title: STMicroelectronics MEMS sensors LIS2MDL SPI

description: >
This binding gives a base representation of LIS2MDL magnetometer
accessed through SPI bus

compatible: "st,lis2mdl"

include: spi-device.yaml

properties:
irq-gpios:
type: phandle-array
required: false
2 changes: 1 addition & 1 deletion samples/shields/x_nucleo_iks01a2/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main(void)
struct device *lps22hb = device_get_binding(DT_INST_0_ST_LPS22HB_PRESS_LABEL);
struct device *lsm6dsl = device_get_binding(DT_INST_0_ST_LSM6DSL_LABEL);
struct device *lsm303agr_a = device_get_binding(DT_INST_0_ST_LIS2DH_LABEL);
struct device *lsm303agr_m = device_get_binding(DT_INST_0_ST_LIS2MDL_MAGN_LABEL);
struct device *lsm303agr_m = device_get_binding(DT_INST_0_ST_LIS2MDL_LABEL);

if (hts221 == NULL) {
printf("Could not get HTS221 device\n");
Expand Down
2 changes: 1 addition & 1 deletion samples/shields/x_nucleo_iks01a3/standard/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ void main(void)
struct device *hts221 = device_get_binding(DT_INST_0_ST_HTS221_LABEL);
struct device *lps22hh = device_get_binding(DT_INST_0_ST_LPS22HH_LABEL);
struct device *stts751 = device_get_binding(DT_INST_0_ST_STTS751_LABEL);
struct device *lis2mdl = device_get_binding(DT_INST_0_ST_LIS2MDL_MAGN_LABEL);
struct device *lis2mdl = device_get_binding(DT_INST_0_ST_LIS2MDL_LABEL);
struct device *lis2dw12 = device_get_binding(DT_INST_0_ST_LIS2DW12_LABEL);
struct device *lsm6dso = device_get_binding(DT_INST_0_ST_LSM6DSO_LABEL);
int cnt = 1;
Expand Down
12 changes: 6 additions & 6 deletions tests/drivers/build_all/dts_fixup.h
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@
#define DT_ST_LIS2DS12_BUS_I2C 1
#endif

#ifndef DT_INST_0_ST_LIS2MDL_MAGN_LABEL
#define DT_INST_0_ST_LIS2MDL_MAGN_LABEL ""
#define DT_INST_0_ST_LIS2MDL_MAGN_BUS_NAME ""
#define DT_INST_0_ST_LIS2MDL_MAGN_BASE_ADDRESS 0x19
#define DT_INST_0_ST_LIS2MDL_MAGN_IRQ_GPIOS_CONTROLLER ""
#define DT_INST_0_ST_LIS2MDL_MAGN_IRQ_GPIOS_PIN 0
#ifndef DT_INST_0_ST_LIS2MDL_LABEL
#define DT_INST_0_ST_LIS2MDL_LABEL ""
#define DT_INST_0_ST_LIS2MDL_BUS_NAME ""
#define DT_INST_0_ST_LIS2MDL_BASE_ADDRESS 0x19
#define DT_INST_0_ST_LIS2MDL_IRQ_GPIOS_CONTROLLER ""
#define DT_INST_0_ST_LIS2MDL_IRQ_GPIOS_PIN 0
#endif

#ifndef DT_INST_0_ST_LIS2DW12_LABEL
Expand Down