Commit b9b4bdd9 authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

[ALSA] ac97 - Remove ac9_enum definition from public header

Modules: AC97 Codec

Remove the definition of ac97_enum struct from the public ac97_codec.h.
It's used only in the module.

The location of struct ac97_pcm is moved closer to its accessor
to improve readability.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 95a98265
...@@ -396,33 +396,6 @@ typedef struct _snd_ac97_bus_ops ac97_bus_ops_t; ...@@ -396,33 +396,6 @@ typedef struct _snd_ac97_bus_ops ac97_bus_ops_t;
typedef struct _snd_ac97_template ac97_template_t; typedef struct _snd_ac97_template ac97_template_t;
typedef struct _snd_ac97 ac97_t; typedef struct _snd_ac97 ac97_t;
enum ac97_pcm_cfg {
AC97_PCM_CFG_FRONT = 2,
AC97_PCM_CFG_REAR = 10, /* alias surround */
AC97_PCM_CFG_LFE = 11, /* center + lfe */
AC97_PCM_CFG_40 = 4, /* front + rear */
AC97_PCM_CFG_51 = 6, /* front + rear + center/lfe */
AC97_PCM_CFG_SPDIF = 20
};
/* PCM allocation */
struct ac97_pcm {
ac97_bus_t *bus;
unsigned int stream: 1, /* stream type: 1 = capture */
exclusive: 1, /* exclusive mode, don't override with other pcms */
copy_flag: 1, /* lowlevel driver must fill all entries */
spdif: 1; /* spdif pcm */
unsigned short aslots; /* active slots */
unsigned int rates; /* available rates */
struct {
unsigned short slots; /* driver input: requested AC97 slot numbers */
unsigned short rslots[4]; /* allocated slots per codecs */
unsigned char rate_table[4];
ac97_t *codec[4]; /* allocated codecs */
} r[2]; /* 0 = standard rates, 1 = double rates */
unsigned long private_value; /* used by the hardware driver */
};
struct snd_ac97_build_ops { struct snd_ac97_build_ops {
int (*build_3d) (ac97_t *ac97); int (*build_3d) (ac97_t *ac97);
int (*build_specific) (ac97_t *ac97); int (*build_specific) (ac97_t *ac97);
...@@ -581,6 +554,36 @@ struct ac97_quirk { ...@@ -581,6 +554,36 @@ struct ac97_quirk {
int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override); int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override);
int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate); int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate);
/*
* PCM allocation
*/
enum ac97_pcm_cfg {
AC97_PCM_CFG_FRONT = 2,
AC97_PCM_CFG_REAR = 10, /* alias surround */
AC97_PCM_CFG_LFE = 11, /* center + lfe */
AC97_PCM_CFG_40 = 4, /* front + rear */
AC97_PCM_CFG_51 = 6, /* front + rear + center/lfe */
AC97_PCM_CFG_SPDIF = 20
};
struct ac97_pcm {
ac97_bus_t *bus;
unsigned int stream: 1, /* stream type: 1 = capture */
exclusive: 1, /* exclusive mode, don't override with other pcms */
copy_flag: 1, /* lowlevel driver must fill all entries */
spdif: 1; /* spdif pcm */
unsigned short aslots; /* active slots */
unsigned int rates; /* available rates */
struct {
unsigned short slots; /* driver input: requested AC97 slot numbers */
unsigned short rslots[4]; /* allocated slots per codecs */
unsigned char rate_table[4];
ac97_t *codec[4]; /* allocated codecs */
} r[2]; /* 0 = standard rates, 1 = double rates */
unsigned long private_value; /* used by the hardware driver */
};
int snd_ac97_pcm_assign(ac97_bus_t *ac97, int snd_ac97_pcm_assign(ac97_bus_t *ac97,
unsigned short pcms_count, unsigned short pcms_count,
const struct ac97_pcm *pcms); const struct ac97_pcm *pcms);
...@@ -589,14 +592,6 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate, ...@@ -589,14 +592,6 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
int snd_ac97_pcm_close(struct ac97_pcm *pcm); int snd_ac97_pcm_close(struct ac97_pcm *pcm);
int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime); int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime);
struct ac97_enum {
unsigned char reg;
unsigned char shift_l;
unsigned char shift_r;
unsigned short mask;
const char **texts;
};
/* ad hoc AC97 device driver access */ /* ad hoc AC97 device driver access */
extern struct bus_type ac97_bus_type; extern struct bus_type ac97_bus_type;
......
...@@ -36,6 +36,15 @@ ...@@ -36,6 +36,15 @@
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), .info = snd_ac97_info_volsw, \ { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), .info = snd_ac97_info_volsw, \
.get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \ .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
.private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) } .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
struct ac97_enum {
unsigned char reg;
unsigned char shift_l;
unsigned char shift_r;
unsigned short mask;
const char **texts;
};
#define AC97_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \ #define AC97_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \
{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ { .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
.mask = xmask, .texts = xtexts } .mask = xmask, .texts = xtexts }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment