File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -418,8 +418,9 @@ static int tmp108_pm_action(const struct device *dev,
418
418
419
419
return ret ;
420
420
}
421
- #endif
421
+ #endif /* CONFIG_PM_DEVICE */
422
422
423
+ #ifdef CONFIG_PM_DEVICE
423
424
#define TMP108_DEFINE (inst , t ) \
424
425
static struct tmp108_data tmp108_prv_data_##inst##t; \
425
426
static const struct tmp108_config tmp108_config_##inst##t = { \
@@ -437,6 +438,24 @@ static int tmp108_pm_action(const struct device *dev,
437
438
POST_KERNEL, \
438
439
CONFIG_SENSOR_INIT_PRIORITY, \
439
440
&tmp108_driver_api);
441
+ #else
442
+ #define TMP108_DEFINE (inst , t ) \
443
+ static struct tmp108_data tmp108_prv_data_##inst##t; \
444
+ static const struct tmp108_config tmp108_config_##inst##t = { \
445
+ .i2c_spec = I2C_DT_SPEC_INST_GET(inst), \
446
+ .alert_gpio = GPIO_DT_SPEC_INST_GET_OR(inst, \
447
+ alert_gpios, { 0 }),\
448
+ .reg_def = t##_CONF \
449
+ }; \
450
+ SENSOR_DEVICE_DT_INST_DEFINE(inst, \
451
+ &tmp108_init, \
452
+ NULL, \
453
+ &tmp108_prv_data_##inst##t, \
454
+ &tmp108_config_##inst##t, \
455
+ POST_KERNEL, \
456
+ CONFIG_SENSOR_INIT_PRIORITY, \
457
+ &tmp108_driver_api);
458
+ #endif /* CONFIG_PM_DEVICE */
440
459
441
460
#define TMP108_INIT (n ) TMP108_DEFINE(n, TI_TMP108)
442
461
#undef DT_DRV_COMPAT
You can’t perform that action at this time.
0 commit comments