All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Dakinevich <jan.dakinevich@salutedevices.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	<linux-amlogic@lists.infradead.org>, <linux-clk@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<alsa-devel@alsa-project.org>, <linux-sound@vger.kernel.org>,
	<linux-gpio@vger.kernel.org>, <kernel@salutedevices.com>
Subject: Re: [PATCH 12/25] ASoC: meson: t9015: add support for A1 SoC family
Date: Tue, 19 Mar 2024 03:17:14 +0300	[thread overview]
Message-ID: <340ee66a-da5d-4fd5-95a6-ea22839df988@salutedevices.com> (raw)
In-Reply-To: <1j5xxjhktd.fsf@starbuckisacylon.baylibre.com>



On 3/18/24 13:46, Jerome Brunet wrote:
> 
> On Fri 15 Mar 2024 at 02:21, Jan Dakinevich <jan.dakinevich@salutedevices.com> wrote:
> 
>> A1's internal codec is very close to t9015. The main difference, that it
>> has ADC. This commit introduces support for capturing from it.
> 
> This is mis-leading.
> 
> It does not look like the change is A1 specific but rather a extension
> of the support for t9015. It also mixes several different topics like line
> configuration, capture support, etc ...
> 
First, it is not only extentsion. Some bits are changed comparing to
existing t9015, so new compatible string is still required.

Second, I don't know anything about about ADC in t9015 on other SoCs and
even don't sure that it exist there (may be I am inattentive, but I'm
unable to find audio input pin on sm1/g12a's pinout).

> Again, the t9015 changes should be a separated series from the rest, and
> there should be one patch per topic.
> 
> As Mark, if something is meant to be configured based on the HW layout,
> then there a good change a kcontrol is not appropriate, and this should
> rather be part of the platform description, like DT.
> 
> It was also suggested here:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/meson/t9015.c?h=v6.8#n298
> 

Ok. By the way, on a1 LINEOUT_CFG would have another value.

>>
>> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
>> ---
>>  sound/soc/meson/t9015.c | 259 ++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 259 insertions(+)
>>
>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>> index 48f6767bd858..365955bfeb78 100644
>> --- a/sound/soc/meson/t9015.c
>> +++ b/sound/soc/meson/t9015.c
>> @@ -19,16 +19,33 @@
>>  #define  LOLP_EN	3
>>  #define  DACR_EN	4
>>  #define  DACL_EN	5
>> +#define  ADCR_EN	6
>> +#define  ADCL_EN	7
>> +#define  PGAR_ZCD_EN	8
>> +#define  PGAL_ZCD_EN	9
>> +#define  PGAR_EN	10
>> +#define  PGAL_EN	11
>> +#define  ADCR_INV	16
>> +#define  ADCL_INV	17
>> +#define  ADCR_SRC	18
>> +#define  ADCL_SRC	19
>>  #define  DACR_INV	20
>>  #define  DACL_INV	21
>>  #define  DACR_SRC	22
>>  #define  DACL_SRC	23
>> +#define  ADC_DEM_EN	26
>> +#define  ADC_FILTER_MODE 28
>> +#define  ADC_FILTER_EN	29
>>  #define  REFP_BUF_EN	BIT(12)
>>  #define  BIAS_CURRENT_EN BIT(13)
>>  #define  VMID_GEN_FAST	BIT(14)
>>  #define  VMID_GEN_EN	BIT(15)
>>  #define  I2S_MODE	BIT(30)
>>  #define VOL_CTRL0	0x04
>> +#define  PGAR_VC	0
>> +#define  PGAL_VC	8
>> +#define  ADCR_VC	16
>> +#define  ADCL_VC	24
>>  #define  GAIN_H		31
>>  #define  GAIN_L		23
>>  #define VOL_CTRL1	0x08
>> @@ -46,6 +63,28 @@
>>  #define  LOLN_POL	8
>>  #define  LOLP_POL	12
>>  #define POWER_CFG	0x10
>> +#define LINEIN_CFG	0x14
>> +#define  MICBIAS_LEVEL	0
>> +#define  MICBIAS_EN	3
>> +#define  PGAR_CTVMN	8
>> +#define  PGAR_CTVMP	9
>> +#define  PGAL_CTVMN	10
>> +#define  PGAL_CTVMP	11
>> +#define  PGAR_CTVIN	12
>> +#define  PGAR_CTVIP	13
>> +#define  PGAL_CTVIN	14
>> +#define  PGAL_CTVIP	15
>> +
>> +#define PGAR_MASK	(BIT(PGAR_CTVMP) | BIT(PGAR_CTVMN) | \
>> +			 BIT(PGAR_CTVIP) | BIT(PGAR_CTVIN))
>> +#define PGAR_DIFF	(BIT(PGAR_CTVIP) | BIT(PGAR_CTVIN))
>> +#define PGAR_POSITIVE	(BIT(PGAR_CTVIP) | BIT(PGAR_CTVMN))
>> +#define PGAR_NEGATIVE	(BIT(PGAR_CTVIN) | BIT(PGAR_CTVMP))
>> +#define PGAL_MASK	(BIT(PGAL_CTVMP) | BIT(PGAL_CTVMN) | \
>> +			 BIT(PGAL_CTVIP) | BIT(PGAL_CTVIN))
>> +#define PGAL_DIFF	(BIT(PGAL_CTVIP) | BIT(PGAL_CTVIN))
>> +#define PGAL_POSITIVE	(BIT(PGAL_CTVIP) | BIT(PGAL_CTVMN))
>> +#define PGAL_NEGATIVE	(BIT(PGAL_CTVIN) | BIT(PGAL_CTVMP))
>>  
>>  struct t9015 {
>>  	struct regulator *avdd;
>> @@ -103,6 +142,31 @@ static struct snd_soc_dai_driver t9015_dai = {
>>  	.ops = &t9015_dai_ops,
>>  };
>>  
>> +static struct snd_soc_dai_driver a1_t9015_dai = {
>> +	.name = "t9015-hifi",
>> +	.playback = {
>> +		.stream_name = "Playback",
>> +		.channels_min = 1,
>> +		.channels_max = 2,
>> +		.rates = SNDRV_PCM_RATE_8000_96000,
>> +		.formats = (SNDRV_PCM_FMTBIT_S8 |
>> +			    SNDRV_PCM_FMTBIT_S16_LE |
>> +			    SNDRV_PCM_FMTBIT_S20_LE |
>> +			    SNDRV_PCM_FMTBIT_S24_LE),
>> +	},
>> +	.capture = {
>> +		.stream_name = "Capture",
>> +		.channels_min = 1,
>> +		.channels_max = 2,
>> +		.rates = SNDRV_PCM_RATE_8000_96000,
>> +		.formats = (SNDRV_PCM_FMTBIT_S8 |
>> +			    SNDRV_PCM_FMTBIT_S16_LE |
>> +			    SNDRV_PCM_FMTBIT_S20_LE |
>> +			    SNDRV_PCM_FMTBIT_S24_LE),
>> +	},
>> +	.ops = &t9015_dai_ops,
>> +};
>> +
>>  static const DECLARE_TLV_DB_MINMAX_MUTE(dac_vol_tlv, -9525, 0);
>>  
>>  static const char * const ramp_rate_txt[] = { "Fast", "Slow" };
>> @@ -179,6 +243,166 @@ static const struct snd_soc_dapm_route t9015_dapm_routes[] = {
>>  	{ "LOLP", NULL, "Left+ Driver",  },
>>  };
>>  
>> +static const char * const a1_right_driver_txt[] = { "None", "Right DAC",
>> +	"Left DAC Inverted" };
>> +static const unsigned int a1_right_driver_values[] = { 0, 2, 4 };
>> +
>> +static const char * const a1_left_driver_txt[] = { "None", "Left DAC",
>> +	"Right DAC Inverted" };
>> +static const unsigned int a1_left_driver_values[] = { 0, 2, 4 };
>> +
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_right_driver, LINEOUT_CFG, 12, 0x7,
>> +				  a1_right_driver_txt, a1_right_driver_values);
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_left_driver, LINEOUT_CFG, 4, 0x7,
>> +				  a1_left_driver_txt, a1_left_driver_values);
>> +
>> +static const struct snd_kcontrol_new a1_right_driver_mux =
>> +	SOC_DAPM_ENUM("Right Driver+ Source", a1_right_driver);
>> +static const struct snd_kcontrol_new a1_left_driver_mux =
>> +	SOC_DAPM_ENUM("Left Driver+ Source", a1_left_driver);
>> +
>> +static const DECLARE_TLV_DB_MINMAX_MUTE(a1_adc_vol_tlv, -29625, 0);
>> +static const DECLARE_TLV_DB_MINMAX_MUTE(a1_adc_pga_vol_tlv, -1200, 0);
>> +
>> +static const char * const a1_adc_right_txt[] = { "Right", "Left" };
>> +static SOC_ENUM_SINGLE_DECL(a1_adc_right, BLOCK_EN, ADCR_SRC, a1_adc_right_txt);
>> +
>> +static const char * const a1_adc_left_txt[] = { "Left", "Right" };
>> +static SOC_ENUM_SINGLE_DECL(a1_adc_left, BLOCK_EN, ADCL_SRC, a1_adc_left_txt);
>> +
>> +static const struct snd_kcontrol_new a1_adc_right_mux =
>> +	SOC_DAPM_ENUM("ADC Right Source", a1_adc_right);
>> +static const struct snd_kcontrol_new a1_adc_left_mux =
>> +	SOC_DAPM_ENUM("ADC Left Source", a1_adc_left);
>> +
>> +static const char * const a1_adc_filter_mode_txt[] = { "Voice", "HiFi"};
>> +static SOC_ENUM_SINGLE_DECL(a1_adc_filter_mode, BLOCK_EN, ADC_FILTER_MODE,
>> +			    a1_adc_filter_mode_txt);
>> +
>> +static const char * const a1_adc_mic_bias_level_txt[] = { "2.0V", "2.1V",
>> +	"2.3V", "2.5V", "2.8V" };
>> +static const unsigned int a1_adc_mic_bias_level_values[] = { 0, 1, 2, 3, 7 };
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_adc_mic_bias_level,
>> +				  LINEIN_CFG, MICBIAS_LEVEL, 0x7,
>> +				  a1_adc_mic_bias_level_txt,
>> +				  a1_adc_mic_bias_level_values);
>> +
>> +static const char * const a1_adc_pga_txt[] = { "None", "Differential",
>> +	"Positive", "Negative" };
>> +static const unsigned int a1_adc_pga_right_values[] = { 0, PGAR_DIFF,
>> +	PGAR_POSITIVE, PGAR_NEGATIVE };
>> +static const unsigned int a1_adc_pga_left_values[] = { 0, PGAL_DIFF,
>> +	PGAL_POSITIVE, PGAL_NEGATIVE };
>> +
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_adc_pga_right, LINEIN_CFG, 0, PGAR_MASK,
>> +				  a1_adc_pga_txt, a1_adc_pga_right_values);
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_adc_pga_left, LINEIN_CFG, 0, PGAL_MASK,
>> +				  a1_adc_pga_txt, a1_adc_pga_left_values);
>> +
>> +static const struct snd_kcontrol_new a1_adc_pga_right_mux =
>> +	SOC_DAPM_ENUM("ADC PGA Right Source", a1_adc_pga_right);
>> +static const struct snd_kcontrol_new a1_adc_pga_left_mux =
>> +	SOC_DAPM_ENUM("ADC PGA Left Source", a1_adc_pga_left);
>> +
>> +static const struct snd_kcontrol_new a1_t9015_snd_controls[] = {
>> +	/* Volume Controls */
>> +	SOC_ENUM("Playback Channel Mode", mono_enum),
>> +	SOC_SINGLE("Playback Switch", VOL_CTRL1, DAC_SOFT_MUTE, 1, 1),
>> +	SOC_DOUBLE_TLV("Playback Volume", VOL_CTRL1, DACL_VC, DACR_VC,
>> +		       0xff, 0, dac_vol_tlv),
>> +
>> +	/* Ramp Controls */
>> +	SOC_ENUM("Ramp Rate", ramp_rate_enum),
>> +	SOC_SINGLE("Volume Ramp Switch", VOL_CTRL1, VC_RAMP_MODE, 1, 0),
>> +	SOC_SINGLE("Mute Ramp Switch", VOL_CTRL1, MUTE_MODE, 1, 0),
>> +	SOC_SINGLE("Unmute Ramp Switch", VOL_CTRL1, UNMUTE_MODE, 1, 0),
>> +
>> +	/* ADC Controls */
>> +	SOC_DOUBLE_TLV("ADC Volume", VOL_CTRL0, ADCL_VC, ADCR_VC,
>> +		       0x7f, 0, a1_adc_vol_tlv),
>> +	SOC_SINGLE("ADC Filter Switch", BLOCK_EN, ADC_FILTER_EN, 1, 0),
>> +	SOC_ENUM("ADC Filter Mode", a1_adc_filter_mode),
>> +	SOC_SINGLE("ADC Mic Bias Switch", LINEIN_CFG, MICBIAS_EN, 1, 0),
>> +	SOC_ENUM("ADC Mic Bias Level", a1_adc_mic_bias_level),
>> +	SOC_SINGLE("ADC DEM Switch", BLOCK_EN, ADC_DEM_EN, 1, 0),
>> +	SOC_DOUBLE_TLV("ADC PGA Volume", VOL_CTRL0, PGAR_VC, PGAL_VC,
>> +		       0x1f, 0, a1_adc_pga_vol_tlv),
>> +	SOC_DOUBLE("ADC PGA Zero Cross-detection Switch", BLOCK_EN,
>> +		   PGAL_ZCD_EN, PGAR_ZCD_EN, 1, 0),
>> +};
>> +
>> +static const struct snd_soc_dapm_widget a1_t9015_dapm_widgets[] = {
>> +	SND_SOC_DAPM_AIF_IN("Right IN", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +	SND_SOC_DAPM_AIF_IN("Left IN", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +	SND_SOC_DAPM_MUX("Right DAC Sel", SND_SOC_NOPM, 0, 0,
>> +			 &t9015_right_dac_mux),
>> +	SND_SOC_DAPM_MUX("Left DAC Sel", SND_SOC_NOPM, 0, 0,
>> +			 &t9015_left_dac_mux),
>> +	SND_SOC_DAPM_DAC("Right DAC", NULL, BLOCK_EN, DACR_EN, 0),
>> +	SND_SOC_DAPM_DAC("Left DAC",  NULL, BLOCK_EN, DACL_EN, 0),
>> +	SND_SOC_DAPM_MUX("Right+ Driver Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_right_driver_mux),
>> +	SND_SOC_DAPM_MUX("Left+ Driver Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_left_driver_mux),
>> +	SND_SOC_DAPM_OUT_DRV("Right+ Driver", BLOCK_EN, LORP_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_OUT_DRV("Left+ Driver",  BLOCK_EN, LOLP_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_OUTPUT("LORP"),
>> +	SND_SOC_DAPM_OUTPUT("LOLP"),
>> +
>> +	SND_SOC_DAPM_INPUT("ADC IN Right"),
>> +	SND_SOC_DAPM_INPUT("ADC IN Left"),
>> +	SND_SOC_DAPM_MUX("ADC PGA Right Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_adc_pga_right_mux),
>> +	SND_SOC_DAPM_MUX("ADC PGA Left Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_adc_pga_left_mux),
>> +	SND_SOC_DAPM_PGA("ADC PGA Right", BLOCK_EN, PGAR_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_PGA("ADC PGA Left", BLOCK_EN, PGAL_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_ADC("ADC Right", NULL, BLOCK_EN, ADCR_EN, 0),
>> +	SND_SOC_DAPM_ADC("ADC Left", NULL, BLOCK_EN, ADCL_EN, 0),
>> +	SND_SOC_DAPM_MUX("ADC Right Sel", SND_SOC_NOPM, 0, 0, &a1_adc_right_mux),
>> +	SND_SOC_DAPM_MUX("ADC Left Sel", SND_SOC_NOPM, 0, 0, &a1_adc_left_mux),
>> +	SND_SOC_DAPM_AIF_OUT("ADC OUT Right", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +	SND_SOC_DAPM_AIF_OUT("ADC OUT Left", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +};
>> +
>> +static const struct snd_soc_dapm_route a1_t9015_dapm_routes[] = {
>> +	{ "Right IN", NULL, "Playback" },
>> +	{ "Left IN", NULL, "Playback" },
>> +	{ "Right DAC Sel", "Right", "Right IN" },
>> +	{ "Right DAC Sel", "Left", "Left IN" },
>> +	{ "Left DAC Sel", "Right", "Right IN" },
>> +	{ "Left DAC Sel", "Left", "Left IN" },
>> +	{ "Right DAC", NULL, "Right DAC Sel" },
>> +	{ "Left DAC", NULL, "Left DAC Sel" },
>> +	{ "Right+ Driver Sel", "Right DAC", "Right DAC" },
>> +	{ "Right+ Driver Sel", "Left DAC Inverted", "Right DAC" },
>> +	{ "Left+ Driver Sel", "Left DAC", "Left DAC" },
>> +	{ "Left+ Driver Sel", "Right DAC Inverted", "Left DAC" },
>> +	{ "Right+ Driver", NULL, "Right+ Driver Sel" },
>> +	{ "Left+ Driver", NULL, "Left+ Driver Sel" },
>> +	{ "LORP", NULL, "Right+ Driver", },
>> +	{ "LOLP", NULL, "Left+ Driver", },
>> +
>> +	{ "ADC PGA Right Sel", "Differential", "ADC IN Right" },
>> +	{ "ADC PGA Right Sel", "Positive", "ADC IN Right" },
>> +	{ "ADC PGA Right Sel", "Negative", "ADC IN Right" },
>> +	{ "ADC PGA Left Sel", "Differential", "ADC IN Left" },
>> +	{ "ADC PGA Left Sel", "Positive", "ADC IN Left" },
>> +	{ "ADC PGA Left Sel", "Negative", "ADC IN Left" },
>> +	{ "ADC PGA Right", NULL, "ADC PGA Right Sel" },
>> +	{ "ADC PGA Left", NULL, "ADC PGA Left Sel" },
>> +	{ "ADC Right", NULL, "ADC PGA Right" },
>> +	{ "ADC Left", NULL, "ADC PGA Left" },
>> +	{ "ADC Right Sel", "Right", "ADC Right" },
>> +	{ "ADC Right Sel", "Left", "ADC Left" },
>> +	{ "ADC Left Sel", "Right", "ADC Right" },
>> +	{ "ADC Left Sel", "Left", "ADC Left" },
>> +	{ "ADC OUT Right", NULL, "ADC Right Sel" },
>> +	{ "ADC OUT Left", NULL, "ADC Left Sel" },
>> +	{ "Capture", NULL, "ADC OUT Right" },
>> +	{ "Capture", NULL, "ADC OUT Left" },
>> +};
>> +
>>  static int t9015_set_bias_level(struct snd_soc_component *component,
>>  				enum snd_soc_bias_level level)
>>  {
>> @@ -241,6 +465,18 @@ static int t9015_component_probe(struct snd_soc_component *component)
>>  	return 0;
>>  }
>>  
>> +static int a1_t9015_component_probe(struct snd_soc_component *component)
>> +{
>> +	/*
>> +	 * This configuration was stealed from original Amlogic's driver to
>> +	 * reproduce the behavior of the driver more accurately. However, it is
>> +	 * not known for certain what it actually affects.
>> +	 */
>> +	snd_soc_component_write(component, POWER_CFG, 0x00010000);
>> +
>> +	return 0;
>> +}
>> +
>>  static const struct snd_soc_component_driver t9015_codec_driver = {
>>  	.probe			= t9015_component_probe,
>>  	.set_bias_level		= t9015_set_bias_level,
>> @@ -254,6 +490,19 @@ static const struct snd_soc_component_driver t9015_codec_driver = {
>>  	.endianness		= 1,
>>  };
>>  
>> +static const struct snd_soc_component_driver a1_t9015_codec_driver = {
>> +	.probe			= a1_t9015_component_probe,
>> +	.set_bias_level		= t9015_set_bias_level,
>> +	.controls		= a1_t9015_snd_controls,
>> +	.num_controls		= ARRAY_SIZE(a1_t9015_snd_controls),
>> +	.dapm_widgets		= a1_t9015_dapm_widgets,
>> +	.num_dapm_widgets	= ARRAY_SIZE(a1_t9015_dapm_widgets),
>> +	.dapm_routes		= a1_t9015_dapm_routes,
>> +	.num_dapm_routes	= ARRAY_SIZE(a1_t9015_dapm_routes),
>> +	.suspend_bias_off	= 1,
>> +	.endianness		= 1,
>> +};
>> +
>>  static int t9015_probe(struct platform_device *pdev)
>>  {
>>  	struct device *dev = &pdev->dev;
>> @@ -315,11 +564,21 @@ static const struct t9015_match_data t9015_match_data = {
>>  	.max_register = POWER_CFG,
>>  };
>>  
>> +static const struct t9015_match_data a1_t9015_match_data = {
>> +	.component_drv = &a1_t9015_codec_driver,
>> +	.dai_drv = &a1_t9015_dai,
>> +	.max_register = LINEIN_CFG,
>> +};
>> +
>>  static const struct of_device_id t9015_ids[] __maybe_unused = {
>>  	{
>>  		.compatible = "amlogic,t9015",
>>  		.data = &t9015_match_data,
>>  	},
>> +	{
>> +		.compatible = "amlogic,t9015-a1",
>> +		.data = &a1_t9015_match_data,
>> +	},
>>  	{ }
>>  };
>>  MODULE_DEVICE_TABLE(of, t9015_ids);
> 
> 

-- 
Best regards
Jan Dakinevich

WARNING: multiple messages have this Message-ID (diff)
From: Jan Dakinevich <jan.dakinevich@salutedevices.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	<linux-amlogic@lists.infradead.org>, <linux-clk@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<alsa-devel@alsa-project.org>, <linux-sound@vger.kernel.org>,
	<linux-gpio@vger.kernel.org>, <kernel@salutedevices.com>
Subject: Re: [PATCH 12/25] ASoC: meson: t9015: add support for A1 SoC family
Date: Tue, 19 Mar 2024 03:17:14 +0300	[thread overview]
Message-ID: <340ee66a-da5d-4fd5-95a6-ea22839df988@salutedevices.com> (raw)
In-Reply-To: <1j5xxjhktd.fsf@starbuckisacylon.baylibre.com>



On 3/18/24 13:46, Jerome Brunet wrote:
> 
> On Fri 15 Mar 2024 at 02:21, Jan Dakinevich <jan.dakinevich@salutedevices.com> wrote:
> 
>> A1's internal codec is very close to t9015. The main difference, that it
>> has ADC. This commit introduces support for capturing from it.
> 
> This is mis-leading.
> 
> It does not look like the change is A1 specific but rather a extension
> of the support for t9015. It also mixes several different topics like line
> configuration, capture support, etc ...
> 
First, it is not only extentsion. Some bits are changed comparing to
existing t9015, so new compatible string is still required.

Second, I don't know anything about about ADC in t9015 on other SoCs and
even don't sure that it exist there (may be I am inattentive, but I'm
unable to find audio input pin on sm1/g12a's pinout).

> Again, the t9015 changes should be a separated series from the rest, and
> there should be one patch per topic.
> 
> As Mark, if something is meant to be configured based on the HW layout,
> then there a good change a kcontrol is not appropriate, and this should
> rather be part of the platform description, like DT.
> 
> It was also suggested here:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/meson/t9015.c?h=v6.8#n298
> 

Ok. By the way, on a1 LINEOUT_CFG would have another value.

>>
>> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
>> ---
>>  sound/soc/meson/t9015.c | 259 ++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 259 insertions(+)
>>
>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>> index 48f6767bd858..365955bfeb78 100644
>> --- a/sound/soc/meson/t9015.c
>> +++ b/sound/soc/meson/t9015.c
>> @@ -19,16 +19,33 @@
>>  #define  LOLP_EN	3
>>  #define  DACR_EN	4
>>  #define  DACL_EN	5
>> +#define  ADCR_EN	6
>> +#define  ADCL_EN	7
>> +#define  PGAR_ZCD_EN	8
>> +#define  PGAL_ZCD_EN	9
>> +#define  PGAR_EN	10
>> +#define  PGAL_EN	11
>> +#define  ADCR_INV	16
>> +#define  ADCL_INV	17
>> +#define  ADCR_SRC	18
>> +#define  ADCL_SRC	19
>>  #define  DACR_INV	20
>>  #define  DACL_INV	21
>>  #define  DACR_SRC	22
>>  #define  DACL_SRC	23
>> +#define  ADC_DEM_EN	26
>> +#define  ADC_FILTER_MODE 28
>> +#define  ADC_FILTER_EN	29
>>  #define  REFP_BUF_EN	BIT(12)
>>  #define  BIAS_CURRENT_EN BIT(13)
>>  #define  VMID_GEN_FAST	BIT(14)
>>  #define  VMID_GEN_EN	BIT(15)
>>  #define  I2S_MODE	BIT(30)
>>  #define VOL_CTRL0	0x04
>> +#define  PGAR_VC	0
>> +#define  PGAL_VC	8
>> +#define  ADCR_VC	16
>> +#define  ADCL_VC	24
>>  #define  GAIN_H		31
>>  #define  GAIN_L		23
>>  #define VOL_CTRL1	0x08
>> @@ -46,6 +63,28 @@
>>  #define  LOLN_POL	8
>>  #define  LOLP_POL	12
>>  #define POWER_CFG	0x10
>> +#define LINEIN_CFG	0x14
>> +#define  MICBIAS_LEVEL	0
>> +#define  MICBIAS_EN	3
>> +#define  PGAR_CTVMN	8
>> +#define  PGAR_CTVMP	9
>> +#define  PGAL_CTVMN	10
>> +#define  PGAL_CTVMP	11
>> +#define  PGAR_CTVIN	12
>> +#define  PGAR_CTVIP	13
>> +#define  PGAL_CTVIN	14
>> +#define  PGAL_CTVIP	15
>> +
>> +#define PGAR_MASK	(BIT(PGAR_CTVMP) | BIT(PGAR_CTVMN) | \
>> +			 BIT(PGAR_CTVIP) | BIT(PGAR_CTVIN))
>> +#define PGAR_DIFF	(BIT(PGAR_CTVIP) | BIT(PGAR_CTVIN))
>> +#define PGAR_POSITIVE	(BIT(PGAR_CTVIP) | BIT(PGAR_CTVMN))
>> +#define PGAR_NEGATIVE	(BIT(PGAR_CTVIN) | BIT(PGAR_CTVMP))
>> +#define PGAL_MASK	(BIT(PGAL_CTVMP) | BIT(PGAL_CTVMN) | \
>> +			 BIT(PGAL_CTVIP) | BIT(PGAL_CTVIN))
>> +#define PGAL_DIFF	(BIT(PGAL_CTVIP) | BIT(PGAL_CTVIN))
>> +#define PGAL_POSITIVE	(BIT(PGAL_CTVIP) | BIT(PGAL_CTVMN))
>> +#define PGAL_NEGATIVE	(BIT(PGAL_CTVIN) | BIT(PGAL_CTVMP))
>>  
>>  struct t9015 {
>>  	struct regulator *avdd;
>> @@ -103,6 +142,31 @@ static struct snd_soc_dai_driver t9015_dai = {
>>  	.ops = &t9015_dai_ops,
>>  };
>>  
>> +static struct snd_soc_dai_driver a1_t9015_dai = {
>> +	.name = "t9015-hifi",
>> +	.playback = {
>> +		.stream_name = "Playback",
>> +		.channels_min = 1,
>> +		.channels_max = 2,
>> +		.rates = SNDRV_PCM_RATE_8000_96000,
>> +		.formats = (SNDRV_PCM_FMTBIT_S8 |
>> +			    SNDRV_PCM_FMTBIT_S16_LE |
>> +			    SNDRV_PCM_FMTBIT_S20_LE |
>> +			    SNDRV_PCM_FMTBIT_S24_LE),
>> +	},
>> +	.capture = {
>> +		.stream_name = "Capture",
>> +		.channels_min = 1,
>> +		.channels_max = 2,
>> +		.rates = SNDRV_PCM_RATE_8000_96000,
>> +		.formats = (SNDRV_PCM_FMTBIT_S8 |
>> +			    SNDRV_PCM_FMTBIT_S16_LE |
>> +			    SNDRV_PCM_FMTBIT_S20_LE |
>> +			    SNDRV_PCM_FMTBIT_S24_LE),
>> +	},
>> +	.ops = &t9015_dai_ops,
>> +};
>> +
>>  static const DECLARE_TLV_DB_MINMAX_MUTE(dac_vol_tlv, -9525, 0);
>>  
>>  static const char * const ramp_rate_txt[] = { "Fast", "Slow" };
>> @@ -179,6 +243,166 @@ static const struct snd_soc_dapm_route t9015_dapm_routes[] = {
>>  	{ "LOLP", NULL, "Left+ Driver",  },
>>  };
>>  
>> +static const char * const a1_right_driver_txt[] = { "None", "Right DAC",
>> +	"Left DAC Inverted" };
>> +static const unsigned int a1_right_driver_values[] = { 0, 2, 4 };
>> +
>> +static const char * const a1_left_driver_txt[] = { "None", "Left DAC",
>> +	"Right DAC Inverted" };
>> +static const unsigned int a1_left_driver_values[] = { 0, 2, 4 };
>> +
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_right_driver, LINEOUT_CFG, 12, 0x7,
>> +				  a1_right_driver_txt, a1_right_driver_values);
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_left_driver, LINEOUT_CFG, 4, 0x7,
>> +				  a1_left_driver_txt, a1_left_driver_values);
>> +
>> +static const struct snd_kcontrol_new a1_right_driver_mux =
>> +	SOC_DAPM_ENUM("Right Driver+ Source", a1_right_driver);
>> +static const struct snd_kcontrol_new a1_left_driver_mux =
>> +	SOC_DAPM_ENUM("Left Driver+ Source", a1_left_driver);
>> +
>> +static const DECLARE_TLV_DB_MINMAX_MUTE(a1_adc_vol_tlv, -29625, 0);
>> +static const DECLARE_TLV_DB_MINMAX_MUTE(a1_adc_pga_vol_tlv, -1200, 0);
>> +
>> +static const char * const a1_adc_right_txt[] = { "Right", "Left" };
>> +static SOC_ENUM_SINGLE_DECL(a1_adc_right, BLOCK_EN, ADCR_SRC, a1_adc_right_txt);
>> +
>> +static const char * const a1_adc_left_txt[] = { "Left", "Right" };
>> +static SOC_ENUM_SINGLE_DECL(a1_adc_left, BLOCK_EN, ADCL_SRC, a1_adc_left_txt);
>> +
>> +static const struct snd_kcontrol_new a1_adc_right_mux =
>> +	SOC_DAPM_ENUM("ADC Right Source", a1_adc_right);
>> +static const struct snd_kcontrol_new a1_adc_left_mux =
>> +	SOC_DAPM_ENUM("ADC Left Source", a1_adc_left);
>> +
>> +static const char * const a1_adc_filter_mode_txt[] = { "Voice", "HiFi"};
>> +static SOC_ENUM_SINGLE_DECL(a1_adc_filter_mode, BLOCK_EN, ADC_FILTER_MODE,
>> +			    a1_adc_filter_mode_txt);
>> +
>> +static const char * const a1_adc_mic_bias_level_txt[] = { "2.0V", "2.1V",
>> +	"2.3V", "2.5V", "2.8V" };
>> +static const unsigned int a1_adc_mic_bias_level_values[] = { 0, 1, 2, 3, 7 };
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_adc_mic_bias_level,
>> +				  LINEIN_CFG, MICBIAS_LEVEL, 0x7,
>> +				  a1_adc_mic_bias_level_txt,
>> +				  a1_adc_mic_bias_level_values);
>> +
>> +static const char * const a1_adc_pga_txt[] = { "None", "Differential",
>> +	"Positive", "Negative" };
>> +static const unsigned int a1_adc_pga_right_values[] = { 0, PGAR_DIFF,
>> +	PGAR_POSITIVE, PGAR_NEGATIVE };
>> +static const unsigned int a1_adc_pga_left_values[] = { 0, PGAL_DIFF,
>> +	PGAL_POSITIVE, PGAL_NEGATIVE };
>> +
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_adc_pga_right, LINEIN_CFG, 0, PGAR_MASK,
>> +				  a1_adc_pga_txt, a1_adc_pga_right_values);
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_adc_pga_left, LINEIN_CFG, 0, PGAL_MASK,
>> +				  a1_adc_pga_txt, a1_adc_pga_left_values);
>> +
>> +static const struct snd_kcontrol_new a1_adc_pga_right_mux =
>> +	SOC_DAPM_ENUM("ADC PGA Right Source", a1_adc_pga_right);
>> +static const struct snd_kcontrol_new a1_adc_pga_left_mux =
>> +	SOC_DAPM_ENUM("ADC PGA Left Source", a1_adc_pga_left);
>> +
>> +static const struct snd_kcontrol_new a1_t9015_snd_controls[] = {
>> +	/* Volume Controls */
>> +	SOC_ENUM("Playback Channel Mode", mono_enum),
>> +	SOC_SINGLE("Playback Switch", VOL_CTRL1, DAC_SOFT_MUTE, 1, 1),
>> +	SOC_DOUBLE_TLV("Playback Volume", VOL_CTRL1, DACL_VC, DACR_VC,
>> +		       0xff, 0, dac_vol_tlv),
>> +
>> +	/* Ramp Controls */
>> +	SOC_ENUM("Ramp Rate", ramp_rate_enum),
>> +	SOC_SINGLE("Volume Ramp Switch", VOL_CTRL1, VC_RAMP_MODE, 1, 0),
>> +	SOC_SINGLE("Mute Ramp Switch", VOL_CTRL1, MUTE_MODE, 1, 0),
>> +	SOC_SINGLE("Unmute Ramp Switch", VOL_CTRL1, UNMUTE_MODE, 1, 0),
>> +
>> +	/* ADC Controls */
>> +	SOC_DOUBLE_TLV("ADC Volume", VOL_CTRL0, ADCL_VC, ADCR_VC,
>> +		       0x7f, 0, a1_adc_vol_tlv),
>> +	SOC_SINGLE("ADC Filter Switch", BLOCK_EN, ADC_FILTER_EN, 1, 0),
>> +	SOC_ENUM("ADC Filter Mode", a1_adc_filter_mode),
>> +	SOC_SINGLE("ADC Mic Bias Switch", LINEIN_CFG, MICBIAS_EN, 1, 0),
>> +	SOC_ENUM("ADC Mic Bias Level", a1_adc_mic_bias_level),
>> +	SOC_SINGLE("ADC DEM Switch", BLOCK_EN, ADC_DEM_EN, 1, 0),
>> +	SOC_DOUBLE_TLV("ADC PGA Volume", VOL_CTRL0, PGAR_VC, PGAL_VC,
>> +		       0x1f, 0, a1_adc_pga_vol_tlv),
>> +	SOC_DOUBLE("ADC PGA Zero Cross-detection Switch", BLOCK_EN,
>> +		   PGAL_ZCD_EN, PGAR_ZCD_EN, 1, 0),
>> +};
>> +
>> +static const struct snd_soc_dapm_widget a1_t9015_dapm_widgets[] = {
>> +	SND_SOC_DAPM_AIF_IN("Right IN", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +	SND_SOC_DAPM_AIF_IN("Left IN", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +	SND_SOC_DAPM_MUX("Right DAC Sel", SND_SOC_NOPM, 0, 0,
>> +			 &t9015_right_dac_mux),
>> +	SND_SOC_DAPM_MUX("Left DAC Sel", SND_SOC_NOPM, 0, 0,
>> +			 &t9015_left_dac_mux),
>> +	SND_SOC_DAPM_DAC("Right DAC", NULL, BLOCK_EN, DACR_EN, 0),
>> +	SND_SOC_DAPM_DAC("Left DAC",  NULL, BLOCK_EN, DACL_EN, 0),
>> +	SND_SOC_DAPM_MUX("Right+ Driver Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_right_driver_mux),
>> +	SND_SOC_DAPM_MUX("Left+ Driver Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_left_driver_mux),
>> +	SND_SOC_DAPM_OUT_DRV("Right+ Driver", BLOCK_EN, LORP_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_OUT_DRV("Left+ Driver",  BLOCK_EN, LOLP_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_OUTPUT("LORP"),
>> +	SND_SOC_DAPM_OUTPUT("LOLP"),
>> +
>> +	SND_SOC_DAPM_INPUT("ADC IN Right"),
>> +	SND_SOC_DAPM_INPUT("ADC IN Left"),
>> +	SND_SOC_DAPM_MUX("ADC PGA Right Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_adc_pga_right_mux),
>> +	SND_SOC_DAPM_MUX("ADC PGA Left Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_adc_pga_left_mux),
>> +	SND_SOC_DAPM_PGA("ADC PGA Right", BLOCK_EN, PGAR_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_PGA("ADC PGA Left", BLOCK_EN, PGAL_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_ADC("ADC Right", NULL, BLOCK_EN, ADCR_EN, 0),
>> +	SND_SOC_DAPM_ADC("ADC Left", NULL, BLOCK_EN, ADCL_EN, 0),
>> +	SND_SOC_DAPM_MUX("ADC Right Sel", SND_SOC_NOPM, 0, 0, &a1_adc_right_mux),
>> +	SND_SOC_DAPM_MUX("ADC Left Sel", SND_SOC_NOPM, 0, 0, &a1_adc_left_mux),
>> +	SND_SOC_DAPM_AIF_OUT("ADC OUT Right", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +	SND_SOC_DAPM_AIF_OUT("ADC OUT Left", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +};
>> +
>> +static const struct snd_soc_dapm_route a1_t9015_dapm_routes[] = {
>> +	{ "Right IN", NULL, "Playback" },
>> +	{ "Left IN", NULL, "Playback" },
>> +	{ "Right DAC Sel", "Right", "Right IN" },
>> +	{ "Right DAC Sel", "Left", "Left IN" },
>> +	{ "Left DAC Sel", "Right", "Right IN" },
>> +	{ "Left DAC Sel", "Left", "Left IN" },
>> +	{ "Right DAC", NULL, "Right DAC Sel" },
>> +	{ "Left DAC", NULL, "Left DAC Sel" },
>> +	{ "Right+ Driver Sel", "Right DAC", "Right DAC" },
>> +	{ "Right+ Driver Sel", "Left DAC Inverted", "Right DAC" },
>> +	{ "Left+ Driver Sel", "Left DAC", "Left DAC" },
>> +	{ "Left+ Driver Sel", "Right DAC Inverted", "Left DAC" },
>> +	{ "Right+ Driver", NULL, "Right+ Driver Sel" },
>> +	{ "Left+ Driver", NULL, "Left+ Driver Sel" },
>> +	{ "LORP", NULL, "Right+ Driver", },
>> +	{ "LOLP", NULL, "Left+ Driver", },
>> +
>> +	{ "ADC PGA Right Sel", "Differential", "ADC IN Right" },
>> +	{ "ADC PGA Right Sel", "Positive", "ADC IN Right" },
>> +	{ "ADC PGA Right Sel", "Negative", "ADC IN Right" },
>> +	{ "ADC PGA Left Sel", "Differential", "ADC IN Left" },
>> +	{ "ADC PGA Left Sel", "Positive", "ADC IN Left" },
>> +	{ "ADC PGA Left Sel", "Negative", "ADC IN Left" },
>> +	{ "ADC PGA Right", NULL, "ADC PGA Right Sel" },
>> +	{ "ADC PGA Left", NULL, "ADC PGA Left Sel" },
>> +	{ "ADC Right", NULL, "ADC PGA Right" },
>> +	{ "ADC Left", NULL, "ADC PGA Left" },
>> +	{ "ADC Right Sel", "Right", "ADC Right" },
>> +	{ "ADC Right Sel", "Left", "ADC Left" },
>> +	{ "ADC Left Sel", "Right", "ADC Right" },
>> +	{ "ADC Left Sel", "Left", "ADC Left" },
>> +	{ "ADC OUT Right", NULL, "ADC Right Sel" },
>> +	{ "ADC OUT Left", NULL, "ADC Left Sel" },
>> +	{ "Capture", NULL, "ADC OUT Right" },
>> +	{ "Capture", NULL, "ADC OUT Left" },
>> +};
>> +
>>  static int t9015_set_bias_level(struct snd_soc_component *component,
>>  				enum snd_soc_bias_level level)
>>  {
>> @@ -241,6 +465,18 @@ static int t9015_component_probe(struct snd_soc_component *component)
>>  	return 0;
>>  }
>>  
>> +static int a1_t9015_component_probe(struct snd_soc_component *component)
>> +{
>> +	/*
>> +	 * This configuration was stealed from original Amlogic's driver to
>> +	 * reproduce the behavior of the driver more accurately. However, it is
>> +	 * not known for certain what it actually affects.
>> +	 */
>> +	snd_soc_component_write(component, POWER_CFG, 0x00010000);
>> +
>> +	return 0;
>> +}
>> +
>>  static const struct snd_soc_component_driver t9015_codec_driver = {
>>  	.probe			= t9015_component_probe,
>>  	.set_bias_level		= t9015_set_bias_level,
>> @@ -254,6 +490,19 @@ static const struct snd_soc_component_driver t9015_codec_driver = {
>>  	.endianness		= 1,
>>  };
>>  
>> +static const struct snd_soc_component_driver a1_t9015_codec_driver = {
>> +	.probe			= a1_t9015_component_probe,
>> +	.set_bias_level		= t9015_set_bias_level,
>> +	.controls		= a1_t9015_snd_controls,
>> +	.num_controls		= ARRAY_SIZE(a1_t9015_snd_controls),
>> +	.dapm_widgets		= a1_t9015_dapm_widgets,
>> +	.num_dapm_widgets	= ARRAY_SIZE(a1_t9015_dapm_widgets),
>> +	.dapm_routes		= a1_t9015_dapm_routes,
>> +	.num_dapm_routes	= ARRAY_SIZE(a1_t9015_dapm_routes),
>> +	.suspend_bias_off	= 1,
>> +	.endianness		= 1,
>> +};
>> +
>>  static int t9015_probe(struct platform_device *pdev)
>>  {
>>  	struct device *dev = &pdev->dev;
>> @@ -315,11 +564,21 @@ static const struct t9015_match_data t9015_match_data = {
>>  	.max_register = POWER_CFG,
>>  };
>>  
>> +static const struct t9015_match_data a1_t9015_match_data = {
>> +	.component_drv = &a1_t9015_codec_driver,
>> +	.dai_drv = &a1_t9015_dai,
>> +	.max_register = LINEIN_CFG,
>> +};
>> +
>>  static const struct of_device_id t9015_ids[] __maybe_unused = {
>>  	{
>>  		.compatible = "amlogic,t9015",
>>  		.data = &t9015_match_data,
>>  	},
>> +	{
>> +		.compatible = "amlogic,t9015-a1",
>> +		.data = &a1_t9015_match_data,
>> +	},
>>  	{ }
>>  };
>>  MODULE_DEVICE_TABLE(of, t9015_ids);
> 
> 

-- 
Best regards
Jan Dakinevich

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Jan Dakinevich <jan.dakinevich@salutedevices.com>
To: Jerome Brunet <jbrunet@baylibre.com>
Cc: Neil Armstrong <neil.armstrong@linaro.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Kevin Hilman <khilman@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	<linux-amlogic@lists.infradead.org>, <linux-clk@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<alsa-devel@alsa-project.org>, <linux-sound@vger.kernel.org>,
	<linux-gpio@vger.kernel.org>, <kernel@salutedevices.com>
Subject: Re: [PATCH 12/25] ASoC: meson: t9015: add support for A1 SoC family
Date: Tue, 19 Mar 2024 03:17:14 +0300	[thread overview]
Message-ID: <340ee66a-da5d-4fd5-95a6-ea22839df988@salutedevices.com> (raw)
In-Reply-To: <1j5xxjhktd.fsf@starbuckisacylon.baylibre.com>



On 3/18/24 13:46, Jerome Brunet wrote:
> 
> On Fri 15 Mar 2024 at 02:21, Jan Dakinevich <jan.dakinevich@salutedevices.com> wrote:
> 
>> A1's internal codec is very close to t9015. The main difference, that it
>> has ADC. This commit introduces support for capturing from it.
> 
> This is mis-leading.
> 
> It does not look like the change is A1 specific but rather a extension
> of the support for t9015. It also mixes several different topics like line
> configuration, capture support, etc ...
> 
First, it is not only extentsion. Some bits are changed comparing to
existing t9015, so new compatible string is still required.

Second, I don't know anything about about ADC in t9015 on other SoCs and
even don't sure that it exist there (may be I am inattentive, but I'm
unable to find audio input pin on sm1/g12a's pinout).

> Again, the t9015 changes should be a separated series from the rest, and
> there should be one patch per topic.
> 
> As Mark, if something is meant to be configured based on the HW layout,
> then there a good change a kcontrol is not appropriate, and this should
> rather be part of the platform description, like DT.
> 
> It was also suggested here:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/meson/t9015.c?h=v6.8#n298
> 

Ok. By the way, on a1 LINEOUT_CFG would have another value.

>>
>> Signed-off-by: Jan Dakinevich <jan.dakinevich@salutedevices.com>
>> ---
>>  sound/soc/meson/t9015.c | 259 ++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 259 insertions(+)
>>
>> diff --git a/sound/soc/meson/t9015.c b/sound/soc/meson/t9015.c
>> index 48f6767bd858..365955bfeb78 100644
>> --- a/sound/soc/meson/t9015.c
>> +++ b/sound/soc/meson/t9015.c
>> @@ -19,16 +19,33 @@
>>  #define  LOLP_EN	3
>>  #define  DACR_EN	4
>>  #define  DACL_EN	5
>> +#define  ADCR_EN	6
>> +#define  ADCL_EN	7
>> +#define  PGAR_ZCD_EN	8
>> +#define  PGAL_ZCD_EN	9
>> +#define  PGAR_EN	10
>> +#define  PGAL_EN	11
>> +#define  ADCR_INV	16
>> +#define  ADCL_INV	17
>> +#define  ADCR_SRC	18
>> +#define  ADCL_SRC	19
>>  #define  DACR_INV	20
>>  #define  DACL_INV	21
>>  #define  DACR_SRC	22
>>  #define  DACL_SRC	23
>> +#define  ADC_DEM_EN	26
>> +#define  ADC_FILTER_MODE 28
>> +#define  ADC_FILTER_EN	29
>>  #define  REFP_BUF_EN	BIT(12)
>>  #define  BIAS_CURRENT_EN BIT(13)
>>  #define  VMID_GEN_FAST	BIT(14)
>>  #define  VMID_GEN_EN	BIT(15)
>>  #define  I2S_MODE	BIT(30)
>>  #define VOL_CTRL0	0x04
>> +#define  PGAR_VC	0
>> +#define  PGAL_VC	8
>> +#define  ADCR_VC	16
>> +#define  ADCL_VC	24
>>  #define  GAIN_H		31
>>  #define  GAIN_L		23
>>  #define VOL_CTRL1	0x08
>> @@ -46,6 +63,28 @@
>>  #define  LOLN_POL	8
>>  #define  LOLP_POL	12
>>  #define POWER_CFG	0x10
>> +#define LINEIN_CFG	0x14
>> +#define  MICBIAS_LEVEL	0
>> +#define  MICBIAS_EN	3
>> +#define  PGAR_CTVMN	8
>> +#define  PGAR_CTVMP	9
>> +#define  PGAL_CTVMN	10
>> +#define  PGAL_CTVMP	11
>> +#define  PGAR_CTVIN	12
>> +#define  PGAR_CTVIP	13
>> +#define  PGAL_CTVIN	14
>> +#define  PGAL_CTVIP	15
>> +
>> +#define PGAR_MASK	(BIT(PGAR_CTVMP) | BIT(PGAR_CTVMN) | \
>> +			 BIT(PGAR_CTVIP) | BIT(PGAR_CTVIN))
>> +#define PGAR_DIFF	(BIT(PGAR_CTVIP) | BIT(PGAR_CTVIN))
>> +#define PGAR_POSITIVE	(BIT(PGAR_CTVIP) | BIT(PGAR_CTVMN))
>> +#define PGAR_NEGATIVE	(BIT(PGAR_CTVIN) | BIT(PGAR_CTVMP))
>> +#define PGAL_MASK	(BIT(PGAL_CTVMP) | BIT(PGAL_CTVMN) | \
>> +			 BIT(PGAL_CTVIP) | BIT(PGAL_CTVIN))
>> +#define PGAL_DIFF	(BIT(PGAL_CTVIP) | BIT(PGAL_CTVIN))
>> +#define PGAL_POSITIVE	(BIT(PGAL_CTVIP) | BIT(PGAL_CTVMN))
>> +#define PGAL_NEGATIVE	(BIT(PGAL_CTVIN) | BIT(PGAL_CTVMP))
>>  
>>  struct t9015 {
>>  	struct regulator *avdd;
>> @@ -103,6 +142,31 @@ static struct snd_soc_dai_driver t9015_dai = {
>>  	.ops = &t9015_dai_ops,
>>  };
>>  
>> +static struct snd_soc_dai_driver a1_t9015_dai = {
>> +	.name = "t9015-hifi",
>> +	.playback = {
>> +		.stream_name = "Playback",
>> +		.channels_min = 1,
>> +		.channels_max = 2,
>> +		.rates = SNDRV_PCM_RATE_8000_96000,
>> +		.formats = (SNDRV_PCM_FMTBIT_S8 |
>> +			    SNDRV_PCM_FMTBIT_S16_LE |
>> +			    SNDRV_PCM_FMTBIT_S20_LE |
>> +			    SNDRV_PCM_FMTBIT_S24_LE),
>> +	},
>> +	.capture = {
>> +		.stream_name = "Capture",
>> +		.channels_min = 1,
>> +		.channels_max = 2,
>> +		.rates = SNDRV_PCM_RATE_8000_96000,
>> +		.formats = (SNDRV_PCM_FMTBIT_S8 |
>> +			    SNDRV_PCM_FMTBIT_S16_LE |
>> +			    SNDRV_PCM_FMTBIT_S20_LE |
>> +			    SNDRV_PCM_FMTBIT_S24_LE),
>> +	},
>> +	.ops = &t9015_dai_ops,
>> +};
>> +
>>  static const DECLARE_TLV_DB_MINMAX_MUTE(dac_vol_tlv, -9525, 0);
>>  
>>  static const char * const ramp_rate_txt[] = { "Fast", "Slow" };
>> @@ -179,6 +243,166 @@ static const struct snd_soc_dapm_route t9015_dapm_routes[] = {
>>  	{ "LOLP", NULL, "Left+ Driver",  },
>>  };
>>  
>> +static const char * const a1_right_driver_txt[] = { "None", "Right DAC",
>> +	"Left DAC Inverted" };
>> +static const unsigned int a1_right_driver_values[] = { 0, 2, 4 };
>> +
>> +static const char * const a1_left_driver_txt[] = { "None", "Left DAC",
>> +	"Right DAC Inverted" };
>> +static const unsigned int a1_left_driver_values[] = { 0, 2, 4 };
>> +
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_right_driver, LINEOUT_CFG, 12, 0x7,
>> +				  a1_right_driver_txt, a1_right_driver_values);
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_left_driver, LINEOUT_CFG, 4, 0x7,
>> +				  a1_left_driver_txt, a1_left_driver_values);
>> +
>> +static const struct snd_kcontrol_new a1_right_driver_mux =
>> +	SOC_DAPM_ENUM("Right Driver+ Source", a1_right_driver);
>> +static const struct snd_kcontrol_new a1_left_driver_mux =
>> +	SOC_DAPM_ENUM("Left Driver+ Source", a1_left_driver);
>> +
>> +static const DECLARE_TLV_DB_MINMAX_MUTE(a1_adc_vol_tlv, -29625, 0);
>> +static const DECLARE_TLV_DB_MINMAX_MUTE(a1_adc_pga_vol_tlv, -1200, 0);
>> +
>> +static const char * const a1_adc_right_txt[] = { "Right", "Left" };
>> +static SOC_ENUM_SINGLE_DECL(a1_adc_right, BLOCK_EN, ADCR_SRC, a1_adc_right_txt);
>> +
>> +static const char * const a1_adc_left_txt[] = { "Left", "Right" };
>> +static SOC_ENUM_SINGLE_DECL(a1_adc_left, BLOCK_EN, ADCL_SRC, a1_adc_left_txt);
>> +
>> +static const struct snd_kcontrol_new a1_adc_right_mux =
>> +	SOC_DAPM_ENUM("ADC Right Source", a1_adc_right);
>> +static const struct snd_kcontrol_new a1_adc_left_mux =
>> +	SOC_DAPM_ENUM("ADC Left Source", a1_adc_left);
>> +
>> +static const char * const a1_adc_filter_mode_txt[] = { "Voice", "HiFi"};
>> +static SOC_ENUM_SINGLE_DECL(a1_adc_filter_mode, BLOCK_EN, ADC_FILTER_MODE,
>> +			    a1_adc_filter_mode_txt);
>> +
>> +static const char * const a1_adc_mic_bias_level_txt[] = { "2.0V", "2.1V",
>> +	"2.3V", "2.5V", "2.8V" };
>> +static const unsigned int a1_adc_mic_bias_level_values[] = { 0, 1, 2, 3, 7 };
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_adc_mic_bias_level,
>> +				  LINEIN_CFG, MICBIAS_LEVEL, 0x7,
>> +				  a1_adc_mic_bias_level_txt,
>> +				  a1_adc_mic_bias_level_values);
>> +
>> +static const char * const a1_adc_pga_txt[] = { "None", "Differential",
>> +	"Positive", "Negative" };
>> +static const unsigned int a1_adc_pga_right_values[] = { 0, PGAR_DIFF,
>> +	PGAR_POSITIVE, PGAR_NEGATIVE };
>> +static const unsigned int a1_adc_pga_left_values[] = { 0, PGAL_DIFF,
>> +	PGAL_POSITIVE, PGAL_NEGATIVE };
>> +
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_adc_pga_right, LINEIN_CFG, 0, PGAR_MASK,
>> +				  a1_adc_pga_txt, a1_adc_pga_right_values);
>> +static SOC_VALUE_ENUM_SINGLE_DECL(a1_adc_pga_left, LINEIN_CFG, 0, PGAL_MASK,
>> +				  a1_adc_pga_txt, a1_adc_pga_left_values);
>> +
>> +static const struct snd_kcontrol_new a1_adc_pga_right_mux =
>> +	SOC_DAPM_ENUM("ADC PGA Right Source", a1_adc_pga_right);
>> +static const struct snd_kcontrol_new a1_adc_pga_left_mux =
>> +	SOC_DAPM_ENUM("ADC PGA Left Source", a1_adc_pga_left);
>> +
>> +static const struct snd_kcontrol_new a1_t9015_snd_controls[] = {
>> +	/* Volume Controls */
>> +	SOC_ENUM("Playback Channel Mode", mono_enum),
>> +	SOC_SINGLE("Playback Switch", VOL_CTRL1, DAC_SOFT_MUTE, 1, 1),
>> +	SOC_DOUBLE_TLV("Playback Volume", VOL_CTRL1, DACL_VC, DACR_VC,
>> +		       0xff, 0, dac_vol_tlv),
>> +
>> +	/* Ramp Controls */
>> +	SOC_ENUM("Ramp Rate", ramp_rate_enum),
>> +	SOC_SINGLE("Volume Ramp Switch", VOL_CTRL1, VC_RAMP_MODE, 1, 0),
>> +	SOC_SINGLE("Mute Ramp Switch", VOL_CTRL1, MUTE_MODE, 1, 0),
>> +	SOC_SINGLE("Unmute Ramp Switch", VOL_CTRL1, UNMUTE_MODE, 1, 0),
>> +
>> +	/* ADC Controls */
>> +	SOC_DOUBLE_TLV("ADC Volume", VOL_CTRL0, ADCL_VC, ADCR_VC,
>> +		       0x7f, 0, a1_adc_vol_tlv),
>> +	SOC_SINGLE("ADC Filter Switch", BLOCK_EN, ADC_FILTER_EN, 1, 0),
>> +	SOC_ENUM("ADC Filter Mode", a1_adc_filter_mode),
>> +	SOC_SINGLE("ADC Mic Bias Switch", LINEIN_CFG, MICBIAS_EN, 1, 0),
>> +	SOC_ENUM("ADC Mic Bias Level", a1_adc_mic_bias_level),
>> +	SOC_SINGLE("ADC DEM Switch", BLOCK_EN, ADC_DEM_EN, 1, 0),
>> +	SOC_DOUBLE_TLV("ADC PGA Volume", VOL_CTRL0, PGAR_VC, PGAL_VC,
>> +		       0x1f, 0, a1_adc_pga_vol_tlv),
>> +	SOC_DOUBLE("ADC PGA Zero Cross-detection Switch", BLOCK_EN,
>> +		   PGAL_ZCD_EN, PGAR_ZCD_EN, 1, 0),
>> +};
>> +
>> +static const struct snd_soc_dapm_widget a1_t9015_dapm_widgets[] = {
>> +	SND_SOC_DAPM_AIF_IN("Right IN", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +	SND_SOC_DAPM_AIF_IN("Left IN", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +	SND_SOC_DAPM_MUX("Right DAC Sel", SND_SOC_NOPM, 0, 0,
>> +			 &t9015_right_dac_mux),
>> +	SND_SOC_DAPM_MUX("Left DAC Sel", SND_SOC_NOPM, 0, 0,
>> +			 &t9015_left_dac_mux),
>> +	SND_SOC_DAPM_DAC("Right DAC", NULL, BLOCK_EN, DACR_EN, 0),
>> +	SND_SOC_DAPM_DAC("Left DAC",  NULL, BLOCK_EN, DACL_EN, 0),
>> +	SND_SOC_DAPM_MUX("Right+ Driver Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_right_driver_mux),
>> +	SND_SOC_DAPM_MUX("Left+ Driver Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_left_driver_mux),
>> +	SND_SOC_DAPM_OUT_DRV("Right+ Driver", BLOCK_EN, LORP_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_OUT_DRV("Left+ Driver",  BLOCK_EN, LOLP_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_OUTPUT("LORP"),
>> +	SND_SOC_DAPM_OUTPUT("LOLP"),
>> +
>> +	SND_SOC_DAPM_INPUT("ADC IN Right"),
>> +	SND_SOC_DAPM_INPUT("ADC IN Left"),
>> +	SND_SOC_DAPM_MUX("ADC PGA Right Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_adc_pga_right_mux),
>> +	SND_SOC_DAPM_MUX("ADC PGA Left Sel", SND_SOC_NOPM, 0, 0,
>> +			 &a1_adc_pga_left_mux),
>> +	SND_SOC_DAPM_PGA("ADC PGA Right", BLOCK_EN, PGAR_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_PGA("ADC PGA Left", BLOCK_EN, PGAL_EN, 0, NULL, 0),
>> +	SND_SOC_DAPM_ADC("ADC Right", NULL, BLOCK_EN, ADCR_EN, 0),
>> +	SND_SOC_DAPM_ADC("ADC Left", NULL, BLOCK_EN, ADCL_EN, 0),
>> +	SND_SOC_DAPM_MUX("ADC Right Sel", SND_SOC_NOPM, 0, 0, &a1_adc_right_mux),
>> +	SND_SOC_DAPM_MUX("ADC Left Sel", SND_SOC_NOPM, 0, 0, &a1_adc_left_mux),
>> +	SND_SOC_DAPM_AIF_OUT("ADC OUT Right", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +	SND_SOC_DAPM_AIF_OUT("ADC OUT Left", NULL, 0, SND_SOC_NOPM, 0, 0),
>> +};
>> +
>> +static const struct snd_soc_dapm_route a1_t9015_dapm_routes[] = {
>> +	{ "Right IN", NULL, "Playback" },
>> +	{ "Left IN", NULL, "Playback" },
>> +	{ "Right DAC Sel", "Right", "Right IN" },
>> +	{ "Right DAC Sel", "Left", "Left IN" },
>> +	{ "Left DAC Sel", "Right", "Right IN" },
>> +	{ "Left DAC Sel", "Left", "Left IN" },
>> +	{ "Right DAC", NULL, "Right DAC Sel" },
>> +	{ "Left DAC", NULL, "Left DAC Sel" },
>> +	{ "Right+ Driver Sel", "Right DAC", "Right DAC" },
>> +	{ "Right+ Driver Sel", "Left DAC Inverted", "Right DAC" },
>> +	{ "Left+ Driver Sel", "Left DAC", "Left DAC" },
>> +	{ "Left+ Driver Sel", "Right DAC Inverted", "Left DAC" },
>> +	{ "Right+ Driver", NULL, "Right+ Driver Sel" },
>> +	{ "Left+ Driver", NULL, "Left+ Driver Sel" },
>> +	{ "LORP", NULL, "Right+ Driver", },
>> +	{ "LOLP", NULL, "Left+ Driver", },
>> +
>> +	{ "ADC PGA Right Sel", "Differential", "ADC IN Right" },
>> +	{ "ADC PGA Right Sel", "Positive", "ADC IN Right" },
>> +	{ "ADC PGA Right Sel", "Negative", "ADC IN Right" },
>> +	{ "ADC PGA Left Sel", "Differential", "ADC IN Left" },
>> +	{ "ADC PGA Left Sel", "Positive", "ADC IN Left" },
>> +	{ "ADC PGA Left Sel", "Negative", "ADC IN Left" },
>> +	{ "ADC PGA Right", NULL, "ADC PGA Right Sel" },
>> +	{ "ADC PGA Left", NULL, "ADC PGA Left Sel" },
>> +	{ "ADC Right", NULL, "ADC PGA Right" },
>> +	{ "ADC Left", NULL, "ADC PGA Left" },
>> +	{ "ADC Right Sel", "Right", "ADC Right" },
>> +	{ "ADC Right Sel", "Left", "ADC Left" },
>> +	{ "ADC Left Sel", "Right", "ADC Right" },
>> +	{ "ADC Left Sel", "Left", "ADC Left" },
>> +	{ "ADC OUT Right", NULL, "ADC Right Sel" },
>> +	{ "ADC OUT Left", NULL, "ADC Left Sel" },
>> +	{ "Capture", NULL, "ADC OUT Right" },
>> +	{ "Capture", NULL, "ADC OUT Left" },
>> +};
>> +
>>  static int t9015_set_bias_level(struct snd_soc_component *component,
>>  				enum snd_soc_bias_level level)
>>  {
>> @@ -241,6 +465,18 @@ static int t9015_component_probe(struct snd_soc_component *component)
>>  	return 0;
>>  }
>>  
>> +static int a1_t9015_component_probe(struct snd_soc_component *component)
>> +{
>> +	/*
>> +	 * This configuration was stealed from original Amlogic's driver to
>> +	 * reproduce the behavior of the driver more accurately. However, it is
>> +	 * not known for certain what it actually affects.
>> +	 */
>> +	snd_soc_component_write(component, POWER_CFG, 0x00010000);
>> +
>> +	return 0;
>> +}
>> +
>>  static const struct snd_soc_component_driver t9015_codec_driver = {
>>  	.probe			= t9015_component_probe,
>>  	.set_bias_level		= t9015_set_bias_level,
>> @@ -254,6 +490,19 @@ static const struct snd_soc_component_driver t9015_codec_driver = {
>>  	.endianness		= 1,
>>  };
>>  
>> +static const struct snd_soc_component_driver a1_t9015_codec_driver = {
>> +	.probe			= a1_t9015_component_probe,
>> +	.set_bias_level		= t9015_set_bias_level,
>> +	.controls		= a1_t9015_snd_controls,
>> +	.num_controls		= ARRAY_SIZE(a1_t9015_snd_controls),
>> +	.dapm_widgets		= a1_t9015_dapm_widgets,
>> +	.num_dapm_widgets	= ARRAY_SIZE(a1_t9015_dapm_widgets),
>> +	.dapm_routes		= a1_t9015_dapm_routes,
>> +	.num_dapm_routes	= ARRAY_SIZE(a1_t9015_dapm_routes),
>> +	.suspend_bias_off	= 1,
>> +	.endianness		= 1,
>> +};
>> +
>>  static int t9015_probe(struct platform_device *pdev)
>>  {
>>  	struct device *dev = &pdev->dev;
>> @@ -315,11 +564,21 @@ static const struct t9015_match_data t9015_match_data = {
>>  	.max_register = POWER_CFG,
>>  };
>>  
>> +static const struct t9015_match_data a1_t9015_match_data = {
>> +	.component_drv = &a1_t9015_codec_driver,
>> +	.dai_drv = &a1_t9015_dai,
>> +	.max_register = LINEIN_CFG,
>> +};
>> +
>>  static const struct of_device_id t9015_ids[] __maybe_unused = {
>>  	{
>>  		.compatible = "amlogic,t9015",
>>  		.data = &t9015_match_data,
>>  	},
>> +	{
>> +		.compatible = "amlogic,t9015-a1",
>> +		.data = &a1_t9015_match_data,
>> +	},
>>  	{ }
>>  };
>>  MODULE_DEVICE_TABLE(of, t9015_ids);
> 
> 

-- 
Best regards
Jan Dakinevich

_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2024-03-19  0:18 UTC|newest]

Thread overview: 255+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-14 23:21 [PATCH 00/25] Introduce support of audio for Amlogic A1 SoC family Jan Dakinevich
2024-03-14 23:21 ` Jan Dakinevich
2024-03-14 23:21 ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 01/25] clk: meson: a1: restrict an amount of 'hifi_pll' params Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15  8:58   ` Jerome Brunet
2024-03-15  8:58     ` Jerome Brunet
2024-03-15  8:58     ` Jerome Brunet
2024-03-17 14:17     ` Jan Dakinevich
2024-03-17 14:17       ` Jan Dakinevich
2024-03-17 14:17       ` Jan Dakinevich
2024-03-18 10:17       ` Jerome Brunet
2024-03-18 10:17         ` Jerome Brunet
2024-03-18 10:17         ` Jerome Brunet
2024-03-18 22:35         ` Jan Dakinevich
2024-03-18 22:35           ` Jan Dakinevich
2024-03-18 22:35           ` Jan Dakinevich
2024-03-19  8:21           ` Jerome Brunet
2024-03-19  8:21             ` Jerome Brunet
2024-03-19  8:21             ` Jerome Brunet
2024-03-19 13:53             ` Dmitry Rokosov
2024-03-19 13:53               ` Dmitry Rokosov
2024-03-19 13:53               ` Dmitry Rokosov
2024-03-14 23:21 ` [PATCH 02/25] clk: meson: axg: move reset controller's code to separate module Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 03/25] dt-bindings: clock: meson: add A1 audio clock and reset controller bindings Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15  9:56   ` Krzysztof Kozlowski
2024-03-15  9:56     ` Krzysztof Kozlowski
2024-03-15  9:56     ` Krzysztof Kozlowski
2024-03-14 23:21 ` [PATCH 04/25] clk: meson: a1: add the audio clock controller driver Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15  9:20   ` Jerome Brunet
2024-03-15  9:20     ` Jerome Brunet
2024-03-15  9:20     ` Jerome Brunet
2024-03-19  1:47     ` Jan Dakinevich
2024-03-19  1:47       ` Jan Dakinevich
2024-03-19  1:47       ` Jan Dakinevich
2024-03-19  8:30       ` Jerome Brunet
2024-03-19  8:30         ` Jerome Brunet
2024-03-19  8:30         ` Jerome Brunet
2024-03-23 18:02         ` Jan Dakinevich
2024-03-23 18:02           ` Jan Dakinevich
2024-03-23 18:02           ` Jan Dakinevich
2024-03-26 15:26           ` Jerome Brunet
2024-03-26 15:26             ` Jerome Brunet
2024-03-26 15:26             ` Jerome Brunet
2024-03-26 18:44             ` Jan Dakinevich
2024-03-26 18:44               ` Jan Dakinevich
2024-03-26 18:44               ` Jan Dakinevich
2024-03-27 12:57               ` Jerome Brunet
2024-03-27 12:57                 ` Jerome Brunet
2024-03-27 12:57                 ` Jerome Brunet
2024-03-14 23:21 ` [PATCH 05/25] ASoC: meson: codec-glue: add support for capture stream Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 06/25] ASoC: meson: g12a-toacodec: fix "Lane Select" width Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15 10:00   ` Jerome Brunet
2024-03-15 10:00     ` Jerome Brunet
2024-03-15 10:00     ` Jerome Brunet
2024-03-15 13:17   ` Dan Carpenter
2024-03-15 13:17     ` Dan Carpenter
2024-03-15 13:17     ` Dan Carpenter
2024-03-24 17:51   ` Jan Dakinevich
2024-03-24 17:51     ` Jan Dakinevich
2024-03-24 17:51     ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 07/25] ASoC: meson: g12a-toacodec: rework the definition of bits Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 08/25] ASoC: dt-bindings: meson: g12a-toacodec: add support for A1 SoC family Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15  9:58   ` Krzysztof Kozlowski
2024-03-15  9:58     ` Krzysztof Kozlowski
2024-03-15  9:58     ` Krzysztof Kozlowski
2024-03-17 14:29     ` Jan Dakinevich
2024-03-17 14:29       ` Jan Dakinevich
2024-03-17 14:29       ` Jan Dakinevich
2024-03-17 14:46       ` Krzysztof Kozlowski
2024-03-17 14:46         ` Krzysztof Kozlowski
2024-03-17 14:46         ` Krzysztof Kozlowski
2024-03-17 15:11         ` Jan Dakinevich
2024-03-17 15:11           ` Jan Dakinevich
2024-03-17 15:11           ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 09/25] ASoC: " Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15 13:33   ` Mark Brown
2024-03-15 13:33     ` Mark Brown
2024-03-15 13:33     ` Mark Brown
2024-03-17 15:19     ` Jan Dakinevich
2024-03-17 15:19       ` Jan Dakinevich
2024-03-17 15:19       ` Jan Dakinevich
2024-03-18 10:42       ` Jerome Brunet
2024-03-18 10:42         ` Jerome Brunet
2024-03-18 10:42         ` Jerome Brunet
2024-03-18 13:30       ` Mark Brown
2024-03-18 13:30         ` Mark Brown
2024-03-18 13:30         ` Mark Brown
2024-03-14 23:21 ` [PATCH 10/25] ASoC: meson: t9015: prepare to adding new platforms Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 11/25] ASoC: dt-bindings: meson: t9015: add support for A1 SoC family Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-17 19:03   ` Rob Herring
2024-03-17 19:03     ` Rob Herring
2024-03-17 19:03     ` Rob Herring
2024-03-17 23:39     ` Jan Dakinevich
2024-03-17 23:39       ` Jan Dakinevich
2024-03-17 23:39       ` Jan Dakinevich
2024-03-18  7:46       ` Krzysztof Kozlowski
2024-03-18  7:46         ` Krzysztof Kozlowski
2024-03-18  7:46         ` Krzysztof Kozlowski
2024-03-14 23:21 ` [PATCH 12/25] ASoC: " Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15 13:36   ` Mark Brown
2024-03-15 13:36     ` Mark Brown
2024-03-15 13:36     ` Mark Brown
2024-03-17 16:27     ` Jan Dakinevich
2024-03-17 16:27       ` Jan Dakinevich
2024-03-17 16:27       ` Jan Dakinevich
2024-03-18 13:48       ` Mark Brown
2024-03-18 13:48         ` Mark Brown
2024-03-18 13:48         ` Mark Brown
2024-03-18 22:43         ` Jan Dakinevich
2024-03-18 22:43           ` Jan Dakinevich
2024-03-18 22:43           ` Jan Dakinevich
2024-03-18 10:46   ` Jerome Brunet
2024-03-18 10:46     ` Jerome Brunet
2024-03-18 10:46     ` Jerome Brunet
2024-03-19  0:17     ` Jan Dakinevich [this message]
2024-03-19  0:17       ` Jan Dakinevich
2024-03-19  0:17       ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 13/25] ASoC: dt-bindings: meson: axg-pdm: document 'sysrate' property Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15 10:00   ` Krzysztof Kozlowski
2024-03-15 10:00     ` Krzysztof Kozlowski
2024-03-15 10:00     ` Krzysztof Kozlowski
2024-03-15 10:22     ` Jerome Brunet
2024-03-15 10:22       ` Jerome Brunet
2024-03-15 10:22       ` Jerome Brunet
2024-03-17 15:52       ` Jan Dakinevich
2024-03-17 15:52         ` Jan Dakinevich
2024-03-17 15:52         ` Jan Dakinevich
2024-03-18 10:55         ` Jerome Brunet
2024-03-18 10:55           ` Jerome Brunet
2024-03-18 10:55           ` Jerome Brunet
2024-03-18 12:19           ` Jerome Brunet
2024-03-18 12:19             ` Jerome Brunet
2024-03-18 12:19             ` Jerome Brunet
2024-03-19  0:30             ` Jan Dakinevich
2024-03-19  0:30               ` Jan Dakinevich
2024-03-19  0:30               ` Jan Dakinevich
2024-03-19  0:35           ` Jan Dakinevich
2024-03-19  0:35             ` Jan Dakinevich
2024-03-19  0:35             ` Jan Dakinevich
2024-03-19  5:17         ` Krzysztof Kozlowski
2024-03-19  5:17           ` Krzysztof Kozlowski
2024-03-19  5:17           ` Krzysztof Kozlowski
2024-03-17 15:55     ` Jan Dakinevich
2024-03-17 15:55       ` Jan Dakinevich
2024-03-17 15:55       ` Jan Dakinevich
2024-03-17 16:27       ` Krzysztof Kozlowski
2024-03-17 16:27         ` Krzysztof Kozlowski
2024-03-17 16:27         ` Krzysztof Kozlowski
2024-03-17 16:35         ` Jan Dakinevich
2024-03-17 16:35           ` Jan Dakinevich
2024-03-17 16:35           ` Jan Dakinevich
2024-03-19  5:17           ` Krzysztof Kozlowski
2024-03-19  5:17             ` Krzysztof Kozlowski
2024-03-19  5:17             ` Krzysztof Kozlowski
2024-03-14 23:21 ` [PATCH 14/25] ASoC: meson: axg-pdm: introduce " Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 15/25] pinctrl/meson: fix typo in PDM's pin name Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 16/25] ASoC: dt-bindings: meson: meson-axg-audio-arb: claim support of A1 SoC family Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-17 19:10   ` Rob Herring
2024-03-17 19:10     ` Rob Herring
2024-03-17 19:10     ` Rob Herring
2024-03-14 23:21 ` [PATCH 17/25] ASoC: dt-bindings: meson: axg-fifo: " Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-17 19:13   ` Rob Herring
2024-03-17 19:13     ` Rob Herring
2024-03-17 19:13     ` Rob Herring
2024-03-14 23:21 ` [PATCH 18/25] ASoC: dt-bindings: meson: axg-pdm: " Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-17 19:14   ` Rob Herring
2024-03-17 19:14     ` Rob Herring
2024-03-17 19:14     ` Rob Herring
2024-03-14 23:21 ` [PATCH 19/25] ASoC: dt-bindings: meson: axg-sound-card: " Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15 10:06   ` Jerome Brunet
2024-03-15 10:06     ` Jerome Brunet
2024-03-15 10:06     ` Jerome Brunet
2024-03-17 16:39     ` Jan Dakinevich
2024-03-17 16:39       ` Jan Dakinevich
2024-03-17 16:39       ` Jan Dakinevich
2024-03-14 23:21 ` [PATCH 20/25] ASoC: dt-bindings: meson: axg-tdm-formatters: " Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-17 19:16   ` Rob Herring
2024-03-17 19:16     ` Rob Herring
2024-03-17 19:16     ` Rob Herring
2024-03-14 23:21 ` [PATCH 21/25] ASoC: dt-bindings: meson: axg-tdm-iface: " Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-15 10:13   ` Jerome Brunet
2024-03-15 10:13     ` Jerome Brunet
2024-03-15 10:13     ` Jerome Brunet
2024-03-14 23:21 ` [PATCH 22/25] ASoC: dt-bindings: meson: introduce link-name optional property Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-17 19:45   ` Rob Herring
2024-03-17 19:45     ` Rob Herring
2024-03-17 19:45     ` Rob Herring
2024-03-18  7:27     ` Dmitry Rokosov
2024-03-18  7:27       ` Dmitry Rokosov
2024-03-18  7:27       ` Dmitry Rokosov
2024-03-14 23:21 ` [PATCH 23/25] ASoC: meson: implement link-name optional property in meson card utils Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:21   ` Jan Dakinevich
2024-03-14 23:22 ` [PATCH 24/25] arm64: dts: meson: a1: add audio devices Jan Dakinevich
2024-03-14 23:22   ` Jan Dakinevich
2024-03-14 23:22   ` Jan Dakinevich
2024-03-14 23:22 ` [PATCH 25/25] arm64: dts: ad402: enable audio Jan Dakinevich
2024-03-14 23:22   ` Jan Dakinevich
2024-03-14 23:22   ` Jan Dakinevich
2024-03-15 10:01 ` [PATCH 00/25] Introduce support of audio for Amlogic A1 SoC family Jerome Brunet
2024-03-15 10:01   ` Jerome Brunet
2024-03-15 10:01   ` Jerome Brunet
2024-03-15 15:50 ` Rob Herring
2024-03-15 15:50   ` Rob Herring
2024-03-15 15:50   ` Rob Herring
2024-03-15 16:53 ` Neil Armstrong
2024-03-15 16:53   ` Neil Armstrong
2024-03-15 16:53   ` Neil Armstrong
2024-03-18  7:30   ` Dmitry Rokosov
2024-03-18  7:30     ` Dmitry Rokosov
2024-03-18  7:30     ` Dmitry Rokosov

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=340ee66a-da5d-4fd5-95a6-ea22839df988@salutedevices.com \
    --to=jan.dakinevich@salutedevices.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=kernel@salutedevices.com \
    --cc=khilman@baylibre.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=mturquette@baylibre.com \
    --cc=neil.armstrong@linaro.org \
    --cc=p.zabel@pengutronix.de \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tiwai@suse.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.