From 02226256082badea2d76ff0b467c9cce3da47531 Mon Sep 17 00:00:00 2001 From: Andriy Gapon Date: Mon, 1 Jul 2019 15:43:48 +0000 Subject: [PATCH] nctgpio: change default pin names to those used by the datasheet(s) That is, instead of the current GPIO00 - GPIO15 the names will be GPIO00 - GPIO07, GPIO10 - GPIO17. The first digit is a GPIO "bank" / group number and the second one is a pin number within the bank. Alternative view is that the pin names are changed from decimal numbering scheme to octal one (as there are 8 pins per bank). Discussed with: cem, gonzo MFC after: 2 weeks --- sys/dev/nctgpio/nctgpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/nctgpio/nctgpio.c b/sys/dev/nctgpio/nctgpio.c index e0edbd975f89..eb86b0a9e5eb 100644 --- a/sys/dev/nctgpio/nctgpio.c +++ b/sys/dev/nctgpio/nctgpio.c @@ -529,7 +529,7 @@ nct_attach(device_t dev) pin->gp_caps = NCT_GPIO_CAPS; pin->gp_flags = 0; - snprintf(pin->gp_name, GPIOMAXNAME, "GPIO%02u", i); + snprintf(pin->gp_name, GPIOMAXNAME, "GPIO%02o", i); pin->gp_name[GPIOMAXNAME - 1] = '\0'; if (nct_pin_is_input(sc, i))