Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 425026ae authored by Jaechul Lee's avatar Jaechul Lee Committed by Greg Kroah-Hartman
Browse files

ASoC: samsung: Fix invalid argument when devm_gpiod_get is called



commit 975b6a93 upstream.

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: 1bfbc260 ("ASoC: samsung: Add machine driver for Exynos5433 based TM2 board")
Signed-off-by: default avatarJaechul Lee <jcsing.lee@samsung.com>
Reviewed-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 00ac982d
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -436,8 +436,7 @@ static int tm2_probe(struct platform_device *pdev)
	snd_soc_card_set_drvdata(card, priv);
	snd_soc_card_set_drvdata(card, priv);
	card->dev = dev;
	card->dev = dev;


	priv->gpio_mic_bias = devm_gpiod_get(dev, "mic-bias",
	priv->gpio_mic_bias = devm_gpiod_get(dev, "mic-bias", GPIOD_OUT_HIGH);
						GPIOF_OUT_INIT_LOW);
	if (IS_ERR(priv->gpio_mic_bias)) {
	if (IS_ERR(priv->gpio_mic_bias)) {
		dev_err(dev, "Failed to get mic bias gpio\n");
		dev_err(dev, "Failed to get mic bias gpio\n");
		return PTR_ERR(priv->gpio_mic_bias);
		return PTR_ERR(priv->gpio_mic_bias);