devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
To: wangweidong.a@awinic.com, lgirdwood@gmail.com,
	broonie@kernel.org, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, perex@perex.cz,
	tiwai@suse.com, ckeepax@opensource.cirrus.com,
	rf@opensource.cirrus.com, peter.ujfalusi@linux.intel.com,
	james.schulman@cirrus.com, flatmax@flatmax.com,
	ryan.lee.analog@gmail.com, jonathan.albrieux@gmail.com,
	tanureal@opensource.cirrus.com, povik+lin@cutebit.org,
	13691752556@139.com, cezary.rojewski@intel.com,
	stephan@gerhold.net, alsa-devel@alsa-project.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: duanyibo@awinic.com, zhaolei@awinic.com, liweilei@awinic.com,
	yijiangtao@awinic.com, zhangjianming@awinic.com
Subject: Re: [PATCH V7 4/5] ASoC: codecs: Aw883xx chip register file, data type file and Kconfig Makefile
Date: Thu, 22 Dec 2022 09:53:55 -0600	[thread overview]
Message-ID: <b0387660-a4a8-d109-0337-034dfc439325@linux.intel.com> (raw)
In-Reply-To: <20221222123205.106353-5-wangweidong.a@awinic.com>


> +
> +#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)

align on one indentation please

> +
> +enum aw_cfg_hdr_version {
> +	AW_CFG_HDR_VER_0_0_0_1	= 0x00000001,
> +	AW_CFG_HDR_VER_1_0_0_0	= 0x01000000,
> +};
> +

> +struct aw_cfg_hdr {
> +	u32 a_id;				/*acf file ID 0xa15f908*/
> +	char a_project[PROJECT_NAME_MAX];	/*project name*/
> +	char a_custom[CUSTOMER_NAME_MAX];	/*custom name */
> +	char a_version[CFG_VERSION_MAX];	/*author update version*/
> +	u32 a_author_id;			/*author id*/
> +	u32 a_ddt_size;				/*sub section table entry size*/
> +	u32 a_ddt_num;				/*sub section table entry num*/
> +	u32 a_hdr_offset;			/*sub section table offset in file*/
> +	u32 a_hdr_version;			/*sub section table version*/
> +	u32 reserve[3];
> +};

use spaces before and after /* and */

and what's up with the a_ prefix, is this needed?

