Skip to content

Commit f97003e

Browse files
myguitarcujomalainey
authored andcommitted
drivers: spi: dw: read ssi component version
Read the Synopsys SSI component version to extend supported capability based on the version. Signed-off-by: Younghyun Park <younghyunpark@google.com>
1 parent 9e3bbe7 commit f97003e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/spi/spi_dw.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,12 @@ int spi_dw_init(const struct device *dev)
575575
write_imr(dev, DW_SPI_IMR_MASK);
576576
clear_bit_ssienr(dev);
577577

578+
/* SSI component version */
579+
spi->version = read_ssi_comp_version(dev);
580+
LOG_DBG("Version: %c.%c%c%c", (spi->version >> 24) & 0xff,
581+
(spi->version >> 16) & 0xff, (spi->version >> 8) & 0xff,
582+
spi->version & 0xff);
583+
578584
LOG_DBG("Designware SPI driver initialized on device: %p", dev);
579585

580586
err = spi_context_cs_configure_all(&spi->ctx);

drivers/spi/spi_dw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ struct spi_dw_config {
4949
struct spi_dw_data {
5050
DEVICE_MMIO_RAM;
5151
struct spi_context ctx;
52+
uint32_t version; /* ssi comp version */
5253
uint8_t dfs; /* dfs in bytes: 1,2 or 4 */
5354
uint8_t fifo_diff; /* cannot be bigger than FIFO depth */
5455
};

0 commit comments

Comments
 (0)