[PATCH v5 5/8] PCI: dw-rockchip: Add helper function for DDL indicator
Sebastian Reichel
sebastian.reichel at collabora.com
Mon Mar 16 12:10:49 PDT 2026
Remove code duplication and improve readability by introducing a new
function to setup the DLL indicator.
Signed-off-by: Sebastian Reichel <sebastian.reichel at collabora.com>
---
drivers/pci/controller/dwc/pcie-dw-rockchip.c | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-dw-rockchip.c b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
index 373ab897228b..8cb0040b4ae1 100644
--- a/drivers/pci/controller/dwc/pcie-dw-rockchip.c
+++ b/drivers/pci/controller/dwc/pcie-dw-rockchip.c
@@ -560,6 +560,16 @@ static void rockchip_pcie_set_controller_mode(struct rockchip_pcie *rockchip, u3
rockchip_pcie_writel_apb(rockchip, PCIE_CLIENT_SET_MODE(mode), PCIE_CLIENT_GENERAL_CON);
}
+static void rockchip_pcie_unmask_dll_indicator(struct rockchip_pcie *rockchip)
+{
+ u32 val;
+
+ /* unmask DLL up/down indicator and hot reset/link-down reset */
+ val = FIELD_PREP_WM16(PCIE_RDLH_LINK_UP_CHGED, 0) |
+ FIELD_PREP_WM16(PCIE_LINK_REQ_RST_NOT_INT, 0);
+ rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_INTR_MASK_MISC);
+}
+
static int rockchip_pcie_configure_rc(struct rockchip_pcie *rockchip)
{
struct dw_pcie_rp *pp;
@@ -581,7 +591,6 @@ static int rockchip_pcie_configure_ep(struct platform_device *pdev,
{
struct device *dev = &pdev->dev;
int irq, ret;
- u32 val;
if (!IS_ENABLED(CONFIG_PCIE_ROCKCHIP_DW_EP))
return -ENODEV;
@@ -621,10 +630,7 @@ static int rockchip_pcie_configure_ep(struct platform_device *pdev,
pci_epc_init_notify(rockchip->pci.ep.epc);
- /* unmask DLL up/down indicator and hot reset/link-down reset */
- val = FIELD_PREP_WM16(PCIE_RDLH_LINK_UP_CHGED, 0) |
- FIELD_PREP_WM16(PCIE_LINK_REQ_RST_NOT_INT, 0);
- rockchip_pcie_writel_apb(rockchip, val, PCIE_CLIENT_INTR_MASK_MISC);
+ rockchip_pcie_unmask_dll_indicator(rockchip);
return ret;
}
--
2.51.0
More information about the Linux-rockchip
mailing list