linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode
@ 2020-06-05 10:33 Jiaxin Yu
  2020-06-05 10:33 ` [PATCH v2 1/2] " Jiaxin Yu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jiaxin Yu @ 2020-06-05 10:33 UTC (permalink / raw)
  To: lgirdwood, broonie, tiwai, matthias.bgg, hariprasad.kelam
  Cc: alsa-devel, howie.huang, linux-kernel, Jiaxin Yu, tzungbi,
	linux-mediatek, linux-arm-kernel

v2 changes:
	1. Uses a DT property to select DMIC mode instead of a mixer control.

v1 changes:
	1. Uses a mixer control to select DMIC mode.
	2. patchwork list:
		https://patchwork.kernel.org/patch/11578309

Jiaxin Yu (2):
  ASoC: mediatek: mt6358: support DMIC one-wire mode
  ASoC: dt-bindings: mediatek: mt6358: add dmic-mode property

 Documentation/devicetree/bindings/sound/mt6358.txt |  6 ++++++
 sound/soc/codecs/mt6358.c                          | 23 +++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

-- 
1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH v2 1/2] ASoC: mediatek: mt6358: support DMIC one-wire mode
  2020-06-05 10:33 [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode Jiaxin Yu
@ 2020-06-05 10:33 ` Jiaxin Yu
  2020-06-05 10:33 ` [PATCH v2 2/2] ASoC: dt-bindings: mediatek: mt6358: add dmic-mode property Jiaxin Yu
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jiaxin Yu @ 2020-06-05 10:33 UTC (permalink / raw)
  To: lgirdwood, broonie, tiwai, matthias.bgg, hariprasad.kelam
  Cc: alsa-devel, howie.huang, linux-kernel, Jiaxin Yu, tzungbi,
	linux-mediatek, linux-arm-kernel

Supports DMIC one-wire mode. Uses a DT property "dmic-mode" to select.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
---
 sound/soc/codecs/mt6358.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/mt6358.c b/sound/soc/codecs/mt6358.c
index 1b830ea..1f39d59 100644
--- a/sound/soc/codecs/mt6358.c
+++ b/sound/soc/codecs/mt6358.c
@@ -95,6 +95,8 @@ struct mt6358_priv {
 	struct regulator *avdd_reg;
 
 	int wov_enabled;
+
+	unsigned int dmic_one_wire_mode;
 };
 
 int mt6358_set_mtkaif_protocol(struct snd_soc_component *cmpnt,
@@ -1831,7 +1833,10 @@ static int mt6358_dmic_enable(struct mt6358_priv *priv)
 	mt6358_mtkaif_tx_enable(priv);
 
 	/* UL dmic setting */
-	regmap_write(priv->regmap, MT6358_AFE_UL_SRC_CON0_H, 0x0080);
+	if (priv->dmic_one_wire_mode)
+		regmap_write(priv->regmap, MT6358_AFE_UL_SRC_CON0_H, 0x0400);
+	else
+		regmap_write(priv->regmap, MT6358_AFE_UL_SRC_CON0_H, 0x0080);
 
 	/* UL turn on */
 	regmap_write(priv->regmap, MT6358_AFE_UL_SRC_CON0_L, 0x0003);
@@ -2426,6 +2431,20 @@ static int mt6358_codec_probe(struct snd_soc_component *cmpnt)
 	.num_dapm_routes = ARRAY_SIZE(mt6358_dapm_routes),
 };
 
+static void mt6358_parse_dt(struct mt6358_priv *priv)
+{
+	int ret;
+	struct device *dev = priv->dev;
+
+	ret = of_property_read_u32(dev->of_node, "mediatek,dmic-mode",
+				   &priv->dmic_one_wire_mode);
+	if (ret) {
+		dev_warn(priv->dev, "%s() failed to read dmic-mode\n",
+			 __func__);
+		priv->dmic_one_wire_mode = 0;
+	}
+}
+
 static int mt6358_platform_driver_probe(struct platform_device *pdev)
 {
 	struct mt6358_priv *priv;
@@ -2445,6 +2464,8 @@ static int mt6358_platform_driver_probe(struct platform_device *pdev)
 	if (IS_ERR(priv->regmap))
 		return PTR_ERR(priv->regmap);
 
+	mt6358_parse_dt(priv);
+
 	dev_info(priv->dev, "%s(), dev name %s\n",
 		 __func__, dev_name(&pdev->dev));
 
-- 
1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* [PATCH v2 2/2] ASoC: dt-bindings: mediatek: mt6358: add dmic-mode property
  2020-06-05 10:33 [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode Jiaxin Yu
  2020-06-05 10:33 ` [PATCH v2 1/2] " Jiaxin Yu
