From nobody Tue Dec 16 23:41:29 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5FBDC2FC35 for ; Thu, 17 Aug 2023 14:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351681AbjHQOES (ORCPT ); Thu, 17 Aug 2023 10:04:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351663AbjHQODn (ORCPT ); Thu, 17 Aug 2023 10:03:43 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6E5B10E6 for ; Thu, 17 Aug 2023 07:03:30 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2b9c0391749so124004211fa.0 for ; Thu, 17 Aug 2023 07:03:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692281009; x=1692885809; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=088USFovIsdoCEmzlnqhLgFZBLMNvUbAonAQf/mwAxw=; b=wRf+w2hVofU/IxEx6VHKnhqF/EYCqFXdyuaJFbKv7U3n8gNC3s046jZuHdCtATWzhp 7U+8q70z10E91FBbXknUsa7BIRqpjTQ5hPd1GCS2pGrZlLyL6pz1pl+l0rFTBKED5yEf qNoaBvGX1VuQAEsKhM1euCnfrtZPVGfaXH0VkOCThH8yZk0p8wRgSyxXILk2cE4F/fBV Y0TbdJSMpiRgUQGkZqjNO1mW4Xh94qm3XAFCZ9ivTmkc6a2u74fEHaQmoR7b2S+YklNA k0jO1unCHxZqyc3/6nFonNc8eBLICRKLTzZbKav5rgosKv6v5VHO6y/pxuFFa9sEED1D xJkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692281009; x=1692885809; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=088USFovIsdoCEmzlnqhLgFZBLMNvUbAonAQf/mwAxw=; b=l638WTpy/SREBrMVMF5uN1wF/hYqBPw00RifB7YsY1v+/zmRLXRm3H2IsMjv/l37Ap IIOUv9uSLVhoMi+RU2Jb7mVa/RBJrgZKek4rAWCeKNg2k6U5SVfQuneKrr7wY6cbzeQe Dvz++Yn3e0tWFmVjpBHFz3TrRbASgOKM9D7hzJJh8GcanyWc+M2jBNTYWJlNQ5fPsjDU VW7sizXpvIJqKVjwobAiHnOsvTAlh8MDB/VKLY0ZxhM7V/h633iap8ceJYDyF9o9dEKc vyNs1MRuO2qRW07/oSZHpwR6zM0zfPIe5ylzPVDQnOJUBBTA11M4ChnC3T6FwiJhjGfg D0kA== X-Gm-Message-State: AOJu0YyL3tftSFuXUBAIVW3i0U8YHyI9gPsEE0VjJyJINRZUsYJh1ykM VNSKg2msJXl3QoVbq1mPNfmzUA== X-Google-Smtp-Source: AGHT+IG2Pux8VKOdbP86Oj7Mi6rjgF8/0qq8sb4PVwu1oDpFYcRedBksyLzRLMctv2SUuMjfYx1nQw== X-Received: by 2002:a2e:9c99:0:b0:2b6:e618:b593 with SMTP id x25-20020a2e9c99000000b002b6e618b593mr4368277lji.31.1692281009055; Thu, 17 Aug 2023 07:03:29 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id g3-20020a2eb0c3000000b002b9c3e18095sm4064645ljl.14.2023.08.17.07.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 07:03:28 -0700 (PDT) From: Linus Walleij Date: Thu, 17 Aug 2023 16:03:17 +0200 Subject: [PATCH v2 1/5] ASoC: rt5640: Convert to just use GPIO descriptors MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230817-descriptors-asoc-rt-v2-1-02fa2ca3e5b0@linaro.org> References: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> In-Reply-To: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> To: Oder Chiou , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The RT5640 driver is already using GPIO descriptors for some stuff, all that is needed is to convert the remaining LDO1 control line to also use descriptors. Simplify the code using gpiod_get_optional() and drop the special "of" parsing function: these descriptors need not come from device tree and it's optional so hey. Keep some NULL checks around the GPIO operations even though gpiolib is essentially NULL-tolerant, because by checking for whether we have a valid GPIO descriptor or not we can avoid a 400 ms delay which is great. Signed-off-by: Linus Walleij --- sound/soc/codecs/rt5640.c | 55 +++++++++++++------------------------------= ---- sound/soc/codecs/rt5640.h | 2 +- 2 files changed, 16 insertions(+), 41 deletions(-) diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index eceed8209787..8920726c38e8 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c @@ -12,11 +12,10 @@ #include #include #include -#include +#include #include #include #include -#include #include #include #include @@ -2812,8 +2811,8 @@ static int rt5640_suspend(struct snd_soc_component *c= omponent) rt5640_reset(component); regcache_cache_only(rt5640->regmap, true); regcache_mark_dirty(rt5640->regmap); - if (gpio_is_valid(rt5640->ldo1_en)) - gpio_set_value_cansleep(rt5640->ldo1_en, 0); + if (rt5640->ldo1_en) + gpiod_set_value_cansleep(rt5640->ldo1_en, 0); =20 return 0; } @@ -2822,8 +2821,8 @@ static int rt5640_resume(struct snd_soc_component *co= mponent) { struct rt5640_priv *rt5640 =3D snd_soc_component_get_drvdata(component); =20 - if (gpio_is_valid(rt5640->ldo1_en)) { - gpio_set_value_cansleep(rt5640->ldo1_en, 1); + if (rt5640->ldo1_en) { + gpiod_set_value_cansleep(rt5640->ldo1_en, 1); msleep(400); } =20 @@ -2986,22 +2985,6 @@ static const struct acpi_device_id rt5640_acpi_match= [] =3D { MODULE_DEVICE_TABLE(acpi, rt5640_acpi_match); #endif =20 -static int rt5640_parse_dt(struct rt5640_priv *rt5640, struct device_node = *np) -{ - rt5640->ldo1_en =3D of_get_named_gpio(np, "realtek,ldo1-en-gpios", 0); - /* - * LDO1_EN is optional (it may be statically tied on the board). - * -ENOENT means that the property doesn't exist, i.e. there is no - * GPIO, so is not an error. Any other error code means the property - * exists, but could not be parsed. - */ - if (!gpio_is_valid(rt5640->ldo1_en) && - (rt5640->ldo1_en !=3D -ENOENT)) - return rt5640->ldo1_en; - - return 0; -} - static int rt5640_i2c_probe(struct i2c_client *i2c) { struct rt5640_priv *rt5640; @@ -3015,12 +2998,16 @@ static int rt5640_i2c_probe(struct i2c_client *i2c) return -ENOMEM; i2c_set_clientdata(i2c, rt5640); =20 - if (i2c->dev.of_node) { - ret =3D rt5640_parse_dt(rt5640, i2c->dev.of_node); - if (ret) - return ret; - } else - rt5640->ldo1_en =3D -EINVAL; + rt5640->ldo1_en =3D devm_gpiod_get_optional(&i2c->dev, + "realtek,ldo1-en", + GPIOD_OUT_HIGH); + if (IS_ERR(rt5640->ldo1_en)) + return PTR_ERR(rt5640->ldo1_en); + + if (rt5640->ldo1_en) { + gpiod_set_consumer_name(rt5640->ldo1_en, "RT5640 LDO1_EN"); + msleep(400); + } =20 rt5640->regmap =3D devm_regmap_init_i2c(i2c, &rt5640_regmap); if (IS_ERR(rt5640->regmap)) { @@ -3030,18 +3017,6 @@ static int rt5640_i2c_probe(struct i2c_client *i2c) return ret; } =20 - if (gpio_is_valid(rt5640->ldo1_en)) { - ret =3D devm_gpio_request_one(&i2c->dev, rt5640->ldo1_en, - GPIOF_OUT_INIT_HIGH, - "RT5640 LDO1_EN"); - if (ret < 0) { - dev_err(&i2c->dev, "Failed to request LDO1_EN %d: %d\n", - rt5640->ldo1_en, ret); - return ret; - } - msleep(400); - } - regmap_read(rt5640->regmap, RT5640_VENDOR_ID2, &val); if (val !=3D RT5640_DEVICE_ID) { dev_err(&i2c->dev, diff --git a/sound/soc/codecs/rt5640.h b/sound/soc/codecs/rt5640.h index 9847a1ae01f4..94b9a502f7f9 100644 --- a/sound/soc/codecs/rt5640.h +++ b/sound/soc/codecs/rt5640.h @@ -2138,7 +2138,7 @@ struct rt5640_priv { struct regmap *regmap; struct clk *mclk; =20 - int ldo1_en; /* GPIO for LDO1_EN */ + struct gpio_desc *ldo1_en; /* GPIO for LDO1_EN */ int irq; int jd_gpio_irq; int sysclk; --=20 2.34.1 From nobody Tue Dec 16 23:41:29 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4958C2FC2F for ; Thu, 17 Aug 2023 14:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351676AbjHQOER (ORCPT ); Thu, 17 Aug 2023 10:04:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351664AbjHQODn (ORCPT ); Thu, 17 Aug 2023 10:03:43 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFA8E30FB for ; Thu, 17 Aug 2023 07:03:31 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2b962c226ceso120185761fa.3 for ; Thu, 17 Aug 2023 07:03:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692281010; x=1692885810; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=LIqqw/pMNM0WFKKC3NTiQx16fR5msgynp0J7IYgi66w=; b=WE5RtX3/0+0Xk6bnPsgBDBpqvXpMfBzdYTsh3Bjwjj6YyvPHQn9hJjjsmYj9jOE0qF 83dUbq/m4f+LQ8lBdDSPoSS7q/2npkuEtBFwewViWCnZqya7+PBQXmfKmORq9eG2vMYA XWHJmWc1u3KH4/rhE0KIB0lTF0igbfpxY8WtdeWqk0EOUXUqq9iRGDNdLhmTa85+01yY 1ToIHq5D38PhIk+yB0cZRUZyuIX47QqBn0N6LN+Zc1iKn18NQKk24UXHPt5IV1CzAAkS J+FIurca9rOd1aAfOU/0Hm0NvtinD+sSSoiWrtv+lQIFywTFYxzXGzZoVG3oIyJxjk7Q hepA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692281010; x=1692885810; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=LIqqw/pMNM0WFKKC3NTiQx16fR5msgynp0J7IYgi66w=; b=MQqPvlfqmhRJWJB65jYb5OMtrwOhpgZqQaWMnBXaEZSQ1wfPbOXrMI7q+EH8GEjXWR w67CUtyshnL2/1J5c0yAJ2fn1xIKFdVOEaiEewIPj66cyMc4nTNevrTgUzzIUtteP/za 4Dx9bFpkkMVYgJGsGbSJVZHYHvms6KBMtpgdmojKWjT97iOJjgrD/h/oz+WwPjZCZPVY b3sCKHPCm9ujEzp90eZmd3eWIBmuCdkAvaUd6NeJYPYXgTQQ4RxlQGBc1Lo4R8BiIWNE vbpG5mMdJqMrq0jCdIIi8sob3XJ8OuGxtfjVxlm3YmaemLObxhcOJK+RXcKY1GhWK/dd dPtg== X-Gm-Message-State: AOJu0YxLLjNspEYlLb4OEa9pOJlXq1Lx3MVcYJCpuhEkCEq+GJcG/C6U alqDAus06Ri2AfLjskqCfRhvxA== X-Google-Smtp-Source: AGHT+IFZD78S4HIGKyf6Rs6uW1DQcdJj3K6+vF1CKagH2d7CwoX5ilTAehbT7IjXL7l2L4AU5JpJFg== X-Received: by 2002:a2e:9b0d:0:b0:2b9:ba02:436c with SMTP id u13-20020a2e9b0d000000b002b9ba02436cmr4407547lji.28.1692281010067; Thu, 17 Aug 2023 07:03:30 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id g3-20020a2eb0c3000000b002b9c3e18095sm4064645ljl.14.2023.08.17.07.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 07:03:29 -0700 (PDT) From: Linus Walleij Date: Thu, 17 Aug 2023 16:03:18 +0200 Subject: [PATCH v2 2/5] ASoC: rt5665: Convert to use GPIO descriptors MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230817-descriptors-asoc-rt-v2-2-02fa2ca3e5b0@linaro.org> References: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> In-Reply-To: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> To: Oder Chiou , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The RT5665 driver has some stub support for GPIO descriptors going back to the initial driver commit, where there are two GPIO descriptors for the LDO and headphone detection defined in the device state. Well, let's make use of the descriptor properly. We remove the global GPIO number from the platform data, but it is still possible to create board files using GPIO descriptor tables, if desired. Signed-off-by: Linus Walleij --- include/sound/rt5665.h | 2 -- sound/soc/codecs/rt5665.c | 17 ++++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/sound/rt5665.h b/include/sound/rt5665.h index 3b3d6a19ca49..e865f041929b 100644 --- a/include/sound/rt5665.h +++ b/include/sound/rt5665.h @@ -31,8 +31,6 @@ struct rt5665_platform_data { bool in3_diff; bool in4_diff; =20 - int ldo1_en; /* GPIO for LDO1_EN */ - enum rt5665_dmic1_data_pin dmic1_data_pin; enum rt5665_dmic2_data_pin dmic2_data_pin; enum rt5665_jd_src jd_src; diff --git a/sound/soc/codecs/rt5665.c b/sound/soc/codecs/rt5665.c index 525713c33d71..a39de4a7df00 100644 --- a/sound/soc/codecs/rt5665.c +++ b/sound/soc/codecs/rt5665.c @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -4659,9 +4658,6 @@ static int rt5665_parse_dt(struct rt5665_priv *rt5665= , struct device *dev) of_property_read_u32(dev->of_node, "realtek,jd-src", &rt5665->pdata.jd_src); =20 - rt5665->pdata.ldo1_en =3D of_get_named_gpio(dev->of_node, - "realtek,ldo1-en-gpios", 0); - return 0; } =20 @@ -4795,10 +4791,13 @@ static int rt5665_i2c_probe(struct i2c_client *i2c) return ret; } =20 - if (gpio_is_valid(rt5665->pdata.ldo1_en)) { - if (devm_gpio_request_one(&i2c->dev, rt5665->pdata.ldo1_en, - GPIOF_OUT_INIT_HIGH, "rt5665")) - dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n"); + + rt5665->gpiod_ldo1_en =3D devm_gpiod_get_optional(&i2c->dev, + "realtek,ldo1-en", + GPIOD_OUT_HIGH); + if (IS_ERR(rt5665->gpiod_ldo1_en)) { + dev_err(&i2c->dev, "Failed gpio request ldo1_en\n"); + return PTR_ERR(rt5665->gpiod_ldo1_en); } =20 /* Sleep for 300 ms miniumum */ --=20 2.34.1 From nobody Tue Dec 16 23:41:29 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C307CC41513 for ; Thu, 17 Aug 2023 14:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351667AbjHQOEO (ORCPT ); Thu, 17 Aug 2023 10:04:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351666AbjHQODn (ORCPT ); Thu, 17 Aug 2023 10:03:43 -0400 Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BC32310C8 for ; Thu, 17 Aug 2023 07:03:32 -0700 (PDT) Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2b9b904bb04so123720231fa.1 for ; Thu, 17 Aug 2023 07:03:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692281011; x=1692885811; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=e8CZiR3Xu/7M/67rXheXq6UmPj0XpjwcOmaMWEgamKE=; b=EAXiuKU/5jqRfsfD8D636xmi7FYERS+6fk1Az+reX11zn/mygBydlX7V08cOLeGLJ8 KQrTdrmNrVk/dSjblX9mAcIVxYtM8/pARJnzo4bK/ftUgLMUQWxA5pn6Le806J1V9k5O 2xORBl2Ap5Z80wAKyEq+09suIGM5x/1knxYsUKmQAiTodnsGUqScoUHc4QWuvlfERPhw 1h3LC7GG5wyW/c0ZvUE/HuB+s2VvSEDPGLQSL7wUfcjCErvKIybqYI6TqKIrRxcBdIkr 79KKetuUbh/Aom3rbXE05v7jvmB780m4opR/BVMXk8Av/97i5szMWdfxUqFjQVGjqXEN TWTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692281011; x=1692885811; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=e8CZiR3Xu/7M/67rXheXq6UmPj0XpjwcOmaMWEgamKE=; b=EJu93pxJxN9KuX0qgvpbXy3zXvkncAIXjsoN9XHj7PGMBpCt6+6yVHivJ3QqWw/zgj KN1S8R3nAOzc816hcrL2lkiVNs34mGf3KSOora034XTW/RR7Ge0k1nyCJyWZjvLdlCUp QHnW0YSt3eomGXKZhYori8FBKjtwLLjJyoSrRiLu+LI5YplxddkVYHNPGKM8Z6XZEjyZ V8rAeRN9l3k7o142PXr7RXzO0zp1lBJYMWMMiL1BbXqAPWzaS5p7t/gAPExgRyoln25e rxoA5sXegbT59z/SzXxn2b9zbCEr/7TyvZvuJu7+38ND5FJ3mE+HRD9FCWFBV8NKdbOe IUcA== X-Gm-Message-State: AOJu0Yy5gzP3fUpu3lhw7V5Fk/cvVzbNoYphahB4Ss2mghjXScWREzik RQ0ZXZG0NBE6rg9fo6YbgvQCKg== X-Google-Smtp-Source: AGHT+IH4gg/vR6q4py/1tlJcmjg2VOr2qGwSY69we4f+NfmGIjQ5OxOfgwbAria/spCBKz9bUzEXPA== X-Received: by 2002:a2e:800c:0:b0:2bb:997a:493e with SMTP id j12-20020a2e800c000000b002bb997a493emr3549301ljg.35.1692281010969; Thu, 17 Aug 2023 07:03:30 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id g3-20020a2eb0c3000000b002b9c3e18095sm4064645ljl.14.2023.08.17.07.03.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 07:03:30 -0700 (PDT) From: Linus Walleij Date: Thu, 17 Aug 2023 16:03:19 +0200 Subject: [PATCH v2 3/5] ASoC: rt5668: Convert to use GPIO descriptors MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230817-descriptors-asoc-rt-v2-3-02fa2ca3e5b0@linaro.org> References: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> In-Reply-To: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> To: Oder Chiou , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the RT5668 to use GPIO descriptors and drop the legacy GPIO headers. We remove the global GPIO number from the platform data, but it is still possible to create board files using GPIO descriptor tables, if desired. Signed-off-by: Linus Walleij --- include/sound/rt5668.h | 3 --- sound/soc/codecs/rt5668.c | 17 ++++++++--------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/include/sound/rt5668.h b/include/sound/rt5668.h index 182edfbc9e7a..b682418c6cd6 100644 --- a/include/sound/rt5668.h +++ b/include/sound/rt5668.h @@ -25,9 +25,6 @@ enum rt5668_jd_src { }; =20 struct rt5668_platform_data { - - int ldo1_en; /* GPIO for LDO1_EN */ - enum rt5668_dmic1_data_pin dmic1_data_pin; enum rt5668_dmic1_clk_pin dmic1_clk_pin; enum rt5668_jd_src jd_src; diff --git a/sound/soc/codecs/rt5668.c b/sound/soc/codecs/rt5668.c index f04c810fd710..4623b3e62487 100644 --- a/sound/soc/codecs/rt5668.c +++ b/sound/soc/codecs/rt5668.c @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -43,6 +42,7 @@ static const char *rt5668_supply_names[RT5668_NUM_SUPPLIE= S] =3D { struct rt5668_priv { struct snd_soc_component *component; struct rt5668_platform_data pdata; + struct gpio_desc *ldo1_en; struct regmap *regmap; struct snd_soc_jack *hs_jack; struct regulator_bulk_data supplies[RT5668_NUM_SUPPLIES]; @@ -2393,9 +2393,6 @@ static int rt5668_parse_dt(struct rt5668_priv *rt5668= , struct device *dev) of_property_read_u32(dev->of_node, "realtek,jd-src", &rt5668->pdata.jd_src); =20 - rt5668->pdata.ldo1_en =3D of_get_named_gpio(dev->of_node, - "realtek,ldo1-en-gpios", 0); - return 0; } =20 @@ -2497,10 +2494,12 @@ static int rt5668_i2c_probe(struct i2c_client *i2c) return ret; } =20 - if (gpio_is_valid(rt5668->pdata.ldo1_en)) { - if (devm_gpio_request_one(&i2c->dev, rt5668->pdata.ldo1_en, - GPIOF_OUT_INIT_HIGH, "rt5668")) - dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n"); + rt5668->ldo1_en =3D devm_gpiod_get_optional(&i2c->dev, + "realtek,ldo1-en", + GPIOD_OUT_HIGH); + if (IS_ERR(rt5668->ldo1_en)) { + dev_err(&i2c->dev, "Fail gpio request ldo1_en\n"); + return PTR_ERR(rt5668->ldo1_en); } =20 /* Sleep for 300 ms miniumum */ --=20 2.34.1 From nobody Tue Dec 16 23:41:29 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 147BBC2FC39 for ; Thu, 17 Aug 2023 14:04:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351696AbjHQOEU (ORCPT ); Thu, 17 Aug 2023 10:04:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351671AbjHQODo (ORCPT ); Thu, 17 Aug 2023 10:03:44 -0400 Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C58A42D6D for ; Thu, 17 Aug 2023 07:03:33 -0700 (PDT) Received: by mail-lj1-x22d.google.com with SMTP id 38308e7fff4ca-2b9b50be31aso117337231fa.3 for ; Thu, 17 Aug 2023 07:03:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692281012; x=1692885812; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=s8QnfXt14InmPur1jaC24sUVlinocDE8jpHSEWJ37+o=; b=TV6FCMvT/LoEqFsobincahfEyqStn0Fuyfn5b5hYbFZazgJ1W6IM9va0mjfgxXgRNM KFxVwj1TawdUco9eenFuTdc2QsFvm8H8JJjb8LAsrNemqAoRN/LTz/ArVsDkBPQouV5V dAjD1U6CLmgytPQuCwo11QMnTcdMgL6wke6WtIJf98Zw1iFq8MsdiwVLVX87SjChjsyl oURNiZrNDyXKkU2oeYC5S+RLAr/IexciJQah2Wib9DJyoqsrlxjWyy3SjIWQrJTptdQf jSNJe8GZ94Mmcm2lzrWmnyxkpKFclCsKozrp7v6ngM5I/GK6ySpZyupxAz3iTGCe7ub9 fMoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692281012; x=1692885812; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=s8QnfXt14InmPur1jaC24sUVlinocDE8jpHSEWJ37+o=; b=Ci4aijMim0aOIpvZslWZG9ZE/yGNE2D4zNlP5qApcXl9FrvuwkNyAFHiBv0aj71/0A AaDiZ8Xux1P4fDe/GDOx8Bb7uIVVjIBVEC/EL+JYz4S1RQ7hFCL4gYwlPtB9uBSCMzVJ +BZylkAuN+q2XoQaOUoskjYh2U7vd7TZKdl7nQ/JzkZ4fnfKKa/nTYUjFhxi27WfuoAT e/82UU0QGI5e/Kagi4AiMT9t6+z2lE5ws11LX0MnjbwPnCXY5kd1nxemuLmYlflqKo8P C6PCP/ZgfZhvgQoWoh+REWyAJxdy6zC3nrVN7uzc2olhF7RwB0Sj/XdHtjqFzR6L8Ami vyiA== X-Gm-Message-State: AOJu0YyfC/5V9uwpGsq4cTAFf6U4zcDlA/MDCHfVxp2Lb2zbM7OUa9aA gVD80rxqxPHzvqGkrA8bwsF9iwIXvRt/mZ00xF0= X-Google-Smtp-Source: AGHT+IF5riaWQT2nv6OvAWzXDDhE1Yh2ZeIyZUsJE/SAjXNz/hCQGKh0HlxKGTYoYC1yTHp2FVoyGg== X-Received: by 2002:a2e:8012:0:b0:2b9:df49:b818 with SMTP id j18-20020a2e8012000000b002b9df49b818mr4043578ljg.53.1692281012072; Thu, 17 Aug 2023 07:03:32 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id g3-20020a2eb0c3000000b002b9c3e18095sm4064645ljl.14.2023.08.17.07.03.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 07:03:31 -0700 (PDT) From: Linus Walleij Date: Thu, 17 Aug 2023 16:03:20 +0200 Subject: [PATCH v2 4/5] ASoC: rt5682: Convert to use GPIO descriptors MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230817-descriptors-asoc-rt-v2-4-02fa2ca3e5b0@linaro.org> References: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> In-Reply-To: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> To: Oder Chiou , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the RT5682 to use GPIO descriptors and drop the legacy GPIO headers. We remove the global GPIO number from the platform data, but it is still possible to create board files using GPIO descriptor tables, if desired. Make sure to make sure SDW devices can associate with an LDO1 EN descriptor too, if they so desire by putting the lookup into the common code. Signed-off-by: Linus Walleij --- include/sound/rt5682.h | 3 --- sound/soc/codecs/rt5682-i2c.c | 11 ++++------- sound/soc/codecs/rt5682-sdw.c | 5 +++++ sound/soc/codecs/rt5682.c | 20 +++++++++++++++----- sound/soc/codecs/rt5682.h | 3 +++ 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/include/sound/rt5682.h b/include/sound/rt5682.h index 3900a07e3935..4256df721e3a 100644 --- a/include/sound/rt5682.h +++ b/include/sound/rt5682.h @@ -31,9 +31,6 @@ enum rt5682_dai_clks { }; =20 struct rt5682_platform_data { - - int ldo1_en; /* GPIO for LDO1_EN */ - enum rt5682_dmic1_data_pin dmic1_data_pin; enum rt5682_dmic1_clk_pin dmic1_clk_pin; enum rt5682_jd_src jd_src; diff --git a/sound/soc/codecs/rt5682-i2c.c b/sound/soc/codecs/rt5682-i2c.c index fb8ffb5b2ff6..b05b4f73d8aa 100644 --- a/sound/soc/codecs/rt5682-i2c.c +++ b/sound/soc/codecs/rt5682-i2c.c @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -170,11 +169,9 @@ static int rt5682_i2c_probe(struct i2c_client *i2c) return ret; } =20 - if (gpio_is_valid(rt5682->pdata.ldo1_en)) { - if (devm_gpio_request_one(&i2c->dev, rt5682->pdata.ldo1_en, - GPIOF_OUT_INIT_HIGH, "rt5682")) - dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n"); - } + ret =3D rt5682_get_ldo1(rt5682, &i2c->dev); + if (ret) + return ret; =20 /* Sleep for 300 ms miniumum */ usleep_range(300000, 350000); diff --git a/sound/soc/codecs/rt5682-sdw.c b/sound/soc/codecs/rt5682-sdw.c index 65e9c6dc1a54..e67c2e19cb1a 100644 --- a/sound/soc/codecs/rt5682-sdw.c +++ b/sound/soc/codecs/rt5682-sdw.c @@ -320,6 +320,11 @@ static int rt5682_sdw_init(struct device *dev, struct = regmap *regmap, return ret; } =20 + + ret =3D rt5682_get_ldo1(rt5682, dev); + if (ret) + return ret; + regcache_cache_only(rt5682->sdw_regmap, true); regcache_cache_only(rt5682->regmap, true); =20 diff --git a/sound/soc/codecs/rt5682.c b/sound/soc/codecs/rt5682.c index 694c581070d9..e3aca9c785a0 100644 --- a/sound/soc/codecs/rt5682.c +++ b/sound/soc/codecs/rt5682.c @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -3094,9 +3093,6 @@ int rt5682_parse_dt(struct rt5682_priv *rt5682, struc= t device *dev) device_property_read_u32(dev, "realtek,dmic-delay-ms", &rt5682->pdata.dmic_delay); =20 - rt5682->pdata.ldo1_en =3D of_get_named_gpio(dev->of_node, - "realtek,ldo1-en-gpios", 0); - if (device_property_read_string_array(dev, "clock-output-names", rt5682->pdata.dai_clk_names, RT5682_DAI_NUM_CLKS) < 0) @@ -3111,6 +3107,20 @@ int rt5682_parse_dt(struct rt5682_priv *rt5682, stru= ct device *dev) } EXPORT_SYMBOL_GPL(rt5682_parse_dt); =20 +int rt5682_get_ldo1(struct rt5682_priv *rt5682, struct device *dev) +{ + rt5682->ldo1_en =3D devm_gpiod_get_optional(dev, + "realtek,ldo1-en", + GPIOD_OUT_HIGH); + if (IS_ERR(rt5682->ldo1_en)) { + dev_err(dev, "Fail gpio request ldo1_en\n"); + return PTR_ERR(rt5682->ldo1_en); + } + + return 0; +} +EXPORT_SYMBOL_GPL(rt5682_get_ldo1); + void rt5682_calibrate(struct rt5682_priv *rt5682) { int value, count; diff --git a/sound/soc/codecs/rt5682.h b/sound/soc/codecs/rt5682.h index 1a43d595f341..b2d9e87af259 100644 --- a/sound/soc/codecs/rt5682.h +++ b/sound/soc/codecs/rt5682.h @@ -11,6 +11,7 @@ =20 #include #include +#include #include #include #include @@ -1430,6 +1431,7 @@ struct rt5682_priv { struct snd_soc_component *component; struct device *i2c_dev; struct rt5682_platform_data pdata; + struct gpio_desc *ldo1_en; struct regmap *regmap; struct regmap *sdw_regmap; struct snd_soc_jack *hs_jack; @@ -1481,6 +1483,7 @@ int rt5682_register_component(struct device *dev); void rt5682_calibrate(struct rt5682_priv *rt5682); void rt5682_reset(struct rt5682_priv *rt5682); int rt5682_parse_dt(struct rt5682_priv *rt5682, struct device *dev); +int rt5682_get_ldo1(struct rt5682_priv *rt5682, struct device *dev); =20 int rt5682_register_dai_clks(struct rt5682_priv *rt5682); =20 --=20 2.34.1 From nobody Tue Dec 16 23:41:29 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01EA4C2FC34 for ; Thu, 17 Aug 2023 14:04:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351687AbjHQOET (ORCPT ); Thu, 17 Aug 2023 10:04:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351672AbjHQODo (ORCPT ); Thu, 17 Aug 2023 10:03:44 -0400 Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4B16358A for ; Thu, 17 Aug 2023 07:03:34 -0700 (PDT) Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-2b703a0453fso119157821fa.3 for ; Thu, 17 Aug 2023 07:03:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692281013; x=1692885813; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SVRGKrIqK8zdIPLjLE/8ZwUbdMywu2KHkrv9/v0NkSo=; b=oioclo5JM2Z8IQ//cUwFPPQ37qFbQD2VKB4e+vIUFHeDvjfiQwtwWq+AOjZ/raQCf+ z354ZE7/AFnzPICOq6EWUTqvVSc6x2yVVauyV5h+XVXEkvKAosCUJMnksLP6EvPm3xn3 NxZ9q1HxjiEYesrw416DCagvdKhMBPua+iPIithASgflIyKuKgq5mMa4uu+Xsy8R+tHT sboGbYN+DOvBat7iQn8q2qNXzFJJ/dGa4bbWMj1NjGI1XOomH0nynE+a0ROaJskQTA1H NyMWbIgVPJNAFEETbzoFRERS4Oc2pWUsRY3JTQ6Zhs0zW2c4xz+GC8xxejNuZhlfRGdK ZSTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692281013; x=1692885813; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SVRGKrIqK8zdIPLjLE/8ZwUbdMywu2KHkrv9/v0NkSo=; b=VWSai0oF50715PfnB/JvdoAYijfSjycjANPn+2lcM3JIXhFzmWyE7bNAXa+PqIC1M+ QHZOC2/2gPQnG//uZUAECtBCW5jJODNPCJMU3LrilvbkCtjKkz4hkDS+pZ7mcYACElfy pBYi1b9cNbltiJTwrTcsC5s0ahW8cXZ2kFzCM4H2VEKY6jgZXe/XhiL7cvXh0geqMJUH oKkaEXhEOv/t/iPnSwA8k6oK87pZ7ed3pjSKZO1xABIY3PFFSkBRBaIDBeq2RyT4pb9Y fsebQWY5ZxpBBBfPcQ3aop9+5r4Lf8iiPaVszq/xE0twohLnnVWvRwkGgiimlIjlzwqC Qnzg== X-Gm-Message-State: AOJu0Yy96IoWgcSVzG7GIwGdtTDbEYDF17rCszlJfXy54yUlbbsSZ1Sc gZ9dk76adHaxcqegOvWm/3p2JQ== X-Google-Smtp-Source: AGHT+IHt8slVZzlqM+67wFP56al0ESEwXNkqY3msrUtb07eUTGraVFPwWUsEKyiz1+fXP8sgs7X0hg== X-Received: by 2002:a05:651c:203:b0:2b9:575e:5298 with SMTP id y3-20020a05651c020300b002b9575e5298mr4236590ljn.13.1692281013057; Thu, 17 Aug 2023 07:03:33 -0700 (PDT) Received: from [127.0.1.1] ([85.235.12.238]) by smtp.gmail.com with ESMTPSA id g3-20020a2eb0c3000000b002b9c3e18095sm4064645ljl.14.2023.08.17.07.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 07:03:32 -0700 (PDT) From: Linus Walleij Date: Thu, 17 Aug 2023 16:03:21 +0200 Subject: [PATCH v2 5/5] ASoC: rt5682s: Convert to use GPIO descriptors MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230817-descriptors-asoc-rt-v2-5-02fa2ca3e5b0@linaro.org> References: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> In-Reply-To: <20230817-descriptors-asoc-rt-v2-0-02fa2ca3e5b0@linaro.org> To: Oder Chiou , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Linus Walleij X-Mailer: b4 0.12.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the RT5682S to use GPIO descriptors and drop the legacy GPIO headers. We remove the global GPIO number from the platform data, but it is still possible to create board files using GPIO descriptor tables, if desired. Signed-off-by: Linus Walleij --- include/sound/rt5682s.h | 3 --- sound/soc/codecs/rt5682s.c | 16 +++++++--------- sound/soc/codecs/rt5682s.h | 2 ++ 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/include/sound/rt5682s.h b/include/sound/rt5682s.h index f18d91308b9a..66ca0c75b914 100644 --- a/include/sound/rt5682s.h +++ b/include/sound/rt5682s.h @@ -32,9 +32,6 @@ enum rt5682s_dai_clks { }; =20 struct rt5682s_platform_data { - - int ldo1_en; /* GPIO for LDO1_EN */ - enum rt5682s_dmic1_data_pin dmic1_data_pin; enum rt5682s_dmic1_clk_pin dmic1_clk_pin; enum rt5682s_jd_src jd_src; diff --git a/sound/soc/codecs/rt5682s.c b/sound/soc/codecs/rt5682s.c index c77c675bd5f5..68ac5ea50396 100644 --- a/sound/soc/codecs/rt5682s.c +++ b/sound/soc/codecs/rt5682s.c @@ -15,8 +15,7 @@ #include #include #include -#include -#include +#include #include #include #include @@ -2973,9 +2972,6 @@ static int rt5682s_parse_dt(struct rt5682s_priv *rt56= 82s, struct device *dev) device_property_read_u32(dev, "realtek,amic-delay-ms", &rt5682s->pdata.amic_delay); =20 - rt5682s->pdata.ldo1_en =3D of_get_named_gpio(dev->of_node, - "realtek,ldo1-en-gpios", 0); - if (device_property_read_string_array(dev, "clock-output-names", rt5682s->pdata.dai_clk_names, RT5682S_DAI_NUM_CLKS) < 0) @@ -3172,10 +3168,12 @@ static int rt5682s_i2c_probe(struct i2c_client *i2c) return ret; } =20 - if (gpio_is_valid(rt5682s->pdata.ldo1_en)) { - if (devm_gpio_request_one(&i2c->dev, rt5682s->pdata.ldo1_en, - GPIOF_OUT_INIT_HIGH, "rt5682s")) - dev_err(&i2c->dev, "Fail gpio_request gpio_ldo\n"); + rt5682s->ldo1_en =3D devm_gpiod_get_optional(&i2c->dev, + "realtek,ldo1-en", + GPIOD_OUT_HIGH); + if (IS_ERR(rt5682s->ldo1_en)) { + dev_err(&i2c->dev, "Fail gpio request ldo1_en\n"); + return PTR_ERR(rt5682s->ldo1_en); } =20 /* Sleep for 50 ms minimum */ diff --git a/sound/soc/codecs/rt5682s.h b/sound/soc/codecs/rt5682s.h index caa7733b430f..1d79d432d0d8 100644 --- a/sound/soc/codecs/rt5682s.h +++ b/sound/soc/codecs/rt5682s.h @@ -11,6 +11,7 @@ =20 #include #include +#include #include #include #include @@ -1446,6 +1447,7 @@ enum { struct rt5682s_priv { struct snd_soc_component *component; struct rt5682s_platform_data pdata; + struct gpio_desc *ldo1_en; struct regmap *regmap; struct snd_soc_jack *hs_jack; struct regulator_bulk_data supplies[RT5682S_NUM_SUPPLIES]; --=20 2.34.1