* 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
This commit is contained in:
@@ -33,8 +33,6 @@
|
|||||||
#include <MediaDefs.h>
|
#include <MediaDefs.h>
|
||||||
#include "ac97.h"
|
#include "ac97.h"
|
||||||
|
|
||||||
#define REVERSE_EAMP_POLARITY 0
|
|
||||||
|
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
#include "io.h"
|
#include "io.h"
|
||||||
|
|
||||||
@@ -277,12 +275,20 @@ void ad1981b_init(device_config *config)
|
|||||||
|
|
||||||
void default_amp_enable(device_config *config, bool yesno)
|
void default_amp_enable(device_config *config, bool yesno)
|
||||||
{
|
{
|
||||||
|
uint32 id;
|
||||||
LOG(("default_amp_enable\n"));
|
LOG(("default_amp_enable\n"));
|
||||||
LOG(("powerdown register was = %#04x\n",auich_codec_read(config, AC97_POWERDOWN)));
|
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;
|
yesno = !yesno;
|
||||||
LOG(("using reverse eamp polarity\n"));
|
LOG(("using reverse eamp polarity\n"));
|
||||||
#endif
|
}
|
||||||
if (yesno)
|
if (yesno)
|
||||||
auich_codec_write(config, AC97_POWERDOWN, auich_codec_read(config, AC97_POWERDOWN) & ~0x8000); /* switch on (low active) */
|
auich_codec_write(config, AC97_POWERDOWN, auich_codec_read(config, AC97_POWERDOWN) & ~0x8000); /* switch on (low active) */
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -11,13 +11,6 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* 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
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
* ``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));
|
// TRACE(("auich_int(%p)\n", card));
|
||||||
|
|
||||||
sta = auich_reg_read_16(&card->config, AUICH_REG_GLOB_STA);
|
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)) {
|
if (sta & (STA_S0RI | STA_S1RI | STA_S2RI)) {
|
||||||
// ignore and clear resume interrupt(s)
|
// ignore and clear resume interrupt(s)
|
||||||
@@ -422,9 +415,9 @@ auich_int(void *arg)
|
|||||||
|
|
||||||
//TRACE(("interrupt !! %x\n", sta));
|
//TRACE(("interrupt !! %x\n", sta));
|
||||||
|
|
||||||
LIST_FOREACH(stream, &card->streams, next)
|
LIST_FOREACH(stream, &card->streams, next)
|
||||||
if (sta & stream->sta) {
|
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));
|
stream->base + GET_REG_SR(&stream->card->config));
|
||||||
sr &= SR_MASK;
|
sr &= SR_MASK;
|
||||||
|
|
||||||
@@ -436,7 +429,7 @@ auich_int(void *arg)
|
|||||||
if (sr & SR_BCIS) {
|
if (sr & SR_BCIS) {
|
||||||
curblk = auich_stream_curaddr(stream);
|
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);
|
(curblk + 2) % AUICH_DMALIST_MAX);
|
||||||
|
|
||||||
stream->trigblk = (curblk) % stream->blkmod;
|
stream->trigblk = (curblk) % stream->blkmod;
|
||||||
@@ -448,14 +441,14 @@ auich_int(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
auich_reg_write_16(&card->config,
|
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 {
|
} else {
|
||||||
TRACE(("interrupt masked %x, ", card->interrupt_mask));
|
TRACE(("interrupt masked %x, ", card->interrupt_mask));
|
||||||
TRACE(("sta %x\n", sta));
|
TRACE(("sta %x\n", sta));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gotone)
|
if (gotone)
|
||||||
return B_INVOKE_SCHEDULER;
|
return B_INVOKE_SCHEDULER;
|
||||||
|
|
||||||
TRACE(("Got unhandled interrupt\n"));
|
TRACE(("Got unhandled interrupt\n"));
|
||||||
|
|||||||
@@ -11,13 +11,6 @@
|
|||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in the
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
* documentation and/or other materials provided with the distribution.
|
* 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
|
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||||
|
|||||||
Reference in New Issue
Block a user