drivers: sensors: Convert to new DT_INST macros
Convert older DT_INST_ macro use the new include/devicetree.h DT_INST macro APIs. Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
007aa031b5
commit
9872dc16b5
66 changed files with 491 additions and 399 deletions
|
@ -4,6 +4,8 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#define DT_DRV_COMPAT ams_ccs811
|
||||
|
||||
#include <drivers/sensor.h>
|
||||
#include "ccs811.h"
|
||||
|
||||
|
@ -11,7 +13,7 @@
|
|||
#include <logging/log.h>
|
||||
LOG_MODULE_DECLARE(CCS811);
|
||||
|
||||
#define IRQ_PIN DT_INST_0_AMS_CCS811_IRQ_GPIOS_PIN
|
||||
#define IRQ_PIN DT_INST_GPIO_PIN(0, irq_gpios)
|
||||
|
||||
int ccs811_attr_set(struct device *dev,
|
||||
enum sensor_channel chan,
|
||||
|
@ -173,7 +175,7 @@ int ccs811_init_interrupt(struct device *dev)
|
|||
drv_data->dev = dev;
|
||||
|
||||
gpio_pin_configure(drv_data->irq_gpio, IRQ_PIN,
|
||||
GPIO_INPUT | DT_INST_0_AMS_CCS811_IRQ_GPIOS_FLAGS);
|
||||
GPIO_INPUT | DT_INST_GPIO_FLAGS(0, irq_gpios));
|
||||
|
||||
gpio_init_callback(&drv_data->gpio_cb, gpio_callback, BIT(IRQ_PIN));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue