qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Evgeny Voevodin <e.voevodin@samsung.com>
To: qemu-devel@nongnu.org
Cc: m.kozlov@samsung.com, Mitsyanko Igor <i.mitsyanko@samsung.com>,
	d.solodkiy@samsung.com, Evgeny Voevodin <e.voevodin@samsung.com>
Subject: [Qemu-devel] [PATCH v3 12/14] hw/sd.c, hw/sd.h: add receive ready query routine to SD/MMC API
Date: Mon, 12 Dec 2011 10:43:24 +0400	[thread overview]
Message-ID: <1323672206-11891-13-git-send-email-e.voevodin@samsung.com> (raw)
In-Reply-To: <1323672206-11891-1-git-send-email-e.voevodin@samsung.com>

From: Mitsyanko Igor <i.mitsyanko@samsung.com>

Data transfer direction between host controller and SD/MMC card is selected by
host controller configuration registers, but whether we actually need or need
not perform data transfer depends on type of last issued command. To avoid
memorization of which type of command host controller issued the last time, we
can use simple query procedures, to make sure that SD/MMC card is in the
right state. The only query routine currently presented in SD/MMC card
emulation is sd_data_ready(), this patch adds sd_receive_ready() routine.

Signed-off-by: Evgeny Voevodin <e.voevodin@samsung.com>
---
 hw/sd.c |    5 +++++
 hw/sd.h |    1 +
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/sd.c b/hw/sd.c
index 10e26ad..b0a8557 100644
--- a/hw/sd.c
+++ b/hw/sd.c
@@ -1670,3 +1670,8 @@ void sd_enable(SDState *sd, int enable)
 {
     sd->enable = enable;
 }
+
+int sd_receive_ready(SDState *sd)
+{
+    return sd->state == sd_receivingdata_state;
+}
diff --git a/hw/sd.h b/hw/sd.h
index ac4b7c4..71ab781 100644
--- a/hw/sd.h
+++ b/hw/sd.h
@@ -75,5 +75,6 @@ uint8_t sd_read_data(SDState *sd);
 void sd_set_cb(SDState *sd, qemu_irq readonly, qemu_irq insert);
 int sd_data_ready(SDState *sd);
 void sd_enable(SDState *sd, int enable);
+int sd_receive_ready(SDState *sd);
 
 #endif	/* __hw_sd_h */
-- 
1.7.4.1

  parent reply	other threads:[~2011-12-12  6:43 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-12  6:43 [Qemu-devel] [PATCH v3 00/14] ARM: Samsung Exynos4210-based boards support Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 01/14] ARM: Samsung exynos4210-based boards emulation Evgeny Voevodin
2011-12-12 22:17   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 02/14] ARM: exynos4210: CMU support Evgeny Voevodin
2011-12-12 22:44   ` Peter Maydell
2011-12-14 12:10     ` Maksim E. Kozlov
2011-12-14 11:43       ` Peter Maydell
2011-12-14 17:08     ` Maksim E. Kozlov
2011-12-14 16:25       ` Peter Maydell
2011-12-15  7:11     ` Dmitry Solodkiy
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 03/14] ARM: exynos4210: UART support Evgeny Voevodin
2011-12-12 22:55   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 04/14] hw/sysbus.h: Increase maximum number of device IRQs Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 05/14] ARM: exynos4210: IRQ subsystem support Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 06/14] ARM: exynos4210: PWM support Evgeny Voevodin
2011-12-13 10:51   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 07/14] hw/arm_boot.c: Add new secondary CPU bootloader Evgeny Voevodin
2011-12-13 11:28   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 08/14] ARM: exynos4210: MCT support Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 09/14] hw/exynos4210.c: Boot secondary CPU Evgeny Voevodin
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 10/14] hw/lan9118: Add basic 16-bit mode support Evgeny Voevodin
2011-12-13 11:54   ` Peter Maydell
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 11/14] hw/exynos4210.c: Add LAN support for SMDKC210 Evgeny Voevodin
2011-12-13 12:01   ` Peter Maydell
2011-12-12  6:43 ` Evgeny Voevodin [this message]
2011-12-13 15:11   ` [Qemu-devel] [PATCH v3 12/14] hw/sd.c, hw/sd.h: add receive ready query routine to SD/MMC API Peter Maydell
2011-12-13 16:22     ` Peter Maydell
2011-12-14  8:29       ` Mitsyanko Igor
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 13/14] ARM: exynos4210: added SD/MMC host controller Evgeny Voevodin
2011-12-13 14:56   ` Peter Maydell
2011-12-13 16:23     ` Mitsyanko Igor
2011-12-12  6:43 ` [Qemu-devel] [PATCH v3 14/14] ARM: exynos4210: added display controller implementation Evgeny Voevodin
2011-12-12  7:22 ` [Qemu-devel] [PATCH v3 00/14] ARM: Samsung Exynos4210-based boards support Stefan Weil
2011-12-13 10:14 ` Peter Maydell
2011-12-13 10:37   ` Dmitry Solodkiy
2011-12-13 10:59     ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323672206-11891-13-git-send-email-e.voevodin@samsung.com \
    --to=e.voevodin@samsung.com \
    --cc=d.solodkiy@samsung.com \
    --cc=i.mitsyanko@samsung.com \
    --cc=m.kozlov@samsung.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).