blob: 8faff6dcf25d0c1328c799cf40b78620aa3c59d9 [file] [log] [blame]
Mark Browna4b12992014-03-12 23:04:35 +00001/*
2 * Intel Baytrail SST IPC Support
3 * Copyright (c) 2014, Intel Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 */
14
15#ifndef __SST_BYT_IPC_H
16#define __SST_BYT_IPC_H
17
18#include <linux/types.h>
19
20struct sst_byt;
21struct sst_byt_stream;
22struct sst_pdata;
23extern struct sst_ops sst_byt_ops;
24
25
26#define SST_BYT_MAILBOX_OFFSET 0x144000
27#define SST_BYT_TIMESTAMP_OFFSET (SST_BYT_MAILBOX_OFFSET + 0x800)
28
29/**
30 * Upfront defined maximum message size that is
31 * expected by the in/out communication pipes in FW.
32 */
33#define SST_BYT_IPC_MAX_PAYLOAD_SIZE 200
34
35/* stream API */
36struct sst_byt_stream *sst_byt_stream_new(struct sst_byt *byt, int id,
37 uint32_t (*get_write_position)(struct sst_byt_stream *stream,
38 void *data),
39 void *data);
40
41/* stream configuration */
42int sst_byt_stream_set_bits(struct sst_byt *byt, struct sst_byt_stream *stream,
43 int bits);
44int sst_byt_stream_set_channels(struct sst_byt *byt,
45 struct sst_byt_stream *stream, u8 channels);
46int sst_byt_stream_set_rate(struct sst_byt *byt, struct sst_byt_stream *stream,
47 unsigned int rate);
48int sst_byt_stream_type(struct sst_byt *byt, struct sst_byt_stream *stream,
49 int codec_type, int stream_type, int operation);
50int sst_byt_stream_buffer(struct sst_byt *byt, struct sst_byt_stream *stream,
51 uint32_t buffer_addr, uint32_t buffer_size);
52int sst_byt_stream_commit(struct sst_byt *byt, struct sst_byt_stream *stream);
53int sst_byt_stream_free(struct sst_byt *byt, struct sst_byt_stream *stream);
54
55/* stream ALSA trigger operations */
Jarkko Nikulaa6686ed2014-05-08 16:07:23 +030056int sst_byt_stream_start(struct sst_byt *byt, struct sst_byt_stream *stream,
57 u32 start_offset);
Mark Browna4b12992014-03-12 23:04:35 +000058int sst_byt_stream_stop(struct sst_byt *byt, struct sst_byt_stream *stream);
59int sst_byt_stream_pause(struct sst_byt *byt, struct sst_byt_stream *stream);
60int sst_byt_stream_resume(struct sst_byt *byt, struct sst_byt_stream *stream);
61
62int sst_byt_get_dsp_position(struct sst_byt *byt,
63 struct sst_byt_stream *stream, int buffer_size);
64
65/* init */
66int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata);
67void sst_byt_dsp_free(struct device *dev, struct sst_pdata *pdata);
68struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt);
Liam Girdwoodaf94aa52014-05-08 16:07:26 +030069int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata);
70int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata);
71int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata);
Mark Browna4b12992014-03-12 23:04:35 +000072
73#endif