Skip to content

Commit

Permalink
ASoC: codecs: Aw883xx chip register file, data type file and Kconfig …
Browse files Browse the repository at this point in the history
…Makefile

The Awinic AW883XX is an I2S/TDM input, high efficiency
digital Smart K audio amplifier with an integrated 10.25V
smart boost convert

Signed-off-by: Nick Li <liweilei@awinic.com>
Signed-off-by: Bruce zhao <zhaolei@awinic.com>
Signed-off-by: Weidong Wang <wangweidong.a@awinic.com>
  • Loading branch information
wangweidonga authored and intel-lab-lkp committed Dec 30, 2022
1 parent acf2ebf commit 870b0ec
Show file tree
Hide file tree
Showing 4 changed files with 543 additions and 0 deletions.
10 changes: 10 additions & 0 deletions sound/soc/codecs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ config SND_SOC_ALL_CODECS
imply SND_SOC_ALC5623
imply SND_SOC_ALC5632
imply SND_SOC_AW8738
imply SND_SOC_AW883XX
imply SND_SOC_BT_SCO
imply SND_SOC_BD28623
imply SND_SOC_CQ0093VC
Expand Down Expand Up @@ -2167,4 +2168,13 @@ config SND_SOC_LPASS_TX_MACRO
select SND_SOC_LPASS_MACRO_COMMON
tristate "Qualcomm TX Macro in LPASS(Low Power Audio SubSystem)"

config SND_SOC_AW883XX
tristate "Soc Audio for awinic aw883xx series"
depends on I2C
help
this option enables support for aw883xx series Smart PA.
The Awinic AW883XX is an I2S/TDM input, high efficiency
digital Smart K audio amplifier with an integrated 10V
smart boost convert.

endmenu
6 changes: 6 additions & 0 deletions sound/soc/codecs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ snd-soc-tas2780-objs := tas2780.o
# Mux
snd-soc-simple-mux-objs := simple-mux.o

snd_soc_aw883xx-objs := aw883xx/aw883xx.o \
aw883xx/aw883xx_device.o \
aw883xx/aw883xx_bin_parse.o \

obj-$(CONFIG_SND_SOC_88PM860X) += snd-soc-88pm860x.o
obj-$(CONFIG_SND_SOC_AB8500_CODEC) += snd-soc-ab8500-codec.o
obj-$(CONFIG_SND_SOC_AC97_CODEC) += snd-soc-ac97.o
Expand Down Expand Up @@ -721,3 +725,5 @@ obj-$(CONFIG_SND_SOC_LPASS_TX_MACRO) += snd-soc-lpass-tx-macro.o

# Mux
obj-$(CONFIG_SND_SOC_SIMPLE_MUX) += snd-soc-simple-mux.o

obj-$(CONFIG_SND_SOC_AW883XX) +=snd_soc_aw883xx.o
143 changes: 143 additions & 0 deletions sound/soc/codecs/aw883xx/aw883xx_data_type.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* aw883xx.c -- ALSA SoC AW883XX codec support
*
* Copyright (c) 2022 AWINIC Technology CO., LTD
*
* Author: Bruce zhao <zhaolei@awinic.com>
*/

#ifndef __AW883XX_DATA_TYPE_H__
#define __AW883XX_DATA_TYPE_H__

#define PROJECT_NAME_MAX (24)
#define CUSTOMER_NAME_MAX (16)
#define CFG_VERSION_MAX (4)
#define DEV_NAME_MAX (16)
#define PROFILE_STR_MAX (32)

#define ACF_FILE_ID (0xa15f908)

enum aw_cfg_hdr_version {
AW_CFG_HDR_VER = 0x00000001,
AW_CFG_HDR_VER_V1 = 0x01000000,
};

enum aw_cfg_dde_type {
AW_DEV_NONE_TYPE_ID = 0xFFFFFFFF,
AW_DEV_TYPE_ID = 0x00000000,
AW_SKT_TYPE_ID = 0x00000001,
AW_DEV_DEFAULT_TYPE_ID = 0x00000002,
};

enum aw_sec_type {
ACF_SEC_TYPE_REG = 0,
ACF_SEC_TYPE_DSP,
ACF_SEC_TYPE_DSP_CFG,
ACF_SEC_TYPE_DSP_FW,
ACF_SEC_TYPE_HDR_REG,
ACF_SEC_TYPE_HDR_DSP_CFG,
ACF_SEC_TYPE_HDR_DSP_FW,
ACF_SEC_TYPE_MULTIPLE_BIN,
ACF_SEC_TYPE_SKT_PROJECT,
ACF_SEC_TYPE_DSP_PROJECT,
ACF_SEC_TYPE_MONITOR,
ACF_SEC_TYPE_MAX,
};

enum profile_data_type {
AW_DATA_TYPE_REG = 0,
AW_DATA_TYPE_DSP_CFG,
AW_DATA_TYPE_DSP_FW,
AW_DATA_TYPE_MAX,
};

enum aw_prof_type {
AW_PROFILE_MUSIC = 0,
AW_PROFILE_VOICE,
AW_PROFILE_VOIP,
AW_PROFILE_RINGTONE,
AW_PROFILE_RINGTONE_HS,
AW_PROFILE_LOWPOWER,
AW_PROFILE_BYPASS,
AW_PROFILE_MMI,
AW_PROFILE_FM,
AW_PROFILE_NOTIFICATION,
AW_PROFILE_RECEIVER,
AW_PROFILE_MAX,
};

enum aw_profile_status {
AW_PROFILE_WAIT = 0,
AW_PROFILE_OK,
};

struct aw_cfg_hdr {
u32 id;
char project[PROJECT_NAME_MAX];
char custom[CUSTOMER_NAME_MAX];
char version[CFG_VERSION_MAX];
u32 author_id;
u32 ddt_size;
u32 ddt_num;
u32 hdr_offset;
u32 hdr_version;
u32 reserved[3];
};

struct aw_cfg_dde {
u32 type;
char dev_name[DEV_NAME_MAX];
u16 dev_index;
u16 dev_bus;
u16 dev_addr;
u16 dev_profile;
u32 data_type;
u32 data_size;
u32 data_offset;
u32 data_crc;
u32 reserved[5];
};

struct aw_cfg_dde_v1 {
u32 type;
char dev_name[DEV_NAME_MAX];
u16 dev_index;
u16 dev_bus;
u16 dev_addr;
u16 dev_profile;
u32 data_type;
u32 data_size;
u32 data_offset;
u32 data_crc;
char dev_profile_str[PROFILE_STR_MAX];
u32 chip_id;
u32 reserved[4];
};

struct aw_sec_data_desc {
u32 len;
u8 *data;
};

struct aw_prof_desc {
u32 id;
u32 prof_st;
char *prf_str;
u32 fw_ver;
struct aw_sec_data_desc sec_desc[AW_DATA_TYPE_MAX];
};

struct aw_all_prof_info {
struct aw_prof_desc prof_desc[AW_PROFILE_MAX];
};

struct aw_prof_info {
int count;
int prof_type;
char **prof_name_list;
struct aw_prof_desc *prof_desc;
};

#endif

Loading

0 comments on commit 870b0ec

Please sign in to comment.