linux/sound/soc/qcom/qdsp6/q6adm.c

// SPDX-License-Identifier: GPL-2.0
// Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
// Copyright (c) 2018, Linaro Limited

#include <linux/device.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/kref.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/soc/qcom/apr.h>
#include <linux/wait.h>
#include <sound/asound.h>
#include "q6adm.h"
#include "q6afe.h"
#include "q6core.h"
#include "q6dsp-common.h"
#include "q6dsp-errno.h"

#define ADM_CMD_DEVICE_OPEN_V5
#define ADM_CMDRSP_DEVICE_OPEN_V5
#define ADM_CMD_DEVICE_CLOSE_V5
#define ADM_CMD_MATRIX_MAP_ROUTINGS_V5

#define TIMEOUT_MS
#define RESET_COPP_ID
#define INVALID_COPP_ID
/* Definition for a legacy device session. */
#define ADM_LEGACY_DEVICE_SESSION
#define ADM_MATRIX_ID_AUDIO_RX
#define ADM_MATRIX_ID_AUDIO_TX

struct q6copp {};

struct q6adm {};

struct q6adm_cmd_device_open_v5 {} __packed;

struct q6adm_cmd_matrix_map_routings_v5 {} __packed;

struct q6adm_session_map_node_v5 {} __packed;

static struct q6copp *q6adm_find_copp(struct q6adm *adm, int port_idx,
				  int copp_idx)
{}

static void q6adm_free_copp(struct kref *ref)
{}

static int q6adm_callback(struct apr_device *adev, struct apr_resp_pkt *data)
{}

static struct q6copp *q6adm_alloc_copp(struct q6adm *adm, int port_idx)
{}

static int q6adm_apr_send_copp_pkt(struct q6adm *adm, struct q6copp *copp,
				   struct apr_pkt *pkt, uint32_t rsp_opcode)
{}

static int q6adm_device_close(struct q6adm *adm, struct q6copp *copp,
			      int port_id, int copp_idx)
{}

static struct q6copp *q6adm_find_matching_copp(struct q6adm *adm,
					       int port_id, int topology,
					       int mode, int rate,
					       int channel_mode, int bit_width,
					       int app_type)
{}

static int q6adm_device_open(struct q6adm *adm, struct q6copp *copp,
			     int port_id, int path, int topology,
			     int channel_mode, int bit_width, int rate)
{}

/**
 * q6adm_open() - open adm and grab a free copp
 *
 * @dev: Pointer to adm child device.
 * @port_id: port id
 * @path: playback or capture path.
 * @rate: rate at which copp is required.
 * @channel_mode: channel mode
 * @topology: adm topology id
 * @perf_mode: performace mode.
 * @bit_width: audio sample bit width
 * @app_type: Application type.
 * @acdb_id: ACDB id
 *
 * Return: Will be an negative on error or a valid copp pointer on success.
 */
struct q6copp *q6adm_open(struct device *dev, int port_id, int path, int rate,
	       int channel_mode, int topology, int perf_mode,
	       uint16_t bit_width, int app_type, int acdb_id)
{}
EXPORT_SYMBOL_GPL();

/**
 * q6adm_get_copp_id() - get copp index
 *
 * @copp: Pointer to valid copp
 *
 * Return: Will be an negative on error or a valid copp index on success.
 **/
int q6adm_get_copp_id(struct q6copp *copp)
{}
EXPORT_SYMBOL_GPL();

/**
 * q6adm_matrix_map() - Map asm streams and afe ports using payload
 *
 * @dev: Pointer to adm child device.
 * @path: playback or capture path.
 * @payload_map: map between session id and afe ports.
 * @perf_mode: Performace mode.
 *
 * Return: Will be an negative on error or a zero on success.
 */
int q6adm_matrix_map(struct device *dev, int path,
		     struct route_payload payload_map, int perf_mode)
{}
EXPORT_SYMBOL_GPL();

/**
 * q6adm_close() - Close adm copp
 *
 * @dev: Pointer to adm child device.
 * @copp: pointer to previously opened copp
 *
 * Return: Will be an negative on error or a zero on success.
 */
int q6adm_close(struct device *dev, struct q6copp *copp)
{}
EXPORT_SYMBOL_GPL();

static int q6adm_probe(struct apr_device *adev)
{}

#ifdef CONFIG_OF
static const struct of_device_id q6adm_device_id[]  =;
MODULE_DEVICE_TABLE(of, q6adm_device_id);
#endif

static struct apr_driver qcom_q6adm_driver =;

module_apr_driver();
MODULE_DESCRIPTION();
MODULE_LICENSE();