svn commit: r349579 - head/sys/dev/nctgpio

Andriy Gapon avg at FreeBSD.org
Mon Jul 1 15:43:49 UTC 2019


Author: avg
Date: Mon Jul  1 15:43:48 2019
New Revision: 349579
URL: https://svnweb.freebsd.org/changeset/base/349579

Log:
  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

Modified:
  head/sys/dev/nctgpio/nctgpio.c

Modified: head/sys/dev/nctgpio/nctgpio.c
==============================================================================
--- head/sys/dev/nctgpio/nctgpio.c	Mon Jul  1 13:41:37 2019	(r349578)
+++ head/sys/dev/nctgpio/nctgpio.c	Mon Jul  1 15:43:48 2019	(r349579)
@@ -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))


More information about the svn-src-head mailing list