Unverified Commit 1a22f701 authored by Mark Brown's avatar Mark Brown
Browse files

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.
parents c6e86e19 e58b3914
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -37,8 +37,14 @@ properties:
  pa-gpios:
    maxItems: 1
  hp-det-gpio:
    deprecated: true
    maxItems: 1
  hp-det-gpios:
    maxItems: 1
  mic-det-gpio:
    deprecated: true
    maxItems: 1
  mic-det-gpios:
    maxItems: 1

required:
+12 −0
Original line number Diff line number Diff line
@@ -207,8 +207,14 @@ properties:
  simple-audio-card,pin-switches:
    $ref: "#/definitions/pin-switches"
  simple-audio-card,hp-det-gpio:
    deprecated: true
    maxItems: 1
  simple-audio-card,hp-det-gpios:
    maxItems: 1
  simple-audio-card,mic-det-gpio:
    deprecated: true
    maxItems: 1
  simple-audio-card,mic-det-gpios:
    maxItems: 1

patternProperties:
@@ -256,8 +262,14 @@ patternProperties:
      pin-switches:
        $ref: "#/definitions/pin-switches"
      hp-det-gpio:
        deprecated: true
        maxItems: 1
      hp-det-gpios:
        maxItems: 1
      mic-det-gpio:
        deprecated: true
        maxItems: 1
      mic-det-gpios:
        maxItems: 1

    patternProperties:
+5 −3
Original line number Diff line number Diff line
@@ -1033,14 +1033,15 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
	}

	/*
	 * Properties "hp-det-gpio" and "mic-det-gpio" are optional, and
	 * Properties "hp-det-gpios" and "mic-det-gpios" are optional, and
	 * simple_util_init_jack() uses these properties for creating
	 * Headphone Jack and Microphone Jack.
	 *
	 * The notifier is initialized in snd_soc_card_jack_new(), then
	 * snd_soc_jack_notifier_register can be called.
	 */
	if (of_property_read_bool(np, "hp-det-gpio")) {
	if (of_property_read_bool(np, "hp-det-gpios") ||
	    of_property_read_bool(np, "hp-det-gpio") /* deprecated */) {
		ret = simple_util_init_jack(&priv->card, &priv->hp_jack,
					    1, NULL, "Headphone Jack");
		if (ret)
@@ -1049,7 +1050,8 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
		snd_soc_jack_notifier_register(&priv->hp_jack.jack, &hp_jack_nb);
	}

	if (of_property_read_bool(np, "mic-det-gpio")) {
	if (of_property_read_bool(np, "mic-det-gpios") ||
	    of_property_read_bool(np, "mic-det-gpio") /* deprecated */) {
		ret = simple_util_init_jack(&priv->card, &priv->mic_jack,
					    0, NULL, "Mic Jack");
		if (ret)