2000-05-02 10:30:49 +04:00
|
|
|
/* $NetBSD: am7930var.h,v 1.7 2000/05/02 06:30:51 augustss Exp $ */
|
|
|
|
|
|
|
|
struct am7930_softc;
|
|
|
|
|
|
|
|
struct am7930_glue {
|
|
|
|
u_int8_t (*codec_iread) __P((struct am7930_softc *sc, int));
|
|
|
|
void (*codec_iwrite) __P((struct am7930_softc *sc, int, u_int8_t));
|
|
|
|
u_int16_t (*codec_iread16) __P((struct am7930_softc *sc, int));
|
|
|
|
void (*codec_iwrite16) __P((struct am7930_softc *sc, int, u_int16_t));
|
|
|
|
void (*onopen) __P((struct am7930_softc *sc));
|
|
|
|
void (*onclose) __P((struct am7930_softc *sc));
|
|
|
|
int factor;
|
|
|
|
void (*input_conv) __P((void *, u_int8_t *, int));
|
|
|
|
void (*output_conv) __P((void *, u_int8_t *, int));
|
1999-03-15 01:29:00 +03:00
|
|
|
};
|
1998-06-24 15:09:23 +04:00
|
|
|
|
|
|
|
struct am7930_softc {
|
|
|
|
struct device sc_dev; /* base device */
|
|
|
|
|
|
|
|
int sc_open; /* single use device */
|
|
|
|
int sc_locked; /* true when transfering data */
|
|
|
|
|
2000-05-02 10:30:49 +04:00
|
|
|
u_int8_t sc_rlevel; /* record level */
|
|
|
|
u_int8_t sc_plevel; /* play level */
|
|
|
|
u_int8_t sc_mlevel; /* monitor level */
|
|
|
|
u_int8_t sc_out_port; /* output port */
|
|
|
|
u_int8_t sc_mic_mute;
|
1998-06-24 15:09:23 +04:00
|
|
|
|
2000-05-02 10:30:49 +04:00
|
|
|
struct am7930_glue *sc_glue;
|
|
|
|
};
|
1998-06-24 15:09:23 +04:00
|
|
|
|
2000-05-02 10:30:49 +04:00
|
|
|
extern int am7930debug;
|
1998-06-24 15:09:23 +04:00
|
|
|
|
2000-05-02 10:30:49 +04:00
|
|
|
void am7930_init __P((struct am7930_softc *, int));
|
1998-06-24 15:09:23 +04:00
|
|
|
|
2000-05-02 10:30:49 +04:00
|
|
|
#define AM7930_IWRITE(x,y,z) (*(x)->sc_glue->codec_iwrite)((x),(y),(z))
|
|
|
|
#define AM7930_IREAD(x,y) (*(x)->sc_glue->codec_iread)((x),(y))
|
|
|
|
#define AM7930_IWRITE16(x,y,z) (*(x)->sc_glue->codec_iwrite16)((x),(y),(z))
|
|
|
|
#define AM7930_IREAD16(x,y) (*(x)->sc_glue->codec_iread16)((x),(y))
|
1998-06-24 15:09:23 +04:00
|
|
|
|
2000-05-02 10:30:49 +04:00
|
|
|
#define AUDIOAMD_POLL_MODE 0
|
|
|
|
#define AUDIOAMD_DMA_MODE 1
|
1998-06-24 15:09:23 +04:00
|
|
|
|
|
|
|
/*
|
2000-05-02 10:30:49 +04:00
|
|
|
* audio channel definitions.
|
1998-06-24 15:09:23 +04:00
|
|
|
*/
|
|
|
|
|
2000-05-02 10:30:49 +04:00
|
|
|
#define AUDIOAMD_SPEAKER_VOL 0 /* speaker volume */
|
|
|
|
#define AUDIOAMD_HEADPHONES_VOL 1 /* headphones volume */
|
|
|
|
#define AUDIOAMD_OUTPUT_CLASS 2
|
1998-06-24 15:09:23 +04:00
|
|
|
|
2000-05-02 10:30:49 +04:00
|
|
|
#define AUDIOAMD_MONITOR_VOL 3 /* monitor input volume */
|
|
|
|
#define AUDIOAMD_MONITOR_OUTPUT 4 /* output selector */
|
|
|
|
#define AUDIOAMD_MONITOR_CLASS 5
|
1998-06-24 15:09:23 +04:00
|
|
|
|
2000-05-02 10:30:49 +04:00
|
|
|
#define AUDIOAMD_MIC_VOL 6 /* microphone volume */
|
|
|
|
#define AUDIOAMD_MIC_MUTE 7
|
|
|
|
#define AUDIOAMD_INPUT_CLASS 8
|
|
|
|
|
|
|
|
#define AUDIOAMD_RECORD_SOURCE 9 /* source selector */
|
|
|
|
#define AUDIOAMD_RECORD_CLASS 10
|
1998-06-24 15:09:23 +04:00
|
|
|
|
|
|
|
/*
|
|
|
|
* audio(9) MI callbacks from upper-level audio layer.
|
|
|
|
*/
|
2000-05-02 10:30:49 +04:00
|
|
|
|
1998-06-24 15:09:23 +04:00
|
|
|
struct audio_device;
|
|
|
|
struct audio_encoding;
|
|
|
|
struct audio_params;
|
|
|
|
|
|
|
|
int am7930_open __P((void *, int));
|
|
|
|
void am7930_close __P((void *));
|
|
|
|
int am7930_query_encoding __P((void *, struct audio_encoding *));
|
2000-05-02 10:30:49 +04:00
|
|
|
int am7930_set_params __P((void *, int, int, struct audio_params *,
|
|
|
|
struct audio_params *));
|
1998-06-24 15:09:23 +04:00
|
|
|
int am7930_commit_settings __P((void *));
|
|
|
|
int am7930_round_blocksize __P((void *, int));
|
|
|
|
int am7930_halt_output __P((void *));
|
|
|
|
int am7930_halt_input __P((void *));
|
|
|
|
int am7930_getdev __P((void *, struct audio_device *));
|
|
|
|
int am7930_get_props __P((void *));
|
2000-05-02 10:30:49 +04:00
|
|
|
int am7930_set_port __P((void *, mixer_ctrl_t *));
|
|
|
|
int am7930_get_port __P((void *, mixer_ctrl_t *));
|
|
|
|
int am7930_query_devinfo __P((void *, mixer_devinfo_t *));
|