Skip to content

Commit d8b864c

Browse files
floatiousbjorn-helgaas
authored andcommitted
PCI: dw-rockchip: Add rockchip_pcie_get_ltssm() helper
Add a rockchip_pcie_ltssm() helper function that reads the LTSSM status. This helper will be used in additional places in follow-up commits. Link: https://lore.kernel.org/linux-pci/[email protected] Signed-off-by: Niklas Cassel <[email protected]> Signed-off-by: Krzysztof Wilczyński <[email protected]> Signed-off-by: Bjorn Helgaas <[email protected]> Reviewed-by: Manivannan Sadhasivam <[email protected]>
1 parent 2baa5fc commit d8b864c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

drivers/pci/controller/dwc/pcie-dw-rockchip.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ static int rockchip_pcie_init_irq_domain(struct rockchip_pcie *rockchip)
143143
return 0;
144144
}
145145

146+
static u32 rockchip_pcie_get_ltssm(struct rockchip_pcie *rockchip)
147+
{
148+
return rockchip_pcie_readl_apb(rockchip, PCIE_CLIENT_LTSSM_STATUS);
149+
}
150+
146151
static void rockchip_pcie_enable_ltssm(struct rockchip_pcie *rockchip)
147152
{
148153
rockchip_pcie_writel_apb(rockchip, PCIE_CLIENT_ENABLE_LTSSM,
@@ -152,7 +157,7 @@ static void rockchip_pcie_enable_ltssm(struct rockchip_pcie *rockchip)
152157
static int rockchip_pcie_link_up(struct dw_pcie *pci)
153158
{
154159
struct rockchip_pcie *rockchip = to_rockchip_pcie(pci);
155-
u32 val = rockchip_pcie_readl_apb(rockchip, PCIE_CLIENT_LTSSM_STATUS);
160+
u32 val = rockchip_pcie_get_ltssm(rockchip);
156161

157162
if ((val & PCIE_LINKUP) == PCIE_LINKUP &&
158163
(val & PCIE_LTSSM_STATUS_MASK) == PCIE_L0S_ENTRY)

0 commit comments

Comments
 (0)