Mark Brown | a4b1299 | 2014-03-12 23:04:35 +0000 | [diff] [blame] | 1 | /* |
| 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 | |
| 20 | struct sst_byt; |
| 21 | struct sst_byt_stream; |
| 22 | struct sst_pdata; |
| 23 | extern 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 */ |
| 36 | struct 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 */ |
| 42 | int sst_byt_stream_set_bits(struct sst_byt *byt, struct sst_byt_stream *stream, |
| 43 | int bits); |
| 44 | int sst_byt_stream_set_channels(struct sst_byt *byt, |
| 45 | struct sst_byt_stream *stream, u8 channels); |
| 46 | int sst_byt_stream_set_rate(struct sst_byt *byt, struct sst_byt_stream *stream, |
| 47 | unsigned int rate); |
| 48 | int sst_byt_stream_type(struct sst_byt *byt, struct sst_byt_stream *stream, |
| 49 | int codec_type, int stream_type, int operation); |
| 50 | int sst_byt_stream_buffer(struct sst_byt *byt, struct sst_byt_stream *stream, |
| 51 | uint32_t buffer_addr, uint32_t buffer_size); |
| 52 | int sst_byt_stream_commit(struct sst_byt *byt, struct sst_byt_stream *stream); |
| 53 | int sst_byt_stream_free(struct sst_byt *byt, struct sst_byt_stream *stream); |
| 54 | |
| 55 | /* stream ALSA trigger operations */ |
Jarkko Nikula | a6686ed | 2014-05-08 16:07:23 +0300 | [diff] [blame] | 56 | int sst_byt_stream_start(struct sst_byt *byt, struct sst_byt_stream *stream, |
| 57 | u32 start_offset); |
Mark Brown | a4b1299 | 2014-03-12 23:04:35 +0000 | [diff] [blame] | 58 | int sst_byt_stream_stop(struct sst_byt *byt, struct sst_byt_stream *stream); |
| 59 | int sst_byt_stream_pause(struct sst_byt *byt, struct sst_byt_stream *stream); |
| 60 | int sst_byt_stream_resume(struct sst_byt *byt, struct sst_byt_stream *stream); |
| 61 | |
| 62 | int sst_byt_get_dsp_position(struct sst_byt *byt, |
| 63 | struct sst_byt_stream *stream, int buffer_size); |
| 64 | |
| 65 | /* init */ |
| 66 | int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata); |
| 67 | void sst_byt_dsp_free(struct device *dev, struct sst_pdata *pdata); |
| 68 | struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt); |
Liam Girdwood | af94aa5 | 2014-05-08 16:07:26 +0300 | [diff] [blame] | 69 | int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata); |
| 70 | int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata); |
| 71 | int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata); |
Mark Brown | a4b1299 | 2014-03-12 23:04:35 +0000 | [diff] [blame] | 72 | |
| 73 | #endif |