aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/mid-x86/sst_platform.h
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/mid-x86/sst_platform.h')
-rw-r--r--sound/soc/mid-x86/sst_platform.h82
1 files changed, 75 insertions, 7 deletions
diff --git a/sound/soc/mid-x86/sst_platform.h b/sound/soc/mid-x86/sst_platform.h
index df370286694..f04f4f72daa 100644
--- a/sound/soc/mid-x86/sst_platform.h
+++ b/sound/soc/mid-x86/sst_platform.h
@@ -42,14 +42,14 @@
42#define SST_MIN_PERIODS 2 42#define SST_MIN_PERIODS 2
43#define SST_MAX_PERIODS (1024*2) 43#define SST_MAX_PERIODS (1024*2)
44#define SST_FIFO_SIZE 0 44#define SST_FIFO_SIZE 0
45#define SST_CARD_NAMES "intel_mid_card" 45#define SST_CODEC_TYPE_PCM 1
46#define MSIC_VENDOR_ID 3
47 46
48struct sst_runtime_stream { 47struct pcm_stream_info {
49 int stream_status; 48 int str_id;
50 struct pcm_stream_info stream_info; 49 void *mad_substream;
51 struct intel_sst_card_ops *sstdrv_ops; 50 void (*period_elapsed) (void *mad_substream);
52 spinlock_t status_lock; 51 unsigned long long buffer_ptr;
52 int sfreq;
53}; 53};
54 54
55enum sst_drv_status { 55enum sst_drv_status {
@@ -60,4 +60,72 @@ enum sst_drv_status {
60 SST_PLATFORM_DROPPED, 60 SST_PLATFORM_DROPPED,
61}; 61};
62 62
63enum sst_controls {
64 SST_SND_ALLOC = 0x00,
65 SST_SND_PAUSE = 0x01,
66 SST_SND_RESUME = 0x02,
67 SST_SND_DROP = 0x03,
68 SST_SND_FREE = 0x04,
69 SST_SND_BUFFER_POINTER = 0x05,
70 SST_SND_STREAM_INIT = 0x06,
71 SST_SND_START = 0x07,
72 SST_MAX_CONTROLS = 0x07,
73};
74
75enum sst_stream_ops {
76 STREAM_OPS_PLAYBACK = 0,
77 STREAM_OPS_CAPTURE,
78};
79
80enum sst_audio_device_type {
81 SND_SST_DEVICE_HEADSET = 1,
82 SND_SST_DEVICE_IHF,
83 SND_SST_DEVICE_VIBRA,
84 SND_SST_DEVICE_HAPTIC,
85 SND_SST_DEVICE_CAPTURE,
86};
87
88/* PCM Parameters */
89struct sst_pcm_params {
90 u16 codec; /* codec type */
91 u8 num_chan; /* 1=Mono, 2=Stereo */
92 u8 pcm_wd_sz; /* 16/24 - bit*/
93 u32 reserved; /* Bitrate in bits per second */
94 u32 sfreq; /* Sampling rate in Hz */
95 u32 ring_buffer_size;
96 u32 period_count; /* period elapsed in samples*/
97 u32 ring_buffer_addr;
98};
99
100struct sst_stream_params {
101 u32 result;
102 u32 stream_id;
103 u8 codec;
104 u8 ops;
105 u8 stream_type;
106 u8 device_type;
107 struct sst_pcm_params sparams;
108};
109
110struct sst_ops {
111 int (*open) (struct sst_stream_params *str_param);
112 int (*device_control) (int cmd, void *arg);
113 int (*close) (unsigned int str_id);
114};
115
116struct sst_runtime_stream {
117 int stream_status;
118 struct pcm_stream_info stream_info;
119 struct sst_ops *ops;
120 spinlock_t status_lock;
121};
122
123struct sst_device {
124 char *name;
125 struct device *dev;
126 struct sst_ops *ops;
127};
128
129int sst_register_dsp(struct sst_device *sst);
130int sst_unregister_dsp(struct sst_device *sst);
63#endif 131#endif