forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ASoC: SOF: add sof vBE and vFE support
This patch adds the sof virtio BE and FE support. It will create a dev node for the communication to the userspace. It also handles the virtio vq event. It dispatches the different vq kicks to different handlers. In the virtio vq handling, it handles all the ipc events from vFE. When there is position update from FW, it will check whether there is an available entry in notification vq. If yes, send the position update notification immediately. If there is no available entry, add the position update event in a list. As soon as the notification vq has an available entry, send the position update to the vFE. For vFE, it will create a virtual audio device driver and communite with vBE audio driver to create PCMs and playback/capture streams. Signed-off-by: Libin Yang <libin.yang@intel.com>
- Loading branch information
Showing
14 changed files
with
2,000 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause) | ||
* | ||
* This file is provided under a dual BSD/GPLv2 license. When using or | ||
* redistributing this file, you may do so under either license. | ||
* | ||
* Copyright(c) 2018 Intel Corporation. All rights reserved. | ||
* | ||
* Contact Information: | ||
* Author: Luo Xionghu <xionghu.luo@intel.com> | ||
* Liam Girdwood <liam.r.girdwood@linux.intel.com>. | ||
*/ | ||
|
||
#ifndef _SOF_VIRTIO_H | ||
#define _SOF_VIRTIO_H | ||
|
||
/* Currently we defined 4 vqs to do the IPC, CMD_TX is for send the msg | ||
* from FE to BE, and CMD_RX is to receive the reply. NOT_RX is to receive | ||
* the notification, and NOT_TX is to send empty buffer from FE to BE. | ||
* If we can handle the IPC with only 2 vqs, the config still need to | ||
* be changed in the device model(VM config), then only CMD_VQ and NOT_VQ | ||
* is needed. | ||
*/ | ||
|
||
#define SOF_VIRTIO_IPC_CMD_TX_VQ 0 | ||
#define SOF_VIRTIO_IPC_CMD_RX_VQ 1 | ||
#define SOF_VIRTIO_IPC_NOT_TX_VQ 2 | ||
#define SOF_VIRTIO_IPC_NOT_RX_VQ 3 | ||
#define SOF_VIRTIO_NUM_OF_VQS 4 | ||
|
||
/* command messages from FE to BE, trigger/open/hw_params and so on */ | ||
#define SOF_VIRTIO_IPC_CMD_TX_VQ_NAME "sof-ipc-cmd-tx" | ||
|
||
/* get the reply of the command message */ | ||
#define SOF_VIRTIO_IPC_CMD_RX_VQ_NAME "sof-ipc-cmd-rx" | ||
|
||
/* first the FE need send empty buffer to BE to get the notification */ | ||
#define SOF_VIRTIO_IPC_NOT_TX_VQ_NAME "sof-ipc-not-tx" | ||
|
||
/* the vq to get the notification */ | ||
#define SOF_VIRTIO_IPC_NOT_RX_VQ_NAME "sof-ipc-not-rx" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.