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 ...@@ -1253,17 +1253,16 @@ static inline int ali_get_free_write_space(struct
{ {
struct dmabuf *dmabuf = &state->dmabuf; struct dmabuf *dmabuf = &state->dmabuf;
int free; int free;
ali_update_ptr(state);
// catch underruns during playback
if (dmabuf->count < 0) { if (dmabuf->count < 0) {
dmabuf->count = 0; dmabuf->count = 0;
dmabuf->swptr = dmabuf->hwptr; dmabuf->swptr = dmabuf->hwptr;
} }
free = dmabuf->dmasize - dmabuf->count; free = dmabuf->dmasize - dmabuf->swptr;
free -= (dmabuf->hwptr % dmabuf->fragsize); if ((dmabuf->count + free) > dmabuf->dmasize){
if (free < 0) free = dmabuf->dmasize - dmabuf->count;
return (0); }
return (free); return free;
} }
static inline int ali_get_available_read_data(struct static inline int ali_get_available_read_data(struct
...@@ -1860,6 +1859,7 @@ static ssize_t ali_write(struct file *file, ...@@ -1860,6 +1859,7 @@ static ssize_t ali_write(struct file *file,
NOTHING we can do to prevent it. */ NOTHING we can do to prevent it. */
/* FIXME - do timeout handling here !! */ /* FIXME - do timeout handling here !! */
schedule_timeout(tmo >= 2 ? tmo : 2);
if (signal_pending(current)) { if (signal_pending(current)) {
if (!ret) 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