2 * PXA2xx i2Sound: support for Intel PXA2xx I2S audio
4 * Copyright (c) 2005 Giorgio Padrin <giorgio@mandarinlogiq.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
12 * 2005-03 Giorgio Padrin Initial release
13 * 2005-05-02 Giorgio Padrin added event() to board plugins interface
14 * 2005-05-14 Giorgio Padrin Splitted event()
17 #ifndef __SOUND_PXA2xx_I2SOUND_H
18 #define __SOUND_PXA2xx_I2SOUND_H
20 #include <sound/driver.h>
21 #include <sound/core.h>
22 #include <sound/pcm.h>
23 #include <sound/initval.h>
25 struct snd_pxa2xx_i2sound_board_stream_hw
{
26 unsigned int rates
; /* SNDRV_PCM_RATE_* */
27 unsigned int rate_min
; /* min rate */
28 unsigned int rate_max
; /* max rate */
29 unsigned int *rates_table
; /* in case the field rates is not enough */
30 unsigned int rates_num
; /* size of rates_table */
33 struct snd_pxa2xx_i2sound_board
{
35 char *desc
; /* short description */
36 char *acard_id
; /* ALSA card id */
40 struct snd_pxa2xx_i2sound_board_stream_hw streams_hw
[2];
42 int (*activate
)(void);
43 void (*deactivate
)(void);
45 int (*set_rate
)(unsigned int rate
);
47 int (*open_stream
)(int stream
);
48 void (*close_stream
)(int stream
);
51 int (*add_mixer_controls
)(struct snd_card
*acard
);
53 /* tune ALSA hw params space at substream opening */
54 int (*add_hw_constraints
)(struct snd_pcm_substream
*asubs
);
57 /* Power Management */
58 int (*suspend
) (pm_message_t state
);
63 #define SND_PXA2xx_I2SOUND_INFO_CLOCK_FROM_PXA 1 << 0
64 #define SND_PXA2xx_I2SOUND_INFO_CAN_CAPTURE 1 << 1
65 #define SND_PXA2xx_I2SOUND_INFO_HALF_DUPLEX 1 << 2
67 void snd_pxa2xx_i2sound_i2slink_get(void);
68 void snd_pxa2xx_i2sound_i2slink_free(void);
70 int snd_pxa2xx_i2sound_card_activate(struct snd_pxa2xx_i2sound_board
*board
);
71 void snd_pxa2xx_i2sound_card_deactivate(void);
73 #endif /* __SOUND_PXA2xx_I2SOUND_H */