Add a property "dmic-gpios" for switching between two MICs.
Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
---
.../bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml b/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml
index 4fc5b045d3cf..212d2982590a 100644
--- a/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml
+++ b/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml
@@ -21,6 +21,10 @@ properties:
$ref: "/schemas/types.yaml#/definitions/phandle"
description: The phandle of MT8186 ASoC platform.
+ dmic-gpios:
+ maxItems: 1
+ description: GPIO for switching between DMICs
+
headset-codec:
type: object
additionalProperties: false
@@ -72,6 +76,8 @@ examples:
pinctrl-0 = <&aud_clk_mosi_off>;
pinctrl-1 = <&aud_clk_mosi_on>;
+ dmic-gpios = <&pio 23 0>;
+
headset-codec {
sound-dai = <&rt5682s>;
};
--
2.25.1
On 28/10/2022 13:22, Ajye Huang wrote: > Add a property "dmic-gpios" for switching between two MICs. Use subject prefixes matching the subsystem (git log --oneline -- ...). > > Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com> > --- > .../bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml b/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml > index 4fc5b045d3cf..212d2982590a 100644 > --- a/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml > +++ b/Documentation/devicetree/bindings/sound/mt8186-mt6366-rt1019-rt5682s.yaml > @@ -21,6 +21,10 @@ properties: > $ref: "/schemas/types.yaml#/definitions/phandle" > description: The phandle of MT8186 ASoC platform. > > + dmic-gpios: > + maxItems: 1 > + description: GPIO for switching between DMICs Switching how? Enabling? What is the meaning of each GPIO pin value? > + > headset-codec: > type: object > additionalProperties: false > @@ -72,6 +76,8 @@ examples: > pinctrl-0 = <&aud_clk_mosi_off>; > pinctrl-1 = <&aud_clk_mosi_on>; > > + dmic-gpios = <&pio 23 0>; Use defines for flags. Best regards, Krzysztof
On Sat, Oct 29, 2022 at 1:58 AM Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
> >
> > + dmic-gpios:
> > + maxItems: 1
> > + description: GPIO for switching between DMICs
>
> Switching how? Enabling? What is the meaning of each GPIO pin value?
>
I think I should add more like an example,
description: dmic-gpios optional prop for switching between two DMICs.
Ex, the GPIO can control a MUX HW component to
select dmic clk and data form a Front or Rear dmic.
Do you agree with that or have other suggestions? If do, I will send
the v3 patch for you to check, thanks
> >
> > + dmic-gpios = <&pio 23 0>;
>
> Use defines for flags.
Yes, you are right, I will change it to
dmic-gpios = <&pio 23 GPIO_ACTIVE_HIGH>;
On 28/10/2022 14:26, Ajye Huang wrote: > On Sat, Oct 29, 2022 at 1:58 AM Krzysztof Kozlowski > <krzysztof.kozlowski@linaro.org> wrote: > > >>> >>> + dmic-gpios: >>> + maxItems: 1 >>> + description: GPIO for switching between DMICs >> >> Switching how? Enabling? What is the meaning of each GPIO pin value? >> > I think I should add more like an example, > description: dmic-gpios optional prop for switching between two DMICs. > Ex, the GPIO can control a MUX HW component to > select dmic clk and data form a Front or Rear dmic. > > Do you agree with that or have other suggestions? If do, I will send > the v3 patch for you to check, thanks Sounds better. Best regards, Krzysztof
On Sat, Oct 29, 2022 at 02:26:30AM +0800, Ajye Huang wrote: > On Sat, Oct 29, 2022 at 1:58 AM Krzysztof Kozlowski > > Switching how? Enabling? What is the meaning of each GPIO pin value? > I think I should add more like an example, > description: dmic-gpios optional prop for switching between two DMICs. > Ex, the GPIO can control a MUX HW component to > select dmic clk and data form a Front or Rear dmic. > Do you agree with that or have other suggestions? If do, I will send > the v3 patch for you to check, thanks There was my thing about putting the names in DT too.
Hi Mark Brown,
On Sat, Oct 29, 2022 at 2:44 AM Mark Brown <broonie@kernel.org> wrote:
>
> There was my thing about putting the names in DT too.
> @@ -72,6 +76,8 @@ examples:
> pinctrl-0 = <&aud_clk_mosi_off>;
> pinctrl-1 = <&aud_clk_mosi_on>;
>
> + dmic-gpios = <&pio 23 0>;
I think I added the pinctrl-name and pinctrl id in its example, to
make it easier for the user to understand , like below, what do you
think? thanks
examples:
- |
sound: mt8186-sound {
compatible = "mediatek,mt8186-mt6366-rt1019-rt5682s-sound";
mediatek,platform = <&afe>;
pinctrl-names = "aud_clk_mosi_off",
"aud_clk_mosi_on";
+ "aud_gpio_dmic_sec";
pinctrl-0 = <&aud_clk_mosi_off>;
pinctrl-1 = <&aud_clk_mosi_on>;
+ pinctrl-2 = <&aud_gpio_dmic_sec>;
+ dmic-gpios = <&pio 23 GPIO_ACTIVE_HIGH>;
headset-codec {
sound-dai = <&rt5682s>;
};
playback-codecs {
sound-dai = <&it6505dptx>,
<&rt1019p>;
};
};
© 2016 - 2026 Red Hat, Inc.