bcc2a2dc3b
Skylake driver is divided into two modules: - snd_soc_skl - snd_soc_skl_ipc and nothing would be wrong if not for the fact that both cannot exist without one another. IPC module is not some kind of extension, as it is the case for snd_hda_ext_core which is separated from snd_hda_core - legacy hda interface. It's as much core Skylake module as snd_soc_skl is. Statement backed up by existence of circular dependency between this two. To eliminate said problem, struct skl_sst has been created. From that very momment, Skylake has been plagued by header errors (incomplete structs, unknown references etc.) whenever something new is to be added or code is cleaned up. As this design is being corrected, struct skl_sst is no longer needed, so combine it with struct skl. To avoid ambiguity when searching for skl stuff (struct skl *skl) it has also been renamed to skl_dev. No functional changes. Signed-off-by: Piotr Maziarz <piotrx.maziarz@intel.com> Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com> Link: https://lore.kernel.org/r/20190723145854.8527-2-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
89 lines
2.1 KiB
C
89 lines
2.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Intel SST generic IPC Support
|
|
*
|
|
* Copyright (C) 2015, Intel Corporation. All rights reserved.
|
|
*/
|
|
|
|
#ifndef __SST_GENERIC_IPC_H
|
|
#define __SST_GENERIC_IPC_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/wait.h>
|
|
#include <linux/list.h>
|
|
#include <linux/workqueue.h>
|
|
#include <linux/sched.h>
|
|
|
|
#define IPC_MAX_MAILBOX_BYTES 256
|
|
|
|
struct ipc_message {
|
|
struct list_head list;
|
|
u64 header;
|
|
|
|
/* direction wrt host CPU */
|
|
char *tx_data;
|
|
size_t tx_size;
|
|
char *rx_data;
|
|
size_t rx_size;
|
|
|
|
wait_queue_head_t waitq;
|
|
bool pending;
|
|
bool complete;
|
|
bool wait;
|
|
int errno;
|
|
};
|
|
|
|
struct sst_generic_ipc;
|
|
struct sst_dsp;
|
|
|
|
struct sst_plat_ipc_ops {
|
|
void (*tx_msg)(struct sst_generic_ipc *, struct ipc_message *);
|
|
void (*shim_dbg)(struct sst_generic_ipc *, const char *);
|
|
void (*tx_data_copy)(struct ipc_message *, char *, size_t);
|
|
u64 (*reply_msg_match)(u64 header, u64 *mask);
|
|
bool (*is_dsp_busy)(struct sst_dsp *dsp);
|
|
int (*check_dsp_lp_on)(struct sst_dsp *dsp, bool state);
|
|
};
|
|
|
|
/* SST generic IPC data */
|
|
struct sst_generic_ipc {
|
|
struct device *dev;
|
|
struct sst_dsp *dsp;
|
|
|
|
/* IPC messaging */
|
|
struct list_head tx_list;
|
|
struct list_head rx_list;
|
|
struct list_head empty_list;
|
|
wait_queue_head_t wait_txq;
|
|
struct task_struct *tx_thread;
|
|
struct work_struct kwork;
|
|
bool pending;
|
|
struct ipc_message *msg;
|
|
int tx_data_max_size;
|
|
int rx_data_max_size;
|
|
|
|
struct sst_plat_ipc_ops ops;
|
|
};
|
|
|
|
int sst_ipc_tx_message_wait(struct sst_generic_ipc *ipc, u64 header,
|
|
void *tx_data, size_t tx_bytes, void *rx_data, size_t rx_bytes);
|
|
|
|
int sst_ipc_tx_message_nowait(struct sst_generic_ipc *ipc, u64 header,
|
|
void *tx_data, size_t tx_bytes);
|
|
|
|
int sst_ipc_tx_message_nopm(struct sst_generic_ipc *ipc, u64 header,
|
|
void *tx_data, size_t tx_bytes, void *rx_data, size_t rx_bytes);
|
|
|
|
struct ipc_message *sst_ipc_reply_find_msg(struct sst_generic_ipc *ipc,
|
|
u64 header);
|
|
|
|
void sst_ipc_tx_msg_reply_complete(struct sst_generic_ipc *ipc,
|
|
struct ipc_message *msg);
|
|
|
|
void sst_ipc_drop_all(struct sst_generic_ipc *ipc);
|
|
int sst_ipc_init(struct sst_generic_ipc *ipc);
|
|
void sst_ipc_fini(struct sst_generic_ipc *ipc);
|
|
|
|
#endif
|