Commit 631005b2 authored by CK Hu's avatar CK Hu
Browse files

drm/mediatek: add no_clk into ddp private data



Mutex has no clock in some SoC, so add no_clk in private data and get
clock according to no_clk.

Signed-off-by: default avatarCK Hu <ck.hu@mediatek.com>
parent 1037edf2
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -157,6 +157,7 @@ struct mtk_ddp_data {
	const unsigned int *mutex_sof;
	const unsigned int mutex_mod_reg;
	const unsigned int mutex_sof_reg;
	const bool no_clk;
};

struct mtk_ddp {
@@ -622,11 +623,15 @@ static int mtk_ddp_probe(struct platform_device *pdev)
	for (i = 0; i < 10; i++)
		ddp->mutex[i].id = i;

	ddp->data = of_device_get_match_data(dev);

	if (!ddp->data->no_clk) {
		ddp->clk = devm_clk_get(dev, NULL);
		if (IS_ERR(ddp->clk)) {
			dev_err(dev, "Failed to get clock\n");
			return PTR_ERR(ddp->clk);
		}
	}

	regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	ddp->regs = devm_ioremap_resource(dev, regs);
@@ -635,8 +640,6 @@ static int mtk_ddp_probe(struct platform_device *pdev)
		return PTR_ERR(ddp->regs);
	}

	ddp->data = of_device_get_match_data(dev);

	platform_set_drvdata(pdev, ddp);

	return 0;