Skip to contentSkip to conversation

ASoC: rt5682: Add a new property for the DMIC clock driving

PATCH In review Oder Chiou 3 participants 5 messages Nov 13, 2020 – Nov 16, 2020

Subsystems (4)
lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 2/2 ASoC: rt5682: Add a new property to the device tree.

In reply to Oder Chiou

The patch adds a new property to the drice tree for the DMIC clcok driving.

---
 Documentation/devicetree/bindings/sound/rt5682.txt | 2 ++
 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/sound/rt5682.txt +2 -0
index 707fa98d1310..9c5fadb6ac82 100644
@@ -44,6 +44,8 @@ Optional properties:
 - realtek,dmic-delay-ms : Set the delay time (ms) for the requirement of
   the particular DMIC.
 
+- realtek,dmic-clk-driving-high : Set the high drving of the DMIC clock out.
+
 Pins on the device (for linking into audio routes) for RT5682:
 
   * DMIC L1
Signature · 1 line
2.29.0

Oder Chiou

author maintainer
#0 lore raw

PATCH 1/2 ASoC: rt5682: Add a new property for the DMIC clock driving

The patch adds a new property to set the DMIC clock driving.

---
 include/sound/rt5682.h        |  1 +
 sound/soc/codecs/rt5682-i2c.c |  5 +++++
 sound/soc/codecs/rt5682.c     |  3 +++
 sound/soc/codecs/rt5682.h     | 14 ++++++++++++++
 4 files changed, 23 insertions(+)
include/sound/rt5682.h +1 -0
index e1f790561ac1..3900a07e3935 100644
@@ -40,6 +40,7 @@ struct rt5682_platform_data {
 	unsigned int btndet_delay;
 	unsigned int dmic_clk_rate;
 	unsigned int dmic_delay;
+	bool dmic_clk_driving_high;
 
 	const char *dai_clk_names[RT5682_DAI_NUM_CLKS];
 };
sound/soc/codecs/rt5682-i2c.c +5 -0
index 6b4e0eb30c89..37d13120f5ba 100644
@@ -221,6 +221,11 @@ static int rt5682_i2c_probe(struct i2c_client *i2c,
 		case RT5682_DMIC1_CLK_GPIO3: /* share with BCLK2 */
 			regmap_update_bits(rt5682->regmap, RT5682_GPIO_CTRL_1,
 				RT5682_GP3_PIN_MASK, RT5682_GP3_PIN_DMIC_CLK);
+			if (rt5682->pdata.dmic_clk_driving_high)
+				regmap_update_bits(rt5682->regmap,
+					RT5682_PAD_DRIVING_CTRL,
+					RT5682_PAD_DRV_GP3_MASK,
+					2 << RT5682_PAD_DRV_GP3_SFT);
 			break;
 
 		default:
sound/soc/codecs/rt5682.c +3 -0
index a9acce7b6cca..f299b30f4f59 100644
@@ -2989,6 +2989,9 @@ int rt5682_parse_dt(struct rt5682_priv *rt5682, struct device *dev)
 			 rt5682->pdata.dai_clk_names[RT5682_DAI_WCLK_IDX],
 			 rt5682->pdata.dai_clk_names[RT5682_DAI_BCLK_IDX]);
 
+	rt5682->pdata.dmic_clk_driving_high = device_property_read_bool(dev,
+		"realtek,dmic-clk-driving-high");
+
 	return 0;
 }
 EXPORT_SYMBOL_GPL(rt5682_parse_dt);
sound/soc/codecs/rt5682.h +14 -0
index 354acd735ef4..99b85cfe6248 100644
@@ -1271,6 +1271,20 @@
 #define RT5682_CP_CLK_HP_300KHZ			(0x2 << 4)
 #define RT5682_CP_CLK_HP_600KHZ			(0x3 << 4)
 
