drivers: adc: lmp90xxx: do not use generated macros

Do not used generated macro from devicetree subsys directly
in driver.
Remove definition of it's own "FOREACH_STATUS_OKAY".
Redefine "DT_DRV_COMPAT" for each supported compatible string.

Signed-off-by: Aymeric Aillet <aymeric.aillet@iot.bzh>
This commit is contained in:
Aymeric Aillet 2021-12-08 13:35:59 +01:00 committed by Anas Nashif
commit 513389b659

View file

@ -1076,56 +1076,66 @@ static const struct adc_driver_api lmp90xxx_adc_api = {
CONFIG_ADC_INIT_PRIORITY, \
&lmp90xxx_adc_api);
#define LMP90XXX_FOREACH_STATUS_OKAY(compat, fn) \
COND_CODE_1(DT_HAS_COMPAT_STATUS_OKAY(compat), \
(UTIL_CAT(DT_FOREACH_OKAY_INST_, \
compat)(fn)), \
())
/*
* LMP90077: 16 bit, 2 diff/4 se (4 channels), 0 currents
*/
#define LMP90077_INIT(n) LMP90XXX_INIT(90077, n, 16, 4)
LMP90XXX_FOREACH_STATUS_OKAY(ti_lmp90077, LMP90077_INIT)
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT ti_lmp90077
DT_INST_FOREACH_STATUS_OKAY(LMP90077_INIT)
/*
* LMP90078: 16 bit, 2 diff/4 se (4 channels), 2 currents
*/
#define LMP90078_INIT(n) LMP90XXX_INIT(90078, n, 16, 4)
LMP90XXX_FOREACH_STATUS_OKAY(ti_lmp90078, LMP90078_INIT)
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT ti_lmp90078
DT_INST_FOREACH_STATUS_OKAY(LMP90078_INIT)
/*
* LMP90079: 16 bit, 4 diff/7 se (7 channels), 0 currents, has VIN3-5
*/
#define LMP90079_INIT(n) LMP90XXX_INIT(90079, n, 16, 7)
LMP90XXX_FOREACH_STATUS_OKAY(ti_lmp90079, LMP90079_INIT)
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT ti_lmp90079
DT_INST_FOREACH_STATUS_OKAY(LMP90079_INIT)
/*
* LMP90080: 16 bit, 4 diff/7 se (7 channels), 2 currents, has VIN3-5
*/
#define LMP90080_INIT(n) LMP90XXX_INIT(90080, n, 16, 7)
LMP90XXX_FOREACH_STATUS_OKAY(ti_lmp90080, LMP90080_INIT)
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT ti_lmp90080
DT_INST_FOREACH_STATUS_OKAY(LMP90080_INIT)
/*
* LMP90097: 24 bit, 2 diff/4 se (4 channels), 0 currents
*/
#define LMP90097_INIT(n) LMP90XXX_INIT(90097, n, 24, 4)
LMP90XXX_FOREACH_STATUS_OKAY(ti_lmp90097, LMP90097_INIT)
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT ti_lmp90097
DT_INST_FOREACH_STATUS_OKAY(LMP90097_INIT)
/*
* LMP90098: 24 bit, 2 diff/4 se (4 channels), 2 currents
*/
#define LMP90098_INIT(n) LMP90XXX_INIT(90098, n, 24, 4)
LMP90XXX_FOREACH_STATUS_OKAY(ti_lmp90098, LMP90098_INIT)
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT ti_lmp90098
DT_INST_FOREACH_STATUS_OKAY(LMP90098_INIT)
/*
* LMP90099: 24 bit, 4 diff/7 se (7 channels), 0 currents, has VIN3-5
*/
#define LMP90099_INIT(n) LMP90XXX_INIT(90099, n, 24, 7)
LMP90XXX_FOREACH_STATUS_OKAY(ti_lmp90099, LMP90099_INIT)
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT ti_lmp90099
DT_INST_FOREACH_STATUS_OKAY(LMP90099_INIT)
/*
* LMP90100: 24 bit, 4 diff/7 se (7 channels), 2 currents, has VIN3-5
*/
#define LMP90100_INIT(n) LMP90XXX_INIT(90100, n, 24, 7)
LMP90XXX_FOREACH_STATUS_OKAY(ti_lmp90100, LMP90100_INIT)
#undef DT_DRV_COMPAT
#define DT_DRV_COMPAT ti_lmp90100
DT_INST_FOREACH_STATUS_OKAY(LMP90100_INIT)