* Copyright (c) 2021 Huawei Device Co., Ltd.
*
* HDF is dual licensed: you can use it either under the terms of
* the GPL, or the BSD license, at your option.
* See the LICENSE file in the root of this repository for complete details.
*/
#ifndef AUDIO_CODEC_IF_H
#define AUDIO_CODEC_IF_H
#include "audio_host.h"
#include "audio_control.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
* @brief Defines Codec device name and data.
*
* @since 1.0
* @version 1.0
*/
struct CodecDevice {
const char *devCodecName;
struct CodecData *devData;
struct HdfDeviceObject *device;
struct DListHead list;
};
* @brief Defines Codec private data.
*
* @since 1.0
* @version 1.0
*/
struct CodecData {
const char *drvCodecName;
* @brief Defines Codec device init.
*
* @param audioCard Indicates an audio card device.
* @param codec Indicates a codec device.
*
* @return Returns <b>0</b> if codec device init success; returns a non-zero value otherwise.
*
* @since 1.0
* @version 1.0
*/
int32_t (*Init)(struct AudioCard *audioCard, const struct CodecDevice *codec);
* @brief Defines Codec device reg read.
*
* @param codec Indicates a codec device.
* @param reg Indicates reg offset.
* @param value Indicates read reg value.
*
* @return Returns <b>0</b> if codec device read reg success; returns a non-zero value otherwise.
*
* @since 1.0
* @version 1.0
*/
int32_t (*Read)(const struct CodecDevice *codec, uint32_t reg, uint32_t *value);
* @brief Defines Codec device reg write.
*
* @param codec Indicates a codec device.
* @param reg Indicates reg offset.
* @param value Indicates write reg value.
*
* @return Returns <b>0</b> if codec device write reg success; returns a non-zero value otherwise.
*
* @since 1.0
* @version 1.0
*/
int32_t (*Write)(const struct CodecDevice *codec, uint32_t reg, uint32_t value);
struct AudioKcontrol *controls;
int numControls;
struct AudioSapmComponent *sapmComponents;
int numSapmComponent;
const struct AudioSapmRoute *sapmRoutes;
int numSapmRoutes;
unsigned long virtualAddress;
struct AudioRegCfgData *regConfig;
struct AudioRegCfgGroupNode **regCfgGroup;
struct OsalMutex mutex;
void *privateParam;
};
* @brief Defines Codec host in audio driver.
*
* @since 1.0
* @version 1.0
*/
struct CodecHost {
struct IDeviceIoService service;
struct HdfDeviceObject *device;
void *priv;
};
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif