From c769a88d4475f648595c6a270d9d0b0f3f7f3740 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Fri, 14 Aug 2020 11:23:40 +0200 Subject: hw/sd: Rename read/write_data() as read/write_byte() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The read/write_data() methods write do a single byte access on the data line of a SD card. Rename them as read/write_byte(). Add some documentation (not in "hw/sd/sdcard_legacy.h" which we are going to remove soon). Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20200814092346.21825-2-f4bug@amsat.org> --- include/hw/sd/sd.h | 19 +++++++++++++++++-- include/hw/sd/sdcard_legacy.h | 4 ++-- 2 files changed, 19 insertions(+), 4 deletions(-) (limited to 'include/hw/sd') diff --git a/include/hw/sd/sd.h b/include/hw/sd/sd.h index 8767ab817c..b58b5a19af 100644 --- a/include/hw/sd/sd.h +++ b/include/hw/sd/sd.h @@ -104,8 +104,23 @@ typedef struct { /*< public >*/ int (*do_command)(SDState *sd, SDRequest *req, uint8_t *response); - void (*write_data)(SDState *sd, uint8_t value); - uint8_t (*read_data)(SDState *sd); + /** + * Write a byte to a SD card. + * @sd: card + * @value: byte to write + * + * Write a byte on the data lines of a SD card. + */ + void (*write_byte)(SDState *sd, uint8_t value); + /** + * Read a byte from a SD card. + * @sd: card + * + * Read a byte from the data lines of a SD card. + * + * Return: byte value read + */ + uint8_t (*read_byte)(SDState *sd); bool (*data_ready)(SDState *sd); void (*set_voltage)(SDState *sd, uint16_t millivolts); uint8_t (*get_dat_lines)(SDState *sd); diff --git a/include/hw/sd/sdcard_legacy.h b/include/hw/sd/sdcard_legacy.h index 8681f8089b..0dc3889555 100644 --- a/include/hw/sd/sdcard_legacy.h +++ b/include/hw/sd/sdcard_legacy.h @@ -34,8 +34,8 @@ /* Legacy functions to be used only by non-qdevified callers */ SDState *sd_init(BlockBackend *blk, bool is_spi); int sd_do_command(SDState *card, SDRequest *request, uint8_t *response); -void sd_write_data(SDState *card, uint8_t value); -uint8_t sd_read_data(SDState *card); +void sd_write_byte(SDState *card, uint8_t value); +uint8_t sd_read_byte(SDState *card); void sd_set_cb(SDState *card, qemu_irq readonly, qemu_irq insert); /* sd_enable should not be used -- it is only used on the nseries boards, -- cgit v1.2.3