From: Andrzej Zaborowski <balrogg@gmail.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [4249] Improve audio api use in WM8750.
Date: Thu, 24 Apr 2008 21:01:41 +0000 [thread overview]
Message-ID: <E1Jp8ZZ-0002f6-Ha@cvs.savannah.gnu.org> (raw)
Revision: 4249
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4249
Author: balrog
Date: 2008-04-24 21:01:40 +0000 (Thu, 24 Apr 2008)
Log Message:
-----------
Improve audio api use in WM8750.
These are changes from
http://svn.openmoko.org/trunk/src/host/qemu-neo1973/hw/wm8753.c that I
forgot to push to WM8750. Some were suggested by malc.
Modified Paths:
--------------
trunk/hw/wm8750.c
Modified: trunk/hw/wm8750.c
===================================================================
--- trunk/hw/wm8750.c 2008-04-24 19:21:53 UTC (rev 4248)
+++ trunk/hw/wm8750.c 2008-04-24 21:01:40 UTC (rev 4249)
@@ -55,10 +55,10 @@
static inline void wm8750_out_flush(struct wm8750_s *s)
{
- int sent;
- if (!s->idx_out)
- return;
- sent = AUD_write(*s->out[0], s->data_out, s->idx_out);
+ int sent = 0;
+ while (sent < s->idx_out)
+ sent += AUD_write(*s->out[0], s->data_out + sent, s->idx_out - sent)
+ ?: s->idx_out;
s->idx_out = 0;
}
@@ -67,19 +67,20 @@
struct wm8750_s *s = (struct wm8750_s *) opaque;
s->req_in = avail_b;
s->data_req(s->opaque, s->req_out >> 2, avail_b >> 2);
-
-#if 0
- wm8750_in_load(s);
-#endif
}
static void wm8750_audio_out_cb(void *opaque, int free_b)
{
struct wm8750_s *s = (struct wm8750_s *) opaque;
- s->req_out = free_b;
- s->data_req(s->opaque, free_b >> 2, s->req_in >> 2);
- wm8750_out_flush(s);
+ if (s->idx_out >= free_b) {
+ s->idx_out = free_b;
+ s->req_out = 0;
+ wm8750_out_flush(s);
+ } else
+ s->req_out = free_b - s->idx_out;
+
+ s->data_req(s->opaque, s->req_out >> 2, s->req_in >> 2);
}
struct wm_rate_s {
@@ -121,7 +122,7 @@
{ 512, 24000, 512, 24000 }, /* SR: 11100 */
{ 768, 24000, 768, 24000 }, /* SR: 11101 */
{ 128, 88200, 128, 88200 }, /* SR: 11110 */
- { 192, 88200, 128, 88200 }, /* SR: 11111 */
+ { 192, 88200, 192, 88200 }, /* SR: 11111 */
};
static void wm8750_set_format(struct wm8750_s *s)
@@ -597,6 +598,7 @@
return &s->i2c;
}
+#if 0
static void wm8750_fini(i2c_slave *i2c)
{
struct wm8750_s *s = (struct wm8750_s *) i2c;
@@ -604,6 +606,7 @@
AUD_remove_card(&s->card);
qemu_free(s);
}
+#endif
void wm8750_data_req_set(i2c_slave *i2c,
void (*data_req)(void *, int, int), void *opaque)
next reply other threads:[~2008-04-24 21:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-24 21:01 Andrzej Zaborowski [this message]
2008-04-24 21:30 ` [Qemu-devel] [4249] Improve audio api use in WM8750 Jan Kiszka
2008-04-24 23:34 ` andrzej zaborowski
2008-04-24 23:57 ` Jan Kiszka
2008-04-25 0:09 ` Jan Kiszka
2008-04-25 0:23 ` andrzej zaborowski
2008-04-25 0:45 ` Jan Kiszka
2008-04-25 1:00 ` Jan Kiszka
2008-04-25 1:41 ` andrzej zaborowski
2008-04-25 1:05 ` andrzej zaborowski
2008-04-25 1:10 ` Jan Kiszka
2008-04-25 0:15 ` andrzej zaborowski
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=E1Jp8ZZ-0002f6-Ha@cvs.savannah.gnu.org \
--to=balrogg@gmail.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).