Skip to content

Commit de0a01f

Browse files
xlnx-hyunkwonLorenzo Pieralisi
authored andcommitted
PCI: xilinx-nwl: Enable the clock through CCF
Enable PCIe reference clock. There is no remove function that's why this should be enough for simple operation. Normally this clock is enabled by default by firmware but there are usecases where this clock should be enabled by driver itself. It is also good that PCIe clock is recorded in a clock framework. Link: https://lore.kernel.org/r/ee6997a08fab582b1c6de05f8be184f3fe8d5357.1624618100.git.michal.simek@xilinx.com Fixes: ab597d3 ("PCI: xilinx-nwl: Add support for Xilinx NWL PCIe Host Controller") Signed-off-by: Hyun Kwon <[email protected]> Signed-off-by: Bharat Kumar Gogada <[email protected]> Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Cc: [email protected]
1 parent 4d79e36 commit de0a01f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/pci/controller/pcie-xilinx-nwl.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* (C) Copyright 2014 - 2015, Xilinx, Inc.
77
*/
88

9+
#include <linux/clk.h>
910
#include <linux/delay.h>
1011
#include <linux/interrupt.h>
1112
#include <linux/irq.h>
@@ -169,6 +170,7 @@ struct nwl_pcie {
169170
u8 last_busno;
170171
struct nwl_msi msi;
171172
struct irq_domain *legacy_irq_domain;
173+
struct clk *clk;
172174
raw_spinlock_t leg_mask_lock;
173175
};
174176

@@ -823,6 +825,16 @@ static int nwl_pcie_probe(struct platform_device *pdev)
823825
return err;
824826
}
825827

828+
pcie->clk = devm_clk_get(dev, NULL);
829+
if (IS_ERR(pcie->clk))
830+
return PTR_ERR(pcie->clk);
831+
832+
err = clk_prepare_enable(pcie->clk);
833+
if (err) {
834+
dev_err(dev, "can't enable PCIe ref clock\n");
835+
return err;
836+
}
837+
826838
err = nwl_pcie_bridge_init(pcie);
827839
if (err) {
828840
dev_err(dev, "HW Initialization failed\n");

0 commit comments

Comments
 (0)