diff --git a/src/add-ons/kernel/drivers/audio/ac97/ich/ac97.c b/src/add-ons/kernel/drivers/audio/ac97/ich/ac97.c index 5bb9f7c219..c0c73bd828 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/ich/ac97.c +++ b/src/add-ons/kernel/drivers/audio/ac97/ich/ac97.c @@ -33,6 +33,8 @@ //#define DEBUG 1 +#define REVERSE_EAMP_POLARITY 0 + #include "debug.h" #include "io.h" @@ -124,6 +126,10 @@ ac97_amp_enable(bool yesno) default: { LOG(("powerdown register was = %#04x\n",ich_codec_read(config->codecoffset + AC97_POWERDOWN))); + #if REVERSE_EAMP_POLARITY + yesno = !yesno; + LOG(("using reverse eamp polarity\n")); + #endif if (yesno) ich_codec_write(config->codecoffset + AC97_POWERDOWN, ich_codec_read(AC97_POWERDOWN) & ~0x8000); /* switch on (low active) */ else diff --git a/src/add-ons/kernel/drivers/audio/ac97/ich/debug.h b/src/add-ons/kernel/drivers/audio/ac97/ich/debug.h index 0922b726ca..31ec330b78 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/ich/debug.h +++ b/src/add-ons/kernel/drivers/audio/ac97/ich/debug.h @@ -39,7 +39,7 @@ * DEBUG == 2, TRACE & LOG, PRINT with snooze() */ #ifndef DEBUG - #define DEBUG 0 + #define DEBUG 1 #endif #undef PRINT diff --git a/src/add-ons/kernel/drivers/audio/ac97/ich/ich.c b/src/add-ons/kernel/drivers/audio/ac97/ich/ich.c index 481033890b..ff59dd9663 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/ich/ich.c +++ b/src/add-ons/kernel/drivers/audio/ac97/ich/ich.c @@ -519,8 +519,8 @@ init_driver(void) ac97_init(); ac97_amp_enable(true); - LOG(("codec vendor id = %#08x\n",ac97_get_vendor_id())); - LOG(("codec descripton = %s\n",ac97_get_vendor_id_description())); + LOG(("codec vendor id = %#08x\n",ac97_get_vendor_id())); + LOG(("codec descripton = %s\n",ac97_get_vendor_id_description())); LOG(("codec 3d enhancement = %s\n",ac97_get_3d_stereo_enhancement())); /* reset all channels */ @@ -546,12 +546,27 @@ init_driver(void) int_thread_id = spawn_kernel_thread(int_thread, "ich_ac97 interrupt poller", B_REAL_TIME_PRIORITY, 0); resume_thread(int_thread_id); } + + LOG(("codec master output = %#04x\n",ich_codec_read(config->codecoffset + 0x02))); + LOG(("codec aux output = %#04x\n",ich_codec_read(config->codecoffset + 0x04))); + LOG(("codec mono output = %#04x\n",ich_codec_read(config->codecoffset + 0x06))); + LOG(("codec pcm output = %#04x\n",ich_codec_read(config->codecoffset + 0x18))); + LOG(("writing codec registers\n")); /* enable master output */ ich_codec_write(config->codecoffset + 0x02, 0x0000); + /* enable aux output */ + ich_codec_write(config->codecoffset + 0x04, 0x0000); + /* enable mono output */ + ich_codec_write(config->codecoffset + 0x06, 0x0000); /* enable pcm output */ ich_codec_write(config->codecoffset + 0x18, 0x0404); + LOG(("codec master output = %#04x\n",ich_codec_read(config->codecoffset + 0x02))); + LOG(("codec aux output = %#04x\n",ich_codec_read(config->codecoffset + 0x04))); + LOG(("codec mono output = %#04x\n",ich_codec_read(config->codecoffset + 0x06))); + LOG(("codec pcm output = %#04x\n",ich_codec_read(config->codecoffset + 0x18))); + #if 0 /* enable pcm input */ ich_codec_write(config->codecoffset + 0x10, 0x0000); diff --git a/src/add-ons/kernel/drivers/audio/ac97/ich/ich.h b/src/add-ons/kernel/drivers/audio/ac97/ich/ich.h index 873be51ddd..cb59ff278f 100644 --- a/src/add-ons/kernel/drivers/audio/ac97/ich/ich.h +++ b/src/add-ons/kernel/drivers/audio/ac97/ich/ich.h @@ -30,7 +30,7 @@ #include "hardware.h" -#define VERSION "Version 1.4, Copyright (c) 2002 Marcus Overhagen, compiled on " ## __DATE__ ## " " ## __TIME__ +#define VERSION "Version 1.5, Copyright (c) 2002 Marcus Overhagen, compiled on " ## __DATE__ ## " " ## __TIME__ #define DRIVER_NAME "ich_ac97" #define BUFFER_SIZE 2048