From 3272810db4c7248d4fffd7a0b5aa16193cff09ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Sat, 10 May 2008 13:44:38 +0000 Subject: [PATCH] * synched license terms with current * minor space cleanup * support for revert enable amp for known models git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25420 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../kernel/drivers/audio/ac97/auich/ac97.c | 14 ++++++++++---- .../kernel/drivers/audio/ac97/auich/auich.c | 19 ++++++------------- .../kernel/drivers/audio/ac97/auich/auich.h | 7 ------- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/add-ons/kernel/drivers/audio/ac97/auich/ac97.c b/src/add-ons/kernel/drivers/audio/ac97/auich/ac97.c index a0803a56da..5a3fc0476e 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/auich/ac97.c +++ b/src/add-ons/kernel/drivers/audio/ac97/auich/ac97.c @@ -33,8 +33,6 @@ #include #include "ac97.h" -#define REVERSE_EAMP_POLARITY 0 - #include "debug.h" #include "io.h" @@ -277,12 +275,20 @@ void ad1981b_init(device_config *config) void default_amp_enable(device_config *config, bool yesno) { + uint32 id; LOG(("default_amp_enable\n")); LOG(("powerdown register was = %#04x\n",auich_codec_read(config, AC97_POWERDOWN))); - #if REVERSE_EAMP_POLARITY + id = (config->subvendor_id << 16) | config->subsystem_id; + if (id == 0x161f202f + || id == 0x161f203a + || id == 0x161f204c + || id == 0x104d8144 + || id == 0x104d8197 + || id == 0x104d81c0 + || id == 0x104d81c5) { yesno = !yesno; LOG(("using reverse eamp polarity\n")); - #endif + } if (yesno) auich_codec_write(config, AC97_POWERDOWN, auich_codec_read(config, AC97_POWERDOWN) & ~0x8000); /* switch on (low active) */ else diff --git a/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c b/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c index 924b585298..dc09d07472 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c +++ b/src/add-ons/kernel/drivers/audio/ac97/auich/auich.c @@ -11,13 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED @@ -411,7 +404,7 @@ auich_int(void *arg) // TRACE(("auich_int(%p)\n", card)); sta = auich_reg_read_16(&card->config, AUICH_REG_GLOB_STA); - if(sta & card->interrupt_mask) { + if (sta & card->interrupt_mask) { if (sta & (STA_S0RI | STA_S1RI | STA_S2RI)) { // ignore and clear resume interrupt(s) @@ -422,9 +415,9 @@ auich_int(void *arg) //TRACE(("interrupt !! %x\n", sta)); - LIST_FOREACH(stream, &card->streams, next) + LIST_FOREACH(stream, &card->streams, next) if (sta & stream->sta) { - sr = auich_reg_read_16(&card->config, + sr = auich_reg_read_16(&card->config, stream->base + GET_REG_SR(&stream->card->config)); sr &= SR_MASK; @@ -436,7 +429,7 @@ auich_int(void *arg) if (sr & SR_BCIS) { curblk = auich_stream_curaddr(stream); - auich_reg_write_8(&card->config, stream->base + AUICH_REG_X_LVI, + auich_reg_write_8(&card->config, stream->base + AUICH_REG_X_LVI, (curblk + 2) % AUICH_DMALIST_MAX); stream->trigblk = (curblk) % stream->blkmod; @@ -448,14 +441,14 @@ auich_int(void *arg) } auich_reg_write_16(&card->config, - stream->base + GET_REG_SR(&stream->card->config), sr); + stream->base + GET_REG_SR(&stream->card->config), sr); } } else { TRACE(("interrupt masked %x, ", card->interrupt_mask)); TRACE(("sta %x\n", sta)); } - if(gotone) + if (gotone) return B_INVOKE_SCHEDULER; TRACE(("Got unhandled interrupt\n")); diff --git a/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h b/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h index 2ca40529ae..9fdc15a55e 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h +++ b/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h @@ -11,13 +11,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED