mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
67 lines
1.8 KiB
Diff
67 lines
1.8 KiB
Diff
From e1d7ad70ff4447218815f3b9427ee7cd8cc6836b Mon Sep 17 00:00:00 2001
|
|
From: Corentin Labbe <clabbe@baylibre.com>
|
|
Date: Tue, 27 Sep 2022 07:54:52 +0000
|
|
Subject: [PATCH 30/49] crypto: rockchip: handle reset also in PM
|
|
|
|
reset could be handled by PM functions.
|
|
We keep the initial reset pulse to be sure the hw is a know device state
|
|
after probe.
|
|
|
|
Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
|
|
---
|
|
drivers/crypto/rockchip/rk3288_crypto.c | 22 ++++++++++------------
|
|
1 file changed, 10 insertions(+), 12 deletions(-)
|
|
|
|
--- a/drivers/crypto/rockchip/rk3288_crypto.c
|
|
+++ b/drivers/crypto/rockchip/rk3288_crypto.c
|
|
@@ -74,14 +74,23 @@ static int rk_crypto_pm_suspend(struct d
|
|
struct rk_crypto_info *rkdev = dev_get_drvdata(dev);
|
|
|
|
rk_crypto_disable_clk(rkdev);
|
|
+ reset_control_assert(rkdev->rst);
|
|
+
|
|
return 0;
|
|
}
|
|
|
|
static int rk_crypto_pm_resume(struct device *dev)
|
|
{
|
|
struct rk_crypto_info *rkdev = dev_get_drvdata(dev);
|
|
+ int ret;
|
|
+
|
|
+ ret = rk_crypto_enable_clk(rkdev);
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ reset_control_deassert(rkdev->rst);
|
|
+ return 0;
|
|
|
|
- return rk_crypto_enable_clk(rkdev);
|
|
}
|
|
|
|
static const struct dev_pm_ops rk_crypto_pm_ops = {
|
|
@@ -222,13 +231,6 @@ static void rk_crypto_unregister(void)
|
|
}
|
|
}
|
|
|
|
-static void rk_crypto_action(void *data)
|
|
-{
|
|
- struct rk_crypto_info *crypto_info = data;
|
|
-
|
|
- reset_control_assert(crypto_info->rst);
|
|
-}
|
|
-
|
|
static const struct of_device_id crypto_of_id_table[] = {
|
|
{ .compatible = "rockchip,rk3288-crypto" },
|
|
{}
|
|
@@ -258,10 +260,6 @@ static int rk_crypto_probe(struct platfo
|
|
usleep_range(10, 20);
|
|
reset_control_deassert(crypto_info->rst);
|
|
|
|
- err = devm_add_action_or_reset(dev, rk_crypto_action, crypto_info);
|
|
- if (err)
|
|
- goto err_crypto;
|
|
-
|
|
crypto_info->reg = devm_platform_ioremap_resource(pdev, 0);
|
|
if (IS_ERR(crypto_info->reg)) {
|
|
err = PTR_ERR(crypto_info->reg);
|