Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 15942
b: refs/heads/master
c: b9b4bdd
h: refs/heads/master
v: v3
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Jan 3, 2006
1 parent a7e9b4d commit e30d2d7
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 95a98265eb7b112b3268761053d643635171e219
refs/heads/master: b9b4bdd9f1c98388f13591608d574650a9873717
65 changes: 30 additions & 35 deletions trunk/include/sound/ac97_codec.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 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 {
int (*build_3d) (ac97_t *ac97);
int (*build_specific) (ac97_t *ac97);
Expand Down Expand Up @@ -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_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,
unsigned short pcms_count,
const struct ac97_pcm *pcms);
Expand All @@ -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_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 */
extern struct bus_type ac97_bus_type;

Expand Down
9 changes: 9 additions & 0 deletions trunk/sound/pci/ac97/ac97_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@
{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), .info = snd_ac97_info_volsw, \
.get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
.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) \
{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
.mask = xmask, .texts = xtexts }
Expand Down

0 comments on commit e30d2d7

Please sign in to comment.