]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
pinctrl: baytrail: Use defined macro instead of magic in byt_get_gpio_mux()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 3 Jul 2019 00:30:17 +0000 (03:30 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 4 Jul 2019 07:48:49 +0000 (09:48 +0200)
By the fact byt_get_gpio_mux() returns a value of mux settings as
it is represented in hardware. Use defined macro instead of magic numbers
to clarify this.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20190703003018.75186-1-andriy.shevchenko@linux.intel.com
Reviewed-By: Enrico Weigelt <info@metux.net>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/intel/pinctrl-baytrail.c

index 18d9ad504194788cd406dab062e9de52fca6d50f..c72d831ca8b6dfdb4867611b34c8c2fe2afc673a 100644 (file)
@@ -91,6 +91,7 @@
  * does not find a match for the requested function.
  */
 #define BYT_DEFAULT_GPIO_MUX   0
+#define BYT_ALTER_GPIO_MUX     1
 
 struct byt_gpio_pin_context {
        u32 conf0;
@@ -932,14 +933,14 @@ static u32 byt_get_gpio_mux(struct byt_gpio *vg, unsigned int offset)
        /* SCORE pin 92-93 */
        if (!strcmp(vg->soc_data->uid, BYT_SCORE_ACPI_UID) &&
            offset >= 92 && offset <= 93)
-               return 1;
+               return BYT_ALTER_GPIO_MUX;
 
        /* SUS pin 11-21 */
        if (!strcmp(vg->soc_data->uid, BYT_SUS_ACPI_UID) &&
            offset >= 11 && offset <= 21)
-               return 1;
+               return BYT_ALTER_GPIO_MUX;
 
-       return 0;
+       return BYT_DEFAULT_GPIO_MUX;
 }
 
 static void byt_gpio_clear_triggering(struct byt_gpio *vg, unsigned int offset)