Skip to contentSkip to conversation

Add new machine driver for mt2701

PATCH New Ryder Lee 1 participant 3 messages Mar 29, 2017 1 message not in the archive

Subsystems (4)
lore
Share & tools
lore

Ryder Lee

author
#0 lore raw

cover Add new machine driver for mt2701

Hi,

This adds wm8960 machine driver and DT bindings document.

Ryder Lee (2):
ASoC: mediatek: Add mt2701-wm8960 machine driver
ASoC: mediatek: add bindings for wm8960 codec

 .../devicetree/bindings/sound/mt2701-wm8960.txt    |  24 +++
 sound/soc/mediatek/Kconfig                         |  10 ++
 sound/soc/mediatek/mt2701/Makefile                 |   1 +
 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c         |  16 ++
 sound/soc/mediatek/mt2701/mt2701-wm8960.c          | 176 +++++++++++++++++++++
 5 files changed, 227 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mt2701-wm8960.txt
 create mode 100644 sound/soc/mediatek/mt2701/mt2701-wm8960.c
Signature · 1 line
1.9.1

A message that is not in the archive (sent off-list or not yet received): 1490777972-41841-1-git-send-email-ryder.lee-NuS5LvNUpcJWk0Htik3J/[email protected]

author
#2 lore raw

PATCH 1/2 ASoC: mediatek: Add mt2701-wm8960 machine driver

Add wm8960 machine driver and config option for MT2701.

---
 sound/soc/mediatek/Kconfig                 |  10 ++
 sound/soc/mediatek/mt2701/Makefile         |   1 +
 sound/soc/mediatek/mt2701/mt2701-afe-pcm.c |  16 +++
 sound/soc/mediatek/mt2701/mt2701-wm8960.c  | 176 +++++++++++++++++++++++++++++
 4 files changed, 203 insertions(+)
 create mode 100644 sound/soc/mediatek/mt2701/mt2701-wm8960.c
sound/soc/mediatek/Kconfig +10 -0
index d7013bd..c6f3904 100644
@@ -22,6 +22,16 @@ config SND_SOC_MT2701_CS42448
 	  Select Y if you have such device.
 	  If unsure select "N".
 
+config SND_SOC_MT2701_WM8960
+	tristate "ASoc Audio driver for MT2701 with WM8960 codec"
+	depends on SND_SOC_MT2701
+	select SND_SOC_WM8960
+	help
+	  This adds ASoC driver for Mediatek MT2701 boards
+	  with the WM8960 codecs.
+	  Select Y if you have such device.
+	  If unsure select "N".
+
 config SND_SOC_MT8173
 	tristate "ASoC support for Mediatek MT8173 chip"
 	depends on ARCH_MEDIATEK
sound/soc/mediatek/mt2701/Makefile +1 -0
index 31c3d04..c91deb6 100644
@@ -17,3 +17,4 @@ obj-$(CONFIG_SND_SOC_MT2701) += snd-soc-mt2701-afe.o
 
 # machine driver
 obj-$(CONFIG_SND_SOC_MT2701_CS42448) += mt2701-cs42448.o
+obj-$(CONFIG_SND_SOC_MT2701_WM8960) += mt2701-wm8960.o
sound/soc/mediatek/mt2701/mt2701-afe-pcm.c +16 -0
index c7fa3e6..bc5d4db 100644
@@ -604,6 +604,22 @@ static int mt2701_irq_fs(struct snd_pcm_substream *substream, unsigned int rate)
 static struct snd_soc_dai_driver mt2701_afe_pcm_dais[] = {
 	/* FE DAIs: memory intefaces to CPU */
 	{
+		.name = "PCMO0",
+		.id = MT2701_MEMIF_DL1,
+		.suspend = mtk_afe_dai_suspend,
+		.resume = mtk_afe_dai_resume,
+		.playback = {
+			.stream_name = "DL1",
+			.channels_min = 1,
+			.channels_max = 2,
+			.rates = SNDRV_PCM_RATE_8000_192000,
+			.formats = (SNDRV_PCM_FMTBIT_S16_LE
+				| SNDRV_PCM_FMTBIT_S24_LE
+				| SNDRV_PCM_FMTBIT_S32_LE)
+		},
+		.ops = &mt2701_single_memif_dai_ops,
+	},
+	{
 		.name = "PCM_multi",
 		.id = MT2701_MEMIF_DLM,
 		.suspend = mtk_afe_dai_suspend,
sound/soc/mediatek/mt2701/mt2701-wm8960.c new file +176 -0

176 lines not on this page · raw message

Signature · 1 line
1.9.1
author
#3 lore raw

PATCH 2/2 ASoC: mediatek: add bindings for wm8960 codec

In reply to a message not in the archive

add device tree bindings for mt2701-wm8960.

---
 .../devicetree/bindings/sound/mt2701-wm8960.txt    | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mt2701-wm8960.txt
Documentation/devicetree/bindings/sound/mt2701-wm8960.txt new file +24 -0
new file mode 100644
index 0000000..809b609
@@ -0,0 +1,24 @@
+MT2701 with WM8960 CODEC
+
+Required properties:
+- compatible: "mediatek,mt2701-wm8960-machine"
+- mediatek,platform: the phandle of MT2701 ASoC platform
+- audio-routing: a list of the connections between audio
+- mediatek,audio-codec: the phandles of wm8960 codec
+- pinctrl-names: Should contain only one value - "default"
+- pinctrl-0: Should specify pin control groups used for this controller.
+
+Example:
+
+	sound:sound {
+		compatible = "mediatek,mt2701-wm8960-machine";
+		mediatek,platform = <&afe>;
+		audio-routing =
+			"Headphone", "HP_L",
+			"Headphone", "HP_R",
+			"LINPUT1", "AMIC",
+			"RINPUT1", "AMIC";
+		mediatek,audio-codec = <&wm8960>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&aud_pins_default>;
+	};
Signature · 1 line
1.9.1