From 0034ebe6ee3151e5c54fd13c6f441429bd2cdadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Thu, 8 Feb 2018 13:48:09 -0300 Subject: sdhci: implement UHS-I voltage switch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [based on a patch from Alistair Francis from qemu/xilinx tag xilinx-v2015.2] Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20180208164818.7961-22-f4bug@amsat.org> --- hw/sd/core.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'hw/sd/core.c') diff --git a/hw/sd/core.c b/hw/sd/core.c index 498284f109..6d198ea775 100644 --- a/hw/sd/core.c +++ b/hw/sd/core.c @@ -41,6 +41,19 @@ static SDState *get_card(SDBus *sdbus) return SD_CARD(kid->child); } +void sdbus_set_voltage(SDBus *sdbus, uint16_t millivolts) +{ + SDState *card = get_card(sdbus); + + trace_sdbus_set_voltage(sdbus_name(sdbus), millivolts); + if (card) { + SDCardClass *sc = SD_CARD_GET_CLASS(card); + + assert(sc->set_voltage); + sc->set_voltage(card, millivolts); + } +} + int sdbus_do_command(SDBus *sdbus, SDRequest *req, uint8_t *response) { SDState *card = get_card(sdbus); -- cgit v1.2.3