1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Intel Baytrail SST IPC Support
4 * Copyright (c) 2014, Intel Corporation.
7 #ifndef __SST_BYT_IPC_H
8 #define __SST_BYT_IPC_H
10 #include <linux/types.h>
13 struct sst_byt_stream
;
15 extern struct sst_ops sst_byt_ops
;
18 #define SST_BYT_MAILBOX_OFFSET 0x144000
19 #define SST_BYT_TIMESTAMP_OFFSET (SST_BYT_MAILBOX_OFFSET + 0x800)
22 * Upfront defined maximum message size that is
23 * expected by the in/out communication pipes in FW.
25 #define SST_BYT_IPC_MAX_PAYLOAD_SIZE 200
28 struct sst_byt_stream
*sst_byt_stream_new(struct sst_byt
*byt
, int id
,
29 uint32_t (*get_write_position
)(struct sst_byt_stream
*stream
,
33 /* stream configuration */
34 int sst_byt_stream_set_bits(struct sst_byt
*byt
, struct sst_byt_stream
*stream
,
36 int sst_byt_stream_set_channels(struct sst_byt
*byt
,
37 struct sst_byt_stream
*stream
, u8 channels
);
38 int sst_byt_stream_set_rate(struct sst_byt
*byt
, struct sst_byt_stream
*stream
,
40 int sst_byt_stream_type(struct sst_byt
*byt
, struct sst_byt_stream
*stream
,
41 int codec_type
, int stream_type
, int operation
);
42 int sst_byt_stream_buffer(struct sst_byt
*byt
, struct sst_byt_stream
*stream
,
43 uint32_t buffer_addr
, uint32_t buffer_size
);
44 int sst_byt_stream_commit(struct sst_byt
*byt
, struct sst_byt_stream
*stream
);
45 int sst_byt_stream_free(struct sst_byt
*byt
, struct sst_byt_stream
*stream
);
47 /* stream ALSA trigger operations */
48 int sst_byt_stream_start(struct sst_byt
*byt
, struct sst_byt_stream
*stream
,
50 int sst_byt_stream_stop(struct sst_byt
*byt
, struct sst_byt_stream
*stream
);
51 int sst_byt_stream_pause(struct sst_byt
*byt
, struct sst_byt_stream
*stream
);
52 int sst_byt_stream_resume(struct sst_byt
*byt
, struct sst_byt_stream
*stream
);
54 int sst_byt_get_dsp_position(struct sst_byt
*byt
,
55 struct sst_byt_stream
*stream
, int buffer_size
);
58 int sst_byt_dsp_init(struct device
*dev
, struct sst_pdata
*pdata
);
59 void sst_byt_dsp_free(struct device
*dev
, struct sst_pdata
*pdata
);
60 struct sst_dsp
*sst_byt_get_dsp(struct sst_byt
*byt
);
61 int sst_byt_dsp_suspend_late(struct device
*dev
, struct sst_pdata
*pdata
);
62 int sst_byt_dsp_boot(struct device
*dev
, struct sst_pdata
*pdata
);
63 int sst_byt_dsp_wait_for_ready(struct device
*dev
, struct sst_pdata
*pdata
);