* [PATCH 0/2] ASoC: codecs: twl4030: external mute GPIO lookup fix and binding update
@ 2026-10-22 20:29 Dmitry Torokhov
2026-10-22 20:29 ` [PATCH 1/2] ASoC: codecs: twl4030: fix external mute GPIO lookup Dmitry Torokhov
2026-10-22 20:29 ` [PATCH 2/2] dt-bindings: mfd: twl4030-audio: document preferred name for external mute Dmitry Torokhov
0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2026-10-22 20:29 UTC (permalink / raw)
To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Peng Fan, Linus Walleij, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Peter Ujfalusi
Cc: linux-sound, linux-kernel, devicetree
This series fixes external mute GPIO lookup for the TWL4030 codec driver
and updates the corresponding device tree binding.
The twl4030-codec platform device created by the twl4030-audio MFD does
not have its own of_node or fwnode assigned, as its DT properties reside
in the "codec" child node of the parent MFD device. Consequently,
standard devm_gpiod_get_optional() calls on the codec device never
succeed. Fix this by looking up the GPIO descriptor directly from the
codec child firmware node. Also update the device tree binding to
document the standard "ti,hs_extmute-gpios" property name.
Note that to fully restore external mute GPIO lookup on existing device
trees that still use the legacy "ti,hs_extmute_gpio" property name (with
an underscore), the companion gpiolib OF quirk [1] is also needed at
runtime. There is no build-time dependency between the two changes, so
they can be merged independently via the ASoC and GPIO trees.
[1] https://lore.kernel.org/r/20260724051822.3545532-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
Dmitry Torokhov (2):
ASoC: codecs: twl4030: fix external mute GPIO lookup
dt-bindings: mfd: twl4030-audio: document preferred name for external mute
.../bindings/sound/ti,twl4030-audio.yaml | 8 +-
sound/soc/codecs/twl4030.c | 108 +++++++++++----------
2 files changed, 62 insertions(+), 54 deletions(-)
---
base-commit: 8f7df005a7564bd7ffa75da9c3085d5b996f1e16
change-id: 20261022-twl4030-extmute-59e516f0e056
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 1/2] ASoC: codecs: twl4030: fix external mute GPIO lookup 2026-10-22 20:29 [PATCH 0/2] ASoC: codecs: twl4030: external mute GPIO lookup fix and binding update Dmitry Torokhov @ 2026-10-22 20:29 ` Dmitry Torokhov 2026-10-22 20:39 ` sashiko-bot 2026-10-22 20:29 ` [PATCH 2/2] dt-bindings: mfd: twl4030-audio: document preferred name for external mute Dmitry Torokhov 1 sibling, 1 reply; 6+ messages in thread From: Dmitry Torokhov @ 2026-10-22 20:29 UTC (permalink / raw) To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, Peng Fan, Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Peter Ujfalusi Cc: linux-sound, linux-kernel, devicetree The twl4030-codec platform device instantiated by the twl4030-audio MFD core does not have its own of_node or fwnode assigned; its device tree properties reside in the "codec" child node of the parent MFD device node. Because of this, devm_gpiod_get_optional() called on the codec device never locates the external mute GPIO. Furthermore, previous board param handling only marked external mute active when the legacy "ti,hs_extmute_gpio" property was present, ignoring the standard "ti,hs_extmute-gpios" property when "ti,hs_extmute" was absent, and set hs_extmute even if GPIO acquisition subsequently failed. Switch to fwnode APIs to parse board properties directly inside twl4030_get_board_params(), fold the helper function into it, and acquire the GPIO descriptor directly from the "codec" child firmware node using devm_fwnode_gpiod_get_optional() with the "ti,hs_extmute" connection ID, removing the redundant legacy property check. Fixes: 178c169a30b0 ("ASoC: codec: twl4030: Convert to GPIO descriptors") Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- sound/soc/codecs/twl4030.c | 108 +++++++++++++++++++++++---------------------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c index 7117af5a1a56..9541c8a5a24e 100644 --- a/sound/soc/codecs/twl4030.c +++ b/sound/soc/codecs/twl4030.c @@ -6,6 +6,7 @@ */ #include <linux/delay.h> +#include <linux/err.h> #include <linux/gpio/consumer.h> #include <linux/i2c.h> #include <linux/init.h> @@ -13,9 +14,9 @@ #include <linux/mfd/twl4030-audio.h> #include <linux/module.h> #include <linux/moduleparam.h> -#include <linux/of.h> #include <linux/pm.h> #include <linux/platform_device.h> +#include <linux/property.h> #include <linux/slab.h> #include <sound/core.h> #include <sound/initval.h> @@ -198,41 +199,53 @@ static void twl4030_codec_enable(struct snd_soc_component *component, int enable udelay(10); } -static void -twl4030_get_board_param_values(struct twl4030_board_params *board_params, - struct device_node *node) +static struct twl4030_board_params *twl4030_get_board_params(struct device *dev) { - of_property_read_u32(node, "ti,digimic_delay", &board_params->digimic_delay); - of_property_read_u32(node, "ti,ramp_delay_value", &board_params->ramp_delay_value); - of_property_read_u32(node, "ti,offset_cncl_path", &board_params->offset_cncl_path); - board_params->hs_extmute = of_property_read_bool(node, "ti,hs_extmute"); + struct twl4030_board_params *params; + int error; - if (of_property_present(node, "ti,hs_extmute_gpio")) - board_params->hs_extmute = 1; -} + struct fwnode_handle *codec_node __free(fwnode_handle) = + device_get_named_child_node(dev->parent, "codec"); + if (!codec_node) + return NULL; -static struct twl4030_board_params* -twl4030_get_board_params(struct device *dev) -{ - struct twl4030_board_params *board_params = NULL; - struct device_node *twl4030_codec_node = NULL; - - twl4030_codec_node = of_get_child_by_name(dev->parent->of_node, - "codec"); - - if (twl4030_codec_node) { - board_params = devm_kzalloc(dev, - sizeof(struct twl4030_board_params), - GFP_KERNEL); - if (!board_params) { - of_node_put(twl4030_codec_node); - return ERR_PTR(-ENOMEM); - } - twl4030_get_board_param_values(board_params, twl4030_codec_node); - of_node_put(twl4030_codec_node); + params = devm_kzalloc(dev, sizeof(*params), GFP_KERNEL); + if (!params) + return ERR_PTR(-ENOMEM); + + fwnode_property_read_u32(codec_node, "ti,digimic_delay", + ¶ms->digimic_delay); + fwnode_property_read_u32(codec_node, "ti,ramp_delay_value", + ¶ms->ramp_delay_value); + fwnode_property_read_u32(codec_node, "ti,offset_cncl_path", + ¶ms->offset_cncl_path); + + /* + * Headset external mute can be controlled either via TWL4030's + * dedicated GPIO6/EXTMUTE pin (enabled by the boolean "ti,hs_extmute" + * property) or via a separate GPIO line ("ti,hs_extmute-gpios" or + * legacy "ti,hs_extmute_gpio"), which implies external mute is active. + */ + params->hs_extmute = fwnode_property_read_bool(codec_node, "ti,hs_extmute"); + + /* + * This will attempt to parse "ti,hs_extmute-gpios" or + * "ti,hs_extmute_gpio". + */ + params->hs_extmute_gpio = devm_fwnode_gpiod_get_optional(dev, codec_node, + "ti,hs_extmute", + GPIOD_OUT_LOW, + "hs_extmute"); + error = PTR_ERR_OR_ZERO(params->hs_extmute_gpio); + if (error) { + dev_err_probe(dev, error, "Failed to get hs_extmute GPIO\n"); + return ERR_PTR(error); } - return board_params; + if (params->hs_extmute_gpio) + params->hs_extmute = 1; + + return params; } static int twl4030_get_hw_params(struct device *dev, @@ -244,30 +257,19 @@ static int twl4030_get_hw_params(struct device *dev, if (IS_ERR(board_params)) return PTR_ERR(board_params); - if (board_params && board_params->hs_extmute) { - board_params->hs_extmute_gpio = devm_gpiod_get_optional(dev, - "ti,hs_extmute", - GPIOD_OUT_LOW); - if (IS_ERR(board_params->hs_extmute_gpio)) - return dev_err_probe(dev, - PTR_ERR(board_params->hs_extmute_gpio), - "Failed to get hs_extmute GPIO\n"); - - if (board_params->hs_extmute_gpio) { - gpiod_set_consumer_name(board_params->hs_extmute_gpio, "hs_extmute"); - } else { - u8 pin_mux; + if (board_params && board_params->hs_extmute && + !board_params->hs_extmute_gpio) { + u8 pin_mux; - dev_info(dev, "use TWL4030 GPIO6\n"); + dev_info(dev, "use TWL4030 GPIO6\n"); - /* Set TWL4030 GPIO6 as EXTMUTE signal */ - twl_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux, - TWL4030_PMBR1_REG); - pin_mux &= ~TWL4030_GPIO6_PWM0_MUTE(0x03); - pin_mux |= TWL4030_GPIO6_PWM0_MUTE(0x02); - twl_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux, - TWL4030_PMBR1_REG); - } + /* Set TWL4030 GPIO6 as EXTMUTE signal */ + twl_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux, + TWL4030_PMBR1_REG); + pin_mux &= ~TWL4030_GPIO6_PWM0_MUTE(0x03); + pin_mux |= TWL4030_GPIO6_PWM0_MUTE(0x02); + twl_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux, + TWL4030_PMBR1_REG); } twl4030->board_params = board_params; -- 2.56.0.257.gf7497c7d27-goog ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: codecs: twl4030: fix external mute GPIO lookup 2026-10-22 20:29 ` [PATCH 1/2] ASoC: codecs: twl4030: fix external mute GPIO lookup Dmitry Torokhov @ 2026-10-22 20:39 ` sashiko-bot 0 siblings, 0 replies; 6+ messages in thread From: sashiko-bot @ 2026-10-22 20:39 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: linux-sound, devicetree, robh, conor+dt Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [High] ASoC: twl4030: broken ti,hs_extmute_gpio lookup in twl4030_get_board_params() -- commit 0efa5663d0f46476c9f10223a843a170f4992c82 Author: Dmitry Torokhov <dmitry.torokhov@gmail.com> ASoC: codecs: twl4030: fix external mute GPIO lookup This commit updates twl4030_get_board_params() to read properties from the parent device's "codec" child fwnode and request the external mute gpio via devm_fwnode_gpiod_get_optional(). > diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c > index 7117af5a1a569..9541c8a5a24e8 100644 > --- a/sound/soc/codecs/twl4030.c > +++ b/sound/soc/codecs/twl4030.c [ ... ] > @@ -198,41 +199,53 @@ static void twl4030_codec_enable(struct snd_soc_component *component, int enable > udelay(10); > } > > -static void > -twl4030_get_board_param_values(struct twl4030_board_params *board_params, > - struct device_node *node) > +static struct twl4030_board_params *twl4030_get_board_params(struct device *dev) > { > - of_property_read_u32(node, "ti,digimic_delay", &board_params->digimic_delay); > - of_property_read_u32(node, "ti,ramp_delay_value", &board_params->ramp_delay_value); > - of_property_read_u32(node, "ti,offset_cncl_path", &board_params->offset_cncl_path); > - board_params->hs_extmute = of_property_read_bool(node, "ti,hs_extmute"); > + struct twl4030_board_params *params; > + int error; > > - if (of_property_present(node, "ti,hs_extmute_gpio")) > - board_params->hs_extmute = 1; > -} > + struct fwnode_handle *codec_node __free(fwnode_handle) = > + device_get_named_child_node(dev->parent, "codec"); > + if (!codec_node) > + return NULL; > > -static struct twl4030_board_params* > -twl4030_get_board_params(struct device *dev) > -{ > - struct twl4030_board_params *board_params = NULL; > - struct device_node *twl4030_codec_node = NULL; > - > - twl4030_codec_node = of_get_child_by_name(dev->parent->of_node, > - "codec"); > - > - if (twl4030_codec_node) { > - board_params = devm_kzalloc(dev, > - sizeof(struct twl4030_board_params), > - GFP_KERNEL); > - if (!board_params) { > - of_node_put(twl4030_codec_node); > - return ERR_PTR(-ENOMEM); > - } > - twl4030_get_board_param_values(board_params, twl4030_codec_node); > - of_node_put(twl4030_codec_node); > + params = devm_kzalloc(dev, sizeof(*params), GFP_KERNEL); > + if (!params) > + return ERR_PTR(-ENOMEM); > + > + fwnode_property_read_u32(codec_node, "ti,digimic_delay", > + ¶ms->digimic_delay); > + fwnode_property_read_u32(codec_node, "ti,ramp_delay_value", > + ¶ms->ramp_delay_value); > + fwnode_property_read_u32(codec_node, "ti,offset_cncl_path", > + ¶ms->offset_cncl_path); > + > + /* > + * Headset external mute can be controlled either via TWL4030's > + * dedicated GPIO6/EXTMUTE pin (enabled by the boolean "ti,hs_extmute" > + * property) or via a separate GPIO line ("ti,hs_extmute-gpios" or > + * legacy "ti,hs_extmute_gpio"), which implies external mute is active. > + */ > + params->hs_extmute = fwnode_property_read_bool(codec_node, "ti,hs_extmute"); > + > + /* > + * This will attempt to parse "ti,hs_extmute-gpios" or > + * "ti,hs_extmute_gpio". > + */ > + params->hs_extmute_gpio = devm_fwnode_gpiod_get_optional(dev, codec_node, > + "ti,hs_extmute", > + GPIOD_OUT_LOW, > + "hs_extmute"); > + error = PTR_ERR_OR_ZERO(params->hs_extmute_gpio); > + if (error) { > + dev_err_probe(dev, error, "Failed to get hs_extmute GPIO\n"); > + return ERR_PTR(error); > + } > > - return board_params; > + if (params->hs_extmute_gpio) > + params->hs_extmute = 1; [Severity: High] Will devm_fwnode_gpiod_get_optional() actually match the legacy "ti,hs_extmute_gpio" property (with an underscore) when called with "ti,hs_extmute" as con_id in twl4030_get_board_params()? In drivers/gpio/gpiolib.h, for_each_gpio_property_name() constructs candidate property names using a hyphen: if (con_id) snprintf(propname, sizeof(propname), "%s-%s", con_id, __gs); When of_find_gpio() in drivers/gpio/gpiolib-of.c iterates over gpio_suffixes ("gpios" and "gpio"), it only checks "ti,hs_extmute-gpios" and "ti,hs_extmute-gpio", and of_find_gpio_rename() has no fallback entry for "ti,hs_extmute_gpio". However, Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml and arch/arm/boot/dts/ti/omap/logicpd-som-lv.dtsi specify "ti,hs_extmute_gpio" with an underscore: twl_audio: audio { compatible = "ti,twl4030-audio"; codec { ti,hs_extmute_gpio = <&gpio2 25 GPIO_ACTIVE_HIGH>; }; }; When probing a board whose "codec" node uses "ti,hs_extmute_gpio", won't devm_fwnode_gpiod_get_optional() return NULL, leaving params->hs_extmute_gpio unset (so params->hs_extmute stays 0 on boards like logicpd-som-lv.dtsi, or twl4030_get_hw_params() configures the internal pin mux in TWL4030_PMBR1_REG if "ti,hs_extmute" is also present)? > + > + return params; > } [ ... ] > -- Sashiko AI review · https://sashiko.dev/#/patchset/20261022-twl4030-extmute-v1-0-3d2dbe260df9@gmail.com?part=1 ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] dt-bindings: mfd: twl4030-audio: document preferred name for external mute 2026-10-22 20:29 [PATCH 0/2] ASoC: codecs: twl4030: external mute GPIO lookup fix and binding update Dmitry Torokhov 2026-10-22 20:29 ` [PATCH 1/2] ASoC: codecs: twl4030: fix external mute GPIO lookup Dmitry Torokhov @ 2026-10-22 20:29 ` Dmitry Torokhov 2026-10-22 20:44 ` sashiko-bot 2026-10-23 19:15 ` Rob Herring (Arm) 1 sibling, 2 replies; 6+ messages in thread From: Dmitry Torokhov @ 2026-10-22 20:29 UTC (permalink / raw) To: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, Peng Fan, Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley, Peter Ujfalusi Cc: linux-sound, linux-kernel, devicetree Proper names for GPIOs should use "-gpios" suffix. Now that the twl4030 codec driver has been converted to use GPIO descriptors in commit 178c169a30b0 ("ASoC: codec: twl4030: Convert to GPIO descriptors"), update the binding documentation to list "ti,hs_extmute-gpios" as the preferred property name and mark "ti,hs_extmute_gpio" as deprecated. Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml b/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml index c9c3f7513ad4..1d41f582261d 100644 --- a/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml +++ b/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml @@ -39,12 +39,18 @@ properties: description: Enable the use of an external mute for headset pop reduction. - ti,hs_extmute_gpio: + ti,hs_extmute-gpios: $ref: /schemas/types.yaml#/definitions/phandle-array description: The GPIO specifier for the external mute control. maxItems: 1 + ti,hs_extmute_gpio: + $ref: /schemas/types.yaml#/definitions/phandle-array + description: + Deprecated legacy name for ti,hs_extmute-gpios. + maxItems: 1 + ti,offset_cncl_path: $ref: /schemas/types.yaml#/definitions/uint32 description: -- 2.56.0.257.gf7497c7d27-goog ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] dt-bindings: mfd: twl4030-audio: document preferred name for external mute 2026-10-22 20:29 ` [PATCH 2/2] dt-bindings: mfd: twl4030-audio: document preferred name for external mute Dmitry Torokhov @ 2026-10-22 20:44 ` sashiko-bot 2026-10-23 19:15 ` Rob Herring (Arm) 1 sibling, 0 replies; 6+ messages in thread From: sashiko-bot @ 2026-10-22 20:44 UTC (permalink / raw) To: Dmitry Torokhov; +Cc: linux-sound, devicetree, robh, conor+dt Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] dt-bindings: sound: ti,twl4030-audio: invalid $ref and missing deprecated tag - [Medium] ASoC: twl4030: legacy ti,hs_extmute_gpio property not matched by gpiolib -- commit 43d9eacfe52fdbf41c021df1d5b980ba9e4220b9 Author: Dmitry Torokhov <dmitry.torokhov@gmail.com> dt-bindings: mfd: twl4030-audio: document preferred name for external mute This commit updates the ti,twl4030-audio binding schema to document ti,hs_extmute-gpios as the preferred external mute gpio property name and retain ti,hs_extmute_gpio as a deprecated legacy property. > diff --git a/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml b/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml > index c9c3f7513ad42..1d41f582261db 100644 > --- a/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml > +++ b/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml > @@ -39,12 +39,18 @@ properties: > description: > Enable the use of an external mute for headset pop reduction. > > - ti,hs_extmute_gpio: > + ti,hs_extmute-gpios: > $ref: /schemas/types.yaml#/definitions/phandle-array > description: > The GPIO specifier for the external mute control. > maxItems: 1 [Severity: Medium] Will keeping $ref: /schemas/types.yaml#/definitions/phandle-array under properties.codec.properties.ti,hs_extmute-gpios in Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml cause a schema validation error when running dt_binding_check? The explicit phandle-array $ref was previously required on ti,hs_extmute_gpio because its underscore _gpio suffix did not match standard gpio suffix patterns. Because ti,hs_extmute-gpios uses the standard -gpios suffix, the core dtschema meta-schema (meta-schemas/gpios.yaml and schemas/gpio/gpio-consumer.yaml) automatically assigns its type and sets additionalProperties: false, which disallows an explicit $ref to phandle-array. Also, for properties.codec.properties.ti,hs_extmute_gpio below, should deprecated: true be added to the property definition in addition to the description text so that dtschema validation tools recognize ti,hs_extmute_gpio as deprecated? > > + ti,hs_extmute_gpio: > + $ref: /schemas/types.yaml#/definitions/phandle-array > + description: > + Deprecated legacy name for ti,hs_extmute-gpios. > + maxItems: 1 [Severity: Medium] Can gpiolib actually resolve the deprecated ti,hs_extmute_gpio property documented here at properties.codec.properties.ti,hs_extmute_gpio when a device tree uses the legacy underscore name (for example, under twl_audio in arch/arm/boot/dts/ti/omap/logicpd-som-lv.dtsi)? During driver probe, twl4030_get_hw_params() calls twl4030_get_board_params() in sound/soc/codecs/twl4030.c (updated in commit "ASoC: codecs: twl4030: fix external mute GPIO lookup"): /* * This will attempt to parse "ti,hs_extmute-gpios" or * "ti,hs_extmute_gpio". */ params->hs_extmute_gpio = devm_fwnode_gpiod_get_optional(dev, codec_node, "ti,hs_extmute", GPIOD_OUT_LOW, "hs_extmute"); This calls into gpiod_find_and_request() -> of_find_gpio() in drivers/gpio/gpiolib-of.c: /* Try GPIO property "foo-gpios" and "foo-gpio" */ for_each_gpio_property_name(propname, con_id) { desc = of_get_named_gpiod_flags(np, propname, idx, &of_flags); if (!gpiod_not_found(desc)) break; } /* Properly named GPIO was not found, try workarounds */ for (q = of_find_gpio_quirks; gpiod_not_found(desc) && *q; q++) desc = (*q)(np, con_id, idx, &of_flags); However, for_each_gpio_property_name() in drivers/gpio/gpiolib.h formats candidate names using a hyphen: #define for_each_gpio_property_name(propname, con_id) \ for (const char * const *__suffixes = gpio_suffixes; \ *__suffixes && ({ \ const char *__gs = *__suffixes; \ \ if (con_id) \ snprintf(propname, sizeof(propname), "%s-%s", con_id, __gs); \ Because this only checks ti,hs_extmute-gpios and ti,hs_extmute-gpio, and of_find_gpio_rename() in drivers/gpio/gpiolib-of.c has no entry mapping ti,hs_extmute to ti,hs_extmute_gpio, devm_fwnode_gpiod_get_optional() returns NULL for boards specifying ti,hs_extmute_gpio. When ti,hs_extmute is absent, external mute is silently skipped in headset_ramp(). When ti,hs_extmute is set alongside ti,hs_extmute_gpio, twl4030_get_hw_params() in sound/soc/codecs/twl4030.c sees a null hs_extmute_gpio and reprograms TWL4030_PMBR1_REG to mux the internal gpio6/pwm0 pin as extmute instead of using the external gpio: if (board_params && board_params->hs_extmute && !board_params->hs_extmute_gpio) { u8 pin_mux; dev_info(dev, "use TWL4030 GPIO6\n"); /* Set TWL4030 GPIO6 as EXTMUTE signal */ twl_i2c_read_u8(TWL4030_MODULE_INTBR, &pin_mux, TWL4030_PMBR1_REG); pin_mux &= ~TWL4030_GPIO6_PWM0_MUTE(0x03); pin_mux |= TWL4030_GPIO6_PWM0_MUTE(0x02); twl_i2c_write_u8(TWL4030_MODULE_INTBR, pin_mux, TWL4030_PMBR1_REG); } Does of_find_gpio_rename() in drivers/gpio/gpiolib-of.c (or a fallback lookup in twl4030_get_board_params()) need to handle ti,hs_extmute_gpio so legacy device trees continue to work as documented by this binding? -- Sashiko AI review · https://sashiko.dev/#/patchset/20261022-twl4030-extmute-v1-0-3d2dbe260df9@gmail.com?part=2 ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] dt-bindings: mfd: twl4030-audio: document preferred name for external mute 2026-10-22 20:29 ` [PATCH 2/2] dt-bindings: mfd: twl4030-audio: document preferred name for external mute Dmitry Torokhov 2026-10-22 20:44 ` sashiko-bot @ 2026-10-23 19:15 ` Rob Herring (Arm) 1 sibling, 0 replies; 6+ messages in thread From: Rob Herring (Arm) @ 2026-10-23 19:15 UTC (permalink / raw) To: Dmitry Torokhov Cc: Peng Fan, Linus Walleij, linux-sound, Liam Girdwood, Peter Ujfalusi, Conor Dooley, devicetree, Mark Brown, Takashi Iwai, linux-kernel, Krzysztof Kozlowski, Jaroslav Kysela On Thu, 22 Oct 2026 13:29:47 -0700, Dmitry Torokhov wrote: > Proper names for GPIOs should use "-gpios" suffix. Now that the > twl4030 codec driver has been converted to use GPIO descriptors in > commit 178c169a30b0 ("ASoC: codec: twl4030: Convert to GPIO > descriptors"), update the binding documentation to list > "ti,hs_extmute-gpios" as the preferred property name and mark > "ti,hs_extmute_gpio" as deprecated. > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > --- > Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > My bot found errors running 'make dt_binding_check' on your patch: yamllint warnings/errors: dtschema/dtc warnings/errors: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/sound/ti,twl4030-audio.yaml: properties:codec:properties:ti,hs_extmute-gpios: 'anyOf' conditional failed, one must be fixed: '$ref' is not one of ['maxItems', 'description', 'deprecated'] hint: Only "maxItems" is required for a single entry if there are no constraints defined for the values. Additional properties are not allowed ('$ref' was unexpected) hint: Arrays must be described with a combination of minItems/maxItems/items 'maxItems' is not one of ['description', 'deprecated', 'const', 'enum', 'minimum', 'maximum', 'multipleOf', 'default', '$ref', 'oneOf'] 1 is less than the minimum of 2 hint: Arrays must be described with a combination of minItems/maxItems/items hint: cell array properties must define how many entries and what the entries are when there is more than one entry. from schema $id: http://devicetree.org/meta-schemas/cell.yaml doc reference errors (make refcheckdocs): See https://patchwork.kernel.org/project/devicetree/patch/20261022-twl4030-extmute-v1-2-3d2dbe260df9@gmail.com The base for the series is generally the latest rc1. A different dependency should be noted in *this* patch. If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure 'yamllint' is installed and dt-schema is up to date: pip3 install dtschema --upgrade Please check and re-submit after running the above command yourself. Note that DT_SCHEMA_FILES can be set to your schema file to speed up checking your schema. However, it must be unset to test all examples with your schema. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-23 19:15 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-10-22 20:29 [PATCH 0/2] ASoC: codecs: twl4030: external mute GPIO lookup fix and binding update Dmitry Torokhov 2026-10-22 20:29 ` [PATCH 1/2] ASoC: codecs: twl4030: fix external mute GPIO lookup Dmitry Torokhov 2026-10-22 20:39 ` sashiko-bot 2026-10-22 20:29 ` [PATCH 2/2] dt-bindings: mfd: twl4030-audio: document preferred name for external mute Dmitry Torokhov 2026-10-22 20:44 ` sashiko-bot 2026-10-23 19:15 ` Rob Herring (Arm)
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox