sst-baytrail-ipc.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. #ifndef __SST_BYT_IPC_H
  15. #define __SST_BYT_IPC_H
  16. #include <linux/types.h>
  17. struct sst_byt;
  18. struct sst_byt_stream;
  19. struct sst_pdata;
  20. extern struct sst_ops sst_byt_ops;
  21. #define SST_BYT_MAILBOX_OFFSET 0x144000
  22. #define SST_BYT_TIMESTAMP_OFFSET (SST_BYT_MAILBOX_OFFSET + 0x800)
  23. /**
  24. * Upfront defined maximum message size that is
  25. * expected by the in/out communication pipes in FW.
  26. */
  27. #define SST_BYT_IPC_MAX_PAYLOAD_SIZE 200
  28. /* stream API */
  29. struct sst_byt_stream *sst_byt_stream_new(struct sst_byt *byt, int id,
  30. uint32_t (*get_write_position)(struct sst_byt_stream *stream,
  31. void *data),
  32. void *data);
  33. /* stream configuration */
  34. int sst_byt_stream_set_bits(struct sst_byt *byt, struct sst_byt_stream *stream,
  35. int bits);
  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,
  39. unsigned int rate);
  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);
  46. /* stream ALSA trigger operations */
  47. int sst_byt_stream_start(struct sst_byt *byt, struct sst_byt_stream *stream,
  48. u32 start_offset);
  49. int sst_byt_stream_stop(struct sst_byt *byt, struct sst_byt_stream *stream);
  50. int sst_byt_stream_pause(struct sst_byt *byt, struct sst_byt_stream *stream);
  51. int sst_byt_stream_resume(struct sst_byt *byt, struct sst_byt_stream *stream);
  52. int sst_byt_get_dsp_position(struct sst_byt *byt,
  53. struct sst_byt_stream *stream, int buffer_size);
  54. /* init */
  55. int sst_byt_dsp_init(struct device *dev, struct sst_pdata *pdata);
  56. void sst_byt_dsp_free(struct device *dev, struct sst_pdata *pdata);
  57. struct sst_dsp *sst_byt_get_dsp(struct sst_byt *byt);
  58. int sst_byt_dsp_suspend_late(struct device *dev, struct sst_pdata *pdata);
  59. int sst_byt_dsp_boot(struct device *dev, struct sst_pdata *pdata);
  60. int sst_byt_dsp_wait_for_ready(struct device *dev, struct sst_pdata *pdata);
  61. #endif