/*
* 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
*/
/*
*/
#ifndef _SYS_AUDIOHD_IMPL_H_
#define _SYS_AUDIOHD_IMPL_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* vendor IDs of PCI audio controllers
*/
/*
* specific audiohd controller device id
*/
/*
* codec special initial flags
*/
/*
* Only for Intel hardware:
* PCI Express traffic class select register in PCI configure space
*/
/*
* Only for ATI SB450:
* MISC control register 2
*/
/* NVIDIA snoop */
#define AUDIOHDC_NID(x) x
#define AUDIOHD_PW_D0 0
#define AUDIOHD_SP_OFF 0
#define AUDIOHD_PIN_CON_JACK 0
/*
* Audio registers of high definition
*/
/*
* Offset of Stream Descriptor Registers
*/
/* bits for stream descriptor control reg */
/* bits for stream descriptor status register */
#define AUDIOHDR_SD_STS_INTRS \
(AUDIOHDR_SD_STS_BCIS | \
/* bits for GCTL register */
/* bits for CORBRP register */
/* bits for CORBCTL register */
/* bits for CORB SIZE register */
#define AUDIOHDR_CORBSZ_8 0
/* bits for RIRBCTL register */
/* bits for RIRBWP register */
/* bits for RIRB SIZE register */
#define AUDIOHDR_RIRBSZ_8 0
/* HD spec: ID of Root node is 0 */
/* HD spec: ID of audio function group is "1" */
/*
* HD audio verbs can be either 12-bit or 4-bit in length.
*/
/*
* 12-bit verbs
*/
/*
* 4-bit verbs
*/
/*
* parameters of nodes
*/
/*
*/
/* value used to set max volume for left output */
#define AUDIOHDC_AMP_LOUT_MAX \
/* value used to set max volume for right output */
#define AUDIOHDC_AMP_ROUT_MAX \
/*
* Bits for pin widget control verb
*/
/*
* Bits for Amplifier capabilities
*/
/*
* Bits for Audio Widget Capabilities
*/
/*
* buffer descriptor list entry of stream descriptor
*/
typedef struct {
enum audiohda_widget_type {
WTYPE_AUDIO_OUT = 0,
};
enum audiohda_device_type {
DTYPE_LINEOUT = 0,
};
enum audiohd_pin_color {
AUDIOHD_PIN_UNKNOWN = 0,
};
/* values for audiohd_widget.path_flags */
struct audiohd_entry_prop {
int conns_per_entry;
int bits_per_conn;
};
struct audiohd_widget {
int out_weight;
int in_weight;
int finish;
/*
* available (input) connections. 0 means this widget
* has fixed connection
*/
int nconns;
/*
* wid of possible & selected input & output connections
*/
/* output pin -> input pin */
/*
* pointer to struct depending on widget type:
* 1. DAC audiohd_path_t
* 2. ADC audiohd_path_t
* 3. PIN audiohd_pin_t
*/
void *priv;
};
#define PORT_DAC 0
typedef enum {
PLAY = 0,
} path_type_t;
struct audiohd_path {
int pin_nums;
int mute_dir;
int gain_dir;
};
typedef struct audiohd_port
{
int index;
unsigned nframes;
int curpos;
unsigned sync_dir;
enum {
CTL_VOLUME = 0,
/* this one must be last */
};
typedef struct audiohd_ctrl
{
int num;
struct audiohd_pin {
int no_phys_conn;
/*
* mg_dir, mg_gain, mg_wid are used to store the monitor gain control
* widget wid.
*/
int num;
int finish;
};
typedef struct {
struct hda_codec {
/* use wid as index to the array of widget pointers */
};
struct audiohd_state {
/*
* Now, for the time being, we add some fields
* for parsing codec topology
*/
/*
*/
/*
* Controls
*/
/* for multichannel */
};
struct audiohd_codec_info {
const char *buf;
};
/*
* Operation for high definition audio control system bus
* interface registers
*/
/*
* enable a pin widget to input
*/
{ \
}
/*
* disable input pin
*/
{ \
\
AUDIOHDC_VERB_GET_PIN_CTRL, 0); \
if (lTmp == AUDIOHD_CODEC_FAILURE) \
return (DDI_FAILURE); \
(lTmp & ~AUDIOHDC_PIN_CONTROL_IN_ENABLE)); \
if (lTmp == AUDIOHD_CODEC_FAILURE) \
return (DDI_FAILURE); \
}
/*
* unmute an output pin
*/
{ \
return (DDI_FAILURE); \
}
/*
* check volume adjust value of 2 channels control
*/
{ \
if ((value) & ~0xffff) \
return (EINVAL); \
return (EINVAL); \
}
/*
* check volume adjust value of mono channel control
*/
{ \
if ((value) & ~0xff) \
return (EINVAL); \
return (EINVAL); \
}
#ifdef __cplusplus
}
#endif
/* Warlock annotation */
#endif /* _SYS_AUDIOHD_IMPL_H_ */