hw/sd: Introduce receive_ready() callback

At present there is a data_ready() callback for the SD data read
path. Let's add a receive_ready() for the SD data write path.

Signed-off-by: Bin Meng <bin.meng@windriver.com>
Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-Id: <20210128063035.15674-5-bmeng.cn@gmail.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
Bin Meng 2021-01-28 14:30:30 +08:00 committed by Philippe Mathieu-Daudé
parent eedb7f249c
commit 995731d3f7
3 changed files with 21 additions and 0 deletions

View file

@ -160,6 +160,19 @@ void sdbus_read_data(SDBus *sdbus, void *buf, size_t length)
}
}
bool sdbus_receive_ready(SDBus *sdbus)
{
SDState *card = get_card(sdbus);
if (card) {
SDCardClass *sc = SD_CARD_GET_CLASS(card);
return sc->receive_ready(card);
}
return false;
}
bool sdbus_data_ready(SDBus *sdbus)
{
SDState *card = get_card(sdbus);