summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2020-06-15 20:58:43 +0100
committerMark Brown <broonie@kernel.org>2020-06-15 20:58:43 +0100
commitba05f17965573985b6a709c2cb2264a9807e6b3c (patch)
tree9396f91495a3344ace41f9e51c4940278446d2ac /sound
parent13919056bf44dc8f70c2301915433fa2b474c1ba (diff)
parent6323f13b4d927f52f339f7122676de0b0d1da3c3 (diff)
Merge series "ASoC: mediatek: mt6358: support DMIC one-wire mode" from Jiaxin Yu <jiaxin.yu@mediatek.com>:
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-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/mt6358.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/sound/soc/codecs/mt6358.c b/sound/soc/codecs/mt6358.c
index 1b830ea4f6ed..1f39d5998cf6 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 const struct snd_soc_component_driver mt6358_soc_component_driver = {
.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));