All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
To: matti.vaittinen@fi.rohmeurope.com, mazziesaccount@gmail.com
Cc: Lee Jones <lee.jones@linaro.org>,
	Rob Herring <robh+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-power@fi.rohmeurope.com
Subject: [PATCH v3 11/15] regulator: rohm-regulator: Support SNVS HW state.
Date: Mon, 8 Mar 2021 12:44:24 +0200	[thread overview]
Message-ID: <4e9d048689acb3570159e87f31becf39455af3c9.1615198094.git.matti.vaittinen@fi.rohmeurope.com> (raw)
In-Reply-To: <cover.1615198094.git.matti.vaittinen@fi.rohmeurope.com>

The ROHM BD71815 supports setting voltage levels/regulator status
for HW-states "RUN", "SUSPEND", "LPSR" and "SNVS". Add DT parsing
helper also for SNVS state.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
---
 drivers/regulator/rohm-regulator.c | 6 ++++++
 include/linux/mfd/rohm-generic.h   | 6 +++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/rohm-regulator.c b/drivers/regulator/rohm-regulator.c
index 63aabb8c7786..6e0d9c08ec1c 100644
--- a/drivers/regulator/rohm-regulator.c
+++ b/drivers/regulator/rohm-regulator.c
@@ -95,6 +95,12 @@ int rohm_regulator_set_dvs_levels(const struct rohm_dvs_config *dvs,
 				mask = dvs->lpsr_mask;
 				omask = dvs->lpsr_on_mask;
 				break;
+			case ROHM_DVS_LEVEL_SNVS:
+				prop = "rohm,dvs-snvs-voltage";
+				reg = dvs->snvs_reg;
+				mask = dvs->snvs_mask;
+				omask = dvs->snvs_on_mask;
+				break;
 			default:
 				return -EINVAL;
 			}
diff --git a/include/linux/mfd/rohm-generic.h b/include/linux/mfd/rohm-generic.h
index e5392bcbc098..afcd1760c5d3 100644
--- a/include/linux/mfd/rohm-generic.h
+++ b/include/linux/mfd/rohm-generic.h
@@ -27,7 +27,8 @@ struct rohm_regmap_dev {
 #define ROHM_DVS_LEVEL_IDLE		BIT(1)
 #define ROHM_DVS_LEVEL_SUSPEND		BIT(2)
 #define ROHM_DVS_LEVEL_LPSR		BIT(3)
-#define ROHM_DVS_LEVEL_VALID_AMOUNT	4
+#define ROHM_DVS_LEVEL_SNVS		BIT(4)
+#define ROHM_DVS_LEVEL_VALID_AMOUNT	5
 #define ROHM_DVS_LEVEL_UNKNOWN		0
 
 /**
@@ -66,6 +67,9 @@ struct rohm_dvs_config {
 	unsigned int lpsr_reg;
 	unsigned int lpsr_mask;
 	unsigned int lpsr_on_mask;
+	unsigned int snvs_reg;
+	unsigned int snvs_mask;
+	unsigned int snvs_on_mask;
 };
 
 #if IS_ENABLED(CONFIG_REGULATOR_ROHM)
-- 
2.25.4


-- 
Matti Vaittinen, Linux device drivers
ROHM Semiconductors, Finland SWDC
Kiviharjunlenkki 1E
90220 OULU
FINLAND

~~~ "I don't think so," said Rene Descartes. Just then he vanished ~~~
Simon says - in Latin please.
~~~ "non cogito me" dixit Rene Descarte, deinde evanescavit ~~~
Thanks to Simon Glass for the translation =] 

  parent reply	other threads:[~2021-03-08 10:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-08 10:39 [PATCH v3 00/15] Support ROHM BD71815 PMIC Matti Vaittinen
2021-03-08 10:39 ` [PATCH v3 01/15] rtc: bd70528: Do not require parent data Matti Vaittinen
2021-03-08 10:39 ` [PATCH v3 02/15] mfd: bd718x7: simplify by cleaning unnecessary device data Matti Vaittinen
2021-03-08 10:40 ` [PATCH v3 03/15] dt_bindings: bd71828: Add clock output mode Matti Vaittinen
2021-03-08 10:40 ` [PATCH v3 04/15] dt_bindings: regulator: Add ROHM BD71815 PMIC regulators Matti Vaittinen
2021-03-08 10:40 ` [PATCH v3 05/15] dt_bindings: mfd: Add ROHM BD71815 PMIC Matti Vaittinen
2021-03-08 17:39   ` Rob Herring
2021-03-09 12:51     ` Matti Vaittinen
2021-03-09 15:11       ` Rob Herring
2021-03-10  6:30         ` Matti Vaittinen
2021-03-08 10:41 ` [PATCH v3 06/15] mfd: Add ROHM BD71815 ID Matti Vaittinen
2021-03-10 10:36   ` Lee Jones
2021-03-10 11:07     ` Vaittinen, Matti
2021-03-10 11:17       ` Lee Jones
2021-03-10 13:02         ` Matti Vaittinen
2021-03-10 13:31           ` Lee Jones
2021-03-10 14:39             ` Matti Vaittinen
2021-03-10 16:38               ` Lee Jones
2021-03-08 10:42 ` [PATCH v3 07/15] mfd: Support for ROHM BD71815 PMIC core Matti Vaittinen
2021-03-10 10:40   ` Lee Jones
2021-03-08 10:43 ` [PATCH v3 08/15] gpio: support ROHM BD71815 GPOs Matti Vaittinen
2021-03-08 10:43 ` [PATCH v3 09/15] regulator: helpers: Export helper voltage listing Matti Vaittinen
2021-03-08 10:44 ` Matti Vaittinen [this message]
2021-03-10 10:43   ` [PATCH v3 11/15] regulator: rohm-regulator: Support SNVS HW state Lee Jones
2021-03-08 10:44 ` [PATCH v3 12/15] regulator: Support ROHM BD71815 regulators Matti Vaittinen
2021-03-08 10:45 ` [PATCH v3 13/15] clk: bd718x7: Add support for clk gate on ROHM BD71815 PMIC Matti Vaittinen
2021-03-08 10:45 ` [PATCH v3 14/15] rtc: bd70528: Support RTC on ROHM BD71815 Matti Vaittinen
2021-03-08 10:45 ` [PATCH v3 15/15] MAINTAINERS: Add ROHM BD71815AGW Matti Vaittinen

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=4e9d048689acb3570159e87f31becf39455af3c9.1615198094.git.matti.vaittinen@fi.rohmeurope.com \
    --to=matti.vaittinen@fi.rohmeurope.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=robh+dt@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.