linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] Add mediatek codec mt6359 driver
@ 2020-08-14 10:45 Jiaxin Yu
  2020-08-14 10:45 ` [PATCH v3 2/2] WIP: dt-bindings: mediatek: mt6359: add codec document Jiaxin Yu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Jiaxin Yu @ 2020-08-14 10:45 UTC (permalink / raw)
  To: broonie, matthias.bgg, robh+dt, tiwai, linux-kernel
  Cc: alsa-devel, shane.chien, howie.huang, bicycle.tasi, tzungbi,
	linux-mediatek, Jiaxin Yu, eason.yen, linux-arm-kernel

Add mediatek codec (MT6359) driver

MT6359 support playback and capture feature.

On downlink path, it includes three DACs for handset, headset,
and lineout path. On unlink path, it includeds three ADCs for
main mic, second mic, 3rd mic, and headset mic.

By scenario, select *_MUX widget to create damp path.
And by select mic_type_mux to choose DMIC/AMIC/....

For example, select these MUX widget to create headset path
(1) DAC In Mux --> "Normal Path"
(2) HPL Mux --> "Audio Playback"
(3) HPR Mux --> "Audio Playback"

v3 changes:
	1. Remove calibration related functions.
	2. Conbined 'HPL Mux' and 'HPR Mux' to 'HP Mux'.
	3. Move the regulator_enable of 'vaud18' to the component probe.
	4. Fix some incorrect coding style.

v2 changes:
	1. patchwork link:
		https://patchwork.kernel.org/cover/11706935/
		https://patchwork.kernel.org/patch/11708865/
		https://patchwork.kernel.org/patch/11706937/

v1 changes:
	1.lkml link:
		https://lkml.org/lkml/2020/3/5/1257

Jiaxin Yu (2):
  WIP: ASoC: mediatek: mt6359: add codec driver
  WIP: dt-bindings: mediatek: mt6359: add codec document

 .../devicetree/bindings/sound/mt6359.yaml     |   68 +
 sound/soc/codecs/Kconfig                      |    8 +
 sound/soc/codecs/Makefile                     |    2 +
 sound/soc/codecs/mt6359.c                     | 2737 +++++++++++++++++
 sound/soc/codecs/mt6359.h                     | 2640 ++++++++++++++++
 5 files changed, 5455 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mt6359.yaml
 create mode 100644 sound/soc/codecs/mt6359.c
 create mode 100644 sound/soc/codecs/mt6359.h

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v3 2/2] WIP: dt-bindings: mediatek: mt6359: add codec document
  2020-08-14 10:45 [PATCH v3 0/2] Add mediatek codec mt6359 driver Jiaxin Yu
@ 2020-08-14 10:45 ` Jiaxin Yu
  2020-08-14 13:18 ` [PATCH v3 0/2] Add mediatek codec mt6359 driver Tzung-Bi Shih
       [not found] ` <1597401954-28388-2-git-send-email-jiaxin.yu@mediatek.com>
  2 siblings, 0 replies; 5+ messages in thread
From: Jiaxin Yu @ 2020-08-14 10:45 UTC (permalink / raw)
  To: broonie, matthias.bgg, robh+dt, tiwai, linux-kernel
  Cc: alsa-devel, shane.chien, howie.huang, bicycle.tasi, tzungbi,
	linux-mediatek, Jiaxin Yu, eason.yen, linux-arm-kernel

This patch adds MediaTek MT6359 codec document.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
---
 .../devicetree/bindings/sound/mt6359.yaml     | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/mt6359.yaml

diff --git a/Documentation/devicetree/bindings/sound/mt6359.yaml b/Documentation/devicetree/bindings/sound/mt6359.yaml
new file mode 100644
index 0000000000000..a669b49965874
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/mt6359.yaml
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/mt6359.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek MT6359 Codec Device Tree Bindings
+
+maintainers:
+  - Eason Yen <eason.yen@mediatek.com>
+  - Jiaxin Yu <jiaxin.yu@mediatek.com>
+  - Shane Chien <shane.chien@mediatek.com>
+
+description: |
+  The communication between MT6359 and SoC is through Mediatek PMIC wrapper.
+  For more detail, please visit Mediatek PMIC wrapper documentation.
+  Must be a child node of PMIC wrapper.
+
+properties:
+  compatible:
+    const: mediatek,mt6359-sound
+
+  mediatek,dmic-mode:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Indicates how many data pins are used to transmit two channels of PDM
+      signal. 0 means two wires, 1 means one wire. Default value is 0.
+    enum:
+      - 0 # one wire
+      - 1 # two wires
+
+  mediatek,mic-type-0:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Specifies the type of mic type connected to adc0
+
+    enum:
+      - 0 # IDLE - mic in turn-off status
+      - 1 # ACC - analog mic with alternating coupling
+      - 2 # DMIC - digital mic
+      - 3 # DCC - analog mic with direct couping
+      - 4 # DCC_ECM_DIFF - analog electret condenser mic with differential mode
+      - 5 # DCC_ECM_SINGLE - analog electret condenser mic with single mode
+
+  mediatek,mic-type-1:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Specifies the type of mic type connected to adc1
+
+  mediatek,mic-type-2:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description: |
+      Specifies the type of mic type connected to adc2
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    mt6359codec: mt6359codec {
+      compatible = "mediatek,mt6359-sound";
+      mediatek,dmic-mode = <0>;
+      mediatek,mic-type-0 = <2>;
+    };
+
+...
-- 
2.18.0
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 0/2] Add mediatek codec mt6359 driver
  2020-08-14 10:45 [PATCH v3 0/2] Add mediatek codec mt6359 driver Jiaxin Yu
  2020-08-14 10:45 ` [PATCH v3 2/2] WIP: dt-bindings: mediatek: mt6359: add codec document Jiaxin Yu
@ 2020-08-14 13:18 ` Tzung-Bi Shih
       [not found] ` <1597401954-28388-2-git-send-email-jiaxin.yu@mediatek.com>
  2 siblings, 0 replies; 5+ messages in thread
From: Tzung-Bi Shih @ 2020-08-14 13:18 UTC (permalink / raw)
  To: Jiaxin Yu
  Cc: ALSA development, howie.huang, Takashi Iwai, Rob Herring,
	Linux Kernel Mailing List, shane.chien, Mark Brown,
	linux-mediatek, bicycle.tasi, eason.yen, Matthias Brugger,
	linux-arm-kernel

On Fri, Aug 14, 2020 at 6:47 PM Jiaxin Yu <jiaxin.yu@mediatek.com> wrote:
> Jiaxin Yu (2):
>   WIP: ASoC: mediatek: mt6359: add codec driver
>   WIP: dt-bindings: mediatek: mt6359: add codec document

Please remove the "WIP: " prefixes and resend again.

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 1/2] WIP: ASoC: mediatek: mt6359: add codec driver
       [not found] ` <1597401954-28388-2-git-send-email-jiaxin.yu@mediatek.com>
@ 2020-08-14 16:01   ` Mark Brown
  2020-08-15 17:27     ` Jiaxin Yu
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2020-08-14 16:01 UTC (permalink / raw)
  To: Jiaxin Yu
  Cc: alsa-devel, shane.chien, howie.huang, tiwai, bicycle.tasi,
	linux-kernel, tzungbi, robh+dt, linux-mediatek, eason.yen,
	matthias.bgg, linux-arm-kernel


[-- Attachment #1.1: Type: text/plain, Size: 524 bytes --]

On Fri, Aug 14, 2020 at 06:45:53PM +0800, Jiaxin Yu wrote:

This looks mostly good, a couple of very small things:

> +	ret = regulator_enable(priv->avdd_reg);
> +	if (ret) {
> +		dev_err(&pdev->dev, "%s(), failed to enable regulator!\n",
> +			__func__);
> +		return ret;
> +	}

You need a remove() function to undo this enable.

> +	dev_info(&pdev->dev, "%s(), dev name %s\n",
> +		 __func__, dev_name(&pdev->dev));

This isn't really adding anything, just remove it - it's not reading
info from the hardware or anything.

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v3 1/2] WIP: ASoC: mediatek: mt6359: add codec driver
  2020-08-14 16:01   ` [PATCH v3 1/2] WIP: ASoC: mediatek: mt6359: add codec driver Mark Brown
@ 2020-08-15 17:27     ` Jiaxin Yu
  0 siblings, 0 replies; 5+ messages in thread
From: Jiaxin Yu @ 2020-08-15 17:27 UTC (permalink / raw)
  To: Mark Brown, tzungbi
  Cc: alsa-devel, shane.chien, howie.huang, tiwai, linux-kernel,
	tzungbi, robh+dt, linux-mediatek, eason.yen, matthias.bgg,
	Bicycle.Tsai, linux-arm-kernel

On Fri, 2020-08-14 at 17:01 +0100, Mark Brown wrote:
> On Fri, Aug 14, 2020 at 06:45:53PM +0800, Jiaxin Yu wrote:
> 
> This looks mostly good, a couple of very small things:
> 
> > +	ret = regulator_enable(priv->avdd_reg);
> > +	if (ret) {
> > +		dev_err(&pdev->dev, "%s(), failed to enable regulator!\n",
> > +			__func__);
> > +		return ret;
> > +	}
> 
> You need a remove() function to undo this enable.
> 

Ok, I will add a remove() function to do regulator_disable() and
snd_soc_unregister_component().

> > +	dev_info(&pdev->dev, "%s(), dev name %s\n",
> > +		 __func__, dev_name(&pdev->dev));
> 
> This isn't really adding anything, just remove it - it's not reading
> info from the hardware or anything.

Yes, it was unnecessary, removed it in PATCH v4.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-15 17:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-14 10:45 [PATCH v3 0/2] Add mediatek codec mt6359 driver Jiaxin Yu
2020-08-14 10:45 ` [PATCH v3 2/2] WIP: dt-bindings: mediatek: mt6359: add codec document Jiaxin Yu
2020-08-14 13:18 ` [PATCH v3 0/2] Add mediatek codec mt6359 driver Tzung-Bi Shih
     [not found] ` <1597401954-28388-2-git-send-email-jiaxin.yu@mediatek.com>
2020-08-14 16:01   ` [PATCH v3 1/2] WIP: ASoC: mediatek: mt6359: add codec driver Mark Brown
2020-08-15 17:27     ` Jiaxin Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).