Skip to content

Commit 037e8cf

Browse files
nxpfrankliwilldeacon
authored andcommitted
perf/imx_ddr: Get and enable optional clks
Get and enable optional clks because fsl,imx8dxl-db-pmu have two clocks. Signed-off-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Will Deacon <will@kernel.org>
1 parent 66db99f commit 037e8cf

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

drivers/perf/fsl_imx8_ddr_perf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include <linux/bitfield.h>
8+
#include <linux/clk.h>
89
#include <linux/init.h>
910
#include <linux/interrupt.h>
1011
#include <linux/io.h>
@@ -732,10 +733,12 @@ static int ddr_perf_offline_cpu(unsigned int cpu, struct hlist_node *node)
732733

733734
static int ddr_perf_probe(struct platform_device *pdev)
734735
{
736+
struct clk_bulk_data *clks;
735737
struct ddr_pmu *pmu;
736738
struct device_node *np;
737739
void __iomem *base;
738740
char *name;
741+
int nclks;
739742
int num;
740743
int ret;
741744
int irq;
@@ -754,6 +757,10 @@ static int ddr_perf_probe(struct platform_device *pdev)
754757

755758
platform_set_drvdata(pdev, pmu);
756759

760+
nclks = devm_clk_bulk_get_all_enabled(&pdev->dev, &clks);
761+
if (nclks < 0)
762+
return dev_err_probe(&pdev->dev, nclks, "Failure get clks\n");
763+
757764
num = ida_alloc(&ddr_ida, GFP_KERNEL);
758765
if (num < 0)
759766
return num;

0 commit comments

Comments
 (0)