/* Write bytes to SDIO fifo. 
Writes bytes to SDIO register, treating it as a fifo. Writes will all be done to same address.  */
int sdio_write_fifo(struct sdio_func *func, uint32_t reg, uint8_t *data, uint32_t len)
/* Write bytes to SDIO fifo. 
Writes bytes to SDIO register, treating it as a fifo. Writes will all be done to same address.  */
int sdio_write_fifo(struct sdio_func *func, uint32_t reg, uint8_t *data, uint32_t len)
{
	int ret;
	if ((func->card->type != CARD_SDIO) && (func->card->type != CARD_COMBO)) {
		LOG_WRN("Card does not support SDIO commands");
		return -ENOTSUP;
	}
	ret = k_mutex_lock(&func->card->lock, K_MSEC(CONFIG_SD_DATA_TIMEOUT));
	if (ret) {
		LOG_WRN("Could not get SD card mutex");
		return -EBUSY;
	}
	ret = sdio_io_rw_extended_helper(func, SDIO_IO_WRITE, reg, false,
		data, len);
	k_mutex_unlock(&func->card->lock);
	return ret;
}