/*
* 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
*/
/*
*/
/*
* CMI (C-Media) codec extensions.
*/
#include "ac97_impl.h"
/*
* C-Media 9739 part is weird. Instead of having independent volume
* controls for each of the channels, it uses a single master volume
* and just provides mute support for the other bits. It does this
* for PCM volume as well, so we can't use it either. Ugh. It also
* has an optional 30 dB mic boost. Apparently the 9761 behaves in
* much the same fashion as the 9739.
*
* C-Media 9738 is a more or less typical 4CH device according to the
* datasheet. It however supports jack retasking allowing the line in
* jack to function as a surround output. Google suggests that the
* volume controls on this part are about as busted as on the other
* parts. So, we just use synthetic volume for it.
*
* C-Media 9780 is largely a mystery (ENODATASHEET).
*/
static void
{
switch (value) {
case 0x1:
/* 0db */
break;
case 0x2:
/* 20dB */
break;
case 0x4:
/* 30dB */
break;
}
}
static void
{
if (value & 2) {
} else {
}
}
static void
{
if (value & 2) {
} else {
}
}
static void
{
static const char *values[] = {
AUDIO_VALUE_OFF, /* 0dB */
AUDIO_VALUE_MEDIUM, /* 20dB */
AUDIO_VALUE_HIGH, /* 30dB */
};
if (ctrl) {
if (ctrl->actrl_initval) {
/* 20dB by default */
}
}
}
static const char *cmi_linein_funcs[] = {
};
static const char *cmi_mic_funcs[] = {
};
static void
{
int ival;
};
};
}
}
}
static void
{
if (value & 2) {
} else {
}
}
static void
{
if (value) {
} else {
}
}
static void
{
int ival;
};
};
}
}
}
static void
{
/*
* These CMI parts seem to be really weird. They don't have
* *any* functioning volume controls on them (mute only) apart
* from the record and monitor sources (excluding PCM). I
* don't understand why not. We just eliminate all of the
* volume controls and replace with a soft volume control.
* Its not an ideal situation, but I don't know what else I
* can do about it.
*/
if (ctrl) {
}
if (ctrl) {
}
if (ctrl) {
}
if (ctrl) {
}
if (ctrl) {
}
/* make sure we have disabled mute and attenuation on physical ctrls */
/*
* NB: This is probably not the best way to do this, because
* it will make overriding this hard for drivers that desire
* to. Fortunately, we don't think any drivers that want to
* override or fine tune AC'97 controls (i.e. creative cards)
* use these C-Media codecs.
*/
}
void
{
}
void
{
}
void
{
}