@ 2020-06-05 10:33 ` Jiaxin Yu
  2020-06-05 12:24 ` [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode Tzung-Bi Shih
  2020-06-15 23:40 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Jiaxin Yu @ 2020-06-05 10:33 UTC (permalink / raw)
  To: lgirdwood, broonie, tiwai, matthias.bgg, hariprasad.kelam
  Cc: alsa-devel, howie.huang, linux-kernel, Jiaxin Yu, tzungbi,
	linux-mediatek, linux-arm-kernel

Adds dmic-mode property and updates example.

Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
---
 Documentation/devicetree/bindings/sound/mt6358.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/mt6358.txt b/Documentation/devicetree/bindings/sound/mt6358.txt
index 5465730..59a73ff 100644
--- a/Documentation/devicetree/bindings/sound/mt6358.txt
+++ b/Documentation/devicetree/bindings/sound/mt6358.txt
@@ -10,9 +10,15 @@ Required properties:
 - compatible : "mediatek,mt6358-sound".
 - Avdd-supply : power source of AVDD
 
+Optional properties:
+- mediatek,dmic-mode : 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.
+
 Example:
 
 mt6358_snd {
 	compatible = "mediatek,mt6358-sound";
 	Avdd-supply = <&mt6358_vaud28_reg>;
+	mediatek,dmic-mode = <0>;
 };
-- 
1.8.1.1.dirty
_______________________________________________
Linux-mediatek mailing list
Linux-mediatek@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-mediatek

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

* Re: [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode
  2020-06-05 10:33 [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode Jiaxin Yu
  2020-06-05 10:33 ` [PATCH v2 1/2] " Jiaxin Yu
  2020-06-05 10:33 ` [PATCH v2 2/2] ASoC: dt-bindings: mediatek: mt6358: add dmic-mode property Jiaxin Yu
@ 2020-06-05 12:24 ` Tzung-Bi Shih
  2020-06-15 23:40 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Tzung-Bi Shih @ 2020-06-05 12:24 UTC (permalink / raw)
  To: Jiaxin Yu
  Cc: Hariprasad Kelam, ALSA development, Linux Kernel Mailing List,
	howie.huang, Liam Girdwood, Takashi Iwai, Mark Brown,
	linux-mediatek, Matthias Brugger, linux-arm-kernel

On Fri, Jun 5, 2020 at 6:37 PM Jiaxin Yu <jiaxin.yu@mediatek.com> wrote:
> Jiaxin Yu (2):
>   ASoC: mediatek: mt6358: support DMIC one-wire mode
Has done previous round review on https://crrev.com/c/2230089

>   ASoC: dt-bindings: mediatek: mt6358: add dmic-mode property
Has done previous round review on https://crrev.com/c/2230086

>  Documentation/devicetree/bindings/sound/mt6358.txt |  6 ++++++
>  sound/soc/codecs/mt6358.c                          | 23 +++++++++++++++++++++-
>  2 files changed, 28 insertions(+), 1 deletion(-)

With that:
Reviewed-by: Tzung-Bi Shih <tzungbi@google.com>

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

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

* Re: [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode
  2020-06-05 10:33 [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode Jiaxin Yu
                   ` (2 preceding siblings ...)
  2020-06-05 12:24 ` [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode Tzung-Bi Shih
@ 2020-06-15 23:40 ` Mark Brown
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2020-06-15 23:40 UTC (permalink / raw)
  To: Jiaxin Yu, lgirdwood, matthias.bgg, tiwai, hariprasad.kelam
  Cc: alsa-devel, howie.huang, linux-kernel, tzungbi, linux-mediatek,
	linux-arm-kernel

On Fri, 5 Jun 2020 18:33:40 +0800, Jiaxin Yu wrote:
> v2 changes:
> 	1. Uses a DT property to select DMIC mode instead of a mixer control.
> 
> v1 changes:
> 	1. Uses a mixer control to select DMIC mode.
> 	2. patchwork list:
> 		https://patchwork.kernel.org/patch/11578309
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: mediatek: mt6358: support DMIC one-wire mode
      commit: c46fc800948c2d0afb548ca12453b837aa1ac880
[2/2] ASoC: dt-bindings: mediatek: mt6358: add dmic-mode property
      commit: 6323f13b4d927f52f339f7122676de0b0d1da3c3

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

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

end of thread, other threads:[~2020-06-15 23:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-05 10:33 [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode Jiaxin Yu
2020-06-05 10:33 ` [PATCH v2 1/2] " Jiaxin Yu
2020-06-05 10:33 ` [PATCH v2 2/2] ASoC: dt-bindings: mediatek: mt6358: add dmic-mode property Jiaxin Yu
2020-06-05 12:24 ` [PATCH v2 0/2] ASoC: mediatek: mt6358: support DMIC one-wire mode Tzung-Bi Shih
2020-06-15 23:40 ` Mark Brown

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).