aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/ac97_codec.h65
-rw-r--r--sound/pci/ac97/ac97_local.h9
2 files changed, 39 insertions, 35 deletions
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h
index 7f0ca79d6c98..6f1e6ba2a190 100644
--- a/include/sound/ac97_codec.h
+++ b/include/sound/ac97_codec.h
@@ -396,33 +396,6 @@ typedef struct _snd_ac97_bus_ops ac97_bus_ops_t;
396typedef struct _snd_ac97_template ac97_template_t; 396typedef struct _snd_ac97_template ac97_template_t;
397typedef struct _snd_ac97 ac97_t; 397typedef struct _snd_ac97 ac97_t;
398 398
399enum ac97_pcm_cfg {
400 AC97_PCM_CFG_FRONT = 2,
401 AC97_PCM_CFG_REAR = 10, /* alias surround */
402 AC97_PCM_CFG_LFE = 11, /* center + lfe */
403 AC97_PCM_CFG_40 = 4, /* front + rear */
404 AC97_PCM_CFG_51 = 6, /* front + rear + center/lfe */
405 AC97_PCM_CFG_SPDIF = 20
406};
407
408/* PCM allocation */
409struct ac97_pcm {
410 ac97_bus_t *bus;
411 unsigned int stream: 1, /* stream type: 1 = capture */
412 exclusive: 1, /* exclusive mode, don't override with other pcms */
413 copy_flag: 1, /* lowlevel driver must fill all entries */
414 spdif: 1; /* spdif pcm */
415 unsigned short aslots; /* active slots */
416 unsigned int rates; /* available rates */
417 struct {
418 unsigned short slots; /* driver input: requested AC97 slot numbers */
419 unsigned short rslots[4]; /* allocated slots per codecs */
420 unsigned char rate_table[4];
421 ac97_t *codec[4]; /* allocated codecs */
422 } r[2]; /* 0 = standard rates, 1 = double rates */
423 unsigned long private_value; /* used by the hardware driver */
424};
425
426struct snd_ac97_build_ops { 399struct snd_ac97_build_ops {
427 int (*build_3d) (ac97_t *ac97); 400 int (*build_3d) (ac97_t *ac97);
428 int (*build_specific) (ac97_t *ac97); 401 int (*build_specific) (ac97_t *ac97);
@@ -581,6 +554,36 @@ struct ac97_quirk {
581int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override); 554int snd_ac97_tune_hardware(ac97_t *ac97, struct ac97_quirk *quirk, const char *override);
582int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate); 555int snd_ac97_set_rate(ac97_t *ac97, int reg, unsigned int rate);
583 556
557/*
558 * PCM allocation
559 */
560
561enum ac97_pcm_cfg {
562 AC97_PCM_CFG_FRONT = 2,
563 AC97_PCM_CFG_REAR = 10, /* alias surround */
564 AC97_PCM_CFG_LFE = 11, /* center + lfe */
565 AC97_PCM_CFG_40 = 4, /* front + rear */
566 AC97_PCM_CFG_51 = 6, /* front + rear + center/lfe */
567 AC97_PCM_CFG_SPDIF = 20
568};
569
570struct ac97_pcm {
571 ac97_bus_t *bus;
572 unsigned int stream: 1, /* stream type: 1 = capture */
573 exclusive: 1, /* exclusive mode, don't override with other pcms */
574 copy_flag: 1, /* lowlevel driver must fill all entries */
575 spdif: 1; /* spdif pcm */
576 unsigned short aslots; /* active slots */
577 unsigned int rates; /* available rates */
578 struct {
579 unsigned short slots; /* driver input: requested AC97 slot numbers */
580 unsigned short rslots[4]; /* allocated slots per codecs */
581 unsigned char rate_table[4];
582 ac97_t *codec[4]; /* allocated codecs */
583 } r[2]; /* 0 = standard rates, 1 = double rates */
584 unsigned long private_value; /* used by the hardware driver */
585};
586
584int snd_ac97_pcm_assign(ac97_bus_t *ac97, 587int snd_ac97_pcm_assign(ac97_bus_t *ac97,
585 unsigned short pcms_count, 588 unsigned short pcms_count,
586 const struct ac97_pcm *pcms); 589 const struct ac97_pcm *pcms);
@@ -589,14 +592,6 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
589int snd_ac97_pcm_close(struct ac97_pcm *pcm); 592int snd_ac97_pcm_close(struct ac97_pcm *pcm);
590int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime); 593int snd_ac97_pcm_double_rate_rules(snd_pcm_runtime_t *runtime);
591 594
592struct ac97_enum {
593 unsigned char reg;
594 unsigned char shift_l;
595 unsigned char shift_r;
596 unsigned short mask;
597 const char **texts;
598};
599
600/* ad hoc AC97 device driver access */ 595/* ad hoc AC97 device driver access */
601extern struct bus_type ac97_bus_type; 596extern struct bus_type ac97_bus_type;
602 597
diff --git a/sound/pci/ac97/ac97_local.h b/sound/pci/ac97/ac97_local.h
index 536a4d4793af..5ff3ef2cae3e 100644
--- a/sound/pci/ac97/ac97_local.h
+++ b/sound/pci/ac97/ac97_local.h
@@ -36,6 +36,15 @@
36{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), .info = snd_ac97_info_volsw, \ 36{ .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), .info = snd_ac97_info_volsw, \
37 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \ 37 .get = snd_ac97_get_volsw, .put = snd_ac97_put_volsw, \
38 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) } 38 .private_value = (reg) | ((shift_left) << 8) | ((shift_right) << 12) | ((mask) << 16) | ((invert) << 24) }
39
40struct ac97_enum {
41 unsigned char reg;
42 unsigned char shift_l;
43 unsigned char shift_r;
44 unsigned short mask;
45 const char **texts;
46};
47
39#define AC97_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \ 48#define AC97_ENUM_DOUBLE(xreg, xshift_l, xshift_r, xmask, xtexts) \
40{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \ 49{ .reg = xreg, .shift_l = xshift_l, .shift_r = xshift_r, \
41 .mask = xmask, .texts = xtexts } 50 .mask = xmask, .texts = xtexts }