Skip to content

Commit 30f88d8

Browse files
JordanYateskartben
authored andcommitted
sdhc: sdhc_spi: additional SPI PM calls
`sdhc_spi_card_busy` requires additional PM calls to ensure the bus is enabled in the API call. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent 43013e4 commit 30f88d8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/sdhc/sdhc_spi.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,13 @@ static int sdhc_spi_card_busy(const struct device *dev)
183183
int ret;
184184
uint8_t response;
185185

186+
/* Request SPI bus to be active */
187+
if (pm_device_runtime_get(config->spi_dev) < 0) {
188+
return -EIO;
189+
}
186190

187191
ret = sdhc_spi_rx(config->spi_dev, data->spi_cfg, &response, 1);
192+
(void)pm_device_runtime_put(config->spi_dev);
188193
if (ret) {
189194
return -EIO;
190195
}

0 commit comments

Comments
 (0)