~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/soc/intel/common/sst-ipc.h

Version: ~ [ linux-5.3 ] ~ [ linux-5.2.15 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.73 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.144 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.193 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.193 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.73 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * Intel SST generic IPC Support
  3  *
  4  * Copyright (C) 2015, Intel Corporation. All rights reserved.
  5  *
  6  * This program is free software; you can redistribute it and/or
  7  * modify it under the terms of the GNU General Public License version
  8  * 2 as published by the Free Software Foundation.
  9  *
 10  * This program is distributed in the hope that it will be useful,
 11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13  * GNU General Public License for more details.
 14  *
 15  */
 16 
 17 #ifndef __SST_GENERIC_IPC_H
 18 #define __SST_GENERIC_IPC_H
 19 
 20 #include <linux/types.h>
 21 #include <linux/kernel.h>
 22 #include <linux/wait.h>
 23 #include <linux/list.h>
 24 #include <linux/workqueue.h>
 25 #include <linux/sched.h>
 26 
 27 #define IPC_MAX_MAILBOX_BYTES   256
 28 
 29 struct ipc_message {
 30         struct list_head list;
 31         u64 header;
 32 
 33         /* direction wrt host CPU */
 34         char *tx_data;
 35         size_t tx_size;
 36         char *rx_data;
 37         size_t rx_size;
 38 
 39         wait_queue_head_t waitq;
 40         bool pending;
 41         bool complete;
 42         bool wait;
 43         int errno;
 44 };
 45 
 46 struct sst_generic_ipc;
 47 
 48 struct sst_plat_ipc_ops {
 49         void (*tx_msg)(struct sst_generic_ipc *, struct ipc_message *);
 50         void (*shim_dbg)(struct sst_generic_ipc *, const char *);
 51         void (*tx_data_copy)(struct ipc_message *, char *, size_t);
 52         u64  (*reply_msg_match)(u64 header, u64 *mask);
 53         bool (*is_dsp_busy)(struct sst_dsp *dsp);
 54         int (*check_dsp_lp_on)(struct sst_dsp *dsp, bool state);
 55 };
 56 
 57 /* SST generic IPC data */
 58 struct sst_generic_ipc {
 59         struct device *dev;
 60         struct sst_dsp *dsp;
 61 
 62         /* IPC messaging */
 63         struct list_head tx_list;
 64         struct list_head rx_list;
 65         struct list_head empty_list;
 66         wait_queue_head_t wait_txq;
 67         struct task_struct *tx_thread;
 68         struct work_struct kwork;
 69         bool pending;
 70         struct ipc_message *msg;
 71         int tx_data_max_size;
 72         int rx_data_max_size;
 73 
 74         struct sst_plat_ipc_ops ops;
 75 };
 76 
 77 int sst_ipc_tx_message_wait(struct sst_generic_ipc *ipc, u64 header,
 78         void *tx_data, size_t tx_bytes, void *rx_data, size_t rx_bytes);
 79 
 80 int sst_ipc_tx_message_nowait(struct sst_generic_ipc *ipc, u64 header,
 81         void *tx_data, size_t tx_bytes);
 82 
 83 int sst_ipc_tx_message_nopm(struct sst_generic_ipc *ipc, u64 header,
 84         void *tx_data, size_t tx_bytes, void *rx_data, size_t rx_bytes);
 85 
 86 struct ipc_message *sst_ipc_reply_find_msg(struct sst_generic_ipc *ipc,
 87         u64 header);
 88 
 89 void sst_ipc_tx_msg_reply_complete(struct sst_generic_ipc *ipc,
 90         struct ipc_message *msg);
 91 
 92 void sst_ipc_drop_all(struct sst_generic_ipc *ipc);
 93 int sst_ipc_init(struct sst_generic_ipc *ipc);
 94 void sst_ipc_fini(struct sst_generic_ipc *ipc);
 95 
 96 #endif
 97 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp