diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2018-12-22 13:12:31 +0300 |
---|---|---|
committer | Wim Van Sebroeck <wim@linux-watchdog.org> | 2018-12-24 10:27:56 +0300 |
commit | d2b911db8b73bc6bfa163515b4ff142fb0dda66d (patch) | |
tree | dead72124a5d5310ca43417ea07af78fb7a981c5 /arch/mips | |
parent | 22ec9bb1cbcd613c73476ccd8f6a5e8c77793f66 (diff) | |
download | linux-d2b911db8b73bc6bfa163515b4ff142fb0dda66d.tar.xz |
watchdog: mtx-1: Convert to use GPIO descriptor
This converts the MTX-1 driver to grab a GPIO descriptor
associated with the device instead of using a resource with
a global GPIO number. Augment the driver and the boardfile.
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Paul Burton <paul.burton@mips.com>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Paul Burton <paul.burton@mips.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/alchemy/board-mtx1.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/mips/alchemy/board-mtx1.c b/arch/mips/alchemy/board-mtx1.c index d625e6f99ae7..9d9d4ee31605 100644 --- a/arch/mips/alchemy/board-mtx1.c +++ b/arch/mips/alchemy/board-mtx1.c @@ -24,6 +24,7 @@ #include <linux/platform_device.h> #include <linux/leds.h> #include <linux/gpio.h> +#include <linux/gpio/machine.h> #include <linux/gpio_keys.h> #include <linux/input.h> #include <linux/mtd/partitions.h> @@ -130,20 +131,18 @@ static struct platform_device mtx1_button = { } }; -static struct resource mtx1_wdt_res[] = { - [0] = { - .start = 215, - .end = 215, - .name = "mtx1-wdt-gpio", - .flags = IORESOURCE_IRQ, - } +static struct gpiod_lookup_table mtx1_wdt_gpio_table = { + .dev_id = "mtx1-wdt.0", + .table = { + /* Global number 215 is offset 15 on Alchemy GPIO 2 */ + GPIO_LOOKUP("alchemy-gpio2", 15, NULL, GPIO_ACTIVE_HIGH), + { }, + }, }; static struct platform_device mtx1_wdt = { .name = "mtx1-wdt", .id = 0, - .num_resources = ARRAY_SIZE(mtx1_wdt_res), - .resource = mtx1_wdt_res, }; static const struct gpio_led default_leds[] = { @@ -310,6 +309,7 @@ static int __init mtx1_register_devices(void) } gpio_direction_input(mtx1_gpio_button[0].gpio); out: + gpiod_add_lookup_table(&mtx1_wdt_gpio_table); return platform_add_devices(mtx1_devs, ARRAY_SIZE(mtx1_devs)); } arch_initcall(mtx1_register_devices); |