Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/arch/macppc/dev Pull up revisions 1.5-1.7 (requeste...



details:   https://anonhg.NetBSD.org/src/rev/1f0ff2cd28e6
branches:  netbsd-1-5
changeset: 490950:1f0ff2cd28e6
user:      he <he%NetBSD.org@localhost>
date:      Thu Mar 22 02:32:01 2001 +0000

description:
Pull up revisions 1.5-1.7 (requested by tsubai):
  Round up block size to at least NBPG bytes.
  Return EINVAL if specified sample rate is not available.
  Fix 16bit ulinear bug, and enable ulinear.

diffstat:

 sys/arch/macppc/dev/awacs.c |  30 ++++++++++++++++++++++++++----
 1 files changed, 26 insertions(+), 4 deletions(-)

diffs (78 lines):

diff -r 82f6b2d0c6c1 -r 1f0ff2cd28e6 sys/arch/macppc/dev/awacs.c
--- a/sys/arch/macppc/dev/awacs.c       Thu Mar 22 02:27:19 2001 +0000
+++ b/sys/arch/macppc/dev/awacs.c       Thu Mar 22 02:32:01 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: awacs.c,v 1.3.2.3 2001/02/26 22:33:15 he Exp $ */
+/*     $NetBSD: awacs.c,v 1.3.2.4 2001/03/22 02:32:01 he Exp $ */
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -373,12 +373,24 @@
                ae->flags = 0;
                return 0;
        case 3:
+               strcpy(ae->name, AudioEulinear_be);
+               ae->encoding = AUDIO_ENCODING_ULINEAR_BE;
+               ae->precision = 16;
+               ae->flags = AUDIO_ENCODINGFLAG_EMULATED;
+               return 0;
+       case 4:
+               strcpy(ae->name, AudioEulinear_le);
+               ae->encoding = AUDIO_ENCODING_ULINEAR_LE;
+               ae->precision = 16;
+               ae->flags = AUDIO_ENCODINGFLAG_EMULATED;
+               return 0;
+       case 5:
                strcpy(ae->name, AudioEmulaw);
                ae->encoding = AUDIO_ENCODING_ULAW;
                ae->precision = 8;
                ae->flags = AUDIO_ENCODINGFLAG_EMULATED;
                return 0;
-       case 4:
+       case 6:
                strcpy(ae->name, AudioEalaw);
                ae->encoding = AUDIO_ENCODING_ALAW;
                ae->precision = 8;
@@ -466,8 +478,14 @@
 
                case AUDIO_ENCODING_ULINEAR_LE:
                        awacs_write_reg(sc, AWACS_BYTE_SWAP, 1);
+                       if (p->channels == 2 && p->precision == 16)
+                               p->sw_code = change_sign16_le;
+                       else
+                               return EINVAL;
+                       break;
+
                case AUDIO_ENCODING_ULINEAR_BE:
-                       if (p->precision == 16)
+                       if (p->channels == 2 && p->precision == 16)
                                p->sw_code = change_sign16_be;
                        else
                                return EINVAL;
@@ -497,7 +515,8 @@
        /* Set the speed */
        rate = p->sample_rate;
 
-       awacs_set_rate(sc, rate);
+       if (awacs_set_rate(sc, rate))
+               return EINVAL;
 
        return 0;
 }
@@ -507,6 +526,8 @@
        void *h;
        int size;
 {
+       if (size < NBPG)
+               size = NBPG;
        return size & ~PGOFSET;
 }
 
@@ -834,6 +855,7 @@
        case 8820:
                c = AWACS_RATE_8820;
                break;
+       case 8000: /* XXX */
        case 7350:
                c = AWACS_RATE_7350;
                break;



Home | Main Index | Thread Index | Old Index