1 #ifndef __INTEL_SST_COMMON_H__
2 #define __INTEL_SST_COMMON_H__
3 /*
4  *  intel_sst_common.h - Intel SST Driver for audio engine
5  *
6  *  Copyright (C) 2008-10 Intel Corporation
7  *  Authors:	Vinod Koul <vinod.koul@intel.com>
8  *		Harsha Priya <priya.harsha@intel.com>
9  *		Dharageswari R <dharageswari.r@intel.com>
10  *		KP Jeeja <jeeja.kp@intel.com>
11  *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12  *
13  *  This program is free software; you can redistribute it and/or modify
14  *  it under the terms of the GNU General Public License as published by
15  *  the Free Software Foundation; version 2 of the License.
16  *
17  *  This program is distributed in the hope that it will be useful, but
18  *  WITHOUT ANY WARRANTY; without even the implied warranty of
19  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
20  *  General Public License for more details.
21  *
22  *  You should have received a copy of the GNU General Public License along
23  *  with this program; if not, write to the Free Software Foundation, Inc.,
24  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
25  *
26  * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27  *
28  *  Common private declarations for SST
29  */
30 
31 #define SST_DRIVER_VERSION "1.2.09"
32 #define SST_VERSION_NUM 0x1209
33 
34 /* driver names */
35 #define SST_DRV_NAME "intel_sst_driver"
36 #define SST_MRST_PCI_ID 0x080A
37 #define SST_MFLD_PCI_ID 0x082F
38 #define PCI_ID_LENGTH 4
39 #define SST_SUSPEND_DELAY 2000
40 
41 enum sst_states {
42 	SST_FW_LOADED = 1,
43 	SST_FW_RUNNING,
44 	SST_UN_INIT,
45 	SST_ERROR,
46 	SST_SUSPENDED
47 };
48 
49 #define MAX_ACTIVE_STREAM	3
50 #define MAX_ENC_STREAM		1
51 #define MAX_AM_HANDLES		1
52 #define ALLOC_TIMEOUT		5000
53 /* SST numbers */
54 #define SST_BLOCK_TIMEOUT	5000
55 #define TARGET_DEV_BLOCK_TIMEOUT	5000
56 
57 #define BLOCK_UNINIT		-1
58 #define RX_TIMESLOT_UNINIT	-1
59 
60 /* SST register map */
61 #define SST_CSR			0x00
62 #define SST_PISR		0x08
63 #define SST_PIMR		0x10
64 #define SST_ISRX		0x18
65 #define SST_IMRX		0x28
66 #define SST_IPCX		0x38 /* IPC IA-SST */
67 #define SST_IPCD		0x40 /* IPC SST-IA */
68 #define SST_ISRD		0x20 /* dummy register for shim workaround */
69 #define SST_SHIM_SIZE		0X44
70 
71 #define SPI_MODE_ENABLE_BASE_ADDR 0xffae4000
72 #define FW_SIGNATURE_SIZE	4
73 
74 /* PMIC and SST hardware states */
75 enum sst_mad_states {
76 	SND_MAD_UN_INIT = 0,
77 	SND_MAD_INIT_DONE,
78 };
79 
80 /* stream states */
81 enum sst_stream_states {
82 	STREAM_UN_INIT	= 0,	/* Freed/Not used stream */
83 	STREAM_RUNNING	= 1,	/* Running */
84 	STREAM_PAUSED	= 2,	/* Paused stream */
85 	STREAM_DECODE	= 3,	/* stream is in decoding only state */
86 	STREAM_INIT	= 4,	/* stream init, waiting for data */
87 };
88 
89 
90 enum sst_ram_type {
91 	SST_IRAM	= 1,
92 	SST_DRAM	= 2,
93 };
94 /* SST shim registers to structure mapping  */
95 union config_status_reg {
96 	struct {
97 		u32 rsvd0:1;
98 		u32 sst_reset:1;
99 		u32 hw_rsvd:3;
100 		u32 sst_clk:2;
101 		u32 bypass:3;
102 		u32 run_stall:1;
103 		u32 rsvd1:2;
104 		u32 strb_cntr_rst:1;
105 		u32 rsvd:18;
106 	} part;
107 	u32 full;
108 };
109 
110 union interrupt_reg {
111 	struct {
112 		u32 done_interrupt:1;
113 		u32 busy_interrupt:1;
114 		u32 rsvd:30;
115 	} part;
116 	u32 full;
117 };
118 
119 union sst_pisr_reg {
120 	struct {
121 		u32 pssp0:1;
122 		u32 pssp1:1;
123 		u32 rsvd0:3;
124 		u32 dmac:1;
125 		u32 rsvd1:26;
126 	} part;
127 	u32 full;
128 };
129 
130 union sst_pimr_reg {
131 	struct {
132 		u32 ssp0:1;
133 		u32 ssp1:1;
134 		u32 rsvd0:3;
135 		u32 dmac:1;
136 		u32 rsvd1:10;
137 		u32 ssp0_sc:1;
138 		u32 ssp1_sc:1;
139 		u32 rsvd2:3;
140 		u32 dmac_sc:1;
141 		u32 rsvd3:10;
142 	} part;
143 	u32 full;
144 };
145 
146 
147 struct sst_stream_bufs {
148 	struct list_head	node;
149 	u32			size;
150 	const char		*addr;
151 	u32			data_copied;
152 	bool			in_use;
153 	u32			offset;
154 };
155 
156 struct snd_sst_user_cap_list {
157 	unsigned int iov_index; /* index of iov */
158 	unsigned long iov_offset; /* offset in iov */
159 	unsigned long offset; /* offset in kmem */
160 	unsigned long size; /* size copied */
161 	struct list_head node;
162 };
163 /*
164 This structure is used to block a user/fw data call to another
165 fw/user call
166 */
167 struct sst_block {
168 	bool	condition; /* condition for blocking check */
169 	int	ret_code; /* ret code when block is released */
170 	void	*data; /* data to be appsed for block if any */
171 	bool	on;
172 };
173 
174 enum snd_sst_buf_type {
175 	SST_BUF_USER_STATIC = 1,
176 	SST_BUF_USER_DYNAMIC,
177 	SST_BUF_MMAP_STATIC,
178 	SST_BUF_MMAP_DYNAMIC,
179 };
180 
181 enum snd_src {
182 	SST_DRV = 1,
183 	MAD_DRV = 2
184 };
185 
186 /**
187  * struct stream_info - structure that holds the stream information
188  *
189  * @status : stream current state
190  * @prev : stream prev state
191  * @codec : stream codec
192  * @sst_id : stream id
193  * @ops : stream operation pb/cp/drm...
194  * @bufs: stream buffer list
195  * @lock : stream mutex for protecting state
196  * @pcm_lock : spinlock for pcm path only
197  * @mmapped : is stream mmapped
198  * @sg_index : current stream user buffer index
199  * @cur_ptr : stream user buffer pointer
200  * @buf_entry : current user buffer
201  * @data_blk : stream block for data operations
202  * @ctrl_blk : stream block for ctrl operations
203  * @buf_type : stream user buffer type
204  * @pcm_substream : PCM substream
205  * @period_elapsed : PCM period elapsed callback
206  * @sfreq : stream sampling freq
207  * @decode_ibuf : Decoded i/p buffers pointer
208  * @decode_obuf : Decoded o/p buffers pointer
209  * @decode_isize : Decoded i/p buffers size
210  * @decode_osize : Decoded o/p buffers size
211  * @decode_ibuf_type : Decoded i/p buffer type
212  * @decode_obuf_type : Decoded o/p buffer type
213  * @idecode_alloc : Decode alloc index
214  * @need_draining : stream set for drain
215  * @str_type : stream type
216  * @curr_bytes : current bytes decoded
217  * @cumm_bytes : cummulative bytes decoded
218  * @str_type : stream type
219  * @src : stream source
220  * @device : output device type (medfield only)
221  * @pcm_slot : pcm slot value
222  */
223 struct stream_info {
224 	unsigned int		status;
225 	unsigned int		prev;
226 	u8			codec;
227 	unsigned int		sst_id;
228 	unsigned int		ops;
229 	struct list_head	bufs;
230 	struct mutex		lock; /* mutex */
231 	spinlock_t          pcm_lock;
232 	bool			mmapped;
233 	unsigned int		sg_index; /*  current buf Index  */
234 	unsigned char __user 	*cur_ptr; /*  Current static bufs  */
235 	struct snd_sst_buf_entry __user *buf_entry;
236 	struct sst_block	data_blk; /* stream ops block */
237 	struct sst_block	ctrl_blk; /* stream control cmd block */
238 	enum snd_sst_buf_type   buf_type;
239 	void			*pcm_substream;
240 	void (*period_elapsed) (void *pcm_substream);
241 	unsigned int		sfreq;
242 	void			*decode_ibuf, *decode_obuf;
243 	unsigned int		decode_isize, decode_osize;
244 	u8 decode_ibuf_type, decode_obuf_type;
245 	unsigned int		idecode_alloc;
246 	unsigned int		need_draining;
247 	unsigned int		str_type;
248 	u32			curr_bytes;
249 	u32			cumm_bytes;
250 	u32			src;
251 	enum snd_sst_audio_device_type device;
252 	u8			pcm_slot;
253 };
254 
255 /*
256  * struct stream_alloc_bloc - this structure is used for blocking the user's
257  * alloc calls to fw's response to alloc calls
258  *
259  * @sst_id : session id of blocked stream
260  * @ops_block : ops block struture
261  */
262 struct stream_alloc_block {
263 	int			sst_id; /* session id of blocked stream */
264 	struct sst_block	ops_block; /* ops block struture */
265 };
266 
267 #define SST_FW_SIGN "$SST"
268 #define SST_FW_LIB_SIGN "$LIB"
269 
270 /*
271  * struct fw_header - FW file headers
272  *
273  * @signature : FW signature
274  * @modules : # of modules
275  * @file_format : version of header format
276  * @reserved : reserved fields
277  */
278 struct fw_header {
279 	unsigned char signature[FW_SIGNATURE_SIZE]; /* FW signature */
280 	u32 file_size; /* size of fw minus this header */
281 	u32 modules; /*  # of modules */
282 	u32 file_format; /* version of header format */
283 	u32 reserved[4];
284 };
285 
286 struct fw_module_header {
287 	unsigned char signature[FW_SIGNATURE_SIZE]; /* module signature */
288 	u32 mod_size; /* size of module */
289 	u32 blocks; /* # of blocks */
290 	u32 type; /* codec type, pp lib */
291 	u32 entry_point;
292 };
293 
294 struct dma_block_info {
295 	enum sst_ram_type	type;	/* IRAM/DRAM */
296 	u32			size;	/* Bytes */
297 	u32			ram_offset; /* Offset in I/DRAM */
298 	u32			rsvd;	/* Reserved field */
299 };
300 
301 struct ioctl_pvt_data {
302 	int			str_id;
303 	int			pvt_id;
304 };
305 
306 struct sst_ipc_msg_wq {
307 	union ipc_header	header;
308 	char mailbox[SST_MAILBOX_SIZE];
309 	struct work_struct	wq;
310 };
311 
312 struct mad_ops_wq {
313 	int stream_id;
314 	enum sst_controls control_op;
315 	struct work_struct	wq;
316 
317 };
318 
319 #define SST_MMAP_PAGES	(640*1024 / PAGE_SIZE)
320 #define SST_MMAP_STEP	(40*1024 / PAGE_SIZE)
321 
322 /***
323  * struct intel_sst_drv - driver ops
324  *
325  * @pmic_state : pmic state
326  * @pmic_vendor : pmic vendor detected
327  * @sst_state : current sst device state
328  * @pci_id : PCI device id loaded
329  * @shim : SST shim pointer
330  * @mailbox : SST mailbox pointer
331  * @iram : SST IRAM pointer
332  * @dram : SST DRAM pointer
333  * @shim_phy_add : SST shim phy addr
334  * @ipc_dispatch_list : ipc messages dispatched
335  * @ipc_post_msg_wq : wq to post IPC messages context
336  * @ipc_process_msg : wq to process msgs from FW context
337  * @ipc_process_reply : wq to process reply from FW context
338  * @ipc_post_msg : wq to post reply from FW context
339  * @mad_ops : MAD driver operations registered
340  * @mad_wq : MAD driver wq
341  * @post_msg_wq : wq to post IPC messages
342  * @process_msg_wq : wq to process msgs from FW
343  * @process_reply_wq : wq to process reply from FW
344  * @streams : sst stream contexts
345  * @alloc_block : block structure for alloc
346  * @tgt_dev_blk : block structure for target device
347  * @fw_info_blk : block structure for fw info block
348  * @vol_info_blk : block structure for vol info block
349  * @mute_info_blk : block structure for mute info block
350  * @hs_info_blk : block structure for hs info block
351  * @list_lock : sst driver list lock (deprecated)
352  * @list_spin_lock : sst driver spin lock block
353  * @scard_ops : sst card ops
354  * @pci : sst pci device struture
355  * @active_streams : sst active streams
356  * @sst_lock : sst device lock
357  * @stream_lock : sst stream lock
358  * @unique_id : sst unique id
359  * @stream_cnt : total sst active stream count
360  * @pb_streams : total active pb streams
361  * @cp_streams : total active cp streams
362  * @lpe_stalled : lpe stall status
363  * @pmic_port_instance : active pmic port instance
364  * @rx_time_slot_status : active rx slot
365  * @lpaudio_start : lpaudio status
366  * @audio_start : audio status
367  * @devt_d : pointer to /dev/lpe node
368  * @devt_c : pointer to /dev/lpe_ctrl node
369  * @max_streams : max streams allowed
370  */
371 struct intel_sst_drv {
372 	bool			pmic_state;
373 	int			pmic_vendor;
374 	int			sst_state;
375 	unsigned int		pci_id;
376 	void __iomem		*shim;
377 	void __iomem		*mailbox;
378 	void __iomem		*iram;
379 	void __iomem		*dram;
380 	unsigned int		shim_phy_add;
381 	struct list_head	ipc_dispatch_list;
382 	struct work_struct	ipc_post_msg_wq;
383 	struct sst_ipc_msg_wq	ipc_process_msg;
384 	struct sst_ipc_msg_wq	ipc_process_reply;
385 	struct sst_ipc_msg_wq	ipc_post_msg;
386 	struct mad_ops_wq	mad_ops;
387 	wait_queue_head_t	wait_queue;
388 	struct workqueue_struct *mad_wq;
389 	struct workqueue_struct *post_msg_wq;
390 	struct workqueue_struct *process_msg_wq;
391 	struct workqueue_struct *process_reply_wq;
392 
393 	struct stream_info	streams[MAX_NUM_STREAMS];
394 	struct stream_alloc_block alloc_block[MAX_ACTIVE_STREAM];
395 	struct sst_block	tgt_dev_blk, fw_info_blk, ppp_params_blk,
396 				vol_info_blk, mute_info_blk, hs_info_blk;
397 	struct mutex		list_lock;/* mutex for IPC list locking */
398 	spinlock_t	list_spin_lock; /* mutex for IPC list locking */
399 	struct snd_pmic_ops	*scard_ops;
400 	struct pci_dev		*pci;
401 	int active_streams[MAX_NUM_STREAMS];
402 	void			*mmap_mem;
403 	struct mutex            sst_lock;
404 	struct mutex		stream_lock;
405 	unsigned int		mmap_len;
406 	unsigned int		unique_id;
407 	unsigned int		stream_cnt;	/* total streams */
408 	unsigned int		encoded_cnt;	/* enocded streams only */
409 	unsigned int		am_cnt;
410 	unsigned int		pb_streams;	/* pb streams active */
411 	unsigned int		cp_streams;	/* cp streams active */
412 	unsigned int		lpe_stalled; /* LPE is stalled or not */
413 	unsigned int		pmic_port_instance; /*pmic port instance*/
414 	int			rx_time_slot_status;
415 	unsigned int		lpaudio_start;
416 		/* 1 - LPA stream(MP3 pb) in progress*/
417 	unsigned int		audio_start;
418 	dev_t			devt_d, devt_c;
419 	unsigned int		max_streams;
420 };
421 
422 extern struct intel_sst_drv *sst_drv_ctx;
423 
424 #define CHIP_REV_REG 0xff108000
425 #define CHIP_REV_ADDR 0x78
426 
427 /* misc definitions */
428 #define FW_DWNL_ID 0xFF
429 #define LOOP1 0x11111111
430 #define LOOP2 0x22222222
431 #define LOOP3 0x33333333
432 #define LOOP4 0x44444444
433 
434 #define SST_DEFAULT_PMIC_PORT 1 /*audio port*/
435 /* NOTE: status will have +ve for good cases and -ve for error ones */
436 #define MAX_STREAM_FIELD 255
437 
438 int sst_alloc_stream(char *params, unsigned int stream_ops, u8 codec,
439 						unsigned int session_id);
440 int sst_alloc_stream_response(unsigned int str_id,
441 				struct snd_sst_alloc_response *response);
442 int sst_stalled(void);
443 int sst_pause_stream(int id);
444 int sst_resume_stream(int id);
445 int sst_enable_rx_timeslot(int status);
446 int sst_drop_stream(int id);
447 int sst_free_stream(int id);
448 int sst_start_stream(int streamID);
449 int sst_play_frame(int streamID);
450 int sst_pcm_play_frame(int str_id, struct sst_stream_bufs *sst_buf);
451 int sst_capture_frame(int streamID);
452 int sst_set_stream_param(int streamID, struct snd_sst_params *str_param);
453 int sst_target_device_select(struct snd_sst_target_device *target_device);
454 int sst_decode(int str_id, struct snd_sst_dbufs *dbufs);
455 int sst_get_decoded_bytes(int str_id, unsigned long long *bytes);
456 int sst_get_fw_info(struct snd_sst_fw_info *info);
457 int sst_get_stream_params(int str_id,
458 		struct snd_sst_get_stream_params *get_params);
459 int sst_get_stream(struct snd_sst_params *str_param);
460 int sst_get_stream_allocated(struct snd_sst_params *str_param,
461 				struct snd_sst_lib_download **lib_dnld);
462 int sst_drain_stream(int str_id);
463 int sst_get_vol(struct snd_sst_vol *set_vol);
464 int sst_set_vol(struct snd_sst_vol *set_vol);
465 int sst_set_mute(struct snd_sst_mute *set_mute);
466 
467 
468 void sst_post_message(struct work_struct *work);
469 void sst_process_message(struct work_struct *work);
470 void sst_process_reply(struct work_struct *work);
471 void sst_process_mad_ops(struct work_struct *work);
472 void sst_process_mad_jack_detection(struct work_struct *work);
473 
474 long intel_sst_ioctl(struct file *file_ptr, unsigned int cmd,
475 			unsigned long arg);
476 int intel_sst_open(struct inode *i_node, struct file *file_ptr);
477 int intel_sst_open_cntrl(struct inode *i_node, struct file *file_ptr);
478 int intel_sst_release(struct inode *i_node, struct file *file_ptr);
479 int intel_sst_release_cntrl(struct inode *i_node, struct file *file_ptr);
480 int intel_sst_read(struct file *file_ptr, char __user *buf,
481 			size_t count, loff_t *ppos);
482 int intel_sst_write(struct file *file_ptr, const char __user *buf,
483 			size_t count, loff_t *ppos);
484 int intel_sst_mmap(struct file *fp, struct vm_area_struct *vma);
485 ssize_t intel_sst_aio_write(struct kiocb *kiocb, const struct iovec *iov,
486 			unsigned long nr_segs, loff_t  offset);
487 ssize_t intel_sst_aio_read(struct kiocb *kiocb, const struct iovec *iov,
488 			unsigned long nr_segs, loff_t offset);
489 
490 int sst_load_fw(const struct firmware *fw, void *context);
491 int sst_load_library(struct snd_sst_lib_download *lib, u8 ops);
492 int sst_spi_mode_enable(void);
493 int sst_get_block_stream(struct intel_sst_drv *sst_drv_ctx);
494 
495 int sst_wait_interruptible(struct intel_sst_drv *sst_drv_ctx,
496 				struct sst_block *block);
497 int sst_wait_interruptible_timeout(struct intel_sst_drv *sst_drv_ctx,
498 		struct sst_block *block, int timeout);
499 int sst_wait_timeout(struct intel_sst_drv *sst_drv_ctx,
500 		struct stream_alloc_block *block);
501 int sst_create_large_msg(struct ipc_post **arg);
502 int sst_create_short_msg(struct ipc_post **arg);
503 void sst_wake_up_alloc_block(struct intel_sst_drv *sst_drv_ctx,
504 		u8 sst_id, int status, void *data);
505 void sst_clear_interrupt(void);
506 int intel_sst_resume(struct pci_dev *pci);
507 int sst_download_fw(void);
508 void free_stream_context(unsigned int str_id);
509 void sst_clean_stream(struct stream_info *stream);
510 
511 /*
512  * sst_fill_header - inline to fill sst header
513  *
514  * @header : ipc header
515  * @msg : IPC message to be sent
516  * @large : is ipc large msg
517  * @str_id : stream id
518  *
519  * this function is an inline function that sets the headers before
520  * sending a message
521  */
sst_fill_header(union ipc_header * header,int msg,int large,int str_id)522 static inline void sst_fill_header(union ipc_header *header,
523 				int msg, int large, int str_id)
524 {
525 	header->part.msg_id = msg;
526 	header->part.str_id = str_id;
527 	header->part.large = large;
528 	header->part.done = 0;
529 	header->part.busy = 1;
530 	header->part.data = 0;
531 }
532 
533 /*
534  * sst_assign_pvt_id - assign a pvt id for stream
535  *
536  * @sst_drv_ctx : driver context
537  *
538  * this inline function assigns a private id for calls that dont have stream
539  * context yet, should be called with lock held
540  */
sst_assign_pvt_id(struct intel_sst_drv * sst_drv_ctx)541 static inline unsigned int sst_assign_pvt_id(struct intel_sst_drv *sst_drv_ctx)
542 {
543 	sst_drv_ctx->unique_id++;
544 	if (sst_drv_ctx->unique_id >= MAX_NUM_STREAMS)
545 		sst_drv_ctx->unique_id = 1;
546 	return sst_drv_ctx->unique_id;
547 }
548 
549 /*
550  * sst_init_stream - this function initialzes stream context
551  *
552  * @stream : stream struture
553  * @codec : codec for stream
554  * @sst_id : stream id
555  * @ops : stream operation
556  * @slot : stream pcm slot
557  * @device : device type
558  *
559  * this inline function initialzes stream context for allocated stream
560  */
sst_init_stream(struct stream_info * stream,int codec,int sst_id,int ops,u8 slot,enum snd_sst_audio_device_type device)561 static inline void sst_init_stream(struct stream_info *stream,
562 		int codec, int sst_id, int ops, u8 slot,
563 		enum snd_sst_audio_device_type device)
564 {
565 	stream->status = STREAM_INIT;
566 	stream->prev = STREAM_UN_INIT;
567 	stream->codec = codec;
568 	stream->sst_id = sst_id;
569 	stream->str_type = 0;
570 	stream->ops = ops;
571 	stream->data_blk.on = false;
572 	stream->data_blk.condition = false;
573 	stream->data_blk.ret_code = 0;
574 	stream->data_blk.data = NULL;
575 	stream->ctrl_blk.on = false;
576 	stream->ctrl_blk.condition = false;
577 	stream->ctrl_blk.ret_code = 0;
578 	stream->ctrl_blk.data = NULL;
579 	stream->need_draining = false;
580 	stream->decode_ibuf = NULL;
581 	stream->decode_isize = 0;
582 	stream->mmapped = false;
583 	stream->pcm_slot = slot;
584 	stream->device = device;
585 }
586 
587 
588 /*
589  * sst_validate_strid - this function validates the stream id
590  *
591  * @str_id : stream id to be validated
592  *
593  * returns 0 if valid stream
594  */
sst_validate_strid(int str_id)595 static inline int sst_validate_strid(int str_id)
596 {
597 	if (str_id <= 0 || str_id > sst_drv_ctx->max_streams) {
598 		pr_err("SST ERR: invalid stream id : %d MAX_STREAMS:%d\n",
599 					str_id, sst_drv_ctx->max_streams);
600 		return -EINVAL;
601 	} else
602 		return 0;
603 }
604 
sst_shim_write(void __iomem * addr,int offset,int value)605 static inline int sst_shim_write(void __iomem *addr, int offset, int value)
606 {
607 
608 	if (sst_drv_ctx->pci_id == SST_MRST_PCI_ID)
609 		writel(value, addr + SST_ISRD);	/*dummy*/
610 	writel(value, addr + offset);
611 	return 0;
612 }
613 
sst_shim_read(void __iomem * addr,int offset)614 static inline int sst_shim_read(void __iomem *addr, int offset)
615 {
616 	return readl(addr + offset);
617 }
618 #endif /* __INTEL_SST_COMMON_H__ */
619