All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: linux-crypto@vger.kernel.org,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S . Miller" <davem@davemloft.net>
Cc: phone-devel@vger.kernel.org, Stefan Hansson <newbyte@disroot.org>,
	Linus Walleij <linus.walleij@linaro.org>
Subject: [PATCH 12/15 v2] crypto: ux500/hash: Drop regulator handling
Date: Mon, 25 Jul 2022 16:05:01 +0200	[thread overview]
Message-ID: <20220725140504.2398965-13-linus.walleij@linaro.org> (raw)
In-Reply-To: <20220725140504.2398965-1-linus.walleij@linaro.org>

This "APE" voltage is not handled by a regulator but by the
power domain, drop it.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
ChangeLog v1->v2:
- New patch after noticing the power domain is handling this
  voltage.
---
 drivers/crypto/ux500/hash/hash_core.c | 38 +++------------------------
 1 file changed, 4 insertions(+), 34 deletions(-)

diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/crypto/ux500/hash/hash_core.c
index 390e50b2b1d2..3bd58b60aade 100644
--- a/drivers/crypto/ux500/hash/hash_core.c
+++ b/drivers/crypto/ux500/hash/hash_core.c
@@ -24,8 +24,6 @@
 #include <linux/mod_devicetable.h>
 #include <linux/platform_device.h>
 #include <linux/crypto.h>
-
-#include <linux/regulator/consumer.h>
 #include <linux/dmaengine.h>
 #include <linux/bitops.h>
 
@@ -244,22 +242,17 @@ static int get_empty_message_digest(
  * hash_disable_power - Request to disable power and clock.
  * @device_data:	Structure for the hash device.
  *
- * This function request for disabling power (regulator) and clock,
- * and could also save current hw state.
+ * This function request for disabling the clock.
  */
 static int hash_disable_power(struct hash_device_data *device_data)
 {
 	int ret = 0;
-	struct device *dev = device_data->dev;
 
 	spin_lock(&device_data->power_state_lock);
 	if (!device_data->power_state)
 		goto out;
 
 	clk_disable(device_data->clk);
-	ret = regulator_disable(device_data->regulator);
-	if (ret)
-		dev_err(dev, "%s: regulator_disable() failed!\n", __func__);
 
 	device_data->power_state = false;
 
@@ -273,8 +266,7 @@ static int hash_disable_power(struct hash_device_data *device_data)
  * hash_enable_power - Request to enable power and clock.
  * @device_data:		Structure for the hash device.
  *
- * This function request for enabling power (regulator) and clock,
- * and could also restore a previously saved hw state.
+ * This function request for enabling the clock.
  */
 static int hash_enable_power(struct hash_device_data *device_data)
 {
@@ -283,17 +275,9 @@ static int hash_enable_power(struct hash_device_data *device_data)
 
 	spin_lock(&device_data->power_state_lock);
 	if (!device_data->power_state) {
-		ret = regulator_enable(device_data->regulator);
-		if (ret) {
-			dev_err(dev, "%s: regulator_enable() failed!\n",
-				__func__);
-			goto out;
-		}
 		ret = clk_enable(device_data->clk);
 		if (ret) {
 			dev_err(dev, "%s: clk_enable() failed!\n", __func__);
-			ret = regulator_disable(
-					device_data->regulator);
 			goto out;
 		}
 		device_data->power_state = true;
@@ -1487,27 +1471,17 @@ static int ux500_hash_probe(struct platform_device *pdev)
 	spin_lock_init(&device_data->ctx_lock);
 	spin_lock_init(&device_data->power_state_lock);
 
-	/* Enable power for HASH1 hardware block */
-	device_data->regulator = regulator_get(dev, "v-ape");
-	if (IS_ERR(device_data->regulator)) {
-		dev_err(dev, "%s: regulator_get() failed!\n", __func__);
-		ret = PTR_ERR(device_data->regulator);
-		device_data->regulator = NULL;
-		goto out;
-	}
-
-	/* Enable the clock for HASH1 hardware block */
 	device_data->clk = devm_clk_get(dev, NULL);
 	if (IS_ERR(device_data->clk)) {
 		dev_err(dev, "%s: clk_get() failed!\n", __func__);
 		ret = PTR_ERR(device_data->clk);
-		goto out_regulator;
+		goto out;
 	}
 
 	ret = clk_prepare(device_data->clk);
 	if (ret) {
 		dev_err(dev, "%s: clk_prepare() failed!\n", __func__);
-		goto out_regulator;
+		goto out;
 	}
 
 	/* Enable device power (and clock) */
@@ -1544,9 +1518,6 @@ static int ux500_hash_probe(struct platform_device *pdev)
 out_clk_unprepare:
 	clk_unprepare(device_data->clk);
 
-out_regulator:
-	regulator_put(device_data->regulator);
-
 out:
 	return ret;
 }
@@ -1585,7 +1556,6 @@ static int ux500_hash_remove(struct platform_device *pdev)
 			__func__);
 
 	clk_unprepare(device_data->clk);
-	regulator_put(device_data->regulator);
 
 	return 0;
 }
-- 
2.36.1


  parent reply	other threads:[~2022-07-25 14:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 14:04 [PATCH 00/15 v2] Ux500 hash cleanup Linus Walleij
2022-07-25 14:04 ` [PATCH 01/15 v2] crypto: ux500/hash: Pass ctx to hash_setconfiguration() Linus Walleij
2022-07-25 14:04 ` [PATCH 02/15 v2] crypto: ux500/hash: Get rid of custom device list Linus Walleij
2022-07-25 14:04 ` [PATCH 03/15 v2] crypto: ux500/hash: Pass context to zero message digest Linus Walleij
2022-07-25 14:04 ` [PATCH 04/15 v2] crypto: ux500/hash: Drop custom state save/restore Linus Walleij
2022-07-25 14:04 ` [PATCH 05/15 v2] crypto: ux500/hash: Drop bit index Linus Walleij
2022-07-25 14:04 ` [PATCH 06/15 v2] crypto: ux500/hash: Break while/do instead of if/else Linus Walleij
2022-07-25 14:04 ` [PATCH 07/15 v2] crypto: ux500/hash: Rename and switch type of member Linus Walleij
2022-07-25 14:04 ` [PATCH 08/15 v2] crypto: ux500/hash: Stop saving/restoring compulsively Linus Walleij
2022-07-25 14:04 ` [PATCH 09/15 v2] crypto: ux500/hash: Get rid of state from request context Linus Walleij
2022-07-25 14:04 ` [PATCH 10/15 v2] crypto: ux500/hash: Implement .export and .import Linus Walleij
2022-07-25 14:05 ` [PATCH 11/15 v2] crypto: ux500/hash: Drop custom uint64 type Linus Walleij
2022-07-25 14:05 ` Linus Walleij [this message]
2022-07-25 14:05 ` [PATCH 13/15 v2] crypto: ux500/hash: Convert to regmap MMIO Linus Walleij
2022-07-25 14:05 ` [PATCH 14/15 v2] crypto: ux500/hash: Use AMBA core primecell IDs Linus Walleij
2022-07-25 14:05 ` [PATCH 15/15 v2] crypto: ux500/hash: Implement runtime PM Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220725140504.2398965-13-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=newbyte@disroot.org \
    --cc=phone-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.