• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  *
4  * HDF is dual licensed: you can use it either under the terms of
5  * the GPL, or the BSD license, at your option.
6  * See the LICENSE file in the root of this repository for complete details.
7  */
8 
9 #ifndef TFA9879_ACCESSORY_IMPL_H
10 #define TFA9879_ACCESSORY_IMPL_H
11 
12 #include "audio_accessory_if.h"
13 #include "osal_mem.h"
14 #include "osal_time.h"
15 #include "osal_io.h"
16 #include "securec.h"
17 #include <linux/types.h>
18 
19 #ifdef __cplusplus
20 #if __cplusplus
21 extern "C" {
22 #endif
23 #endif /* __cplusplus */
24 
25 enum Tfa9879I2sFormatRegVal {
26     I2S_SAMPLE_FORMAT_REG_VAL_MSB_24    = 0x2,    /*  MSB-justified data up to 24 bits */
27     I2S_SAMPLE_FORMAT_REG_VAL_24        = 0x3,    /*  I2S data up to 24 bits */
28     I2S_SAMPLE_FORMAT_REG_VAL_LSB_16    = 0x4,    /*  LSB-justified 16-bit data */
29     I2S_SAMPLE_FORMAT_REG_VAL_LSB_18    = 0x5,    /*  LSB-justified 18-bit data */
30     I2S_SAMPLE_FORMAT_REG_VAL_LSB_20    = 0x6,    /*  LSB-justified 20-bit data */
31     I2S_SAMPLE_FORMAT_REG_VAL_LSB_24    = 0x7,    /*  LSB-justified 24-bit data */
32 };
33 
34 int32_t Tfa9879DeviceInit(struct AudioCard *audioCard, const struct AccessoryDevice *device);
35 int32_t Tfa9879DaiDeviceInit(struct AudioCard *card, const struct DaiDevice *device);
36 int32_t Tfa9879DaiStartup(const struct AudioCard *card, const struct DaiDevice *device);
37 int32_t Tfa9879DaiHwParams(const struct AudioCard *card, const struct AudioPcmHwParams *param);
38 
39 #ifdef __cplusplus
40 #if __cplusplus
41 }
42 #endif
43 #endif
44 
45 #endif
46