Repository: TexasInstruments/processor-sdk-doc
Pull request #234: Updated Kernel GPIO driver doc with examples and command-line tools
Author: login: jonaswood01
Created: 2025-04-01T21:11:07Z | Merged: 2025-04-03T18:26:57Z

In response to the Linux Kernel GPIO in the SDK Docs feeling insufficient. So, this update walks someone through a quick example for using GPIO in user space and provides resources for command-line tools and additional guides.


Diff:
diff --git a/source/images/sk-am62b-p1-top-2.png b/source/images/sk-am62b-p1-top-2.png
new file mode 100644
index 000000000..ee8ff234c
Binary files /dev/null and b/source/images/sk-am62b-p1-top-2.png differ
diff --git a/source/images/sk-am62b-p1-top.png b/source/images/sk-am62b-p1-top.png
new file mode 100644
index 000000000..c4680380c
Binary files /dev/null and b/source/images/sk-am62b-p1-top.png differ
diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
index 268b9b286..677b3ae0c 100644
--- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
+++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
@@ -1,9 +1,8 @@
-.. http://processors.wiki.ti.com/index.php/Processor_SDK_Linux_GPIO_Driver_Overview
-
 .. please note that there is no GPIO user guide from LCPD
 
+----
 GPIO
----------------------------------
+----
 
 .. rubric:: GPIO Driver Overview
    :name: gpio-driver-overview
@@ -48,33 +47,192 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
+
+.. note ::
 
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
+   Since Linux 4.8, the GPIO sysfs interface is deprecated. User space should use the character device instead.
 
+Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
 
-.. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
-   the character device instead.
+#. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+   - This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+   .. Image:: /images/sk-am62b-p1-top.png
+      :width: 625
+
+#. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+      $ gpiodetect
+      gpiochip0 [600000.gpio] (92 lines)
+      gpiochip1 [601000.gpio] (52 lines)
+      gpiochip2 [1-0022] (24 lines)
+
+   - This shows 92+52+24=168 total GPIO lines available across 3 GPIO chips: 0, 1, and 2.
+
+#. Read info for every available **gpiochip**:
+
+   .. code-block:: console
+
+      $ gpioinfo
+      gpiochip0 - 92 lines:
+               line   0:       unnamed                 input
+               line   1:       unnamed                 input
+               {...}
+               line  91:       unnamed                 input
+      gpiochip1 - 52 lines:
+               line   0:       unnamed                 input
+               line   1:       unnamed                 input
+               {...}
+               line  51:       unnamed                 input
+      gpiochip2 - 24 lines:
+               line   0:       "GPIO_CPSW2_RST"        input
+               line   1:       "GPIO_CPSW1_RST"        input
+               {...}
+               line  23:       "IO_EXP_TEST_LED"       input
+
+   - This should result in a large output, 168+ lines in this case. It outputs all GPIO lines available on every GPIO chip, as well as their names and input/output directions. The above output is truncated.
+
+   - For more info on *gpioinfo*, see its man page: https://libgpiod.readthedocs.io/en/latest/gpioinfo.html.
+
+   - To see info for a specific GPIO chip, use the '-c' flag and the GPIO chip number.
+
+#. Read info for **gpiochip2** (for this example):
+
+   .. code-block:: console
+
+      $ gpioinfo -c 2
+      gpiochip2 - 24 lines:
+               line   0:       "GPIO_CPSW2_RST"        input
+               line   1:       "GPIO_CPSW1_RST"        input
+               line   2:       "PRU_DETECT"            input
+               line   3:       "MMC1_SD_EN"            output consumer="regulator-3"
+               line   4:       "VPP_LDO_EN"            input
+               line   5:       "EXP_PS_3V3_En"         input
+               line   6:       "EXP_PS_5V0_En"         input
+               line   7:       "EXP_HAT_DETECT"        input
+               line   8:       "GPIO_AUD_RSTn"         input
+               line   9:       "GPIO_eMMC_RSTn"        input
+               line  10:       "UART1_FET_BUF_EN"      input
+               line  11:       "WL_LT_EN"              input
+               line  12:       "GPIO_HDMI_RSTn"        input
+               line  13:       "CSI_GPIO1"             input
+               line  14:       "CSI_GPIO2"             input
+               line  15:       "PRU_3V3_EN"            input
+               line  16:       "HDMI_INTn"             input consumer="interrupt"
+               line  17:       "PD_I2C_IRQ"            input
+               line  18:       "MCASP1_FET_EN"         input
+               line  19:       "MCASP1_BUF_BT_EN"      input
+               line  20:       "MCASP1_FET_SEL"        input
+               line  21:       "UART1_FET_SEL"         input
+               line  22:       "TSINT#"                input
+               line  23:       "IO_EXP_TEST_LED"       output
+
+   - We see that **IO_EXP_TEST_LED** is connected to *GPIO2_23* on the SK-AM62B-P1 board.
+
+#. Read the value of the GPIO pin:
+
+   .. code-block:: console
+
+      $ gpioget --numeric -c 2 23
+      0
+
+   - Use variations of *gpioget* to read the value of the GPIO pin:
+
+      .. code-block:: console
+
+         $ gpioget -c 2 23
+         "23"=inactive
+         $ gpioget IO_EXP_TEST_LED
+         "IO_EXP_TEST_LED"=inactive
+         $ gpioget --numeric IO_EXP_TEST_LED
+         0
+
+   - For more info on *gpioget*, see its man page: https://libgpiod.readthedocs.io/en/latest/gpioget.html.
+
+#. Set the GPIO pin to turn on the LED
+
+   .. code-block:: console
+
+      $ gpioset -c 2 23=1
+      ^C
+      $ gpioset -c 2 23=0
+      ^C
+
+   - Note:
+
+      - In Bash, *'^C' (Ctrl + C)* exits the command with *SIGINT*, else the *gpioset* command would not exit on its own. For more info, refer to the *3.7.6 Signals* section in the GNU Bash manual: https://www.gnu.org/software/bash/manual/bash.html.
+
+      - The new GPIO value will remain until an exit signal, like *SIGKILL*, *SIGTERM*, or *SIGINT*; after that, its value is not guaranteed. For more info, reference the *Description* section of the *gpioset* man page: https://libgpiod.readthedocs.io/en/latest/gpioset.html.
+
+   - This should have turned the active-high LED "LD11" on the SK-AM62B-P1 on and off.
+
+   - Use variations of *gpioset* to set the value of the GPIO pin:
+
+      .. code-block:: console
+
+         $ gpioset IO_EXP_TEST_LED=1
+         ^C
+         $ gpioset IO_EXP_TEST_LED=0
+         ^C
+
+   - This should have also turned the active-high LED "LD11" on the SK-AM62B-P1 on and off.
+
+   - Example: Toggle *GPIO2_23* (blink "LD11") at 10Hz, then turn it off:
+
+      .. code-block:: console
+
+         $ gpioset --toggle 50ms IO_EXP_TEST_LED=1
+         ^C
+         $ gpioset IO_EXP_TEST_LED=0
+         ^C
+
+   - For more info on *gpioset*, see its man page: https://libgpiod.readthedocs.io/en/latest/gpioset.html.
+
+- For more command-line tools, refer to the *libgpiod* documentation: https://libgpiod.readthedocs.io/en/latest/gpio_tools.html.
+
+Example: Using GPIOs on the Raspberry Pi Compatible 40-pin Header on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top-2.png
+   :width: 625
+
+#. Locate *Table 2-25* under **2.6.17.2 User Expansion Connector** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+#. Identify the desired GPIO pin number and pin multiplexed signal. For example, *GPIO1_25* corresponds to physical pin 8 on the 40-pin header.
+
+#. Use *libgpiod* mentioned in the previous example to control the GPIO pin, ensuring that the GPIO pin is not being used already.
+
+Additional Resources
+
+- For more information about GPIO usage in Linux and U-Boot, refer to these resources:
+
+   - SDK:
+
+      - Kernel: ti-processor-sdk-linux-am62xx-evm-<sdk version>/board-support/ti-linux-kernel-<kernel version>+git-ti/Documentation/devicetree/bindings/gpio/gpio.txt
+      - U-Boot: ti-processor-sdk-linux-am62xx-evm-<sdk version>/board-support/ti-u-boot-<u-boot version>+git/doc/device-tree-bindings/gpio/gpio.txt
+
+   - Online:
+
+      - Linux:  https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1494485/faq-processor-sdk-getting-started-with-gpios-in-linux-using-the-am62-and-am64-family-processors
+      - U-Boot: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1398803/faq-processor-sdk-am62x-how-to-toggle-gpios-and-leds-from-u-boot-command-prompt
+      - GPIO on Sitara: https://www.ti.com/lit/ab/spradk0/spradk0.pdf
+      - https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1398198/faq-am62x-how-to-allocate-use-gpios-from-different-device-domains
+      - https://support.criticallink.com/redmine/projects/mitysom_am62x/wiki/Example\_-_User_level_GPIO_Access
+      - https://software-dl.ti.com/processor-sdk-linux/esd/AM64X/10_01_10_04/exports/docs/linux/How_to_Guides/FAQ/How_to_Check_Device_Tree_Info.html
+      - https://docs.kernel.org/devicetree/usage-model.html
+      - (*Note: AM62P-specific, but similar to AM62x*): https://software-dl.ti.com/processor-sdk-linux/esd/AM62PX/09_02_01_09/exports/docs/linux/Foundational_Components/Tools/GPIO_Tools.html
 
 .. rubric:: Consuming Drivers
    :name: consuming-drivers
 
-The GPIO Driver can also be easily leveraged by other drivers to
-"consume" a GPIO.
+The GPIO Driver can also be easily leveraged by other drivers to "consume" a GPIO.
 
--  GPIO Consumer:
-   Under Kernel directory Documentation/gpio/consumer.txt
+- For an example of a driver using a GPIO pin, examine this entry in a dts file for how the MMC/SD interface could use a GPIO as a card detect pin:
 
-For an example of a driver using a GPIO pin, examine this entry in a dts
-file for how the MMC/SD interface could use a GPIO as a card detect pin
-Under Kernel directory arch/arm/boot/dts/am335x-bone-common.dtsi line 401
+   - ti-processor-sdk-linux-am62xx-evm-<sdk version>/board-support/ti-linux-kernel-<kernel version>+git-ti/arch/arm/boot/dts/ti/omap/am335x-bone-common.dtsi.
 
 |
 


Reviews:
user: login: madweshanshu
body: Looks good! I think the man page links should refer to the source rather than the Debian page.

Thank you for linking the GPIO E2E FAQs :) 
state: CHANGES_REQUESTED
author_association: NONE
submitted_at: 2025-04-01T22:17:53Z
user: login: cshilwant
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-01T22:33:56Z
user: login: jonaswood01
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T22:37:56Z
user: login: jonaswood01
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-01T22:38:43Z
user: login: StaticRocket
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-04-02T00:26:08Z
user: login: StaticRocket
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-04-02T00:26:39Z
user: login: makohoek
body: Hi @jonaswood01,

Thank you for the patch. Looking at the authorship, it seems you are not the author of this patch:
```
commit 1eb41f7a21f9bb2034c74252f885a71e2ec27cec (jonaswood01/master, jonaswood01/HEAD)
Author: Maxime Fournier <mfournier@baylibre.com>
Date:   Tue Apr 1 16:52:17 2025 +0200

    docs(GPIO): Updated Kernel driver doc with examples
    
    Replaced Debian links with lgpiod links and cleaned a lengthy URL.
    
    Signed-off-by: Jonas Wood <jonaslwood@gmail.com>
```

Can you please fix this? It seems weird that Maxime is the author here since you are the one submitting the pull request.
This can be fixed with:
```
$ git commit --amend --reset-author
```

Also, can you rebase this, please? It seems that this commit modifies some Android files (such as `source/android/Foundational_Components_Bootloaders.rst`) which seem unrelated to this change.

See: https://docs.github.com/en/get-started/using-git/about-git-rebase for help with `git rebase`
state: CHANGES_REQUESTED
author_association: COLLABORATOR
submitted_at: 2025-04-02T09:26:00Z
user: login: jmenti
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-04-02T20:54:48Z
user: login: jonaswood01
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-02T22:14:28Z
user: login: praneethbajjuri
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-02T22:46:03Z
user: login: StaticRocket
state: APPROVED
author_association: MEMBER
submitted_at: 2025-04-02T22:47:47Z
user: login: makohoek
body: I mostly review Android related things (which are no longer present in this commit).

I confirm that:
- commit authorship looks good
- there are no longer any (unrelated) Android changes in this PR.

I have not thouroughly reviewed anything else, but approving anyways.
state: APPROVED
author_association: COLLABORATOR
submitted_at: 2025-04-03T08:56:13Z

Review comments:
diff_hunk: @@ -48,33 +46,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+1. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
+
+2. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+         $ gpiodetect
+         gpiochip0 [600000.gpio] (92 lines)
+         gpiochip1 [601000.gpio] (52 lines)
+         gpiochip2 [1-0022] (24 lines)
+
+- This shows 92+52+24=168 total GPIO lines available across 3 GPIO chips: 0, 1, and 2.
+
+3. Read info for every available **gpiochip**:
+
+      .. code-block:: console
+
+         $ gpioinfo
+         gpiochip0 - 92 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  91:       unnamed                 input
+         gpiochip1 - 52 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  51:       unnamed                 input
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 {...}
+                 line  23:       "IO_EXP_TEST_LED"       input
+
+- This should result in a large output, 168+ lines in this case. It outputs all GPIO lines available on every GPIO chip, as well as their names and input/output directions. The above output is truncated.
+
+- For more info on *gpioinfo*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioinfo.1.en.html.
+
+- To see info for a specific GPIO chip, use the '-c' option and the GPIO chip number.
+
+4. Read info for **gpiochip2** (for this example):
+
+      .. code-block:: console
+
+         $ gpioinfo -c 2
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 line   2:       "PRU_DETECT"            input
+                 line   3:       "MMC1_SD_EN"            output consumer="regulator-3"
+                 line   4:       "VPP_LDO_EN"            input
+                 line   5:       "EXP_PS_3V3_En"         input
+                 line   6:       "EXP_PS_5V0_En"         input
+                 line   7:       "EXP_HAT_DETECT"        input
+                 line   8:       "GPIO_AUD_RSTn"         input
+                 line   9:       "GPIO_eMMC_RSTn"        input
+                 line  10:       "UART1_FET_BUF_EN"      input
+                 line  11:       "WL_LT_EN"              input
+                 line  12:       "GPIO_HDMI_RSTn"        input
+                 line  13:       "CSI_GPIO1"             input
+                 line  14:       "CSI_GPIO2"             input
+                 line  15:       "PRU_3V3_EN"            input
+                 line  16:       "HDMI_INTn"             input consumer="interrupt"
+                 line  17:       "PD_I2C_IRQ"            input
+                 line  18:       "MCASP1_FET_EN"         input
+                 line  19:       "MCASP1_BUF_BT_EN"      input
+                 line  20:       "MCASP1_FET_SEL"        input
+                 line  21:       "UART1_FET_SEL"         input
+                 line  22:       "TSINT#"                input
+                 line  23:       "IO_EXP_TEST_LED"       output
+
+- We see that **IO_EXP_TEST_LED** is connected to *GPIO2_23* on the SK-AM62B-P1 board.
+
+5. Read the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioget --numeric -c 2 23
+         0
+
+- Use variations of *gpioget* to read the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioget -c 2 23
+         "23"=inactive
+         $ gpioget IO_EXP_TEST_LED
+         "IO_EXP_TEST_LED"=inactive
+         $ gpioget --numeric IO_EXP_TEST_LED
+         0
+
+- For more info on *gpioget*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioget.1.en.html.
+
+6. Set the GPIO pin to turn on the LED
+
+   .. code-block:: console
+
+         $ gpioset -c 2 23=1
+         ^C
+         $ gpioset -c 2 23=0
+         ^C
+
+- *Note: '^C' (Ctrl + C) interrupts the command, else the command would not terminate on its own. Use '^C' (Ctrl + C) to stop the command, and the new GPIO value will still remain.*
+
+- This should have turned the active-high LED "LD11" on the SK-AM62B-P1 on and off.
+
+- Use variations of *gpioset* to set the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioset IO_EXP_TEST_LED=1
+         ^C
+         $ gpioset IO_EXP_TEST_LED=0
+         ^C
+
+- This should have also turned the active-high LED "LD11" on the SK-AM62B-P1 on and off.
+
+- Example: Toggle *GPIO2_23* (blink "LD11") at 10Hz, then turn it off:
+
+   .. code-block:: console
+
+         $ gpioset --toggle 50ms IO_EXP_TEST_LED=1
+         ^C
+         $ gpioset IO_EXP_TEST_LED=0
+         ^C
+
+- For more info on *gpioset*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioset.1.en.html.
+
+For more command-line tools, refer to the *libgpiod* documentation: https://libgpiod.readthedocs.io/en/latest/gpio_tools.html and the *gpiod* Debian documentation: https://manpages.debian.org/experimental/gpiod/index.html.
+
+# Example: Using GPIOs on the Raspberry Pi Compatible 40-pin Header on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top-2.png
+
+1. Locate *Table 2-25* under **2.6.17.2 User Expansion Connector** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+2. Identify the desired GPIO pin number and pin multiplexed signal. For example, *GPIO1_25* corresponds to physical pin 8 on the 40-pin header.
+
+3. Use *libgpiod* mentioned in the previous example to control the GPIO pin, ensuring that the GPIO pin is not being used already.
+
+# Additional Resources
+
+- For more information about GPIO usage in Linux and U-Boot, refer to these resources:
+
+   - SDK:
+
+      - Kernel: ti-processor-sdk-linux-am62xx-evm-<sdk version>/board-support/ti-linux-kernel-<kernel version>+git-ti/Documentation/devicetree/bindings/gpio/gpio.txt
+      - U-Boot: ti-processor-sdk-linux-am62xx-evm-<sdk version>/board-support/ti-u-boot-<u-boot version>+git/doc/device-tree-bindings/gpio/gpio.txt
+
+   - Online:
+
+      - Linux:  https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1494485/faq-processor-sdk-getting-started-with-gpios-in-linux-using-the-am62-and-am64-family-processors
+      - U-Boot: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1398803/faq-processor-sdk-am62x-how-to-toggle-gpios-and-leds-from-u-boot-command-prompt
+      - GPIO on Sitara: https://www.ti.com/lit/ab/spradk0/spradk0.pdf?ts=1743432396299&ref_url=https%253A%252F%252Fwww.google.com%252F
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: madweshanshu
body: Remove the question mark and all the characters after the question mark. 
Its makes the url cleaner and the delivery information isn't important.
created_at: 2025-04-01T22:07:19Z
author_association: NONE
diff_hunk: @@ -48,33 +46,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+1. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
+
+2. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+         $ gpiodetect
+         gpiochip0 [600000.gpio] (92 lines)
+         gpiochip1 [601000.gpio] (52 lines)
+         gpiochip2 [1-0022] (24 lines)
+
+- This shows 92+52+24=168 total GPIO lines available across 3 GPIO chips: 0, 1, and 2.
+
+3. Read info for every available **gpiochip**:
+
+      .. code-block:: console
+
+         $ gpioinfo
+         gpiochip0 - 92 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  91:       unnamed                 input
+         gpiochip1 - 52 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  51:       unnamed                 input
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 {...}
+                 line  23:       "IO_EXP_TEST_LED"       input
+
+- This should result in a large output, 168+ lines in this case. It outputs all GPIO lines available on every GPIO chip, as well as their names and input/output directions. The above output is truncated.
+
+- For more info on *gpioinfo*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioinfo.1.en.html.
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: madweshanshu
body: Is there a reason to link the Debian page rather than the 'libgpiod.readthedocs.io' command page? If not, then lets link the readthedocs page.
created_at: 2025-04-01T22:12:15Z
author_association: NONE
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+#. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
+
+#. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+         $ gpiodetect
+         gpiochip0 [600000.gpio] (92 lines)
+         gpiochip1 [601000.gpio] (52 lines)
+         gpiochip2 [1-0022] (24 lines)
+
+- This shows 92+52+24=168 total GPIO lines available across 3 GPIO chips: 0, 1, and 2.
+
+#. Read info for every available **gpiochip**:
+
+      .. code-block:: console
+
+         $ gpioinfo
+         gpiochip0 - 92 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  91:       unnamed                 input
+         gpiochip1 - 52 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  51:       unnamed                 input
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 {...}
+                 line  23:       "IO_EXP_TEST_LED"       input
+
+- This should result in a large output, 168+ lines in this case. It outputs all GPIO lines available on every GPIO chip, as well as their names and input/output directions. The above output is truncated.
+
+- For more info on *gpioinfo*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioinfo.1.en.html.
+
+- To see info for a specific GPIO chip, use the '-c' option and the GPIO chip number.
+
+#. Read info for **gpiochip2** (for this example):
+
+      .. code-block:: console
+
+         $ gpioinfo -c 2
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 line   2:       "PRU_DETECT"            input
+                 line   3:       "MMC1_SD_EN"            output consumer="regulator-3"
+                 line   4:       "VPP_LDO_EN"            input
+                 line   5:       "EXP_PS_3V3_En"         input
+                 line   6:       "EXP_PS_5V0_En"         input
+                 line   7:       "EXP_HAT_DETECT"        input
+                 line   8:       "GPIO_AUD_RSTn"         input
+                 line   9:       "GPIO_eMMC_RSTn"        input
+                 line  10:       "UART1_FET_BUF_EN"      input
+                 line  11:       "WL_LT_EN"              input
+                 line  12:       "GPIO_HDMI_RSTn"        input
+                 line  13:       "CSI_GPIO1"             input
+                 line  14:       "CSI_GPIO2"             input
+                 line  15:       "PRU_3V3_EN"            input
+                 line  16:       "HDMI_INTn"             input consumer="interrupt"
+                 line  17:       "PD_I2C_IRQ"            input
+                 line  18:       "MCASP1_FET_EN"         input
+                 line  19:       "MCASP1_BUF_BT_EN"      input
+                 line  20:       "MCASP1_FET_SEL"        input
+                 line  21:       "UART1_FET_SEL"         input
+                 line  22:       "TSINT#"                input
+                 line  23:       "IO_EXP_TEST_LED"       output
+
+- We see that **IO_EXP_TEST_LED** is connected to *GPIO2_23* on the SK-AM62B-P1 board.
+
+#. Read the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioget --numeric -c 2 23
+         0
+
+- Use variations of *gpioget* to read the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioget -c 2 23
+         "23"=inactive
+         $ gpioget IO_EXP_TEST_LED
+         "IO_EXP_TEST_LED"=inactive
+         $ gpioget --numeric IO_EXP_TEST_LED
+         0
+
+- For more info on *gpioget*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioget.1.en.html.
+
+#. Set the GPIO pin to turn on the LED
+
+   .. code-block:: console
+
+         $ gpioset -c 2 23=1
+         ^C
+         $ gpioset -c 2 23=0
+         ^C
+
+- *Note: '^C' (Ctrl + C) interrupts the command, else the command would not terminate on its own. Use '^C' (Ctrl + C) to stop the command, and the new GPIO value will still remain.*
+
+- This should have turned the active-high LED "LD11" on the SK-AM62B-P1 on and off.
+
+- Use variations of *gpioset* to set the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioset IO_EXP_TEST_LED=1
+         ^C
+         $ gpioset IO_EXP_TEST_LED=0
+         ^C
+
+- This should have also turned the active-high LED "LD11" on the SK-AM62B-P1 on and off.
+
+- Example: Toggle *GPIO2_23* (blink "LD11") at 10Hz, then turn it off:
+
+   .. code-block:: console
+
+         $ gpioset --toggle 50ms IO_EXP_TEST_LED=1
+         ^C
+         $ gpioset IO_EXP_TEST_LED=0
+         ^C
+
+- For more info on *gpioset*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioset.1.en.html.
+
+For more command-line tools, refer to the *libgpiod* documentation: https://libgpiod.readthedocs.io/en/latest/gpio_tools.html and the *gpiod* Debian documentation: https://manpages.debian.org/experimental/gpiod/index.html.
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: cshilwant
body: Any reason to point to gpiod package from debian.org in yocto docs?
created_at: 2025-04-01T22:31:35Z
author_association: MEMBER
diff_hunk: @@ -48,33 +46,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+1. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
+
+2. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+         $ gpiodetect
+         gpiochip0 [600000.gpio] (92 lines)
+         gpiochip1 [601000.gpio] (52 lines)
+         gpiochip2 [1-0022] (24 lines)
+
+- This shows 92+52+24=168 total GPIO lines available across 3 GPIO chips: 0, 1, and 2.
+
+3. Read info for every available **gpiochip**:
+
+      .. code-block:: console
+
+         $ gpioinfo
+         gpiochip0 - 92 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  91:       unnamed                 input
+         gpiochip1 - 52 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  51:       unnamed                 input
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 {...}
+                 line  23:       "IO_EXP_TEST_LED"       input
+
+- This should result in a large output, 168+ lines in this case. It outputs all GPIO lines available on every GPIO chip, as well as their names and input/output directions. The above output is truncated.
+
+- For more info on *gpioinfo*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioinfo.1.en.html.
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: jonaswood01
body: Great point, will remove Debian links and replace with lgpiod links
created_at: 2025-04-01T22:37:56Z
author_association: CONTRIBUTOR
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+#. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
+
+#. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+         $ gpiodetect
+         gpiochip0 [600000.gpio] (92 lines)
+         gpiochip1 [601000.gpio] (52 lines)
+         gpiochip2 [1-0022] (24 lines)
+
+- This shows 92+52+24=168 total GPIO lines available across 3 GPIO chips: 0, 1, and 2.
+
+#. Read info for every available **gpiochip**:
+
+      .. code-block:: console
+
+         $ gpioinfo
+         gpiochip0 - 92 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  91:       unnamed                 input
+         gpiochip1 - 52 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  51:       unnamed                 input
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 {...}
+                 line  23:       "IO_EXP_TEST_LED"       input
+
+- This should result in a large output, 168+ lines in this case. It outputs all GPIO lines available on every GPIO chip, as well as their names and input/output directions. The above output is truncated.
+
+- For more info on *gpioinfo*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioinfo.1.en.html.
+
+- To see info for a specific GPIO chip, use the '-c' option and the GPIO chip number.
+
+#. Read info for **gpiochip2** (for this example):
+
+      .. code-block:: console
+
+         $ gpioinfo -c 2
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 line   2:       "PRU_DETECT"            input
+                 line   3:       "MMC1_SD_EN"            output consumer="regulator-3"
+                 line   4:       "VPP_LDO_EN"            input
+                 line   5:       "EXP_PS_3V3_En"         input
+                 line   6:       "EXP_PS_5V0_En"         input
+                 line   7:       "EXP_HAT_DETECT"        input
+                 line   8:       "GPIO_AUD_RSTn"         input
+                 line   9:       "GPIO_eMMC_RSTn"        input
+                 line  10:       "UART1_FET_BUF_EN"      input
+                 line  11:       "WL_LT_EN"              input
+                 line  12:       "GPIO_HDMI_RSTn"        input
+                 line  13:       "CSI_GPIO1"             input
+                 line  14:       "CSI_GPIO2"             input
+                 line  15:       "PRU_3V3_EN"            input
+                 line  16:       "HDMI_INTn"             input consumer="interrupt"
+                 line  17:       "PD_I2C_IRQ"            input
+                 line  18:       "MCASP1_FET_EN"         input
+                 line  19:       "MCASP1_BUF_BT_EN"      input
+                 line  20:       "MCASP1_FET_SEL"        input
+                 line  21:       "UART1_FET_SEL"         input
+                 line  22:       "TSINT#"                input
+                 line  23:       "IO_EXP_TEST_LED"       output
+
+- We see that **IO_EXP_TEST_LED** is connected to *GPIO2_23* on the SK-AM62B-P1 board.
+
+#. Read the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioget --numeric -c 2 23
+         0
+
+- Use variations of *gpioget* to read the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioget -c 2 23
+         "23"=inactive
+         $ gpioget IO_EXP_TEST_LED
+         "IO_EXP_TEST_LED"=inactive
+         $ gpioget --numeric IO_EXP_TEST_LED
+         0
+
+- For more info on *gpioget*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioget.1.en.html.
+
+#. Set the GPIO pin to turn on the LED
+
+   .. code-block:: console
+
+         $ gpioset -c 2 23=1
+         ^C
+         $ gpioset -c 2 23=0
+         ^C
+
+- *Note: '^C' (Ctrl + C) interrupts the command, else the command would not terminate on its own. Use '^C' (Ctrl + C) to stop the command, and the new GPIO value will still remain.*
+
+- This should have turned the active-high LED "LD11" on the SK-AM62B-P1 on and off.
+
+- Use variations of *gpioset* to set the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioset IO_EXP_TEST_LED=1
+         ^C
+         $ gpioset IO_EXP_TEST_LED=0
+         ^C
+
+- This should have also turned the active-high LED "LD11" on the SK-AM62B-P1 on and off.
+
+- Example: Toggle *GPIO2_23* (blink "LD11") at 10Hz, then turn it off:
+
+   .. code-block:: console
+
+         $ gpioset --toggle 50ms IO_EXP_TEST_LED=1
+         ^C
+         $ gpioset IO_EXP_TEST_LED=0
+         ^C
+
+- For more info on *gpioset*, see its man page: https://manpages.debian.org/experimental/gpiod/gpioset.1.en.html.
+
+For more command-line tools, refer to the *libgpiod* documentation: https://libgpiod.readthedocs.io/en/latest/gpio_tools.html and the *gpiod* Debian documentation: https://manpages.debian.org/experimental/gpiod/index.html.
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: jonaswood01
body: Will change links to lgpiod only.
created_at: 2025-04-01T22:38:43Z
author_association: CONTRIBUTOR
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: StaticRocket
body: Style nitpick: newline after directive 
created_at: 2025-04-02T00:06:51Z
author_association: MEMBER
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: StaticRocket
body: ```suggestion
Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
```
created_at: 2025-04-02T00:07:17Z
author_association: MEMBER
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+#. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: StaticRocket
body: Mixed list and numbers? Why? If you are trying to nest sections use the proper indentation.
created_at: 2025-04-02T00:08:08Z
author_association: MEMBER
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+#. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: StaticRocket
body: Should at least define a width or height here so the image doesn't take up a large section of the screen.
created_at: 2025-04-02T00:10:22Z
author_association: MEMBER
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+#. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
+
+#. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+         $ gpiodetect
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: StaticRocket
body: Incorrect indentation depth
created_at: 2025-04-02T00:10:47Z
author_association: MEMBER
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+#. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
+
+#. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+         $ gpiodetect
+         gpiochip0 [600000.gpio] (92 lines)
+         gpiochip1 [601000.gpio] (52 lines)
+         gpiochip2 [1-0022] (24 lines)
+
+- This shows 92+52+24=168 total GPIO lines available across 3 GPIO chips: 0, 1, and 2.
+
+#. Read info for every available **gpiochip**:
+
+      .. code-block:: console
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: StaticRocket
body: Incorrect indentation depth
created_at: 2025-04-02T00:11:07Z
author_association: MEMBER
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+#. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
+
+#. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+         $ gpiodetect
+         gpiochip0 [600000.gpio] (92 lines)
+         gpiochip1 [601000.gpio] (52 lines)
+         gpiochip2 [1-0022] (24 lines)
+
+- This shows 92+52+24=168 total GPIO lines available across 3 GPIO chips: 0, 1, and 2.
+
+#. Read info for every available **gpiochip**:
+
+      .. code-block:: console
+
+         $ gpioinfo
+         gpiochip0 - 92 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  91:       unnamed                 input
+         gpiochip1 - 52 lines:
+                 line   0:       unnamed                 input
+                 line   1:       unnamed                 input
+                 {...}
+                 line  51:       unnamed                 input
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 {...}
+                 line  23:       "IO_EXP_TEST_LED"       input
+
+- This should result in a large output, 168+ lines in this case. It outputs all GPIO lines available on every GPIO chip, as well as their names and input/output directions. The above output is truncated.
+
+- For more info on *gpioinfo*, see its man page: https://libgpiod.readthedocs.io/en/latest/gpioinfo.html.
+
+- To see info for a specific GPIO chip, use the '-c' option and the GPIO chip number.
+
+#. Read info for **gpiochip2** (for this example):
+
+      .. code-block:: console
+
+         $ gpioinfo -c 2
+         gpiochip2 - 24 lines:
+                 line   0:       "GPIO_CPSW2_RST"        input
+                 line   1:       "GPIO_CPSW1_RST"        input
+                 line   2:       "PRU_DETECT"            input
+                 line   3:       "MMC1_SD_EN"            output consumer="regulator-3"
+                 line   4:       "VPP_LDO_EN"            input
+                 line   5:       "EXP_PS_3V3_En"         input
+                 line   6:       "EXP_PS_5V0_En"         input
+                 line   7:       "EXP_HAT_DETECT"        input
+                 line   8:       "GPIO_AUD_RSTn"         input
+                 line   9:       "GPIO_eMMC_RSTn"        input
+                 line  10:       "UART1_FET_BUF_EN"      input
+                 line  11:       "WL_LT_EN"              input
+                 line  12:       "GPIO_HDMI_RSTn"        input
+                 line  13:       "CSI_GPIO1"             input
+                 line  14:       "CSI_GPIO2"             input
+                 line  15:       "PRU_3V3_EN"            input
+                 line  16:       "HDMI_INTn"             input consumer="interrupt"
+                 line  17:       "PD_I2C_IRQ"            input
+                 line  18:       "MCASP1_FET_EN"         input
+                 line  19:       "MCASP1_BUF_BT_EN"      input
+                 line  20:       "MCASP1_FET_SEL"        input
+                 line  21:       "UART1_FET_SEL"         input
+                 line  22:       "TSINT#"                input
+                 line  23:       "IO_EXP_TEST_LED"       output
+
+- We see that **IO_EXP_TEST_LED** is connected to *GPIO2_23* on the SK-AM62B-P1 board.
+
+#. Read the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioget --numeric -c 2 23
+         0
+
+- Use variations of *gpioget* to read the value of the GPIO pin:
+
+   .. code-block:: console
+
+         $ gpioget -c 2 23
+         "23"=inactive
+         $ gpioget IO_EXP_TEST_LED
+         "IO_EXP_TEST_LED"=inactive
+         $ gpioget --numeric IO_EXP_TEST_LED
+         0
+
+- For more info on *gpioget*, see its man page: https://libgpiod.readthedocs.io/en/latest/gpioget.html.
+
+#. Set the GPIO pin to turn on the LED
+
+   .. code-block:: console
+
+         $ gpioset -c 2 23=1
+         ^C
+         $ gpioset -c 2 23=0
+         ^C
+
+- *Note: '^C' (Ctrl + C) interrupts the command, else the command would not terminate on its own. Use '^C' (Ctrl + C) to stop the command, and the new GPIO value will still remain.*
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: StaticRocket
body: This note is incorrect.

https://manpages.debian.org/experimental/gpiod/gpioset.1.en.html#NOTE
created_at: 2025-04-02T00:25:50Z
author_association: MEMBER
diff_hunk: @@ -48,33 +47,186 @@ and interrupt generation.
 .. rubric:: User Layer
    :name: user-layer
 
-The GPIO driver can be used via  user space or by
-other drivers that may need to access pins as either input/outputs or
-interrupts. More information about this driver and GPIO usage in Linux
-can be found in the kernel documentation:
-
--  GPIO Interface:
-   Under Kernel directory Documentation/gpio/gpio.txt
--  GPIO Driver:
-   Under Kernel directory Documentation/gpio/driver.txt
-
+The GPIO driver can be used in user space via Linux CLI. This section provides examples, command-line-tools, and guidance for using GPIOs in user space.
 
 .. note ::
-   Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+   Since linux 4.8, the GPIO sysfs interface is deprecated. User space should use
    the character device instead.
 
+# Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO pin, which is connected to an LED on the SK-AM62B-P1 board:
+
+#. Locate *Table 2-23* under **2.6.16.3 User Test LEDs** in the *AM62x Starter Kit User's Guide (Rev. C)*: https://www.ti.com/lit/pdf/spruj40.
+
+- This example uses LED "LD11", AKA the **IO_EXP_TEST_LED**. It is connected to GPIO *U70.24(P27)*, AKA pin 27 of the *GPIO Port Expander* on the SK-AM62B-P1 board:
+
+.. Image:: /images/sk-am62b-p1-top.png
+
+#. Detect every available **gpiochip**:
+
+   .. code-block:: console
+
+         $ gpiodetect
+         gpiochip0 [600000.gpio] (92 lines)
+         gpiochip1 [601000.gpio] (52 lines)
+         gpiochip2 [1-0022] (24 lines)
+
+- This shows 92+52+24=168 total GPIO lines available across 3 GPIO chips: 0, 1, and 2.
+
+#. Read info for every available **gpiochip**:
+
+      .. code-block:: console
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: StaticRocket
body: This is the case for a number of other code blocks in this file as well.
created_at: 2025-04-02T00:26:39Z
author_association: MEMBER
diff_hunk: @@ -162,7 +162,11 @@ Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO
       $ gpioset -c 2 23=0
       ^C
 
-   - *Note: '^C' (Ctrl + C) interrupts the command, else the command would not terminate on its own. Use '^C' (Ctrl + C) to stop the command, and the new GPIO value will still remain.*
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: jmenti
body: Why not include this second patch with your first patch?
created_at: 2025-04-02T20:54:38Z
author_association: COLLABORATOR
diff_hunk: @@ -162,7 +162,11 @@ Example: Using GPIOs with the *libgpiod* library in user space to toggle a GPIO
       $ gpioset -c 2 23=0
       ^C
 
-   - *Note: '^C' (Ctrl + C) interrupts the command, else the command would not terminate on its own. Use '^C' (Ctrl + C) to stop the command, and the new GPIO value will still remain.*
path: source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst
user: login: jonaswood01
body: Good catch, that second patch edit was meant to be a part of the first patch. It's now consolidated into one patch.
created_at: 2025-04-02T22:14:28Z
author_association: CONTRIBUTOR

PR comments:
user: login: github-actions[bot]
created_at: 2025-04-01T21:17:32Z
body: New warnings found with rstcheck:
```text
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:6: (INFO/1) Enumerated list start value not ordinal-1: "2" (ordinal 2)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:6: (INFO/1) Enumerated list start value not ordinal-1: "3" (ordinal 3)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:6: (INFO/1) Enumerated list start value not ordinal-1: "4" (ordinal 4)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:6: (INFO/1) Enumerated list start value not ordinal-1: "5" (ordinal 5)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:6: (INFO/1) Enumerated list start value not ordinal-1: "6" (ordinal 6)
```

author_association: NONE
user: login: praneethbajjuri
created_at: 2025-04-01T21:18:09Z
body: @DhruvaG2000 for review
author_association: COLLABORATOR
user: login: praneethbajjuri
created_at: 2025-04-01T21:23:32Z
body: @jonaswood01  thanks for sending this PR. Review the checker failures. https://github.com/TexasInstruments/processor-sdk-doc/pull/234/checks 

author_association: COLLABORATOR
user: login: github-actions[bot]
created_at: 2025-04-01T21:53:08Z
body: New warnings found with rstcheck:
```text
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "2" (ordinal 2)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "3" (ordinal 3)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "4" (ordinal 4)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "5" (ordinal 5)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "6" (ordinal 6)
```

author_association: NONE
user: login: github-actions[bot]
created_at: 2025-04-01T22:03:01Z
body: New warnings found with rstcheck:
```text
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "2" (ordinal 2)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "3" (ordinal 3)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "4" (ordinal 4)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "5" (ordinal 5)
source/linux/Foundational_Components/Kernel/Kernel_Drivers/GPIO.rst:4: (INFO/1) Enumerated list start value not ordinal-1: "6" (ordinal 6)
```

author_association: NONE
user: login: jonaswood01
created_at: 2025-04-02T19:25:32Z
body: > > Hi @jonaswood01,
> > Thank you for the patch. Looking at the authorship, it seems you are not the author of this patch:
> > ```
> > commit 1eb41f7a21f9bb2034c74252f885a71e2ec27cec (jonaswood01/master, jonaswood01/HEAD)
> > Author: Maxime Fournier <mfournier@baylibre.com>
> > Date:   Tue Apr 1 16:52:17 2025 +0200
> > 
> >     docs(GPIO): Updated Kernel driver doc with examples
> >     
> >     Replaced Debian links with lgpiod links and cleaned a lengthy URL.
> >     
> >     Signed-off-by: Jonas Wood <jonaslwood@gmail.com>
> > ```
> > 
> > 
> >     
> >       
> >     
> > 
> >       
> >     
> > 
> >     
> >   
> > Can you please fix this? It seems weird that Maxime is the author here since you are the one submitting the pull request. This can be fixed with:
> > ```
> > $ git commit --amend --reset-author
> > ```
> > 
> > 
> >     
> >       
> >     
> > 
> >       
> >     
> > 
> >     
> >   
> > Also, can you rebase this, please? It seems that this commit modifies some Android files (such as `source/android/Foundational_Components_Bootloaders.rst`) which seem unrelated to this change.
> > See: https://docs.github.com/en/get-started/using-git/about-git-rebase for help with `git rebase`

Not sure what happened exactly, seems that a git pull had included Maxime Fournier's patch in mine unintentionally. But the authorship of this patch (me) should be fixed now, and the Android files (and Maxime's patch) you mentioned are removed from this patch and pull request.
author_association: CONTRIBUTOR