From 0432a4da9d3f210c2accd3398d9e2d4e8ccc97d9 Mon Sep 17 00:00:00 2001 From: Randolph Sapp Date: Sun, 15 Dec 2024 13:38:25 -0600 Subject: [PATCH] fix(pmic): normalize all code-blocks and re-tag Normalize all of the code blocks in this section and re-tag them as appropriate. Signed-off-by: Randolph Sapp --- .../Kernel_Drivers/PMIC/pmic_tps6594.rst | 206 +++++++++--------- 1 file changed, 104 insertions(+), 102 deletions(-) diff --git a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/PMIC/pmic_tps6594.rst b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/PMIC/pmic_tps6594.rst index 58e16e7e0..c4723e1f7 100644 --- a/source/linux/Foundational_Components/Kernel/Kernel_Drivers/PMIC/pmic_tps6594.rst +++ b/source/linux/Foundational_Components/Kernel/Kernel_Drivers/PMIC/pmic_tps6594.rst @@ -71,7 +71,7 @@ Configs to be enabled in kernel: For safety applications, a CRC feature can be enabled from userspace: -.. code-block:: bash +.. code-block:: console echo "options tps6594_i2c enable_crc=true" > /etc/modprobe.d/tps6594.conf; sync; @@ -81,7 +81,7 @@ the new setting. CRC feature will be enabled at module loading. Example of kernel messages for J721S2: -.. code-block:: text +.. code-block:: dmesg [ 5.060454] tps6594 0-0048: CRC feature enabled on primary PMIC [ 5.086440] tps6594 0-004c: CRC feature enabled on secondary PMIC @@ -89,7 +89,7 @@ for J721S2: To disable CRC feature, the modprobe conf file must be removed: -.. code-block:: bash +.. code-block:: console rm /etc/modprobe.d/tps6594.conf; sync; @@ -101,16 +101,16 @@ the new setting. CRC feature can be enabled through the kernel command line parameter: -.. code-block:: bash +.. code-block:: console - tps6594_i2c.enable_crc=Y + tps6594_i2c.enable_crc=Y If the kernel command line is edited from uboot, the new setting can be saved to the persistent storage: -.. code-block:: bash +.. code-block:: console - saveenv + saveenv TPS6594 SPI driver ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -119,7 +119,7 @@ Driver source location: .. code-block:: text - drivers/mfd/tps6594-spi.c + drivers/mfd/tps6594-spi.c .. rubric:: Kernel configuration options :name: kernel-configuration-options-spi @@ -128,10 +128,10 @@ Configs to be enabled in kernel: .. code-block:: text - CONFIG_SPI_MASTER - CONFIG_MFD_TPS6594_SPI (TPS6594 SPI support) + CONFIG_SPI_MASTER + CONFIG_MFD_TPS6594_SPI (TPS6594 SPI support) -:: +.. code-block:: menuconfig Device Drivers ---> Multifunction device drivers ---> @@ -153,7 +153,7 @@ Driver source location: .. code-block:: text - drivers/pinctrl/pinctrl-tps6594.c + drivers/pinctrl/pinctrl-tps6594.c [WARNING] GPIO indexation is 0-based in linux, whereas it is 1-based in the PMIC TRM. So GPIO5 in linux corresponds to GPIO6 in the TRM. @@ -165,9 +165,9 @@ Configs to be enabled in kernel: .. code-block:: text - CONFIG_PINCTRL_TPS6594 (TPS6594 GPIO support) + CONFIG_PINCTRL_TPS6594 (TPS6594 GPIO support) -:: +.. code-block:: menuconfig Device Drivers ---> Pin controllers ---> @@ -181,46 +181,43 @@ Examples given for AM62A. List all gpiochips present on the system, their names, labels and number of GPIO lines: -.. code-block:: bash +.. code-block:: console - gpiodetect - - [...] - gpiochip4 [tps6594-gpio] (11 lines) + $ gpiodetect + [...] + gpiochip4 [tps6594-gpio] (11 lines) List all lines of specified gpiochips, their names, consumers, direction, active state and additional flags: -.. code-block:: bash - - gpioinfo gpiochip4 - - gpiochip4 - 11 lines: - line 0: unnamed unused input active-high - line 1: unnamed unused input active-high - line 2: unnamed unused input active-high - line 3: unnamed unused output active-high - line 4: unnamed unused input active-high - line 5: unnamed unused output active-high - line 6: unnamed unused input active-high - line 7: unnamed unused input active-high - line 8: unnamed unused input active-high - line 9: unnamed unused input active-high - line 10: unnamed unused input active-high +.. code-block:: console + + $ gpioinfo gpiochip4 + gpiochip4 - 11 lines: + line 0: unnamed unused input active-high + line 1: unnamed unused input active-high + line 2: unnamed unused input active-high + line 3: unnamed unused output active-high + line 4: unnamed unused input active-high + line 5: unnamed unused output active-high + line 6: unnamed unused input active-high + line 7: unnamed unused input active-high + line 8: unnamed unused input active-high + line 9: unnamed unused input active-high + line 10: unnamed unused input active-high Read values of specified GPIO lines: -.. code-block:: bash +.. code-block:: console - gpioget gpiochip4 5 - - 0 + $ gpioget gpiochip4 5 + 0 Set values of specified GPIO lines: -.. code-block:: bash +.. code-block:: console - gpioset gpiochip4 5=1 + gpioset gpiochip4 5=1 .. rubric:: Driver usage (pinctrl) :name: driver-usage-pinctrl @@ -229,38 +226,43 @@ Examples given for AM62A. Get functions available for each pin: -.. code-block:: bash - - cat /sys/kernel/debug/pinctrl/tps6594-pinctrl.1.auto/pinmux-functions - - function 0: gpio, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] - function 1: nsleep1, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] - function 2: nsleep2, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] - function 3: wkup1, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] - function 4: wkup2, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] - function 5: scl_i2c2-cs_spi, groups = [ GPIO0 GPIO1 ] - function 6: nrstout_soc, groups = [ GPIO0 GPIO10 ] - function 7: trig_wdog, groups = [ GPIO1 GPIO10 ] - function 8: sda_i2c2-sdo_spi, groups = [ GPIO1 ] - function 9: clk32kout, groups = [ GPIO2 GPIO3 GPIO7 ] - function 10: nerr_soc, groups = [ GPIO2 ] - function 11: sclk_spmi, groups = [ GPIO4 ] - function 12: sdata_spmi, groups = [ GPIO5 ] - function 13: nerr_mcu, groups = [ GPIO6 ] - function 14: syncclkout, groups = [ GPIO7 GPIO9 ] - function 15: disable_wdog, groups = [ GPIO7 GPIO8 ] - function 16: pdog, groups = [ GPIO8 ] - function 17: syncclkin, groups = [ GPIO9 ] +.. code-block:: console + + $ cat /sys/kernel/debug/pinctrl/tps6594-pinctrl.1.auto/pinmux-functions + function 0: gpio, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] + function 1: nsleep1, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] + function 2: nsleep2, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] + function 3: wkup1, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] + function 4: wkup2, groups = [ GPIO0 GPIO1 GPIO2 GPIO3 GPIO4 GPIO5 GPIO6 GPIO7 GPIO8 GPIO9 GPIO10 ] + function 5: scl_i2c2-cs_spi, groups = [ GPIO0 GPIO1 ] + function 6: nrstout_soc, groups = [ GPIO0 GPIO10 ] + function 7: trig_wdog, groups = [ GPIO1 GPIO10 ] + function 8: sda_i2c2-sdo_spi, groups = [ GPIO1 ] + function 9: clk32kout, groups = [ GPIO2 GPIO3 GPIO7 ] + function 10: nerr_soc, groups = [ GPIO2 ] + function 11: sclk_spmi, groups = [ GPIO4 ] + function 12: sdata_spmi, groups = [ GPIO5 ] + function 13: nerr_mcu, groups = [ GPIO6 ] + function 14: syncclkout, groups = [ GPIO7 GPIO9 ] + function 15: disable_wdog, groups = [ GPIO7 GPIO8 ] + function 16: pdog, groups = [ GPIO8 ] + function 17: syncclkin, groups = [ GPIO9 ] Modify the function for a pin: -.. code-block:: bash +.. code-block:: console + + echo " " > /sys/kernel/debug/pinctrl/tps6594-pinctrl.1.auto/pinmux-select + +Examples: - echo " " > /sys/kernel/debug/pinctrl/tps6594-pinctrl.1.auto/pinmux-select +.. code-block:: console - Examples: - echo "GPIO7 gpio" > /sys/kernel/debug/pinctrl/tps6594-pinctrl.1.auto/pinmux-select - echo "GPIO2 nerr_soc" > /sys/kernel/debug/pinctrl/tps6594-pinctrl.1.auto/pinmux-select + echo "GPIO7 gpio" > /sys/kernel/debug/pinctrl/tps6594-pinctrl.1.auto/pinmux-select + +.. code-block:: console + + echo "GPIO2 nerr_soc" > /sys/kernel/debug/pinctrl/tps6594-pinctrl.1.auto/pinmux-select TPS6594 regulator driver ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -274,7 +276,7 @@ Driver source location: .. code-block:: text - drivers/regulator/tps6594-regulator.c + drivers/regulator/tps6594-regulator.c .. rubric:: Kernel configuration options :name: kernel-configuration-options-regul @@ -283,9 +285,9 @@ Configs to be enabled in kernel: .. code-block:: text - CONFIG_REGULATOR_TPS6594 (TPS6594 regulator support) + CONFIG_REGULATOR_TPS6594 (TPS6594 regulator support) -:: +.. code-block:: menuconfig Device Drivers ---> Voltage and Current Regulator Support ---> @@ -296,15 +298,15 @@ Configs to be enabled in kernel: Regulator summary can be displayed: -.. code-block:: bash +.. code-block:: console - cat /sys/kernel/debug/regulator/regulator_summary + cat /sys/kernel/debug/regulator/regulator_summary Regulator events, if any, can be seen by running this command: -.. code-block:: bash +.. code-block:: console - cat /proc/interrupts + cat /proc/interrupts TPS6594 ESM driver ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -319,7 +321,7 @@ Driver source location: .. code-block:: text - drivers/misc/tps6594-esm.c + drivers/misc/tps6594-esm.c .. rubric:: Kernel configuration options :name: kernel-configuration-options-esm @@ -328,9 +330,9 @@ Configs to be enabled in kernel: .. code-block:: text - CONFIG_TPS6594_ESM (TPS6594 ESM support) + CONFIG_TPS6594_ESM (TPS6594 ESM support) -:: +.. code-block:: menuconfig Device Drivers ---> Misc devices ---> @@ -343,9 +345,9 @@ PMIC ESM will be started at module loading. ESM errors, if any, can be seen by running this command: -.. code-block:: bash +.. code-block:: console - cat /proc/interrupts + cat /proc/interrupts TPS6594 RTC driver ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -354,7 +356,7 @@ Driver source location: .. code-block:: text - drivers/rtc/rtc-tps6594.c + drivers/rtc/rtc-tps6594.c .. rubric:: Kernel configuration options :name: kernel-configuration-options-rtc @@ -363,9 +365,9 @@ Configs to be enabled in kernel: .. code-block:: text - CONFIG_RTC_DRV_TPS6594 (TPS6594 RTC support) + CONFIG_RTC_DRV_TPS6594 (TPS6594 RTC support) -:: +.. code-block:: menuconfig Device Drivers ---> Real Time Clock ---> @@ -379,20 +381,20 @@ device file by the kernel to be used by userspace: .. code-block:: text - /dev/rtcX X - index (zero-based) + /dev/rtcX X - index (zero-based) Read date/time as follow: -.. code-block:: bash +.. code-block:: console - cat /sys/class/rtc/rtc0/date - cat /sys/class/rtc/rtc0/time + cat /sys/class/rtc/rtc0/date + cat /sys/class/rtc/rtc0/time Alarms, if any, can be seen by running this command: -.. code-block:: bash +.. code-block:: console - cat /proc/interrupts + cat /proc/interrupts An example of how to use RTC from a userspace application is given in PFSM driver chapter. @@ -412,7 +414,7 @@ Driver source location: .. code-block:: text - drivers/misc/tps6594-pfsm.c + drivers/misc/tps6594-pfsm.c .. rubric:: Kernel configuration options :name: kernel-configuration-options-pfsm @@ -421,9 +423,9 @@ Configs to be enabled in kernel: .. code-block:: text - CONFIG_TPS6594_PFSM (TPS6594 PFSM support) + CONFIG_TPS6594_PFSM (TPS6594 PFSM support) -:: +.. code-block:: menuconfig Device Drivers ---> Misc devices ---> @@ -437,35 +439,35 @@ device file by the kernel to be used by userspace: .. code-block:: text - /dev/pfsm-X-Y X - chip ID - [0] = TPS6594 - [1] = TPS6593 - [2] = LP8764 + /dev/pfsm-X-Y X - chip ID + [0] = TPS6594 + [1] = TPS6593 + [2] = LP8764 - Y - I2C address or SPI chip select + Y - I2C address or SPI chip select - Example: '/dev/pfsm-1-0x4c' is TPS6593 @ I2C address 0x4c + Example: '/dev/pfsm-1-0x4c' is TPS6593 @ I2C address 0x4c Dump the registers of pages 0 and 1 as follow: .. code-block:: bash - hexdump -C /dev/pfsm-1-0x4c + hexdump -C /dev/pfsm-1-0x4c PFSM events, if any, can be seen by running this command: .. code-block:: bash - cat /proc/interrupts + cat /proc/interrupts For more information, see kernel documentation: .. code-block:: text - Documentation/misc-devices/tps6594-pfsm.rst + Documentation/misc-devices/tps6594-pfsm.rst A userspace code example is also provided: .. code-block:: text - samples/pfsm + samples/pfsm