Skip to content

Commit db16853

Browse files
myguitarkartben
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 <[email protected]>
1 parent 0ee0a8d commit db16853

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

drivers/spi/spi_dw.c

+6
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,12 @@ int spi_dw_init(const struct device *dev)
566566
write_imr(dev, DW_SPI_IMR_MASK);
567567
clear_bit_ssienr(dev);
568568

569+
/* SSI component version */
570+
spi->version = read_ssi_comp_version(dev);
571+
LOG_DBG("Version: %c.%c%c%c", (spi->version >> 24) & 0xff,
572+
(spi->version >> 16) & 0xff, (spi->version >> 8) & 0xff,
573+
spi->version & 0xff);
574+
569575
LOG_DBG("Designware SPI driver initialized on device: %p", dev);
570576

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

drivers/spi/spi_dw.h

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct spi_dw_config {
4848
struct spi_dw_data {
4949
DEVICE_MMIO_RAM;
5050
struct spi_context ctx;
51+
uint32_t version; /* ssi comp version */
5152
uint8_t dfs; /* dfs in bytes: 1,2 or 4 */
5253
uint8_t fifo_diff; /* cannot be bigger than FIFO depth */
5354
};

0 commit comments

Comments
 (0)