aboutsummaryrefslogtreecommitdiff
path: root/target/linux/mediatek/patches-6.6/930-spi-mt65xx-enable-sel-clk.patch
blob: eb25b99eb422df2cf2e8d3b6955d554241504af8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--- a/drivers/spi/spi-mt65xx.c
+++ b/drivers/spi/spi-mt65xx.c
@@ -1228,8 +1228,15 @@ static int mtk_spi_probe(struct platform
 	if (ret < 0)
 		return dev_err_probe(dev, ret, "failed to enable hclk\n");
 
+	ret = clk_prepare_enable(mdata->sel_clk);
+	if (ret < 0) {
+		clk_disable_unprepare(mdata->spi_hclk);
+		return dev_err_probe(dev, ret, "failed to enable sel_clk\n");
+	}
+
 	ret = clk_prepare_enable(mdata->spi_clk);
 	if (ret < 0) {
+		clk_disable_unprepare(mdata->sel_clk);
 		clk_disable_unprepare(mdata->spi_hclk);
 		return dev_err_probe(dev, ret, "failed to enable spi_clk\n");
 	}