All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Zhu Ning <zhuning0077@gmail.com>, alsa-devel@alsa-project.org
Cc: robh@kernel.org, devicetree@vger.kernel.org, tiwai@suse.com,
	pierre-louis.bossart@linux.intel.com, broonie@kernel.org,
	Zhu Ning <zhuning@everest-semi.com>,
	David Yang <yangxiaohua@everest-semi.com>
Subject: Re: [PATCH v5 2/2] ASoC: codecs: add support for ES8326
Date: Fri, 12 Aug 2022 17:11:52 +0200	[thread overview]
Message-ID: <c2e99c2c-01b6-e89a-5a56-264504dfa428@linux.intel.com> (raw)
In-Reply-To: <20220804091800.744316-2-zhuning0077@gmail.com>

On 8/4/2022 11:18 AM, Zhu Ning wrote:
> The ES8326 codec is not compatible with ES8316 and requires
> a dedicated driver.
> 
> Signed-off-by: David Yang <yangxiaohua@everest-semi.com>
> Signed-off-by: Zhu Ning <zhuning@everest-semi.com>
> ------
> v5 fix compile error
> ---

...

> +
> +static const struct snd_soc_dai_ops es8326_ops = {
> +	.hw_params = es8326_pcm_hw_params,
> +	.set_fmt = es8326_set_dai_fmt,
> +	.set_sysclk = es8326_set_dai_sysclk,
> +};
> +
> +static struct snd_soc_dai_driver es8326_dai = {
> +	.name = "ES8326 HiFi",
> +	.playback = {
> +		.stream_name = "Playback",
> +		.channels_min = 1,
> +		.channels_max = 2,
> +		.rates = SNDRV_PCM_RATE_8000_96000,

coeff_div table seems to contain rates up to 48000, seems like 
SNDRV_PCM_RATE_8000_48000 would be a better value here?

> +		.formats = es8326_FORMATS,
> +		},
> +	.capture = {
> +		.stream_name = "Capture",
> +		.channels_min = 1,
> +		.channels_max = 2,
> +		.rates = SNDRV_PCM_RATE_8000_96000,

Same here?

> +		.formats = es8326_FORMATS,
> +		},
> +	.ops = &es8326_ops,
> +	.symmetric_rate = 1,
> +};
> +

...

> --- /dev/null
> +++ b/sound/soc/codecs/es8326.h
> @@ -0,0 +1,187 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * es8326.h -- es8326 ALSA SoC audio driver
> + * Copyright Everest Semiconductor Co.,Ltd
> + *
> + * Authors: David Yang <yangxiaohua@everest-semi.com>
> + */
> +
> +#ifndef _ES8326_H
> +#define _ES8326_H
> +
> +#define CONFIG_HHTECH_MINIPMP	1
> +
> +/* ES8326 register space */
> +
> +#define ES8326_RESET_00		0x00
> +#define ES8326_CLK_CTL_01	0x01
> +#define ES8326_CLK_INV_02	0x02
> +#define ES8326_CLK_RESAMPLE_03	0x03
> +#define ES8326_CLK_DIV1_04	0x04
> +#define ES8326_CLK_DIV2_05	0x05
> +#define ES8326_CLK_DLL_06	0x06
> +#define ES8326_CLK_MUX_07	0x07
> +#define ES8326_CLK_ADC_SEL_08	0x08
> +#define ES8326_CLK_DAC_SEL_09	0x09
> +#define ES8326_CLK_ADC_OSR_0A	0x0a
> +#define ES8326_CLK_DAC_OSR_0B	0x0b
> +#define ES8326_CLK_DIV_CPC_0C	0x0c
> +#define ES8326_CLK_DIV_BCLK_0D	0x0d
> +#define ES8326_CLK_TRI_0E	0x0e
> +#define ES8326_CLK_DIV_LRCK_0F	0x0f
> +#define ES8326_CLK_VMIDS1_10	0x10
> +#define ES8326_CLK_VMIDS2_11	0x11
> +#define ES8326_CLK_CAL_TIME_12	0x12
> +#define ES8326_FMT_13		0x13
> +
> +#define ES8326_DAC_MUTE_14	0x14
> +#define ES8326_ADC_MUTE_15	0x15
> +#define ES8326_ANA_PDN_16	0x16
> +#define ES8326_PGA_PDN_17	0x17
> +#define ES8326_VMIDSEL_18	0x18
> +#define ES8326_ANA_LOWPOWER_19	0x19
> +#define ES8326_ANA_DMS_1A	0x1a
> +#define ES8326_ANA_MICBIAS_1B	0x1b
> +#define ES8326_ANA_VSEL_1C	0x1c
> +#define ES8326_SYS_BIAS_1D	0x1d
> +#define ES8326_BIAS_SW1_1E	0x1e
> +#define ES8326_BIAS_SW2_1F	0x1f
> +#define ES8326_BIAS_SW3_20	0x20
> +#define ES8326_BIAS_SW4_21	0x21
> +#define ES8326_VMIDLOW_22	0x22
> +
> +#define ES8326_PGAGAIN_23		0x23
> +#define ES8326_HP_DRIVER_24		0x24
> +#define ES8326_DAC2HPMIX_25		0x25
> +#define ES8326_HP_VOL_26		0x26
> +#define ES8326_HP_CAL_27		0x27
> +#define ES8326_HP_DRIVER_REF_28		0x28
> +#define ES8326_ADC_SCALE_29		0x29
> +#define ES8326_ADC1_SRC_2A     0x2a
> +#define ES8326_ADC2_SRC_2B     0x2b
> +#define ES8326_ADC1_VOL_2C     0x2c
> +#define ES8326_ADC2_VOL_2D     0x2d
> +#define ES8326_ADC_RAMPRATE_2E		0x2e
> +#define ES8326_2F			0x2f
> +#define ES8326_30			0x30
> +#define ES8326_31			0x31
> +#define ES8326_ALC_RECOVERY_32		0x32
> +#define ES8326_ALC_LEVEL_33		0x33
> +#define ES8326_ADC_HPFS1_34		0x34
> +#define ES8326_ADC_HPFS2_35		0x35
> +#define ES8326_ADC_EQ_36		0x36
> +#define ES8326_HP_CAL_4A		0x4A
> +#define ES8326_HPL_OFFSET_INI_4B	0x4B
> +#define ES8326_HPR_OFFSET_INI_4C	0x4C
> +#define ES8326_DAC_DSM_4D		0x4D
> +#define ES8326_DAC_RAMPRATE_4E		0x4E
> +#define ES8326_DAC_VPPSCALE_4F		0x4F
> +#define ES8326_DAC_VOL_50		0x50
> +#define ES8326_DRC_RECOVERY_53		0x53
> +#define ES8326_DRC_WINSIZE_54		0x54
> +#define ES8326_HPJACK_TIMER_56		0x56
> +#define ES8326_HP_DET_57	0x57
> +#define ES8326_INT_SOURCE_58	0x58
> +#define ES8326_INTOUT_IO_59	0x59
> +#define ES8326_SDINOUT1_IO_5A	0x5A
> +#define ES8326_SDINOUT23_IO_5B	0x5B
> +#define ES8326_JACK_PULSE_5C	0x5C
> +
> +#define ES8326_PULLUP_CTL_F9	0xF9
> +#define ES8326_HP_DETECT_FB	0xFB
> +#define ES8326_CHIP_ID1_FD	0xFD
> +#define ES8326_CHIP_ID2_FE	0xFE
> +#define ES8326_CHIP_VERSION_FF	0xFF
> +

Can hexadecimal suffix in above defines be dropped? It seems unnecessary 
to me.


WARNING: multiple messages have this Message-ID (diff)
From: "Amadeusz Sławiński" <amadeuszx.slawinski@linux.intel.com>
To: Zhu Ning <zhuning0077@gmail.com>, alsa-devel@alsa-project.org
Cc: robh@kernel.org, devicetree@vger.kernel.org,
	pierre-louis.bossart@linux.intel.com, tiwai@suse.com,
	broonie@kernel.org, Zhu Ning <zhuning@everest-semi.com>,
	David Yang <yangxiaohua@everest-semi.com>
Subject: Re: [PATCH v5 2/2] ASoC: codecs: add support for ES8326
Date: Fri, 12 Aug 2022 17:11:52 +0200	[thread overview]
Message-ID: <c2e99c2c-01b6-e89a-5a56-264504dfa428@linux.intel.com> (raw)
In-Reply-To: <20220804091800.744316-2-zhuning0077@gmail.com>

On 8/4/2022 11:18 AM, Zhu Ning wrote:
> The ES8326 codec is not compatible with ES8316 and requires
> a dedicated driver.
> 
> Signed-off-by: David Yang <yangxiaohua@everest-semi.com>
> Signed-off-by: Zhu Ning <zhuning@everest-semi.com>
> ------
> v5 fix compile error
> ---

...

> +
> +static const struct snd_soc_dai_ops es8326_ops = {
> +	.hw_params = es8326_pcm_hw_params,
> +	.set_fmt = es8326_set_dai_fmt,
> +	.set_sysclk = es8326_set_dai_sysclk,
> +};
> +
> +static struct snd_soc_dai_driver es8326_dai = {
> +	.name = "ES8326 HiFi",
> +	.playback = {
> +		.stream_name = "Playback",
> +		.channels_min = 1,
> +		.channels_max = 2,
> +		.rates = SNDRV_PCM_RATE_8000_96000,

coeff_div table seems to contain rates up to 48000, seems like 
SNDRV_PCM_RATE_8000_48000 would be a better value here?

> +		.formats = es8326_FORMATS,
> +		},
> +	.capture = {
> +		.stream_name = "Capture",
> +		.channels_min = 1,
> +		.channels_max = 2,
> +		.rates = SNDRV_PCM_RATE_8000_96000,

Same here?

> +		.formats = es8326_FORMATS,
> +		},
> +	.ops = &es8326_ops,
> +	.symmetric_rate = 1,
> +};
> +

...

> --- /dev/null
> +++ b/sound/soc/codecs/es8326.h
> @@ -0,0 +1,187 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * es8326.h -- es8326 ALSA SoC audio driver
> + * Copyright Everest Semiconductor Co.,Ltd
> + *
> + * Authors: David Yang <yangxiaohua@everest-semi.com>
> + */
> +
> +#ifndef _ES8326_H
> +#define _ES8326_H
> +
> +#define CONFIG_HHTECH_MINIPMP	1
> +
> +/* ES8326 register space */
> +
> +#define ES8326_RESET_00		0x00
> +#define ES8326_CLK_CTL_01	0x01
> +#define ES8326_CLK_INV_02	0x02
> +#define ES8326_CLK_RESAMPLE_03	0x03
> +#define ES8326_CLK_DIV1_04	0x04
> +#define ES8326_CLK_DIV2_05	0x05
> +#define ES8326_CLK_DLL_06	0x06
> +#define ES8326_CLK_MUX_07	0x07
> +#define ES8326_CLK_ADC_SEL_08	0x08
> +#define ES8326_CLK_DAC_SEL_09	0x09
> +#define ES8326_CLK_ADC_OSR_0A	0x0a
> +#define ES8326_CLK_DAC_OSR_0B	0x0b
> +#define ES8326_CLK_DIV_CPC_0C	0x0c
> +#define ES8326_CLK_DIV_BCLK_0D	0x0d
> +#define ES8326_CLK_TRI_0E	0x0e
> +#define ES8326_CLK_DIV_LRCK_0F	0x0f
> +#define ES8326_CLK_VMIDS1_10	0x10
> +#define ES8326_CLK_VMIDS2_11	0x11
> +#define ES8326_CLK_CAL_TIME_12	0x12
> +#define ES8326_FMT_13		0x13
> +
> +#define ES8326_DAC_MUTE_14	0x14
> +#define ES8326_ADC_MUTE_15	0x15
> +#define ES8326_ANA_PDN_16	0x16
> +#define ES8326_PGA_PDN_17	0x17
> +#define ES8326_VMIDSEL_18	0x18
> +#define ES8326_ANA_LOWPOWER_19	0x19
> +#define ES8326_ANA_DMS_1A	0x1a
> +#define ES8326_ANA_MICBIAS_1B	0x1b
> +#define ES8326_ANA_VSEL_1C	0x1c
> +#define ES8326_SYS_BIAS_1D	0x1d
> +#define ES8326_BIAS_SW1_1E	0x1e
> +#define ES8326_BIAS_SW2_1F	0x1f
> +#define ES8326_BIAS_SW3_20	0x20
> +#define ES8326_BIAS_SW4_21	0x21
> +#define ES8326_VMIDLOW_22	0x22
> +
> +#define ES8326_PGAGAIN_23		0x23
> +#define ES8326_HP_DRIVER_24		0x24
> +#define ES8326_DAC2HPMIX_25		0x25
> +#define ES8326_HP_VOL_26		0x26
> +#define ES8326_HP_CAL_27		0x27
> +#define ES8326_HP_DRIVER_REF_28		0x28
> +#define ES8326_ADC_SCALE_29		0x29
> +#define ES8326_ADC1_SRC_2A     0x2a
> +#define ES8326_ADC2_SRC_2B     0x2b
> +#define ES8326_ADC1_VOL_2C     0x2c
> +#define ES8326_ADC2_VOL_2D     0x2d
> +#define ES8326_ADC_RAMPRATE_2E		0x2e
> +#define ES8326_2F			0x2f
> +#define ES8326_30			0x30
> +#define ES8326_31			0x31
> +#define ES8326_ALC_RECOVERY_32		0x32
> +#define ES8326_ALC_LEVEL_33		0x33
> +#define ES8326_ADC_HPFS1_34		0x34
> +#define ES8326_ADC_HPFS2_35		0x35
> +#define ES8326_ADC_EQ_36		0x36
> +#define ES8326_HP_CAL_4A		0x4A
> +#define ES8326_HPL_OFFSET_INI_4B	0x4B
> +#define ES8326_HPR_OFFSET_INI_4C	0x4C
> +#define ES8326_DAC_DSM_4D		0x4D
> +#define ES8326_DAC_RAMPRATE_4E		0x4E
> +#define ES8326_DAC_VPPSCALE_4F		0x4F
> +#define ES8326_DAC_VOL_50		0x50
> +#define ES8326_DRC_RECOVERY_53		0x53
> +#define ES8326_DRC_WINSIZE_54		0x54
> +#define ES8326_HPJACK_TIMER_56		0x56
> +#define ES8326_HP_DET_57	0x57
> +#define ES8326_INT_SOURCE_58	0x58
> +#define ES8326_INTOUT_IO_59	0x59
> +#define ES8326_SDINOUT1_IO_5A	0x5A
> +#define ES8326_SDINOUT23_IO_5B	0x5B
> +#define ES8326_JACK_PULSE_5C	0x5C
> +
> +#define ES8326_PULLUP_CTL_F9	0xF9
> +#define ES8326_HP_DETECT_FB	0xFB
> +#define ES8326_CHIP_ID1_FD	0xFD
> +#define ES8326_CHIP_ID2_FE	0xFE
> +#define ES8326_CHIP_VERSION_FF	0xFF
> +

Can hexadecimal suffix in above defines be dropped? It seems unnecessary 
to me.


  reply	other threads:[~2022-08-12 15:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04  9:17 [PATCH v5 1/2] ASoC: dt-bindings: Add Everest ES8326 audio CODEC Zhu Ning
2022-08-04  9:17 ` Zhu Ning
2022-08-04  9:18 ` [PATCH v5 2/2] ASoC: codecs: add support for ES8326 Zhu Ning
2022-08-04  9:18   ` Zhu Ning
2022-08-12 15:11   ` Amadeusz Sławiński [this message]
2022-08-12 15:11     ` Amadeusz Sławiński
2022-08-09 18:34 ` [PATCH v5 1/2] ASoC: dt-bindings: Add Everest ES8326 audio CODEC Rob Herring
2022-08-09 18:34   ` Rob Herring
2022-08-10  1:36   ` [PATCH v5 2/2] " Zhu Ning
2022-08-10  1:36     ` Zhu Ning
2022-08-16 13:48 ` [PATCH v5 1/2] " Mark Brown
2022-08-16 13:48   ` Mark Brown

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=c2e99c2c-01b6-e89a-5a56-264504dfa428@linux.intel.com \
    --to=amadeuszx.slawinski@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=robh@kernel.org \
    --cc=tiwai@suse.com \
    --cc=yangxiaohua@everest-semi.com \
    --cc=zhuning0077@gmail.com \
    --cc=zhuning@everest-semi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.