> +
> +struct aw_cfg_dde {
> +	u32 type;				/*DDE type id*/
> +	char dev_name[DEV_NAME_MAX];
> +	u16 dev_index;				/*dev id*/
> +	u16 dev_bus;				/*dev bus id*/
> +	u16 dev_addr;				/*dev addr id*/
> +	u16 dev_profile;			/*dev profile id*/
> +	u32 data_type;				/*data type id*/
> +	u32 data_size;
> +	u32 data_offset;
> +	u32 data_crc;
> +	u32 reserve[5];

reserved

> +};
> +
> +struct aw_cfg_dde_v_1_0_0_0 {
> +	u32 type;				/*DDE type id*/
> +	char dev_name[DEV_NAME_MAX];
> +	u16 dev_index;				/*dev id*/
> +	u16 dev_bus;				/*dev bus id*/
> +	u16 dev_addr;				/*dev addr id*/
> +	u16 dev_profile;			/*dev profile id*/
> +	u32 data_type;				/*data type id*/
> +	u32 data_size;
> +	u32 data_offset;
> +	u32 data_crc;
> +	char dev_profile_str[PROFILE_STR_MAX];
> +	u32 chip_id;
> +	u32 reserve[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
> +
> diff --git a/sound/soc/codecs/aw883xx/aw883xx_pid_2049_reg.h b/sound/soc/codecs/aw883xx/aw883xx_pid_2049_reg.h
> new file mode 100644
> index 000000000000..21d1e913db0b
> --- /dev/null
> +++ b/sound/soc/codecs/aw883xx/aw883xx_pid_2049_reg.h
> @@ -0,0 +1,490 @@
> +/* 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_PID_2049_REG_H__
> +#define __AW883XX_PID_2049_REG_H__
> +
> +#define AW_PID_2049_ID_REG				(0x00)
> +#define AW_PID_2049_SYSST_REG			(0x01)
> +#define AW_PID_2049_SYSINT_REG			(0x02)
> +#define AW_PID_2049_SYSINTM_REG			(0x03)
> +#define AW_PID_2049_SYSCTRL_REG			(0x04)
> +#define AW_PID_2049_SYSCTRL2_REG		(0x05)
> +#define AW_PID_2049_I2SCTRL_REG			(0x06)
> +#define AW_PID_2049_I2SCFG1_REG			(0x07)
> +#define AW_PID_2049_I2SCFG2_REG			(0x08)
> +#define AW_PID_2049_HAGCCFG1_REG		(0x09)
> +#define AW_PID_2049_HAGCCFG2_REG		(0x0A)
> +#define AW_PID_2049_HAGCCFG3_REG		(0x0B)
> +#define AW_PID_2049_HAGCCFG4_REG		(0x0C)
> +#define AW_PID_2049_HAGCCFG5_REG		(0x0D)
> +#define AW_PID_2049_HAGCCFG6_REG		(0x0E)
> +#define AW_PID_2049_HAGCCFG7_REG		(0x0F)
> +#define AW_PID_2049_MPDCFG_REG			(0x10)
> +#define AW_PID_2049_PWMCTRL_REG			(0x11)
> +#define AW_PID_2049_I2SCFG3_REG			(0x12)
> +#define AW_PID_2049_DBGCTRL_REG			(0x13)
> +#define AW_PID_2049_HAGCST_REG			(0x20)
> +#define AW_PID_2049_VBAT_REG			(0x21)
> +#define AW_PID_2049_TEMP_REG			(0x22)
> +#define AW_PID_2049_PVDD_REG			(0x23)
> +#define AW_PID_2049_ISNDAT_REG			(0x24)
> +#define AW_PID_2049_VSNDAT_REG			(0x25)
> +#define AW_PID_2049_I2SINT_REG			(0x26)
> +#define AW_PID_2049_I2SCAPCNT_REG		(0x27)
> +#define AW_PID_2049_ANASTA1_REG			(0x28)
> +#define AW_PID_2049_ANASTA2_REG			(0x29)
> +#define AW_PID_2049_ANASTA3_REG			(0x2A)
> +#define AW_PID_2049_ANASTA4_REG			(0x2B)
> +#define AW_PID_2049_TESTDET_REG			(0x2C)
> +#define AW_PID_2049_TESTIN_REG			(0x38)
> +#define AW_PID_2049_TESTOUT_REG			(0x39)
> +#define AW_PID_2049_DSPMADD_REG			(0x40)
> +#define AW_PID_2049_DSPMDAT_REG			(0x41)
> +#define AW_PID_2049_WDT_REG				(0x42)
> +#define AW_PID_2049_ACR1_REG			(0x43)
> +#define AW_PID_2049_ACR2_REG			(0x44)
> +#define AW_PID_2049_ASR1_REG			(0x45)
> +#define AW_PID_2049_ASR2_REG			(0x46)
> +#define AW_PID_2049_DSPCFG_REG			(0x47)
> +#define AW_PID_2049_ASR3_REG			(0x48)
> +#define AW_PID_2049_ASR4_REG			(0x49)
> +#define AW_PID_2049_VSNCTRL1_REG		(0x50)
> +#define AW_PID_2049_ISNCTRL1_REG		(0x51)
> +#define AW_PID_2049_PLLCTRL1_REG		(0x52)
> +#define AW_PID_2049_PLLCTRL2_REG		(0x53)
> +#define AW_PID_2049_PLLCTRL3_REG		(0x54)
> +#define AW_PID_2049_CDACTRL1_REG		(0x55)
> +#define AW_PID_2049_CDACTRL2_REG		(0x56)
> +#define AW_PID_2049_SADCCTRL1_REG		(0x57)
> +#define AW_PID_2049_SADCCTRL2_REG		(0x58)
> +#define AW_PID_2049_CPCTRL1_REG			(0x59)
> +#define AW_PID_2049_BSTCTRL1_REG		(0x60)
> +#define AW_PID_2049_BSTCTRL2_REG		(0x61)
> +#define AW_PID_2049_BSTCTRL3_REG		(0x62)
> +#define AW_PID_2049_BSTCTRL4_REG		(0x63)
> +#define AW_PID_2049_BSTCTRL5_REG		(0x64)
> +#define AW_PID_2049_BSTCTRL6_REG		(0x65)
> +#define AW_PID_2049_BSTCTRL7_REG		(0x66)
> +#define AW_PID_2049_DSMCFG1_REG			(0x67)
> +#define AW_PID_2049_DSMCFG2_REG			(0x68)
> +#define AW_PID_2049_DSMCFG3_REG			(0x69)
> +#define AW_PID_2049_DSMCFG4_REG			(0x6A)
> +#define AW_PID_2049_DSMCFG5_REG			(0x6B)
> +#define AW_PID_2049_DSMCFG6_REG			(0x6C)
> +#define AW_PID_2049_DSMCFG7_REG			(0x6D)
> +#define AW_PID_2049_DSMCFG8_REG			(0x6E)
> +#define AW_PID_2049_TESTCTRL1_REG		(0x70)
> +#define AW_PID_2049_TESTCTRL2_REG		(0x71)
> +#define AW_PID_2049_EFCTRL1_REG			(0x72)
> +#define AW_PID_2049_EFCTRL2_REG			(0x73)
> +#define AW_PID_2049_EFWH_REG			(0x74)
> +#define AW_PID_2049_EFWM2_REG			(0x75)
> +#define AW_PID_2049_EFWM1_REG			(0x76)
> +#define AW_PID_2049_EFWL_REG			(0x77)
> +#define AW_PID_2049_EFRH_REG			(0x78)
> +#define AW_PID_2049_EFRM2_REG			(0x79)
> +#define AW_PID_2049_EFRM1_REG			(0x7A)
> +#define AW_PID_2049_EFRL_REG			(0x7B)
> +#define AW_PID_2049_TM_REG				(0x7C)

indentation is distracting, please pick one.

> +
> +/*
> + * Register Access
> + */
> +enum aw883xx_id {
> +	AW883XX_PID_2049 = 0x2049,
> +};
> +
> +#define AW_PID_2049_REG_MAX				(0x7D)
> +
> +#define REG_NONE_ACCESS					(0)
> +#define REG_RD_ACCESS					(1 << 0)
> +#define REG_WR_ACCESS					(1 << 1)
> +
> +#define AW_PID_2049_VOLUME_STEP_DB		(6 * 8)
> +
> +#define AW_PID_2049_SOFT_RESET_VALUE	(0x55aa)
> +

      reply	other threads:[~2022-12-22 17:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 12:32 [PATCH V7 0/5] ASoC: codecs: Add Awinic AW883XX audio amplifier driver wangweidong.a
2022-12-22 12:32 ` [PATCH V7 1/5] ASoC: codecs: Add i2c and codec registration for aw883xx and their associated operation functions wangweidong.a
2022-12-22 15:09   ` Pierre-Louis Bossart
2022-12-22 12:32 ` [PATCH V7 2/5] ASoC: codecs: Aw883xx function for ACF file parse and check wangweidong.a
2022-12-22 15:41   ` Pierre-Louis Bossart
2022-12-22 12:32 ` [PATCH V7 3/5] ASoC: codecs: Aw883xx common function for ALSA Audio Driver wangweidong.a
2022-12-22 15:50   ` Pierre-Louis Bossart
2022-12-22 12:32 ` [PATCH V7 4/5] ASoC: codecs: Aw883xx chip register file, data type file and Kconfig Makefile wangweidong.a
2022-12-22 15:53   ` Pierre-Louis Bossart [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b0387660-a4a8-d109-0337-034dfc439325@linux.intel.com \
    --to=pierre-louis.bossart@linux.intel.com \
    --cc=13691752556@139.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=ckeepax@opensource.cirrus.com \
    --cc=devicetree@vger.kernel.org \
    --cc=duanyibo@awinic.com \
    --cc=flatmax@flatmax.com \
    --cc=james.schulman@cirrus.com \
    --cc=jonathan.albrieux@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liweilei@awinic.com \
    --cc=perex@perex.cz \
    --cc=peter.ujfalusi@linux.intel.com \
    --cc=povik+lin@cutebit.org \
    --cc=rf@opensource.cirrus.com \
    --cc=robh+dt@kernel.org \
    --cc=ryan.lee.analog@gmail.com \
    --cc=stephan@gerhold.net \
    --cc=tanureal@opensource.cirrus.com \
    --cc=tiwai@suse.com \
    --cc=wangweidong.a@awinic.com \
    --cc=yijiangtao@awinic.com \
    --cc=zhangjianming@awinic.com \
    --cc=zhaolei@awinic.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).