]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dm: acpi: Use correct GPIO polarity type in acpi_dp_add_gpio()
authorSimon Glass <sjg@chromium.org>
Tue, 22 Sep 2020 18:44:59 +0000 (12:44 -0600)
committerBin Meng <bmeng.cn@gmail.com>
Fri, 25 Sep 2020 03:27:14 +0000 (11:27 +0800)
This function currently accepts the IRQ-polarity type. Fix it to use the
GPIO type instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/sound/max98357a.c
include/acpi/acpi_dp.h
lib/acpi/acpi_dp.c
test/dm/acpi_dp.c

index 841bc6ef682d02cb85d184f2646a3ac71aeacd05..827262d235c7d491857d23c1d8e9f0b34aa83ded 100644 (file)
@@ -81,7 +81,7 @@ static int max98357a_acpi_fill_ssdt(const struct udevice *dev,
        dp = acpi_dp_new_table("_DSD");
        acpi_dp_add_gpio(dp, "sdmode-gpio", path, 0, 0,
                         priv->sdmode_gpio.flags & GPIOD_ACTIVE_LOW ?
-                        ACPI_IRQ_ACTIVE_LOW : ACPI_IRQ_ACTIVE_HIGH);
+                        ACPI_GPIO_ACTIVE_LOW : ACPI_GPIO_ACTIVE_HIGH);
        acpi_dp_add_integer(dp, "sdmode-delay",
                            dev_read_u32_default(dev, "sdmode-delay", 0));
        acpi_dp_write(ctx, dp);
index 0b514bce59ce038840763e566cb495e27f281b1f..5e539b1d218da6707598de63227cc09b97132642 100644 (file)
@@ -221,7 +221,7 @@ struct acpi_dp *acpi_dp_add_child(struct acpi_dp *dp, const char *name,
  */
 struct acpi_dp *acpi_dp_add_gpio(struct acpi_dp *dp, const char *name,
                                 const char *ref, int index, int pin,
-                                enum acpi_irq_polarity polarity);
+                                enum acpi_gpio_polarity polarity);
 
 /**
  * acpi_dp_write() - Write Device Property hierarchy and clean up resources
index 579cab4771512dd851fe0ce98371b8d8c94c6fa0..7e3e3259d8d477585af29e91ac338445254b4e3b 100644 (file)
@@ -324,7 +324,7 @@ struct acpi_dp *acpi_dp_add_integer_array(struct acpi_dp *dp, const char *name,
 
 struct acpi_dp *acpi_dp_add_gpio(struct acpi_dp *dp, const char *name,
                                 const char *ref, int index, int pin,
-                                enum acpi_irq_polarity polarity)
+                                enum acpi_gpio_polarity polarity)
 {
        struct acpi_dp *gpio;
 
@@ -336,7 +336,7 @@ struct acpi_dp *acpi_dp_add_gpio(struct acpi_dp *dp, const char *name,
        if (!acpi_dp_add_reference(gpio, NULL, ref) ||
            !acpi_dp_add_integer(gpio, NULL, index) ||
            !acpi_dp_add_integer(gpio, NULL, pin) ||
-           !acpi_dp_add_integer(gpio, NULL, polarity == ACPI_IRQ_ACTIVE_LOW))
+           !acpi_dp_add_integer(gpio, NULL, polarity == ACPI_GPIO_ACTIVE_LOW))
                return NULL;
 
        if (!acpi_dp_add_array(dp, gpio))
index e0fa61263c8a0a2acd465f2e70b221a8d773f12a..44bcabda6bc12083559c1cf0ba4220262997113d 100644 (file)
@@ -398,9 +398,9 @@ static int dm_test_acpi_dp_gpio(struct unit_test_state *uts)
 
        /* Try a few different parameters */
        ut_assertnonnull(acpi_dp_add_gpio(dp, "reset", TEST_REF, 0x23, 0x24,
-                                         ACPI_IRQ_ACTIVE_HIGH));
+                                         ACPI_GPIO_ACTIVE_HIGH));
        ut_assertnonnull(acpi_dp_add_gpio(dp, "allow", TEST_REF, 0, 0,
-                                         ACPI_IRQ_ACTIVE_LOW));
+                                         ACPI_GPIO_ACTIVE_LOW));
 
        ptr = acpigen_get_current(ctx);
        ut_assertok(acpi_dp_write(ctx, dp));