Skip to content

Commit ac1ec61

Browse files
committed
include: drivers: spi.h: Get CS delay parameters from DT
The CS delay parameter did not make a distinction between the setup and hold time of the CS, and also did not specify very fine control which can be done usually by a native controller CS. So use the new nanosecond DT properties to get the delay values and make distinction. Signed-off-by: Declan Snyder <[email protected]>
1 parent 8649ce8 commit ac1ec61

File tree

155 files changed

+271
-254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+271
-254
lines changed

drivers/adc/adc_ad405x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ static DEVICE_API(adc, ad405x_api_funcs) = {
929929
#define AD405X_INIT(t, n) \
930930
static struct adc_ad405x_data ad##t##_data_##n = {}; \
931931
static const struct adc_ad405x_config ad##t##_config_##n = { \
932-
.bus = {.spi = SPI_DT_SPEC_GET(DT_INST_AD405X(n, t), AD405X_SPI_CFG, 0)}, \
932+
.bus = {.spi = SPI_DT_SPEC_GET(DT_INST_AD405X(n, t), AD405X_SPI_CFG)}, \
933933
.conversion = GPIO_DT_SPEC_GET_BY_IDX(DT_INST_AD405X(n, t), conversion_gpios, 0),\
934934
IF_ENABLED(CONFIG_AD405X_TRIGGER, (AD405X_GPIO(t, n))) \
935935
.chip_id = t, \

drivers/adc/adc_ad4114.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ static DEVICE_API(adc, adc_ad4114_api) = {
440440
#define ADC_AD4114_DEVICE(inst) \
441441
static struct adc_ad4114_data adc_ad4114_data_##inst; \
442442
static const struct adc_ad4114_config adc_ad4114_config_##inst = { \
443-
.spi = SPI_DT_SPEC_INST_GET(inst, SPI_WORD_SET(8), 0), \
443+
.spi = SPI_DT_SPEC_INST_GET(inst, SPI_WORD_SET(8)), \
444444
.resolution = AD4114_ADC_RESOLUTION, \
445445
.map_input = DT_INST_PROP(inst, map_inputs), \
446446
}; \

drivers/adc/adc_ad4130.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,8 +1051,7 @@ static DEVICE_API(adc, adc_ad4130_driver_api) = {
10511051
#define AD4130_ADC_INIT(inst) \
10521052
static const struct ad4130_config ad4130_config_##inst = { \
10531053
.bus = SPI_DT_SPEC_GET(DT_INST(inst, adi_ad4130_adc), \
1054-
SPI_OP_MODE_MASTER | SPI_WORD_SET(8) | SPI_TRANSFER_MSB, \
1055-
1), \
1054+
SPI_OP_MODE_MASTER | SPI_WORD_SET(8) | SPI_TRANSFER_MSB), \
10561055
.resolution = AD4130_ADC_RESOLUTION, \
10571056
.bipolar = DT_INST_PROP_OR(inst, bipolar, 1), \
10581057
.int_ref = DT_INST_PROP_OR(inst, internal_reference_value, 0), \

drivers/adc/adc_ad7124.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1437,7 +1437,7 @@ static DEVICE_API(adc, adc_ad7124_api) = {
14371437
static const struct adc_ad7124_config adc_ad7124_config##inst = { \
14381438
.bus = SPI_DT_SPEC_INST_GET( \
14391439
inst, \
1440-
SPI_OP_MODE_MASTER | SPI_MODE_CPOL | SPI_MODE_CPHA | SPI_WORD_SET(8), 0), \
1440+
SPI_OP_MODE_MASTER | SPI_MODE_CPOL | SPI_MODE_CPHA | SPI_WORD_SET(8)), \
14411441
.resolution = AD7124_RESOLUTION, \
14421442
.filter_type_mask = DT_INST_PROP(inst, filter_type_mask), \
14431443
.bipolar_mask = DT_INST_PROP(inst, bipolar_mask), \

drivers/adc/adc_ads131m02.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ static int ads131m02_init(const struct device *dev)
721721
static const struct ads131m02_config config_##n = { \
722722
.spi = SPI_DT_SPEC_INST_GET( \
723723
n, SPI_OP_MODE_MASTER | SPI_MODE_CPHA | \
724-
SPI_WORD_SET(8), 0), \
724+
SPI_WORD_SET(8)), \
725725
.gpio_drdy = GPIO_DT_SPEC_INST_GET(n, drdy_gpios), \
726726
}; \
727727
static struct ads131m02_data data_##n; \

