[OpenBIOS] r415 - dev/geode/ac97

svn at openbios.org svn at openbios.org
Wed May 23 02:07:02 CEST 2007


Author: wmb
Date: 2007-05-23 02:07:01 +0200 (Wed, 23 May 2007)
New Revision: 415

Modified:
   dev/geode/ac97/ac97.fth
Log:
OLPC audio - driver tweaks to deal with the MIC bias being turned off by early startup code.


Modified: dev/geode/ac97/ac97.fth
===================================================================
--- dev/geode/ac97/ac97.fth	2007-05-22 22:53:34 UTC (rev 414)
+++ dev/geode/ac97/ac97.fth	2007-05-23 00:07:01 UTC (rev 415)
@@ -211,17 +211,7 @@
 
 : set-sample-rate  ( hz -- )  to sample-rate  ;
 
-: open-in  ( -- )
-   sample-rate d# 1000 / to s/ms   ( hz )
-   sample-rate  h# 32 codec!
-   0 set-record-gain
-   mic+0db
-   mic-input
-;
 : amp-default-on?  ( -- flag )  " gx?" eval  ;
-: close-in  ( -- )
-\   h# 8000 set-record-gain		\ mute
-;
 : codec-set  ( bitmask reg# -- )  dup >r codec@ or  r> codec!  ;
 : codec-clr  ( bitmask reg# -- )  dup >r codec@ swap invert and  r> codec!  ;
 : amplifier-on   ( -- )
@@ -240,7 +230,6 @@
 : open-out  ( -- )
    amplifier-on
    disable-playback
-   h# 010 h# 76 codec!            \ Route mixer out to headphones, unlock sample rate
    sample-rate d# 1000 / to s/ms
    sample-rate h# 2e codec!       \ Only need to set surround DAC for OLPC
    h# 606 set-pcm-gain            \ Basic PCM Gain - -9 dB, just below clipping
@@ -338,12 +327,26 @@
 : 48khz   ( -- )  d# 48000 set-sample-rate  ;
 : default ( -- )  48khz disable-playback  ;
 
+: open-in  ( -- )
+   sample-rate d# 1000 / to s/ms   ( hz )
+   sample-rate  h# 32 codec!
+   0 set-record-gain
+   vbias-on
+   mic+0db
+   mic-input
+;
+: close-in  ( -- )
+\   h# 8000 set-record-gain		\ mute
+   vbias-off
+;
+
 : open  ( -- ok? )
    map-regs
    codec-ready?  0=  if  false exit  then
    get-device-id
    fatal-error?  if  false exit  then
    default
+   h# 10 h# 76 codec-set      \ Unlock sample rate
    h# 2801  h# 2a codec-set   \ Enable variable rate, power down LFE and center DACs
    parse-args  0=  if  unmap-regs false exit  then
    true




More information about the OpenBIOS mailing list