Commit b4a80dac authored by Wei Ni's avatar Wei Ni Committed by Linus Torvalds

[PATCH] Legacy ALi5455 Audio Driver update

We've resolved some bugs in legacy ALi5455 audio driver.
parent a0118f46
......@@ -1253,17 +1253,16 @@ static inline int ali_get_free_write_space(struct
{
struct dmabuf *dmabuf = &state->dmabuf;
int free;
ali_update_ptr(state);
// catch underruns during playback
if (dmabuf->count < 0) {
dmabuf->count = 0;
dmabuf->swptr = dmabuf->hwptr;
}
free = dmabuf->dmasize - dmabuf->swptr;
if ((dmabuf->count + free) > dmabuf->dmasize){
free = dmabuf->dmasize - dmabuf->count;
free -= (dmabuf->hwptr % dmabuf->fragsize);
if (free < 0)
return (0);
return (free);
}
return free;
}
static inline int ali_get_available_read_data(struct
......@@ -1860,6 +1859,7 @@ static ssize_t ali_write(struct file *file,
NOTHING we can do to prevent it. */
/* FIXME - do timeout handling here !! */
schedule_timeout(tmo >= 2 ? tmo : 2);
if (signal_pending(current)) {
if (!ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment