Re: [alsa-devel] [PATCH] ASoC: add RT5640 CODEC driver
On 05/31/2013 01:04 AM, bardliao@realtek.com wrote:
From: Bard Liao bardliao@realtek.com
- Use regmap_range_cfg to replace index read/write function.
- Remove I2S3 related code since there is no I2S3 in ALC5640.
- Remove Voice DSP related code since there is no Voice DSP in ALC5640.
- Remove MICBIAS2 since there is no MICBIAS2 in ALC5640.
- Change DMIC1/2 CLK to DMIC1/2 Power since it is for enable/disable DMIC1/2
- Modify some texts for consistent coding style.
- Merge sto adc l/r mux since it shares the same control bits.
- Other minor changes.
+static const struct snd_soc_dapm_widget rt5640_dapm_widgets[] = {
- /* Input Lines */
- SND_SOC_DAPM_INPUT("DMIC1"),
- SND_SOC_DAPM_INPUT("DMIC2"),
Can you explain that more? In the spec for this part, I don't see any DMIC1/2 input pins. Instead, I think they're alternative uses for the IN1P/N pins, right?
- SND_SOC_DAPM_MIXER("HPO MIX L", SND_SOC_NOPM, 0, 0,
rt5640_hpo_mix, ARRAY_SIZE(rt5640_hpo_mix)),
- SND_SOC_DAPM_MIXER("HPO MIX R", SND_SOC_NOPM, 0, 0,
rt5640_hpo_mix, ARRAY_SIZE(rt5640_hpo_mix)),
In the version of the driver I posted, I had replaced this with a single "HPO MIX" DAPM_MIXER, because there is a single bit in HW that controls both the L and R channels. I think you should incorporate that same change.
That relies on commit 85762e7 "ASoC: dapm: Implement mixer control sharing".
In an earlier review, IIRC, Mark had asked you to implement platform data to configure whether the microphones were single-ended or not. I don't see that in this patch.
Finally, I really would prefer if you could implement the support for the LDO1_EN GPIO via platform data. Getting that right requires a bit of knowledge of how set_bias_level() is supposed to work on this CODEC, and I think Realtek have the best information to get that right. I'll certainly send a patch to implement this all by device tree after that.
Anyway, I'll go test this patch and see if it works for me on my HW.
On 06/04/2013 03:51 PM, Stephen Warren wrote:
On 05/31/2013 01:04 AM, bardliao@realtek.com wrote:
From: Bard Liao bardliao@realtek.com
- Use regmap_range_cfg to replace index read/write function.
- Remove I2S3 related code since there is no I2S3 in ALC5640.
- Remove Voice DSP related code since there is no Voice DSP in ALC5640.
- Remove MICBIAS2 since there is no MICBIAS2 in ALC5640.
- Change DMIC1/2 CLK to DMIC1/2 Power since it is for enable/disable DMIC1/2
- Modify some texts for consistent coding style.
- Merge sto adc l/r mux since it shares the same control bits.
- Other minor changes.
+static const struct snd_soc_dapm_widget rt5640_dapm_widgets[] = {
- SND_SOC_DAPM_MIXER("HPO MIX L", SND_SOC_NOPM, 0, 0,
rt5640_hpo_mix, ARRAY_SIZE(rt5640_hpo_mix)),
- SND_SOC_DAPM_MIXER("HPO MIX R", SND_SOC_NOPM, 0, 0,
rt5640_hpo_mix, ARRAY_SIZE(rt5640_hpo_mix)),
In the version of the driver I posted, I had replaced this with a single "HPO MIX" DAPM_MIXER, because there is a single bit in HW that controls both the L and R channels. I think you should incorporate that same change.
That relies on commit 85762e7 "ASoC: dapm: Implement mixer control sharing".
Sorry, ignore that comment; what I had done earlier was to make both the SND_SOC_DAPM_MIXER() invocations above use the same rt5640_hpo_mix kcontrol, which is exactly what you have in your patch.
So, this part is fine. Sorry for the noise.
BTW, I tested on my HW, and I see that headphone output still works fine with this version of the driver.
I didn't test speaker output though, but that didn't work with the previous driver I sent either. Are you able to get that working? I also didn't test any capture path.
On 05/31/2013 01:04 AM, bardliao@realtek.com wrote:
From: Bard Liao bardliao@realtek.com
- Use regmap_range_cfg to replace index read/write function.
- Remove I2S3 related code since there is no I2S3 in ALC5640.
- Remove Voice DSP related code since there is no Voice DSP in ALC5640.
- Remove MICBIAS2 since there is no MICBIAS2 in ALC5640.
- Change DMIC1/2 CLK to DMIC1/2 Power since it is for enable/disable DMIC1/2
- Modify some texts for consistent coding style.
- Merge sto adc l/r mux since it shares the same control bits.
- Other minor changes.
+static const struct snd_soc_dapm_widget rt5640_dapm_widgets[] = {
/* Input Lines */
SND_SOC_DAPM_INPUT("DMIC1"),
SND_SOC_DAPM_INPUT("DMIC2"),
Can you explain that more? In the spec for this part, I don't see any DMIC1/2 input pins. Instead, I think they're alternative uses for the IN1P/N pins, right?
Yes, DMIC1/2 are alternative uses for the IN1P/N pins. If you connect it with a DMIC, it will work as a DMIC input. There are DMIC1/2 component in ALC5640. You can see chapter 4.3 Digital Mixer Path in ALC5640 datasheet for reference. If IN1P/N use as DMIC1/2, the audio path should go through DMIC1/DMIC2.
In an earlier review, IIRC, Mark had asked you to implement platform data to configure whether the microphones were single-ended or not. I don't see that in this patch.
Ok, I will implement the microphones type configuration in my patch. I thought it will be add in the DT patch.
Finally, I really would prefer if you could implement the support for the LDO1_EN GPIO via platform data. Getting that right requires a bit of knowledge of how set_bias_level() is supposed to work on this CODEC, and I think Realtek have the best information to get that right. I'll certainly send a patch to implement this all by device tree after that.
I will do that also, if I have question I will ask you. Thanks.
Anyway, I'll go test this patch and see if it works for me on my HW.
------Please consider the environment before printing this e-mail.
participants (2)
-
Bard Liao
-
Stephen Warren