shithub: riscv

Download patch

ref: 4957a42f37d142c15d5758a9f894b59ccddbb663
parent: 62186910fa0c833f8a5716cb83581494adde1b4e
parent: b3ad2a853a4236cdd8f82bf5836df890a724d0f4
author: cinap_lenrek <cinap_lenrek@centraldogma>
date: Wed Jun 29 23:05:50 EDT 2011

merge

--- a/sys/src/9/pc/audiohda.c
+++ b/sys/src/9/pc/audiohda.c
@@ -441,7 +441,7 @@
 		if(csr16(ctlr, Rirbwp) != re){
 			re = (re + 1) % ctlr->rirbsize;
 			memmove(reply, &ctlr->rirb[re*2], 8);
-			return 8;
+			return 1;
 		}
 		microdelay(1);
 	}
@@ -457,8 +457,10 @@
 		q |= (verb << 8) | par;
 	else
 		q |= (verb << 16) | par;
-	if(hdacmd(id.ctlr, q, w) != 8)
+	if(hdacmd(id.ctlr, q, w) != 1)
 		return -1;
+	if(w[1] != id.codec)
+		return -1;
 	*ret = w[0];
 	return 0;
 }
@@ -1299,7 +1301,7 @@
 	lp = a;
 	qlock(ctlr);
 	for(i=0; i<n/4; i++){
-		if(hdacmd(ctlr, lp[i], w) < 0){
+		if(hdacmd(ctlr, lp[i], w) <= 0){
 			w[0] = 0;
 			w[1] = ~0;
 		}