2 * sst_platform.h - Intel MID Platform driver header file
4 * Copyright (C) 2010 Intel Corp
5 * Author: Vinod Koul <vinod.koul@intel.com>
6 * Author: Harsha Priya <priya.harsha@intel.com>
7 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; version 2 of the License.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
22 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27 #ifndef __SST_PLATFORMDRV_H__
28 #define __SST_PLATFORMDRV_H__
34 #define SST_MIN_RATE 8000
35 #define SST_MAX_RATE 48000
36 #define SST_MIN_CHANNEL 1
37 #define SST_MAX_CHANNEL 5
38 #define SST_MAX_BUFFER (800*1024)
39 #define SST_MIN_BUFFER (800*1024)
40 #define SST_MIN_PERIOD_BYTES 32
41 #define SST_MAX_PERIOD_BYTES SST_MAX_BUFFER
42 #define SST_MIN_PERIODS 2
43 #define SST_MAX_PERIODS (1024*2)
44 #define SST_FIFO_SIZE 0
45 #define SST_CODEC_TYPE_PCM 1
47 struct pcm_stream_info
{
50 void (*period_elapsed
) (void *mad_substream
);
51 unsigned long long buffer_ptr
;
56 SST_PLATFORM_INIT
= 1,
66 SST_SND_RESUME
= 0x02,
69 SST_SND_BUFFER_POINTER
= 0x05,
70 SST_SND_STREAM_INIT
= 0x06,
72 SST_MAX_CONTROLS
= 0x07,
76 STREAM_OPS_PLAYBACK
= 0,
80 enum sst_audio_device_type
{
81 SND_SST_DEVICE_HEADSET
= 1,
84 SND_SST_DEVICE_HAPTIC
,
85 SND_SST_DEVICE_CAPTURE
,
89 struct 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 */
96 u32 period_count
; /* period elapsed in samples*/
100 struct sst_stream_params
{
107 struct sst_pcm_params sparams
;
111 int (*open
) (struct sst_stream_params
*str_param
);
112 int (*device_control
) (int cmd
, void *arg
);
113 int (*close
) (unsigned int str_id
);
116 struct sst_runtime_stream
{
118 struct pcm_stream_info stream_info
;
120 spinlock_t status_lock
;
129 int sst_register_dsp(struct sst_device
*sst
);
130 int sst_unregister_dsp(struct sst_device
*sst
);