diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-07-02 20:30:17 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2019-07-04 03:48:49 -0400 |
commit | a705f9c1798d1da0f4b67956371ef539c273b31c (patch) | |
tree | 0ed98617560f6efe2ab9ba90888a85d851afaaee /drivers/pinctrl/intel | |
parent | 57218371d5ed1a6790675aad3a17c453baf2d1f2 (diff) |
pinctrl: baytrail: Use defined macro instead of magic in byt_get_gpio_mux()
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>
Diffstat (limited to 'drivers/pinctrl/intel')
-rw-r--r-- | drivers/pinctrl/intel/pinctrl-baytrail.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index 18d9ad504194..c72d831ca8b6 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c | |||
@@ -91,6 +91,7 @@ | |||
91 | * does not find a match for the requested function. | 91 | * does not find a match for the requested function. |
92 | */ | 92 | */ |
93 | #define BYT_DEFAULT_GPIO_MUX 0 | 93 | #define BYT_DEFAULT_GPIO_MUX 0 |
94 | #define BYT_ALTER_GPIO_MUX 1 | ||
94 | 95 | ||
95 | struct byt_gpio_pin_context { | 96 | struct byt_gpio_pin_context { |
96 | u32 conf0; | 97 | u32 conf0; |
@@ -932,14 +933,14 @@ static u32 byt_get_gpio_mux(struct byt_gpio *vg, unsigned int offset) | |||
932 | /* SCORE pin 92-93 */ | 933 | /* SCORE pin 92-93 */ |
933 | if (!strcmp(vg->soc_data->uid, BYT_SCORE_ACPI_UID) && | 934 | if (!strcmp(vg->soc_data->uid, BYT_SCORE_ACPI_UID) && |
934 | offset >= 92 && offset <= 93) | 935 | offset >= 92 && offset <= 93) |
935 | return 1; | 936 | return BYT_ALTER_GPIO_MUX; |
936 | 937 | ||
937 | /* SUS pin 11-21 */ | 938 | /* SUS pin 11-21 */ |
938 | if (!strcmp(vg->soc_data->uid, BYT_SUS_ACPI_UID) && | 939 | if (!strcmp(vg->soc_data->uid, BYT_SUS_ACPI_UID) && |
939 | offset >= 11 && offset <= 21) | 940 | offset >= 11 && offset <= 21) |
940 | return 1; | 941 | return BYT_ALTER_GPIO_MUX; |
941 | 942 | ||
942 | return 0; | 943 | return BYT_DEFAULT_GPIO_MUX; |
943 | } | 944 | } |
944 | 945 | ||
945 | static void byt_gpio_clear_triggering(struct byt_gpio *vg, unsigned int offset) | 946 | static void byt_gpio_clear_triggering(struct byt_gpio *vg, unsigned int offset) |