+/* Pad Driving Control (0x0136) */
+#define RT5682_PAD_DRV_GP1_MASK			(0x3 << 14)
+#define RT5682_PAD_DRV_GP1_SFT			14
+#define RT5682_PAD_DRV_GP2_MASK			(0x3 << 12)
+#define RT5682_PAD_DRV_GP2_SFT			12
+#define RT5682_PAD_DRV_GP3_MASK			(0x3 << 10)
+#define RT5682_PAD_DRV_GP3_SFT			10
+#define RT5682_PAD_DRV_GP4_MASK			(0x3 << 8)
+#define RT5682_PAD_DRV_GP4_SFT			8
+#define RT5682_PAD_DRV_GP5_MASK			(0x3 << 6)
+#define RT5682_PAD_DRV_GP5_SFT			6
+#define RT5682_PAD_DRV_GP6_MASK			(0x3 << 4)
+#define RT5682_PAD_DRV_GP6_SFT			4
+
 /* Chopper and Clock control for DAC (0x013a)*/
 #define RT5682_CKXEN_DAC1_MASK			(0x1 << 13)
 #define RT5682_CKXEN_DAC1_SFT			13
Signature · 1 line
2.29.0
maintainer
#4 lore raw
Quoted 1 line · Oder Chiou

The patch adds a new property to set the DMIC clock driving.

Applied to

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

Thanks!

[1/2] ASoC: rt5682: Add a new property for the DMIC clock driving

      commit: 7416f6bc5fcb1fe6700391c94b59ac1c744ad9d1
[2/2] ASoC: rt5682: Add a new property to the device tree.
      commit: 33ee67b47ba09fc30840668c9ccec5ad18c94de0

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

#2 lore raw

Re: [PATCH 2/2] ASoC: rt5682: Add a new property to the device tree.

In reply to Oder Chiou

Couple of typos you may want to fix

Quoted 1 line · Oder Chiou

The patch adds a new property to the drice tree for the DMIC clcok driving.

device?

Quoted 11 lines
---
  Documentation/devicetree/bindings/sound/rt5682.txt | 2 ++
  1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/sound/rt5682.txt +0 -0
index 707fa98d1310..9c5fadb6ac82 100644

Documentation/devicetree/bindings/sound/rt5682.txt Optional properties: · line 47

Quoted 4 lines
Documentation/devicetree/bindings/sound/rt5682.txt +1 -0
@@ -44,6 +44,8 @@ Optional properties:
  - realtek,dmic-delay-ms : Set the delay time (ms) for the requirement of
    the particular DMIC.
 
+- realtek,dmic-clk-driving-high : Set the high drving of the DMIC clock out.

driving?

I must admit I actually don't understand what 'dmic-clk-driving-high' means, a clock is by definition dual-phase and we use both rising and falling edges for the mics.

Or driving high when idle?

Quoted 5 lines
Documentation/devicetree/bindings/sound/rt5682.txt +1 -0
+
  Pins on the device (for linking into audio routes) for RT5682:
 
    * DMIC L1
author maintainer
#3 lore raw

RE: [PATCH 2/2] ASoC: rt5682: Add a new property to the device tree.

Quoted 13 lines

Documentation/devicetree/bindings/sound/rt5682.txt Optional properties: · line 47

Quoted 10 lines
Documentation/devicetree/bindings/sound/rt5682.txt +1 -0
index 707fa98d1310..9c5fadb6ac82 100644
@@ -44,6 +44,8 @@ Optional properties:
  - realtek,dmic-delay-ms : Set the delay time (ms) for the requirement of
    the particular DMIC.
 
+- realtek,dmic-clk-driving-high : Set the high drving of the DMIC clock out.

driving?

Quoted 5 lines

I must admit I actually don't understand what 'dmic-clk-driving-high' means, a clock is by definition dual-phase and we use both rising and falling edges for the mics.

Or driving high when idle?

That reduces the rising time and falling time while the clock is output, and not driving high always when idle, thanks.