summaryrefslogtreecommitdiff
path: root/src/drivers/spi
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/spi')
-rw-r--r--src/drivers/spi/spi-generic.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/drivers/spi/spi-generic.c b/src/drivers/spi/spi-generic.c
index 805e17af5a..3ef437c4a7 100644
--- a/src/drivers/spi/spi-generic.c
+++ b/src/drivers/spi/spi-generic.c
@@ -88,6 +88,16 @@ int spi_xfer(const struct spi_slave *slave, const void *dout, size_t bytesout,
return -1;
}
+int spi_get_config(const struct spi_slave *slave, struct spi_cfg *cfg)
+{
+ const struct spi_ctrlr *ctrlr = slave->ctrlr;
+
+ if (ctrlr && ctrlr->get_config)
+ return ctrlr->get_config(slave, cfg);
+
+ return -1;
+}
+
void __attribute__((weak)) spi_init(void)
{
/* Default weak implementation - do nothing. */