ASoC: samsung: Fix invalid argument when devm_gpiod_get is called
authorJaechul Lee <>
Wed, 6 Sep 2017 01:04:15 +0000 (10:04 +0900)
committerMark Brown <>
Tue, 19 Sep 2017 14:59:07 +0000 (15:59 +0100)
devm_gpiod_get is called with GPIOF_OUT_INIT_LOW but the function doesn't
allow the parameters. Unluckily, GPIOF_OUT_INIT_LOW is same value as
GPIOD_ASIS and gpio direction isn't set properly.

Muted stream comes up when I try recording some sounds on TM2. mic-bias
gpiod state can't be changed because the gpiod is created with the invalid
parameter. The gpio should be set GPIOD_OUT_HIGH.

Fixes: 1bfbc260a5b4 ("ASoC: samsung: Add machine driver for Exynos5433 based TM2 board")
Signed-off-by: Jaechul Lee <>
Reviewed-by: Krzysztof Kozlowski <>
Signed-off-by: Mark Brown <>

index 710e2151141f683ffc4ef3fde3834f7e05e66249..a55d18703fe7319df96608f0f4ce671104d6cd1c 100644 (file)
@@ -439,8 +439,7 @@ static int tm2_probe(struct platform_device *pdev)
        snd_soc_card_set_drvdata(card, priv);
        card->dev = dev;
-       priv->gpio_mic_bias = devm_gpiod_get(dev, "mic-bias",
-                                               GPIOF_OUT_INIT_LOW);
+       priv->gpio_mic_bias = devm_gpiod_get(dev, "mic-bias", GPIOD_OUT_HIGH);
        if (IS_ERR(priv->gpio_mic_bias)) {
                dev_err(dev, "Failed to get mic bias gpio\n");
                return PTR_ERR(priv->gpio_mic_bias);