~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/intel/atom/sst-mfld-platform.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  *  sst_mfld_platform.h - Intel MID Platform driver header file
  4  *
  5  *  Copyright (C) 2010 Intel Corp
  6  *  Author: Vinod Koul <vinod.koul@intel.com>
  7  *  Author: Harsha Priya <priya.harsha@intel.com>
  8  *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  9  *
 10  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 11  */
 12 
 13 #ifndef __SST_PLATFORMDRV_H__
 14 #define __SST_PLATFORMDRV_H__
 15 
 16 #include "sst-mfld-dsp.h"
 17 #include "sst-atom-controls.h"
 18 
 19 extern struct sst_device *sst;
 20 extern const struct snd_compress_ops sst_platform_compress_ops;
 21 
 22 #define DRV_NAME "sst"
 23 
 24 #define SST_MONO                1
 25 #define SST_STEREO              2
 26 #define SST_MAX_CAP             5
 27 
 28 #define SST_MAX_BUFFER          (800*1024)
 29 #define SST_MIN_BUFFER          (800*1024)
 30 #define SST_MIN_PERIOD_BYTES    32
 31 #define SST_MAX_PERIOD_BYTES    SST_MAX_BUFFER
 32 #define SST_MIN_PERIODS         2
 33 #define SST_MAX_PERIODS         (1024*2)
 34 #define SST_FIFO_SIZE           0
 35 
 36 struct pcm_stream_info {
 37         int str_id;
 38         void *arg;
 39         void (*period_elapsed) (void *arg);
 40         unsigned long long buffer_ptr;
 41         unsigned long long pcm_delay;
 42         int sfreq;
 43 };
 44 
 45 enum sst_drv_status {
 46         SST_PLATFORM_INIT = 1,
 47         SST_PLATFORM_STARTED,
 48         SST_PLATFORM_RUNNING,
 49         SST_PLATFORM_PAUSED,
 50         SST_PLATFORM_DROPPED,
 51 };
 52 
 53 enum sst_stream_ops {
 54         STREAM_OPS_PLAYBACK = 0,
 55         STREAM_OPS_CAPTURE,
 56 };
 57 
 58 enum sst_audio_device_type {
 59         SND_SST_DEVICE_HEADSET = 1,
 60         SND_SST_DEVICE_IHF,
 61         SND_SST_DEVICE_VIBRA,
 62         SND_SST_DEVICE_HAPTIC,
 63         SND_SST_DEVICE_CAPTURE,
 64         SND_SST_DEVICE_COMPRESS,
 65 };
 66 
 67 /* PCM Parameters */
 68 struct sst_pcm_params {
 69         u16 codec;      /* codec type */
 70         u8 num_chan;    /* 1=Mono, 2=Stereo */
 71         u8 pcm_wd_sz;   /* 16/24 - bit*/
 72         u32 reserved;   /* Bitrate in bits per second */
 73         u32 sfreq;      /* Sampling rate in Hz */
 74         u32 ring_buffer_size;
 75         u32 period_count;       /* period elapsed in samples*/
 76         u32 ring_buffer_addr;
 77 };
 78 
 79 struct sst_stream_params {
 80         u32 result;
 81         u32 stream_id;
 82         u8 codec;
 83         u8 ops;
 84         u8 stream_type;
 85         u8 device_type;
 86         struct sst_pcm_params sparams;
 87 };
 88 
 89 struct sst_compress_cb {
 90         void *param;
 91         void (*compr_cb)(void *param);
 92         void *drain_cb_param;
 93         void (*drain_notify)(void *param);
 94 };
 95 
 96 struct compress_sst_ops {
 97         const char *name;
 98         int (*open)(struct device *dev,
 99                 struct snd_sst_params *str_params, struct sst_compress_cb *cb);
100         int (*stream_start)(struct device *dev, unsigned int str_id);
101         int (*stream_drop)(struct device *dev, unsigned int str_id);
102         int (*stream_drain)(struct device *dev, unsigned int str_id);
103         int (*stream_partial_drain)(struct device *dev, unsigned int str_id);
104         int (*stream_pause)(struct device *dev, unsigned int str_id);
105         int (*stream_pause_release)(struct device *dev, unsigned int str_id);
106 
107         int (*tstamp)(struct device *dev, unsigned int str_id,
108                         struct snd_compr_tstamp *tstamp);
109         int (*ack)(struct device *dev, unsigned int str_id,
110                         unsigned long bytes);
111         int (*close)(struct device *dev, unsigned int str_id);
112         int (*get_caps)(struct snd_compr_caps *caps);
113         int (*get_codec_caps)(struct snd_compr_codec_caps *codec);
114         int (*set_metadata)(struct device *dev, unsigned int str_id,
115                         struct snd_compr_metadata *mdata);
116         int (*power)(struct device *dev, bool state);
117 };
118 
119 struct sst_ops {
120         int (*open)(struct device *dev, struct snd_sst_params *str_param);
121         int (*stream_init)(struct device *dev, struct pcm_stream_info *str_info);
122         int (*stream_start)(struct device *dev, int str_id);
123         int (*stream_drop)(struct device *dev, int str_id);
124         int (*stream_pause)(struct device *dev, int str_id);
125         int (*stream_pause_release)(struct device *dev, int str_id);
126         int (*stream_read_tstamp)(struct device *dev, struct pcm_stream_info *str_info);
127         int (*send_byte_stream)(struct device *dev, struct snd_sst_bytes_v2 *bytes);
128         int (*close)(struct device *dev, unsigned int str_id);
129         int (*power)(struct device *dev, bool state);
130 };
131 
132 struct sst_runtime_stream {
133         int     stream_status;
134         unsigned int id;
135         size_t bytes_written;
136         struct pcm_stream_info stream_info;
137         struct sst_ops *ops;
138         struct compress_sst_ops *compr_ops;
139         spinlock_t      status_lock;
140 };
141 
142 struct sst_device {
143         char *name;
144         struct device *dev;
145         struct sst_ops *ops;
146         struct platform_device *pdev;
147         struct compress_sst_ops *compr_ops;
148 };
149 
150 struct sst_data;
151 
152 int sst_dsp_init_v2_dpcm(struct snd_soc_component *component);
153 int sst_send_pipe_gains(struct snd_soc_dai *dai, int stream, int mute);
154 int send_ssp_cmd(struct snd_soc_dai *dai, const char *id, bool enable);
155 int sst_handle_vb_timer(struct snd_soc_dai *dai, bool enable);
156 
157 void sst_set_stream_status(struct sst_runtime_stream *stream, int state);
158 int sst_fill_stream_params(void *substream, const struct sst_data *ctx,
159                            struct snd_sst_params *str_params, bool is_compress);
160 
161 struct sst_algo_int_control_v2 {
162         struct soc_mixer_control mc;
163         u16 module_id; /* module identifieer */
164         u16 pipe_id; /* location info: pipe_id + instance_id */
165         u16 instance_id;
166         unsigned int value; /* Value received is stored here */
167 };
168 struct sst_data {
169         struct platform_device *pdev;
170         struct sst_platform_data *pdata;
171         struct snd_sst_bytes_v2 *byte_stream;
172         struct mutex lock;
173         struct snd_soc_card *soc_card;
174         struct sst_cmd_sba_hw_set_ssp ssp_cmd;
175 };
176 int sst_register_dsp(struct sst_device *dev);
177 int sst_unregister_dsp(struct sst_device *dev);
178 #endif
179 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php