Skip to content

Commit 3412c41

Browse files
committed
drivers: mipi-dbi-spi: use the SPI_CS_CONTROL_INIT macro for CS
Remove the delay parameter from the MIPI_DBI_SPI_CONFIG macros and use the SPI_CS_CONTROL_INIT macro to create the SPI CS, which will pull the values for delay and cs_is_gpio from the devicetree This fixes incorrectly trying to use a GPIO CS when there isn't one Signed-off-by: Jeremy Dick <[email protected]>
1 parent 169cf86 commit 3412c41

20 files changed

+39
-45
lines changed

doc/releases/migration-guide-4.3.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ MISC
9393
the ``NRF_ETR`` symbols. Also the driver needs to be explicitly enabled via
9494
:kconfig:option:`DEBUG_DRIVER` as it is no longer built by default.
9595

96+
MIPI-DBI
97+
===
98+
99+
* The macros :c:macro:`MIPI_DBI_SPI_CONFIG_DT` :c:macro:`MIPI_DBI_SPI_CONFIG_DT_INST`,
100+
:c:macro:`MIPI_DBI_CONFIG_DT`, and :c:macro:`MIPI_DBI_CONFIG_DT_INST` have been changed so that
101+
they do not need to be provided a delay parameter anymore. This is because the timing parameters
102+
of a SPI peripheral chip select should now be specified in DT with the
103+
``spi-cs-setup-delay-ns`` and ``spi-cs-hold-delay-ns`` properties.
104+
96105
PWM
97106
===
98107

doc/releases/release-notes-4.3.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ Deprecated APIs and options
6969
:c:macro:`SPI_DT_SPEC_GET`, :c:macro:`SPI_DT_SPEC_INST_GET` is deprecated. Providing a
7070
second argument to :c:macro:`SPI_CS_CONTROL_INIT` is deprecated. Use new DT properties
7171
``spi-cs-setup-delay-ns`` and ``spi-cs-hold-delay-ns`` to specify delay instead.
72+
* Providing a third agument to :c:macro:`MIPI_DBI_SPI_CONFIG_DT`, :c:macro:`MIPI_DBI_SPI_CONFIG_DT_INST`,
73+
:c:macro:`MIPI_DBI_CONFIG_DT`, :c:macro:`MIPI_DBI_CONFIG_DT_INST` is deprecated. Use new DT properties
74+
``spi-cs-setup-delay-ns`` and ``spi-cs-hold-delay-ns`` to specify delay instead.
7275

7376
* :c:enum:`bt_hci_bus` was deprecated as it was not used. :c:macro:`BT_DT_HCI_BUS_GET` should be
7477
used instead.

drivers/display/display_gc9x01x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ static DEVICE_API(display, gc9x01x_api) = {
626626
.mode = MIPI_DBI_MODE_SPI_4WIRE, \
627627
.config = MIPI_DBI_SPI_CONFIG_DT_INST(inst, \
628628
SPI_OP_MODE_MASTER | \
629-
SPI_WORD_SET(8), 0), \
629+
SPI_WORD_SET(8)), \
630630
}, \
631631
.pixel_format = DT_INST_PROP(inst, pixel_format), \
632632
.orientation = DT_INST_ENUM_IDX(inst, orientation), \

drivers/display/display_ili9xxx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,8 +542,7 @@ static const struct ili9xxx_quirks ili9488_quirks = {
542542
.config = MIPI_DBI_SPI_CONFIG_DT( \
543543
INST_DT_ILI9XXX(n, t), \
544544
SPI_OP_MODE_MASTER | \
545-
SPI_WORD_SET(8), \
546-
0), \
545+
SPI_WORD_SET(8)), \
547546
}, \
548547
.pixel_format = DT_PROP(INST_DT_ILI9XXX(n, t), pixel_format), \
549548
.rotation = DT_PROP(INST_DT_ILI9XXX(n, t), rotation), \

drivers/display/display_sh1122.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ static DEVICE_API(display, sh1122_driver_api) = {
485485
static const struct sh1122_config config##node_id = { \
486486
.mipi_dev = DEVICE_DT_GET(DT_PARENT(node_id)), \
487487
.dbi_config = MIPI_DBI_CONFIG_DT( \
488-
node_id, SH1122_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER, 0), \
488+
node_id, SH1122_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER), \
489489
.height = DT_PROP(node_id, height), \
490490
.width = DT_PROP(node_id, width), \
491491
.oscillator_freq = DT_PROP(node_id, oscillator_freq), \

drivers/display/display_ssd1320.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ static DEVICE_API(display, ssd1320_driver_api) = {
522522
static const struct ssd1320_config config##node_id = { \
523523
.mipi_dev = DEVICE_DT_GET(DT_PARENT(node_id)), \
524524
.dbi_config = MIPI_DBI_CONFIG_DT( \
525-
node_id, SSD1320_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER, 0), \
525+
node_id, SSD1320_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER), \
526526
.height = DT_PROP(node_id, height), \
527527
.width = DT_PROP(node_id, width), \
528528
.oscillator_freq = DT_PROP(node_id, oscillator_freq), \

drivers/display/display_ssd1331.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ static DEVICE_API(display, ssd1331_driver_api) = {
348348
static const struct ssd1331_config config##node_id = { \
349349
.mipi_dev = DEVICE_DT_GET(DT_PARENT(node_id)), \
350350
.dbi_config = MIPI_DBI_CONFIG_DT( \
351-
node_id, SSD1331_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER, 0), \
351+
node_id, SSD1331_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER), \
352352
.height = DT_PROP(node_id, height), \
353353
.width = DT_PROP(node_id, width), \
354354
.display_offset = DT_PROP(node_id, display_offset), \

drivers/display/display_ssd135x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ static DEVICE_API(display, ssd135x_driver_api) = {
335335
static const struct ssd135x_config config##node_id = { \
336336
.mipi_dev = DEVICE_DT_GET(DT_PARENT(node_id)), \
337337
.dbi_config = MIPI_DBI_CONFIG_DT( \
338-
node_id, SSD135X_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER, 0), \
338+
node_id, SSD135X_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER), \
339339
.height = DT_PROP(node_id, height), \
340340
.width = DT_PROP(node_id, width), \
341341
.display_offset = DT_PROP(node_id, display_offset), \

drivers/display/display_ssd1363.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ static DEVICE_API(display, ssd1363_driver_api) = {
508508
static const struct ssd1363_config config##node_id = { \
509509
.mipi_dev = DEVICE_DT_GET(DT_PARENT(node_id)), \
510510
.dbi_config = MIPI_DBI_CONFIG_DT( \
511-
node_id, SSD1363_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER, 0), \
511+
node_id, SSD1363_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER), \
512512
.height = DT_PROP(node_id, height), \
513513
.width = DT_PROP(node_id, width), \
514514
.oscillator_freq = DT_PROP(node_id, oscillator_freq), \

drivers/display/display_st730x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ static const struct st730x_specific st7306_specifics = {
542542
static const struct st730x_config config##node_id = { \
543543
.mipi_dev = DEVICE_DT_GET(DT_PARENT(node_id)), \
544544
.dbi_config = MIPI_DBI_CONFIG_DT( \
545-
node_id, ST730X_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER, 0), \
545+
node_id, ST730X_WORD_SIZE(node_id) | SPI_OP_MODE_MASTER), \
546546
.height = DT_PROP(node_id, height), \
547547
.width = DT_PROP(node_id, width), \
548548
.start_line = DT_PROP(node_id, start_line), \

0 commit comments

Comments
 (0)