Skip to content
Snippets Groups Projects
Commit 3c3e15ab authored by Leonard Crestez's avatar Leonard Crestez Committed by Dong Aisheng
Browse files

MLK-21060 i2c: lpi2c: Fix clk fetch


During porting commit ede264ac ("MLK-14982-1 imx8: lpi2c: add ipg
clk for lpi2c driver") which replaced the single clk
with clk_ipg and clk_per was skipped.

Part of the code was later added in commit 96dbdd8c3d0b ("MLK-16713 i2c:
imx-lpi2c: add runtime pm support") except the "clk" field was kept and
clk_get calls were not updated.

Fix imx7ulp boot by fetching both clocks.

Fixes: 96dbdd8c3d0b ("MLK-16713 i2c: imx-lpi2c: add runtime pm support")

Signed-off-by: default avatarLeonard Crestez <leonard.crestez@nxp.com>
Acked-by: default avatarFugang Duan <fugang.duan@nxp.com>
(cherry picked from commit 1b9c92f3)
parent 8dd15e36
No related branches found
No related tags found
No related merge requests found
...@@ -94,7 +94,6 @@ enum lpi2c_imx_pincfg { ...@@ -94,7 +94,6 @@ enum lpi2c_imx_pincfg {
struct lpi2c_imx_struct { struct lpi2c_imx_struct {
struct i2c_adapter adapter; struct i2c_adapter adapter;
struct clk *clk;
int irq; int irq;
struct clk *clk_per; struct clk *clk_per;
struct clk *clk_ipg; struct clk *clk_ipg;
...@@ -571,10 +570,16 @@ static int lpi2c_imx_probe(struct platform_device *pdev) ...@@ -571,10 +570,16 @@ static int lpi2c_imx_probe(struct platform_device *pdev)
strlcpy(lpi2c_imx->adapter.name, pdev->name, strlcpy(lpi2c_imx->adapter.name, pdev->name,
sizeof(lpi2c_imx->adapter.name)); sizeof(lpi2c_imx->adapter.name));
lpi2c_imx->clk = devm_clk_get(&pdev->dev, NULL); lpi2c_imx->clk_per = devm_clk_get(&pdev->dev, "per");
if (IS_ERR(lpi2c_imx->clk)) { if (IS_ERR(lpi2c_imx->clk_per)) {
dev_err(&pdev->dev, "can't get I2C peripheral clock\n"); dev_err(&pdev->dev, "can't get I2C peripheral clock\n");
return PTR_ERR(lpi2c_imx->clk); return PTR_ERR(lpi2c_imx->clk_per);
}
lpi2c_imx->clk_ipg = devm_clk_get(&pdev->dev, "ipg");
if (IS_ERR(lpi2c_imx->clk_ipg)) {
dev_err(&pdev->dev, "can't get I2C ipg clock\n");
return PTR_ERR(lpi2c_imx->clk_ipg);
} }
ret = of_property_read_u32(pdev->dev.of_node, ret = of_property_read_u32(pdev->dev.of_node,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment