summaryrefslogtreecommitdiff
path: root/include/linux/ac97_codec.h
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2003-07-11 06:49:10 -0700
committerSteve French <cifs.adm@hostme.bitkeeper.com>2003-07-11 06:49:10 -0700
commit23a66b7258cae0094bf14e5cae0aeaf8edffa94a (patch)
treeb29e379e39db1950312ae8fb808bcd8b251b367e /include/linux/ac97_codec.h
parented35289e7daf21e75bc70f19c749f786493f3286 (diff)
[PATCH] AC97 updates from 2.4
This deals with several things - Codecs that think they are modems but are not - Abstracting modem detection out of drivers - Abstracting digital switching out of drivers - Codecs that have no volume control - Codec plugins for specific setups - Codec plugins for things like touchscreen/batmon on AC97 - More codec handlers The plugin API is intentionally modelled on the other driver_register type interfaces.
Diffstat (limited to 'include/linux/ac97_codec.h')
-rw-r--r--include/linux/ac97_codec.h44
1 files changed, 42 insertions, 2 deletions
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h
index cb5bd2b5e6ae..2b68241da812 100644
--- a/include/linux/ac97_codec.h
+++ b/include/linux/ac97_codec.h
@@ -214,6 +214,9 @@
(CODEC)->supported_mixers & (1<<FOO) )
struct ac97_codec {
+ /* Linked list of codecs */
+ struct list_head list;
+
/* AC97 controller connected with */
void *private_data;
@@ -221,22 +224,37 @@ struct ac97_codec {
int id;
int dev_mixer;
int type;
+ u32 model;
+
+ int modem:1;
struct ac97_ops *codec_ops;
- /* controller specific lower leverl ac97 accessing routines */
+ /* controller specific lower leverl ac97 accessing routines.
+ must be re-entrant safe */
u16 (*codec_read) (struct ac97_codec *codec, u8 reg);
void (*codec_write) (struct ac97_codec *codec, u8 reg, u16 val);
/* Wait for codec-ready. Ok to sleep here. */
void (*codec_wait) (struct ac97_codec *codec);
+ /* callback used by helper drivers for interesting ac97 setups */
+ void (*codec_unregister) (struct ac97_codec *codec);
+
+ struct ac97_driver *driver;
+ void *driver_private; /* Private data for the driver */
+
+ spinlock_t lock;
+
/* OSS mixer masks */
int modcnt;
int supported_mixers;
int stereo_mixers;
int record_sources;
+ /* Property flags */
+ int flags;
+
int bit_resolution;
/* OSS mixer interface */
@@ -264,7 +282,14 @@ struct ac97_ops
/* Amplifier control */
int (*amplifier)(struct ac97_codec *codec, int on);
/* Digital mode control */
- int (*digital)(struct ac97_codec *codec, int format);
+ int (*digital)(struct ac97_codec *codec, int slots, int rate, int mode);
+#define AUDIO_DIGITAL 0x8000
+#define AUDIO_PRO 0x4000
+#define AUDIO_DRS 0x2000
+#define AUDIO_CCMASK 0x003F
+
+#define AC97_DELUDED_MODEM 1 /* Audio codec reports its a modem */
+#define AC97_NO_PCM_VOLUME 2 /* Volume control is missing */
};
extern int ac97_read_proc (char *page_out, char **start, off_t off,
@@ -275,4 +300,19 @@ extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rat
extern int ac97_save_state(struct ac97_codec *codec);
extern int ac97_restore_state(struct ac97_codec *codec);
+extern struct ac97_codec *ac97_alloc_codec(void);
+extern void ac97_release_codec(struct ac97_codec *codec);
+
+struct ac97_driver {
+ struct list_head list;
+ char *name;
+ u32 codec_id;
+ u32 codec_mask;
+ int (*probe) (struct ac97_codec *codec, struct ac97_driver *driver);
+ void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver);
+};
+
+extern int ac97_register_driver(struct ac97_driver *driver);
+extern void ac97_unregister_driver(struct ac97_driver *driver);
+
#endif /* _AC97_CODEC_H_ */