[libgpiod] Unexpected output of gpioinfo for claimed pins

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

during test of my latest BCM2835 DT patch series [1], i noticed a discrepancy between pinctrl debugfs and gpioinfo from libgpio on my Raspberry Pi 3 (linux-next, multi_v7_defconfig):

1. Pins configured as alternative function (e.g. pin 0 as alt0) are considered by gpioinfo as input even the get_direction callback of the pinctrl-bcm2835 returns -EINVAL in this case

2. Pins whose mux is claimed by a kernel driver (e.g. pin 0 by i2c) are considered by gpioinfo as unused

I think this is very confusing for users. For completeness the relevant outputs are below.

Where does this needs to be fixed (pinctrl/gpio driver, gpiolib, libgpiod)?

Best regards
Stefan

Output of pinmux-pins:
pin 0 (gpio0): 3f205000.i2c (GPIO UNCLAIMED) function alt0 group gpio0
pin 1 (gpio1): 3f205000.i2c (GPIO UNCLAIMED) function alt0 group gpio1
pin 2 (gpio2): 3f804000.i2c (GPIO UNCLAIMED) function alt0 group gpio2
pin 3 (gpio3): 3f804000.i2c (GPIO UNCLAIMED) function alt0 group gpio3
pin 4 (gpio4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 5 (gpio5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 6 (gpio6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 7 (gpio7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 8 (gpio8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 9 (gpio9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 10 (gpio10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 11 (gpio11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 12 (gpio12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 13 (gpio13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 14 (gpio14): 3f215040.serial (GPIO UNCLAIMED) function alt5 group gpio14
pin 15 (gpio15): 3f215040.serial (GPIO UNCLAIMED) function alt5 group gpio15
pin 16 (gpio16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 17 (gpio17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 18 (gpio18): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 19 (gpio19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (gpio20): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 21 (gpio21): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 22 (gpio22): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 23 (gpio23): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 24 (gpio24): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 25 (gpio25): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 26 (gpio26): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 27 (gpio27): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 28 (gpio28): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 29 (gpio29): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 30 (gpio30): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 31 (gpio31): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 32 (gpio32): 3f201000.serial (GPIO UNCLAIMED) function alt3 group gpio32
pin 33 (gpio33): 3f201000.serial (GPIO UNCLAIMED) function alt3 group gpio33
pin 34 (gpio34): 3f300000.sdhci (GPIO UNCLAIMED) function alt3 group gpio34
pin 35 (gpio35): 3f300000.sdhci (GPIO UNCLAIMED) function alt3 group gpio35
pin 36 (gpio36): 3f300000.sdhci (GPIO UNCLAIMED) function alt3 group gpio36
pin 37 (gpio37): 3f300000.sdhci (GPIO UNCLAIMED) function alt3 group gpio37
pin 38 (gpio38): 3f300000.sdhci (GPIO UNCLAIMED) function alt3 group gpio38
pin 39 (gpio39): 3f300000.sdhci (GPIO UNCLAIMED) function alt3 group gpio39
pin 40 (gpio40): 3f20c000.pwm (GPIO UNCLAIMED) function alt0 group gpio40
pin 41 (gpio41): 3f20c000.pwm (GPIO UNCLAIMED) function alt0 group gpio41
pin 42 (gpio42): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 43 (gpio43): 3f201000.serial (GPIO UNCLAIMED) function alt0 group gpio43
pin 44 (gpio44): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 45 (gpio45): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 46 (gpio46): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 47 (gpio47): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 48 (gpio48): 3f202000.mmc (GPIO UNCLAIMED) function alt0 group gpio48
pin 49 (gpio49): 3f202000.mmc (GPIO UNCLAIMED) function alt0 group gpio49
pin 50 (gpio50): 3f202000.mmc (GPIO UNCLAIMED) function alt0 group gpio50
pin 51 (gpio51): 3f202000.mmc (GPIO UNCLAIMED) function alt0 group gpio51
pin 52 (gpio52): 3f202000.mmc (GPIO UNCLAIMED) function alt0 group gpio52
pin 53 (gpio53): 3f202000.mmc (GPIO UNCLAIMED) function alt0 group gpio53

Output of gpioinfo:
	line   0:     "ID_SDA"       unused   input  active-high 
	line   1:     "ID_SCL"       unused   input  active-high 
	line   2:       "SDA1"       unused   input  active-high 
	line   3:       "SCL1"       unused   input  active-high 
	line   4:  "GPIO_GCLK"       unused   input  active-high 
	line   5:      "GPIO5"       unused   input  active-high 
	line   6:      "GPIO6"       unused   input  active-high 
	line   7:  "SPI_CE1_N"       unused   input  active-high 
	line   8:  "SPI_CE0_N"       unused   input  active-high 
	line   9:   "SPI_MISO"       unused   input  active-high 
	line  10:   "SPI_MOSI"       unused   input  active-high 
	line  11:   "SPI_SCLK"       unused   input  active-high 
	line  12:     "GPIO12"       unused   input  active-high 
	line  13:     "GPIO13"       unused   input  active-high 
	line  14:       "TXD1"       unused   input  active-high 
	line  15:       "RXD1"       unused   input  active-high 
	line  16:     "GPIO16"       unused   input  active-high 
	line  17:     "GPIO17"       unused   input  active-high 
	line  18:     "GPIO18"       unused   input  active-high 
	line  19:     "GPIO19"       unused   input  active-high 
	line  20:     "GPIO20"       unused   input  active-high 
	line  21:     "GPIO21"       unused   input  active-high 
	line  22:     "GPIO22"       unused   input  active-high 
	line  23:     "GPIO23"       unused   input  active-high 
	line  24:     "GPIO24"       unused   input  active-high 
	line  25:     "GPIO25"       unused   input  active-high 
	line  26:     "GPIO26"       unused   input  active-high 
	line  27:     "GPIO27"       unused   input  active-high 
	line  28:      unnamed       unused   input  active-high 
	line  29: "LAN_RUN_BOOT" unused input active-high 
	line  30:       "CTS0"       unused   input  active-high 
	line  31:       "RTS0"       unused   input  active-high 
	line  32:       "TXD0"       unused   input  active-high 
	line  33:       "RXD0"       unused   input  active-high 
	line  34:    "SD1_CLK"       unused   input  active-high 
	line  35:    "SD1_CMD"       unused   input  active-high 
	line  36:  "SD1_DATA0"       unused   input  active-high 
	line  37:  "SD1_DATA1"       unused   input  active-high 
	line  38:  "SD1_DATA2"       unused   input  active-high 
	line  39:  "SD1_DATA3"       unused   input  active-high 
	line  40:   "PWM0_OUT"       unused   input  active-high 
	line  41:   "PWM1_OUT"       unused   input  active-high 
	line  42:     "ETHCLK"       unused   input  active-high 
	line  43:   "WIFI_CLK"       unused   input  active-high 
	line  44:       "SDA0"       unused   input  active-high 
	line  45:       "SCL0"       unused   input  active-high 
	line  46:   "SMPS_SCL"       unused   input  active-high 
	line  47:   "SMPS_SDA"       unused  output  active-high 
	line  48:   "SD_CLK_R"       unused   input  active-high 
	line  49:   "SD_CMD_R"       unused   input  active-high 
	line  50: "SD_DATA0_R"       unused   input  active-high 
	line  51: "SD_DATA1_R"       unused   input  active-high 
	line  52: "SD_DATA2_R"       unused   input  active-high 
	line  53: "SD_DATA3_R"       unused   input  active-high

[1] - https://github.com/lategoodbye/rpi-zero/tree/bcm2835-dt-next



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux