@@ -47,7 +47,8 @@
struct exynos_trng_dev {
struct device *dev;
void __iomem *mem;
- struct clk *clk;
+ struct clk *clk; /* operating clock */
+ struct clk *pclk; /* bus clock */
struct hwrng rng;
};
@@ -141,6 +142,13 @@ static int exynos_trng_probe(struct platform_device *pdev)
goto err_clock;
}
+ trng->pclk = devm_clk_get_optional_enabled(&pdev->dev, "pclk");
+ if (IS_ERR(trng->pclk)) {
+ ret = dev_err_probe(&pdev->dev, PTR_ERR(trng->pclk),
+ "Could not get pclk\n");
+ goto err_clock;
+ }
+
ret = devm_hwrng_register(&pdev->dev, &trng->rng);
if (ret) {
dev_err(&pdev->dev, "Could not register hwrng device.\n");