drivers/adc/adc_ads1x4s0x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ BUILD_ASSERT(CONFIG_ADC_INIT_PRIORITY > CONFIG_SPI_INIT_PRIORITY,
15761576
) \
15771577
static const struct ads1x4s0x_config config_##name##_##n = { \
15781578
.bus = SPI_DT_SPEC_INST_GET( \
1579-
n, SPI_OP_MODE_MASTER | SPI_MODE_CPHA | SPI_WORD_SET(8), 0), \
1579+
n, SPI_OP_MODE_MASTER | SPI_MODE_CPHA | SPI_WORD_SET(8)), \
15801580
IF_ENABLED(CONFIG_ADC_ASYNC, (.stack = thread_stack_##name##_##n,)) \
15811581
.gpio_reset = GPIO_DT_SPEC_INST_GET_OR(n, reset_gpios, {0}), \
15821582
.gpio_data_ready = GPIO_DT_SPEC_INST_GET(n, drdy_gpios), \

drivers/adc/adc_ads7052.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static DEVICE_API(adc, ads7052_api) = {
298298
#define ADC_ADS7052_INIT(n) \
299299
\
300300
static const struct ads7052_config ads7052_cfg_##n = { \
301-
.bus = SPI_DT_SPEC_INST_GET(n, ADC_ADS7052_SPI_CFG, 1U), \
301+
.bus = SPI_DT_SPEC_INST_GET(n, ADC_ADS7052_SPI_CFG), \
302302
.channels = 1, \
303303
}; \
304304
\

drivers/adc/adc_lmp90xxx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ static DEVICE_API(adc, lmp90xxx_adc_api) = {
10651065
}; \
10661066
static const struct lmp90xxx_config lmp##t##_config_##n = { \
10671067
.bus = SPI_DT_SPEC_GET(DT_INST_LMP90XXX(n, t), SPI_OP_MODE_MASTER | \
1068-
SPI_TRANSFER_MSB | SPI_WORD_SET(8), 0), \
1068+
SPI_TRANSFER_MSB | SPI_WORD_SET(8)), \
10691069
.drdyb = GPIO_DT_SPEC_GET_OR(DT_INST_LMP90XXX(n, t), drdyb_gpios, {0}), \
10701070
.rtd_current = LMP90XXX_UAMPS_TO_RTD_CUR_SEL( \
10711071
DT_PROP_OR(DT_INST_LMP90XXX(n, t), rtd_current, 0)), \

drivers/adc/adc_max11102_17.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ BUILD_ASSERT(CONFIG_ADC_INIT_PRIORITY > CONFIG_SPI_INIT_PRIORITY,
405405
static const struct max11102_17_config config_##name##_##index = { \
406406
.bus = SPI_DT_SPEC_INST_GET( \
407407
index, \
408-
SPI_OP_MODE_MASTER | SPI_MODE_CPOL | SPI_MODE_CPHA | SPI_WORD_SET(8), 0), \
408+
SPI_OP_MODE_MASTER | SPI_MODE_CPOL | SPI_MODE_CPHA | SPI_WORD_SET(8)), \
409409
.gpio_chsel = GPIO_DT_SPEC_INST_GET_OR(index, chsel_gpios, {0}), \
410410
.resolution = res, \
411411
.channel_count = channels, \

drivers/adc/adc_max1125x.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,8 +787,7 @@ static DEVICE_API(adc, max1125x_api) = {
787787
#define MAX1125X_INIT(t, n, odr_delay_us, res, mux, pgab) \
788788
static const struct max1125x_config max##t##_cfg_##n = { \
789789
.bus = SPI_DT_SPEC_GET(DT_INST_MAX1125X(n, t), \
790-
SPI_OP_MODE_MASTER | SPI_WORD_SET(8) | SPI_TRANSFER_MSB, \
791-
1), \
790+
SPI_OP_MODE_MASTER | SPI_WORD_SET(8) | SPI_TRANSFER_MSB), \
792791
.odr_delay = odr_delay_us, \
793792
.resolution = res, \
794793
.multiplexer = mux, \

0 commit comments

Comments
 (0)