Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: Clean up {hp,mic}-det-gpio handling

Merge series from Geert Uytterhoeven <geert+renesas@glider.be>:

The "gpio" suffix for GPIO consumers was deprecated a while ago, in
favor of the "gpios" suffix. However, there are still several users of
the "hp-det-gpio" and "mic-det-gpio" properties, in DT bindings,
drivers, and DT source files.

Drivers that use gpiolib handle both the deprecated and new properties
transparently, but that is not the case when using of_property_*() calls
directly.

+23 -3
+6
Documentation/devicetree/bindings/sound/audio-graph.yaml
··· 37 37 pa-gpios: 38 38 maxItems: 1 39 39 hp-det-gpio: 40 + deprecated: true 41 + maxItems: 1 42 + hp-det-gpios: 40 43 maxItems: 1 41 44 mic-det-gpio: 45 + deprecated: true 46 + maxItems: 1 47 + mic-det-gpios: 42 48 maxItems: 1 43 49 44 50 required:
+12
Documentation/devicetree/bindings/sound/simple-card.yaml
··· 207 207 simple-audio-card,pin-switches: 208 208 $ref: "#/definitions/pin-switches" 209 209 simple-audio-card,hp-det-gpio: 210 + deprecated: true 211 + maxItems: 1 212 + simple-audio-card,hp-det-gpios: 210 213 maxItems: 1 211 214 simple-audio-card,mic-det-gpio: 215 + deprecated: true 216 + maxItems: 1 217 + simple-audio-card,mic-det-gpios: 212 218 maxItems: 1 213 219 214 220 patternProperties: ··· 262 256 pin-switches: 263 257 $ref: "#/definitions/pin-switches" 264 258 hp-det-gpio: 259 + deprecated: true 260 + maxItems: 1 261 + hp-det-gpios: 265 262 maxItems: 1 266 263 mic-det-gpio: 264 + deprecated: true 265 + maxItems: 1 266 + mic-det-gpios: 267 267 maxItems: 1 268 268 269 269 patternProperties:
+5 -3
sound/soc/fsl/fsl-asoc-card.c
··· 1033 1033 } 1034 1034 1035 1035 /* 1036 - * Properties "hp-det-gpio" and "mic-det-gpio" are optional, and 1036 + * Properties "hp-det-gpios" and "mic-det-gpios" are optional, and 1037 1037 * simple_util_init_jack() uses these properties for creating 1038 1038 * Headphone Jack and Microphone Jack. 1039 1039 * 1040 1040 * The notifier is initialized in snd_soc_card_jack_new(), then 1041 1041 * snd_soc_jack_notifier_register can be called. 1042 1042 */ 1043 - if (of_property_read_bool(np, "hp-det-gpio")) { 1043 + if (of_property_read_bool(np, "hp-det-gpios") || 1044 + of_property_read_bool(np, "hp-det-gpio") /* deprecated */) { 1044 1045 ret = simple_util_init_jack(&priv->card, &priv->hp_jack, 1045 1046 1, NULL, "Headphone Jack"); 1046 1047 if (ret) ··· 1050 1049 snd_soc_jack_notifier_register(&priv->hp_jack.jack, &hp_jack_nb); 1051 1050 } 1052 1051 1053 - if (of_property_read_bool(np, "mic-det-gpio")) { 1052 + if (of_property_read_bool(np, "mic-det-gpios") || 1053 + of_property_read_bool(np, "mic-det-gpio") /* deprecated */) { 1054 1054 ret = simple_util_init_jack(&priv->card, &priv->mic_jack, 1055 1055 0, NULL, "Mic Jack"); 1056 1056 if (ret)