Skip to contentSkip to conversation

ASoC: mid-x86: Add support for capture in machine driver

PATCH In review Harsha Priya 3 participants 4 messages Jan 19, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/4 ASoC: mid-x86: Add support for capture in machine driver

From: Vinod Koul <[email protected]>

This configures the capture unused pins and sets
the DMIC cfg by default (also done by user)

---
 sound/soc/mid-x86/mfld_machine.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
sound/soc/mid-x86/mfld_machine.c +7 -0
index 1a330be..1cd49a2 100644
@@ -182,6 +182,13 @@ static int mfld_init(struct snd_soc_pcm_runtime *runtime)
 	snd_soc_dapm_disable_pin(dapm, "LINEOUTR");
 	lo_dac = 3;
 	hs_switch = 0;
+	/* we dont use linein in this so set to NC */
+	snd_soc_dapm_disable_pin(dapm, "LINEINL");
+	snd_soc_dapm_disable_pin(dapm, "LINEINR");
+	/* we are using DMICs here so configure how the clock and out pin is set */
+	snd_soc_write(codec, SN95031_DMICBUF0123, 0x85);
+	snd_soc_write(codec, SN95031_DMICBUF45, 0x02);
+	snd_soc_update_bits(codec, SN95031_DMICMUX, 0x7, 0x07);
 	return snd_soc_dapm_sync(dapm);
 }
 
Signature · 1 line
1.7.2.3
#1 lore raw

sound/soc/mid-x86/mfld_machine.c static int mfld_init(struct snd_soc_pcm_runtime *runtime) · line 191

Quoted 4 lines · Harsha Priya
sound/soc/mid-x86/mfld_machine.c +4 -0
+	/* we are using DMICs here so configure how the clock and out pin is set */
+	snd_soc_write(codec, SN95031_DMICBUF0123, 0x85);
+	snd_soc_write(codec, SN95031_DMICBUF45, 0x02);
+	snd_soc_update_bits(codec, SN95031_DMICMUX, 0x7, 0x07);

This looks like something which would more normally be done with platform data than with writes in the machine driver.

#2 lore raw
Quoted 9 lines

Review

Quoted 2 lines
(quoted diff) +1 -0
+	/* we are using DMICs here so configure how the clock and out pin is set

*/

sound/soc/mid-x86/mfld_machine.c static int mfld_init(struct snd_soc_pcm_runtime *runtime) · line 191

Quoted 3 lines
sound/soc/mid-x86/mfld_machine.c +3 -0
+	snd_soc_write(codec, SN95031_DMICBUF0123, 0x85);
+	snd_soc_write(codec, SN95031_DMICBUF45, 0x02);
+	snd_soc_update_bits(codec, SN95031_DMICMUX, 0x7, 0x07);

This looks like something which would more normally be done with platform data than with writes in the machine driver.

This is actually optional. The DMIC can be used as GPO or DMIC. This is user option. Wanted to explicitly code here as this machine DMICs are used.

~Vinod

#3 lore raw
Quoted 11 lines · Vinod
Quoted 8 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+	/* we are using DMICs here so configure how the clock and out pin is set

*/

sound/soc/mid-x86/mfld_machine.c static int mfld_init(struct snd_soc_pcm_runtime *runtime) · line 191

Quoted 3 lines
sound/soc/mid-x86/mfld_machine.c +3 -0
+	snd_soc_write(codec, SN95031_DMICBUF0123, 0x85);
+	snd_soc_write(codec, SN95031_DMICBUF45, 0x02);
+	snd_soc_update_bits(codec, SN95031_DMICMUX, 0x7, 0x07);

This looks like something which would more normally be done with platform data than with writes in the machine driver.

This is actually optional. The DMIC can be used as GPO or DMIC. This is user option. Wanted to explicitly code here as this machine DMICs are used.

I'm not saying it shouldn't be optional, I'm saying it should be passed into the driver using platform data instead.