Changeset 25420

Show
Ignore:
Timestamp:
05/10/08 08:44:38 (6 days ago)
Author:
korli
Message:
* synched license terms with current
* minor space cleanup
* support for revert enable amp for known models
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/ac97.c

    r22285 r25420  
    3333#include <MediaDefs.h> 
    3434#include "ac97.h" 
    35  
    36 #define REVERSE_EAMP_POLARITY 0 
    3735 
    3836#include "debug.h" 
     
    278276void default_amp_enable(device_config *config, bool yesno) 
    279277{ 
     278        uint32 id; 
    280279        LOG(("default_amp_enable\n")); 
    281280        LOG(("powerdown register was = %#04x\n",auich_codec_read(config, AC97_POWERDOWN))); 
    282         #if REVERSE_EAMP_POLARITY 
     281        id = (config->subvendor_id << 16) | config->subsystem_id; 
     282        if (id == 0x161f202f 
     283                || id == 0x161f203a 
     284                || id == 0x161f204c 
     285                || id == 0x104d8144 
     286                || id == 0x104d8197 
     287                || id == 0x104d81c0 
     288                || id == 0x104d81c5) { 
    283289                yesno = !yesno; 
    284290                LOG(("using reverse eamp polarity\n")); 
    285         #endif 
     291        } 
    286292        if (yesno) 
    287293                auich_codec_write(config, AC97_POWERDOWN, auich_codec_read(config, AC97_POWERDOWN) & ~0x8000); /* switch on (low active) */ 
  • haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c

    r25418 r25420  
    1212 *    notice, this list of conditions and the following disclaimer in the 
    1313 *    documentation and/or other materials provided with the distribution. 
    14  * 3. All advertising materials mentioning features or use of this software 
    15  *    must display the following acknowledgement: 
    16  *      This product includes software developed by the NetBSD 
    17  *      Foundation, Inc. and its contributors. 
    18  * 4. Neither the name of The NetBSD Foundation nor the names of its 
    19  *    contributors may be used to endorse or promote products derived 
    20  *    from this software without specific prior written permission. 
    2114 * 
    2215 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 
     
    412405         
    413406        sta = auich_reg_read_16(&card->config, AUICH_REG_GLOB_STA); 
    414         if(sta & card->interrupt_mask) { 
     407        if (sta & card->interrupt_mask) { 
    415408                 
    416409                if (sta & (STA_S0RI | STA_S1RI | STA_S2RI)) { 
     
    423416                //TRACE(("interrupt !! %x\n", sta)); 
    424417                 
    425                 LIST_FOREACH(stream, &card->streams, next)  
     418                LIST_FOREACH(stream, &card->streams, next) 
    426419                        if (sta & stream->sta) { 
    427                                 sr = auich_reg_read_16(&card->config,  
     420                                sr = auich_reg_read_16(&card->config, 
    428421                                        stream->base + GET_REG_SR(&stream->card->config)); 
    429422                                sr &= SR_MASK; 
     
    437430                                        curblk = auich_stream_curaddr(stream); 
    438431                                                                         
    439                                         auich_reg_write_8(&card->config, stream->base + AUICH_REG_X_LVI,  
     432                                        auich_reg_write_8(&card->config, stream->base + AUICH_REG_X_LVI, 
    440433                                                (curblk + 2) % AUICH_DMALIST_MAX); 
    441434                                                         
     
    449442                                                                 
    450443                                auich_reg_write_16(&card->config,  
    451                                         stream->base + GET_REG_SR(&stream->card->config), sr);          
     444                                        stream->base + GET_REG_SR(&stream->card->config), sr); 
    452445                        } 
    453446        } else { 
     
    456449        } 
    457450         
    458         if(gotone) 
     451        if (gotone) 
    459452                return B_INVOKE_SCHEDULER; 
    460453 
  • haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h

    r25418 r25420  
    1212 *    notice, this list of conditions and the following disclaimer in the 
    1313 *    documentation and/or other materials provided with the distribution. 
    14  * 3. All advertising materials mentioning features or use of this software 
    15  *    must display the following acknowledgement: 
    16  *      This product includes software developed by the NetBSD 
    17  *      Foundation, Inc. and its contributors. 
    18  * 4. Neither the name of The NetBSD Foundation nor the names of its 
    19  *    contributors may be used to endorse or promote products derived 
    20  *    from this software without specific prior written permission. 
    2114 * 
    2215 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS