[Help] 無 /sys/class/gpio 目錄? [論壇 - 新手村]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊

(1) 2 3 »


[Help] 無 /sys/class/gpio 目錄?
會員二級
註冊日期:
2007/1/13 14:26
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 178
MP : 28 / 6207
EXP: 12
離線
Hi all,

用 ubuntu 12.04.5 32Bits 安裝好的系統.
不知為何 無 /sys/class/gpio 目錄?

Thanx.

2017/3/4 22:23
應用擴展 工具箱
回覆: [Help] 無 /sys/class/gpio 目錄?
會員三級
註冊日期:
2016/4/18 12:29
所屬群組:
已註冊使用者
等級: 9
HP : 0 / 217
MP : 38 / 1693
EXP: 70
離線
你原本的環境是?
剛剛找了一下這是嵌入式再用的,或是編譯核心時打開的
如果是嵌入式的裝置有可能是其他人弄上去的
所以還是要看一下你原本的環境

2017/3/6 17:24
應用擴展 工具箱
回覆: [Help] 無 /sys/class/gpio 目錄?
會員二級
註冊日期:
2007/1/13 14:26
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 178
MP : 28 / 6207
EXP: 12
離線
安裝Lancer大的Ubuntu MAC Style 三代 (12.04LTS) 會有.

2017/3/6 18:27
應用擴展 工具箱
回覆: [Help] 無 /sys/class/gpio 目錄?
會員二級
註冊日期:
2013/11/7 9:24
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 186
MP : 30 / 2786
EXP: 46
離線
wilhelm 寫到:
Hi all,

用 ubuntu 12.04.5 32Bits 安裝好的系統.
不知為何 無 /sys/class/gpio 目錄?

Thanx.


要先回到你的需求,你要/sys/class/gpio這個東西做什麼用?這個界面必需要對應到一個實體的設備才可能有實際的作用,所以,就算是重新編一份自己的kernel,且同時把這個選項打開了,基本上,除非有實體的對應,否則也不會有任何作用。

所以還是要回到你的基本需求,你到底想要什麼樣的功能或機制?

2017/3/7 9:25
應用擴展 工具箱
回覆: [Help] 無 /sys/class/gpio 目錄?
會員二級
註冊日期:
2007/1/13 14:26
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 178
MP : 28 / 6207
EXP: 12
離線
有特殊孔位想用. 如附圖.

附件:



jpg  P5.jpg (44.60 KB)
3133_58be7f55ecb7c.jpg 288X193 px

2017/3/7 17:37
應用擴展 工具箱
回覆: [Help] 無 /sys/class/gpio 目錄?
會員二級
註冊日期:
2013/11/7 9:24
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 186
MP : 30 / 2786
EXP: 46
離線
wilhelm 寫到:
有特殊孔位想用. 如附圖.


單從照片中無法確認你要用GPIO來控制哪一個界面,但是在你要用GPIO來控制之前,有幾件事你可能要先確認:
1/你是否有這個機器的電路圖?因為你要控制它之前,先得知道該界面連結到哪一個腳位。
2/編譯出這個控制界面,不代表你可以透過它來做任一GPIO腳位的控制,你必需在GPIO控制界面(driver層)的初始化階段,把1的的腳位對應好並正確的初始化。

至少這兩件事情要先搞定,才有可能去玩它。

2017/3/7 18:16
應用擴展 工具箱
回覆: [Help] 無 /sys/class/gpio 目錄?
會員三級
註冊日期:
2016/4/18 12:29
所屬群組:
已註冊使用者
等級: 9
HP : 0 / 217
MP : 38 / 1693
EXP: 70
離線

wilhelm

應該是這台

http://www.flytech.com.tw/product/21/POS5000



GPIO應該長這樣
http://preview.acceed.info/images/news/artila-pac-4xxx-news.jpg


你那台上面沒有GPIO可以控制,倒是有很多232,除非你插IO卡然後控制IO
然後我覺得你方向錯了,以RS232而言雖然他有9 Pin但不代表你可以完全控制這9 Pin,原因你需要有點硬體的知識,這不難只怕偏離你的本質學能太多,你會花太多時間有痛苦
建議你找一下linux COM port可能較有幫助或是說出你真正的問題

PS.他規格上不是有linux,沒有相關同仁或業務問?

2017/3/7 18:50
應用擴展 工具箱
回覆: [Help] 無 /sys/class/gpio 目錄?
會員二級
註冊日期:
2007/1/13 14:26
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 178
MP : 28 / 6207
EXP: 12
離線
哇 ubuntu_net2016 連機器都查出來...

那機器上有RJ12孔, 是需要用到gpio.

系統要有GPIO 是應該compile kernel ? 3Q.

2017/3/7 22:35
應用擴展 工具箱
回覆: [Help] 無 /sys/class/gpio 目錄?
會員五級
註冊日期:
2012/4/22 10:50
所屬群組:
已註冊使用者
等級: 34
HP : 165 / 829
MP : 545 / 16138
EXP: 19
離線
先聲明,我對這個議題完全不懂 :p

以下是我看到這篇討論,目前有探索到的簡易紀錄,提供參考,跟樓主原本要問的解答沒直接關係。

我的系統是「Xubuntu 16.04 amd64 英文界面」。

在我的環境是有「/sys/class/gpio」這個資料夾,我沒做什麼特別的設定,也沒特別外接啥硬體。


執行


$ sudo ls /sys/class/gpio -l



顯示


total 0
--w------- 1 root root 4096 Mar 7 22:31 export
--w------- 1 root root 4096 Mar 7 22:14 unexport




然後查詢「wikipedia」

https://zh.wikipedia.org/zh-tw/GPIO
https://en.wikipedia.org/wiki/General-purpose_input/output

可以找到下面這個網址
https://www.kernel.org/doc/Documentation/gpio/gpio.txt


於是我忽然想到可以執行下面的指令,剛剛「回覆」才用到的指令



$ apt-file search gpio



顯示


airspy: /usr/bin/airspy_gpio
airspy: /usr/bin/airspy_gpiodir
airspy: /usr/share/man/man1/airspy_gpio.1.gz
airspy: /usr/share/man/man1/airspy_gpiodir.1.gz
freebsd-manpages: /usr/share/man/man4/gpio.4freebsd.gz
freebsd-manpages: /usr/share/man/man4/gpiobus.4freebsd.gz
freebsd-manpages: /usr/share/man/man4/gpioiic.4freebsd.gz
freebsd-manpages: /usr/share/man/man4/gpioled.4freebsd.gz
fso-deviced: /usr/lib/x86_64-linux-gnu/cornucopia/modules/fsodevice/gpio_input.so
gcc-arm-linux-androideabi: /usr/arm-linux-androideabi/include/asm/arch/gpio-switch.h
gcc-arm-linux-androideabi: /usr/arm-linux-androideabi/include/asm/arch/gpio.h
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/meta/brd.png
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/meta/icon.png
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/meta/info.html
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/raspberrypi-gpio-cache.lib
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/raspberrypi-gpio.cmp
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/raspberrypi-gpio.kicad_pcb
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/raspberrypi-gpio.net
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/raspberrypi-gpio.pro
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/raspberrypi-gpio.sch
kicad-common: /usr/share/kicad/template/raspberrypi-gpio/raspberrypi-gpio.stf
libdc1394-22-doc: /usr/share/doc/libdc1394-22-doc/html/struct____dc1394__pxl__gpio__info__struct.html
libola-dev: /usr/lib/x86_64-linux-gnu/libolagpio.a
libola-dev: /usr/lib/x86_64-linux-gnu/libolagpio.so
libola-dev: /usr/lib/x86_64-linux-gnu/libolagpiocore.a
libola-dev: /usr/lib/x86_64-linux-gnu/libolagpiocore.so
libola1: /usr/lib/x86_64-linux-gnu/libolagpio.so.0
libola1: /usr/lib/x86_64-linux-gnu/libolagpio.so.0.0.0
libola1: /usr/lib/x86_64-linux-gnu/libolagpiocore.so.0
libola1: /usr/lib/x86_64-linux-gnu/libolagpiocore.so.0.0.0
linux-doc: /usr/share/doc/linux-doc/ABI/testing/sysfs-gpio
...略...
linux-doc: /usr/share/doc/linux-doc/zh_CN/gpio.txt.gz
linux-firmware: /lib/firmware/carl9170fw/carlfw/include/gpio.h
linux-firmware: /lib/firmware/carl9170fw/carlfw/src/gpio.c
linux-headers-4.4.0-21: /usr/src/linux-headers-4.4.0-21/arch/alpha/include/asm/gpio.h
...略...
linux-headers-4.4.0-21: /usr/src/linux-headers-4.4.0-21/include/trace/events/gpio.h
linux-headers-4.4.0-21-generic: /usr/src/linux-headers-4.4.0-21-generic/include/config/arch/want/optional/gpiolib.h
...略...
linux-headers-4.4.0-21-generic: /usr/src/linux-headers-4.4.0-21-generic/include/config/w1/master/gpio.h
linux-headers-4.4.0-21-lowlatency: /usr/src/linux-headers-4.4.0-21-lowlatency/include/config/arch/want/optional/gpiolib.h
...略...
linux-headers-4.4.0-21-lowlatency: /usr/src/linux-headers-4.4.0-21-lowlatency/include/config/w1/master/gpio.h
linux-headers-4.4.0-22: /usr/src/linux-headers-4.4.0-22/arch/alpha/include/asm/gpio.h
...略...
linux-headers-4.4.0-22: /usr/src/linux-headers-4.4.0-22/include/trace/events/gpio.h
linux-headers-4.4.0-22-generic: /usr/src/linux-headers-4.4.0-22-generic/include/config/arch/want/optional/gpiolib.h
...略...
linux-headers-4.4.0-22-lowlatency: /usr/src/linux-headers-4.4.0-22-lowlatency/include/config/w1/master/gpio.h
linux-image-4.4.0-21-lowlatency: /lib/modules/4.4.0-21-lowlatency/kernel/drivers/extcon/extcon-gpio.ko
...略...
linux-image-4.4.0-21-lowlatency: /lib/modules/4.4.0-21-lowlatency/kernel/net/rfkill/rfkill-gpio.ko
linux-image-4.4.0-22-lowlatency: /lib/modules/4.4.0-22-lowlatency/kernel/drivers/extcon/extcon-gpio.ko
...略...
linux-image-4.4.0-22-lowlatency: /lib/modules/4.4.0-22-lowlatency/kernel/net/rfkill/rfkill-gpio.ko
linux-image-extra-4.4.0-21-generic: /lib/modules/4.4.0-21-generic/kernel/drivers/extcon/extcon-gpio.ko
...略...
linux-image-extra-4.4.0-21-generic: /lib/modules/4.4.0-21-generic/kernel/net/rfkill/rfkill-gpio.ko
linux-image-extra-4.4.0-22-generic: /lib/modules/4.4.0-22-generic/kernel/drivers/extcon/extcon-gpio.ko
...略...
linux-image-extra-4.4.0-22-generic: /lib/modules/4.4.0-22-generic/kernel/net/rfkill/rfkill-gpio.ko
lttng-modules-dkms: /usr/src/lttng-modules-2.7.1/instrumentation/events/lttng-module/gpio.h
lttng-modules-dkms: /usr/src/lttng-modules-2.7.1/instrumentation/events/mainline/gpio.h
lttng-modules-dkms: /usr/src/lttng-modules-2.7.1/probes/lttng-probe-gpio.c
mingw-w64-common: /usr/share/mingw-w64/include/gpio.h
mingw-w64-i686-dev: /usr/i686-w64-mingw32/include/gpio.h
mingw-w64-x86-64-dev: /usr/x86_64-w64-mingw32/include/gpio.h
openocd: /usr/share/openocd/scripts/interface/sysfsgpio-raspberrypi.cfg
openwince-include: /usr/include/openwince/arm/pxa2x0/gpio.h
openwince-include: /usr/include/openwince/arm/sa11x0/gpio.h
oss4-dkms: /usr/src/oss4-4.2-build2010/drivers/hdaudio_gpio_handlers.c
rtl8812au-dkms: /usr/src/rtl8812au-4.3.8.12175.20140902+dfsg/os_dep/linux/custom_gpio_linux.c
smp-utils: /usr/bin/smp_read_gpio
smp-utils: /usr/bin/smp_write_gpio
smp-utils: /usr/share/man/man8/smp_read_gpio.8.gz
smp-utils: /usr/share/man/man8/smp_write_gpio.8.gz
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/GeneralIOC.nc
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/HalPXA27xGeneralIOM.nc
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/HalPXA27xGpioCapture.nc
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/HalPXA27xGpioInterrupt.nc
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/HalPXA27xSoftCaptureC.nc
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/HalPXA27xSoftCaptureP.nc
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/HplPXA27xGPIO.nc
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/HplPXA27xGPIOC.nc
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/HplPXA27xGPIOM.nc
tinyos-source: /usr/src/tinyos/tos/chips/pxa27x/gpio/HplPXA27xGPIOPin.nc
tinyos-source: /usr/src/tinyos/tos/lib/gpio/SoftCaptureC.nc
tinyos-source: /usr/src/tinyos/tos/lib/gpio/SoftCaptureP.nc
tinyos-source: /usr/src/tinyos/tos/lib/gpio/SoftIrqC.nc
tinyos-source: /usr/src/tinyos/tos/lib/gpio/SoftIrqP.nc
uhd-host: /usr/lib/uhd/examples/gpio
uhd-host: /usr/share/doc/uhd-host/doxygen/html/e3x0_gpio_conn.png
uhd-host: /usr/share/doc/uhd-host/doxygen/html/gpio__api_8dox.html
uhd-host: /usr/share/doc/uhd-host/doxygen/html/page_gpio_api.html




然後執行下面指令,安裝「linux-doc


$ sudo apt-get install linux-doc




安裝完後,執行



$ dpkg -L linux-doc | grep gpio



顯示


/usr/share/doc/linux-doc/gpio
/usr/share/doc/linux-doc/gpio/gpio-legacy.txt.gz
/usr/share/doc/linux-doc/gpio/00-INDEX
/usr/share/doc/linux-doc/gpio/board.txt.gz
/usr/share/doc/linux-doc/gpio/drivers-on-gpio.txt.gz
/usr/share/doc/linux-doc/gpio/consumer.txt.gz
/usr/share/doc/linux-doc/gpio/sysfs.txt.gz
/usr/share/doc/linux-doc/gpio/gpio.txt.gz
/usr/share/doc/linux-doc/gpio/driver.txt.gz
/usr/share/doc/linux-doc/acpi/gpio-properties.txt.gz
/usr/share/doc/linux-doc/html/alsa-driver-api/API-snd-soc-jack-add-gpiods.html
/usr/share/doc/linux-doc/html/alsa-driver-api/API-snd-soc-jack-add-gpios.html
/usr/share/doc/linux-doc/html/alsa-driver-api/API-struct-snd-soc-jack-gpio.html
/usr/share/doc/linux-doc/html/alsa-driver-api/API-snd-soc-jack-free-gpios.html
/usr/share/doc/linux-doc/input/gpio-tilt.txt
/usr/share/doc/linux-doc/ABI/testing/sysfs-gpio
/usr/share/doc/linux-doc/w1/masters/w1-gpio
/usr/share/doc/linux-doc/zh_CN/gpio.txt.gz
/usr/share/doc/linux-doc/i2c/muxes/i2c-mux-gpio
/usr/share/doc/linux-doc/bt8xxgpio.txt.gz
/usr/share/doc/linux-doc/blackfin/bfin-gpio-notes.txt
/usr/share/doc/linux-doc/devicetree/bindings/mtd/gpio-control-nand.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-mm-lantiq.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-poweroff.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-twl4030.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-nmk.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/spear_spics.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/nvidia,tegra20-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-mcp23s08.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-palmas.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-74x164.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/cavium-octeon-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-stp-xway.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-stmpe.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-xlp.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-zevio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-mpc8xxx.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/moxa,moxart-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/pl061-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-clps711x.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-adnp.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-pca953x.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-mvebu.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-xilinx.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio_lpc32xx.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/netxbig-gpio-ext.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/brcm,brcmstb-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-xgene.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-samsung.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/abilis,tb10x-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-pcf857x.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/mrvl-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-atlas7.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/fujitsu,mb86s70-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio.txt.gz
/usr/share/doc/linux-doc/devicetree/bindings/gpio/zx296702-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-grgpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio_atmel.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-altera.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/snps-dwapb-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/renesas,gpio-rcar.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-xgene-sb.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/nxp,lpc1850-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-zynq.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-davinci.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/sodaville.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-max732x.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-ath79.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-fan.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-vf610.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/brcm,kona-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-stericsson-coh901.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-mxs.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-restart.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-lp3943.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-74xx-mmio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-dsp-keystone.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-tz1090-pdc.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/fsl-imx-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/8xxx_gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-etraxfs.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-sx150x.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-omap.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/gpio-tz1090.txt
/usr/share/doc/linux-doc/devicetree/bindings/gpio/cirrus,clps711x-mctrl-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/regulator/gpio-regulator.txt
/usr/share/doc/linux-doc/devicetree/bindings/leds/backlight/gpio-backlight.txt
/usr/share/doc/linux-doc/devicetree/bindings/leds/leds-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/pinctrl/qcom,pmic-gpio.txt.gz
/usr/share/doc/linux-doc/devicetree/bindings/pinctrl/brcm,cygnus-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/pinctrl/brcm,bcm2835-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/input/gpio-keys-polled.txt
/usr/share/doc/linux-doc/devicetree/bindings/input/gpio-matrix-keypad.txt
/usr/share/doc/linux-doc/devicetree/bindings/input/gpio-keys.txt
/usr/share/doc/linux-doc/devicetree/bindings/input/gpio-beeper.txt
/usr/share/doc/linux-doc/devicetree/bindings/spi/spi-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/powerpc/fsl/cpm_qe/gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/w1/w1-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/clock/gpio-mux-clock.txt
/usr/share/doc/linux-doc/devicetree/bindings/clock/gpio-gate-clock.txt
/usr/share/doc/linux-doc/devicetree/bindings/net/mdio-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/net/mdio-mux-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/watchdog/gpio-wdt.txt
/usr/share/doc/linux-doc/devicetree/bindings/i2c/i2c-mux-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/i2c/i2c-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/i2c/i2c-arb-gpio-challenge.txt
/usr/share/doc/linux-doc/devicetree/bindings/i2c/i2c-cbus-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/media/gpio-ir-receiver.txt
/usr/share/doc/linux-doc/devicetree/bindings/extcon/extcon-usb-gpio.txt
/usr/share/doc/linux-doc/devicetree/bindings/power_supply/gpio-charger.txt
/usr/share/doc/linux-doc/devicetree/bindings/pps/pps-gpio.txt




然後可以執行下面指令來觀看內容,


$ less /usr/share/doc/linux-doc/gpio/gpio.txt.gz



就可以看到跟剛剛「https://www.kernel.org/doc/Documentation/gpio/gpio.txt」一樣的內容。

以此類推

執行


$ less /usr/share/doc/linux-doc/gpio/sysfs.txt.gz



就可以看到「https://www.kernel.org/doc/Documentation/gpio/sysfs.txt」。
這篇有提到「/sys/class/gpio」這個路徑。


執行


$ less /usr/share/doc/linux-doc/gpio/driver.txt.gz



就可以看到「https://www.kernel.org/doc/Documentation/gpio/driver.txt」。


以上「less」可以改成「man」「vim」「view」...來觀看



執行


$ grep '/sys/class/gpio' /usr/share/doc/linux-doc/* -R



顯示


/usr/share/doc/linux-doc/ABI/testing/sysfs-gpio:What: /sys/class/gpio/
/usr/share/doc/linux-doc/ABI/testing/sysfs-gpio: /sys/class/gpio



執行


$ less /usr/share/doc/linux-doc/ABI/testing/sysfs-gpio




================================================================================

先執行


$ dpkg -l '*linux*'




可以看到


Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version              Architecture         Description
+++-===============================-====================-====================-======================
...略...
ii  linux-firmware                  1.157.8              all                  Firmware for Linux kernel drivers
...略...
ii  linux-headers-4.4.0-64-generic  4.4.0-64.85          amd64                Linux kernel headers for version 4.4.0 on 64 bit x86 SMP
...略...
ii  linux-image-4.4.0-64-generic    4.4.0-64.85          amd64                Linux kernel image for version 4.4.0 on 64 bit x86 SMP
...略...
ii  linux-image-4.4.0-64-generic    4.4.0-64.85          amd64                Linux kernel image for version 4.4.0 on 64 bit x86 SMP
...略...



執行


$ dpkg -L linux-firmware | grep gpio



顯示


/lib/firmware/carl9170fw/carlfw/include/gpio.h
/lib/firmware/carl9170fw/carlfw/src/gpio.c



執行


$ dpkg -L linux-image-4.4.0-64-generic | grep gpio



沒有任何顯示

執行


$ dpkg -L linux-image-extra-4.4.0-64-generic | grep gpio



顯示


/lib/modules/4.4.0-64-generic/kernel/drivers/mtd/maps/gpio-addr-flash.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/mtd/nand/gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/video/backlight/gpio_backlight.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-tps65912.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-max730x.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-arizona.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-crystalcove.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-max7301.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-ucb1400.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-it87.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-pcf857x.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-mcp23s08.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-wm831x.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-twl6040.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-da9052.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-f7188x.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-mc33880.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-104-idio-16.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-adp5520.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-sch.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-pca953x.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-ml-ioh.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-twl4030.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-dwapb.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-da9055.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-dln2.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-max732x.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-wm8350.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-amd8111.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-amdpt.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-ich.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-sch311x.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-rdc321x.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-adp5588.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-generic.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-max7300.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-janz-ttl.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-vx855.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-kempld.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-wm8994.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-lp3943.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/gpio/gpio-viperboard.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/regulator/gpio-regulator.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/hwmon/gpio-fan.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/leds/leds-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/leds/trigger/ledtrig-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/input/keyboard/gpio_keys_polled.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/input/keyboard/gpio_keys.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/input/misc/gpio_tilt_polled.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/input/misc/gpio-beeper.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/input/mouse/gpio_mouse.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/spi/spi-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/w1/masters/w1-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/net/phy/mdio-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/usb/phy/phy-gpio-vbus-usb.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/mfd/pcf50633-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/mfd/intel_quark_i2c_gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/i2c/muxes/i2c-mux-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/i2c/busses/i2c-cbus-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/i2c/busses/i2c-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/media/rc/gpio-ir-recv.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/extcon/extcon-usb-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/extcon/extcon-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/pps/clients/pps-gpio.ko
/lib/modules/4.4.0-64-generic/kernel/drivers/power/gpio-charger.ko
/lib/modules/4.4.0-64-generic/kernel/net/rfkill/rfkill-gpio.ko




執行


$ dpkg -L linux-headers-4.4.0-64-generic | grep gpio



顯示


/usr/src/linux-headers-4.4.0-64-generic/include/config/mtd/gpio
/usr/src/linux-headers-4.4.0-64-generic/include/config/mtd/gpio/addr.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/mtd/nand/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/viperboard.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/lp3943.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/tps6586x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/acpi.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/sch311x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/wm8350.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/dln2.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/mcp23s08.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/sx150x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/amdpt.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/crystal
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/crystal/cove.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/generic
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/generic/platform.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/dwapb.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/palmas.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/janz
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/janz/ttl.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/adp5520.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/104
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/104/idio
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/104/idio/16.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/it87.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/sch.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/ml
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/ml/ioh.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/max7300.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/ich.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/arizona.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/sysfs.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/wm831x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/kempld.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/max732x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/rc5t583.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/pca953x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/amd8111.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/vx855.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/twl4030.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/mc33880.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/intel
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/intel/mid.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/adp5588.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/f7188x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/tps65912.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/pcf857x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/wm8994.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/da9055.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/zx.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/max730x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/rdc321x.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/ucb1400.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/max7301.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/da9052.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/devres.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/generic.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/twl6040.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/lynxpoint.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpio/tps65910.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/regulator/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/sensors/gpio
/usr/src/linux-headers-4.4.0-64-generic/include/config/sensors/gpio/fan.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/leds/pca9532/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/leds/trigger/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/leds/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/input/gpio
/usr/src/linux-headers-4.4.0-64-generic/include/config/input/gpio/rotary
/usr/src/linux-headers-4.4.0-64-generic/include/config/input/gpio/rotary/encoder.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/input/gpio/beeper.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/input/gpio/tilt
/usr/src/linux-headers-4.4.0-64-generic/include/config/input/gpio/tilt/polled.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/keyboard/gpio
/usr/src/linux-headers-4.4.0-64-generic/include/config/keyboard/gpio/polled.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/keyboard/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/ssb/driver/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/spi/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/backlight/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/pcf50633/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/w1/master/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/usb/gpio
/usr/src/linux-headers-4.4.0-64-generic/include/config/usb/gpio/vbus.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/mfd/sm501/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/mfd/intel/quark/i2c/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/rfkill/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/tracing/events/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/charger/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/mdio/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpiolib
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpiolib/irqchip.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/i2c/cbus/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/i2c/mux/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/i2c/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/gpiolib.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/extcon/usb/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/extcon/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/ir/gpio
/usr/src/linux-headers-4.4.0-64-generic/include/config/ir/gpio/cir.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/pps/client/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/mouse/gpio.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/arch/want/optional/gpiolib.h
/usr/src/linux-headers-4.4.0-64-generic/include/config/bcma/driver/gpio.h



================================================================================

以上套件探索的技巧,可以參考紀錄在「[索引] 套件操作實務」裡面的案例。


報告完畢



2017/3/7 23:28
應用擴展 工具箱
回覆: [Help] 無 /sys/class/gpio 目錄?
會員二級
註冊日期:
2007/1/13 14:26
所屬群組:
已註冊使用者
等級: 8
HP : 0 / 178
MP : 28 / 6207
EXP: 12
離線
強!

2017/3/8 0:03
應用擴展 工具箱

(1) 2 3 »

 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.