/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* ADS (Analog Devices) codec extensions.
*/
/*
* TODO:
*
* line-out jack. So far we haven't found which vendors don't
* do that. So we assume that all vendors swap the surr-out
* and the line-out outputs. So we need swap the two outputs.
*
* Historically we internally processed the "ad198x-swap-output"
* property. If someday some vendors do not swap the outputs, we would
* set "ad198x-swap-output = 0" in the driver.conf file, and unload
* and reload the driver (or reboot).
*
* TODO:
*
* Since we don't have access (at present) to any such systems, we have
* not implemented this swapping property. Once we can test it, we will
* add it. This is noted as CR 6819556.
*
* The old code did this:
*
* if (ddi_prop_get_int(DDI_DEV_T_ANY, statep->dip,
* DDI_PROP_DONTPASS, "ad198x-swap-output", 1) == 1) {
* statep->swap_out = B_TRUE;
* (void) audioixp_read_ac97(statep, CODEC_AD_REG_MISC, &tmp);
* (void) audioixp_write_ac97(statep,
* CODEC_AD_REG_MISC,
* tmp | AD1980_MISC_LOSEL | AD1980_MISC_HPSEL);
*
*/
#include "ac97_impl.h"
static void
{
uint16_t v;
switch (value) {
case 0x1:
/* 0db */
break;
case 0x2:
/* 10dB */
v &= ~AMCR_MBG_MASK;
v |= AMCR_MBG_10dB;
break;
case 0x4:
/* 20dB */
v &= ~AMCR_MBG_MASK;
v |= AMCR_MBG_20dB;
break;
case 0x8:
/* 30dB */
v &= ~AMCR_MBG_MASK;
v |= AMCR_MBG_30dB;
break;
}
}
static void
{
switch (value) {
case 0x1: /* mic1 */
break;
case 0x2: /* mic2 */
break;
case 0x4: /* stereo - ms bit clear to allow MIC1 to be mixed */
break;
}
}
static void
{
static const char *values[] = {
};
}
static void
{
static const char *values[] = {
AUDIO_VALUE_OFF, /* 0dB */
AUDIO_VALUE_LOW, /* 10dB */
AUDIO_VALUE_MEDIUM, /* 20dB */
AUDIO_VALUE_HIGH, /* 30dB */
};
if (ctrl) {
if (ctrl->actrl_initval) {
/* 20dB by default */
}
}
}
void
{
}
void
{
}