# TLMM

Source: [https://docs.qualcomm.com/doc/80-70015-4SC/topic/tlmm-developer-touchpoints.html](https://docs.qualcomm.com/doc/80-70015-4SC/topic/tlmm-developer-touchpoints.html)

硬件通过 top-level 模式多路复用器 (TLMM) 控制通用输入/输出 (GPIO) 和替代功能的多路复用。用户可以在启动过程中使用 TLMM 的 DT 属性来配置 GPIO。

可以编辑以下文件路径，以更新 Linux 主机上的属性：

- /boot\_images/boot/Settings/Soc/&lt;Chipset&gt;/Core/SocInfra/TLMM/&lt;Chipset&gt;-pinctrl.dtsi
- /boot\_images/boot/Settings/Soc/&lt;Chipset&gt;/Core/SocInfra/TLMM/tlmm.dtsi

下表列出了如何根据 Qualcomm 参考设备要求来配置 GPIO 默认值的属性。

Table : TLMM DT 属性

| 属性名称 | 属性说明 | 数据类型 | 可能的值/取值范围 | 设备行为 |
| --- | --- | --- | --- | --- |
| QCOM, sleep-config | &lt;Chipset&gt;-pinctrl.dtsi 中定义的 GPIO 配置设置。这些配置将在设备启动时应用。 | UINT32 | 引脚方向：<br><ul class="ul" id="tlmm-developer-touchpoints__ul_emt_cmk_l1c"><br>                                <li class="li">GPIO_INPUT – 0x1</li><br><br>                                <li class="li">GPIO_OUTPUT – 0x2</li><br><br>                            </ul><br><br>引脚拉取配置：<br><ul class="ul" id="tlmm-developer-touchpoints__ul_bc5_yln_vcc"><br>                                <li class="li">GPIO_PULL_DOWN – 0x4</li><br><br>                                <li class="li">GPIO_PULL_UP – 0x8</li><br><br>                                <li class="li">GPIO_NO_PULL – 0x10</li><br><br>                                <li class="li">GPIO_KEEPER – 0x20</li><br><br>                            </ul>引脚输出：<ul class="ul" id="tlmm-developer-touchpoints__ul_h51_4bp_xcc"><br>                                <li class="li">GPIO_OUT_LOW – 0x40</li><br><br>                                <li class="li">GPIO_OUT_HIGH – 0x80</li><br><br>                                <li class="li">GPIO_PRG_YES – 0x100</li><br><br>                                <li class="li">GPIO_PRG_NO – 0x000</li><br><br>                            </ul> | <ul class="ul" id="tlmm-developer-touchpoints__ul_jzt_kmk_l1c"><br>                                <li class="li">默认值为 GPIO_INPUT<ul class="ul" id="tlmm-developer-touchpoints__ul_khh_lmk_l1c"><br>                                        <li class="li">GPIO_INPUT：允许读取输入引脚的状态</li><br><br>                                        <li class="li">GPIO_OUTPUT：控制输出引脚的状态</li><br><br>                                    </ul><br></li><br><br>                            </ul><ul class="ul" id="tlmm-developer-touchpoints__ul_wbp_lmk_l1c"><br>                                <li class="li">默认值为 GPIO_PULL_DOWN。<ul class="ul" id="tlmm-developer-touchpoints__ul_ows_lmk_l1c"><br>                                        <li class="li">GPIO_PULL_DOWN：逻辑 0，视为接地</li><br><br>                                        <li class="li"><br>                                            <p class="p">GPIO_PULL_UP：逻辑 1，连接到 Vdd 电源</p><br><br>                                        </li><br><br>                                        <li class="li"><br>                                            <p class="p">GPIO_NO_PULL：浮动/高阻抗状态</p><br><br>                                        </li><br><br>                                        <li class="li"><br>                                            <p class="p">GPIO_KEEPER：保持 GPIO 先前的状态。当 SoC 进入最深层省电模式时，将应用此配置。</p><br><br>                                        </li><br><br>                                    </ul><br></li><br><br>                            </ul><ul class="ul" id="tlmm-developer-touchpoints__ul_xbm_4mk_l1c"><br>                                <li class="li">默认值为 GPIO_OUT_LOW<p class="p">GPIO_OUT_HIGH：逻辑高电平，视为连接到 Vdd。</p><br></li><br><br>                            </ul><ul class="ul" id="tlmm-developer-touchpoints__ul_tdt_4mk_l1c"><br>                                <li class="li">默认值为 GPIO_PRG_NO。<p class="p">GPIO_PRG_YES：确保任何未使用的 GPIO 在启动后保持低功耗状态</p><br></li><br><br>                            </ul><br><br>                            <br><br><br><br>                            <br>示例：<br><br><br>                            <br>(GPIO_INPUT | GPIO_PULL_DOWN | GPIO_OUT_LOW | GPIO_PRG_NO) /* PIN 10 */Copy to clipboard |
| Compatible | Compatible 属性包含指向兼容芯片组的只读字符串。 | 字符串 | – | 示例：<br><br>compatible = "qcom,&lt;chipset&gt;-pinctrl" |
| reg | 表示只读 GPIO 的基址和大小。 | UINT32 | reg = <0xf100000 0x100000>;Copy to clipboard | 在 `reg` 属性元组中，第一个索引包含基址，第二个索引包含大小。示例： |
| ngpios | 芯片组中只读 GPIO 引脚的数量。 | UINT32 | – | 示例：<br><br><br>                            <br>ngpios = <175>;Copy to clipboard |
| width | 每个 GPIO 引脚都有自己的一组只读控制寄存器。Width 表示引脚到引脚的寄存器偏移量。 | – | – | 示例：<br><br><br>                            <br>width = <0x1000>;Copy to clipboard |
| id | 只读 GPIO 接插口 ID 的硬件实例 | UINT32 | – | 示例：<br><br><br>                            <br>id = <0x0>;Copy to clipboard |
| version | GPIO 只读驱动程序版本。驱动程序 1.0 称为 0x1。 | UINT32 | – | 示例：<br><br><br>                            <br>version = <0x1>;Copy to clipboard |
| gpio-controller | 将连接的只读设备表示为 GPIO 设备的标识符。 | 字符串 | – | – |
| 引脚配置的句柄 | 用于配置 GPIO 备选功能的多路复用配置。有关详细信息，参见 [引脚说明](https://docs.qualcomm.com/bundle/80-23889-1/resource/80-23889-1_REV_AM_QCS6490_QCS5430_Data_Sheet.pdf)。 | – | `sdc4_data_1: sdc4_data_1 { mux = <13 3>; };` | 启动时，GPIO 配置为 GPIO 的备用功能。<br>示例：<br><br><br>sdc4_data_1: sdc4_data_1 { mux = <13 3>; };Copy to clipboard<br><br><br>在此示例中，13 表示 GPIO 编号，3 表示选择的备用功能。 |

**Parent Topic:** [接口](https://docs.qualcomm.com/doc/80-70015-4SC/topic/interfaces.html)

Last Published: Dec 04, 2024

[Previous Topic
PMIC](https://docs.qualcomm.com/bundle/publicresource/80-70015-4SC/topics/pmic-developer-touchpoints.md) [Next Topic
总线](https://docs.qualcomm.com/bundle/publicresource/80-70015-4SC/topics/buses.md)