* [PATCH] pinctrl: sprd: Add CM4 sleep mode support
@ 2019-10-16 12:23 Baolin Wang
2019-10-16 14:01 ` Linus Walleij
0 siblings, 1 reply; 2+ messages in thread
From: Baolin Wang @ 2019-10-16 12:23 UTC (permalink / raw)
To: linus.walleij
Cc: orsonzhai, zhang.lyra, baolin.wang, bruce.chen, linux-gpio, linux-kernel
From: Bruce Chen <bruce.chen@unisoc.com>
For the new Spreadtrum pin controller, it expands 6bits to describe the
pin sleep mode with adding one CM4_SLEEP mode, which means the pin sleep
related configuration will be loaded automatically by hardware when the
CM4 system goes into deep sleep mode.
Signed-off-by: Bruce Chen <bruce.chen@unisoc.com>
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
---
drivers/pinctrl/sprd/pinctrl-sprd.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c
index 8869843..157712ab 100644
--- a/drivers/pinctrl/sprd/pinctrl-sprd.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd.c
@@ -41,7 +41,8 @@
#define PUBCP_SLEEP_MODE BIT(14)
#define TGLDSP_SLEEP_MODE BIT(15)
#define AGDSP_SLEEP_MODE BIT(16)
-#define SLEEP_MODE_MASK GENMASK(3, 0)
+#define CM4_SLEEP_MODE BIT(17)
+#define SLEEP_MODE_MASK GENMASK(5, 0)
#define SLEEP_MODE_SHIFT 13
#define SLEEP_INPUT BIT(1)
@@ -81,6 +82,7 @@ enum pin_sleep_mode {
PUBCP_SLEEP = BIT(1),
TGLDSP_SLEEP = BIT(2),
AGDSP_SLEEP = BIT(3),
+ CM4_SLEEP = BIT(4),
};
enum pin_func_sel {
@@ -616,6 +618,8 @@ static int sprd_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin_id,
val |= TGLDSP_SLEEP_MODE;
if (arg & AGDSP_SLEEP)
val |= AGDSP_SLEEP_MODE;
+ if (arg & CM4_SLEEP)
+ val |= CM4_SLEEP_MODE;
mask = SLEEP_MODE_MASK;
shift = SLEEP_MODE_SHIFT;
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] pinctrl: sprd: Add CM4 sleep mode support
2019-10-16 12:23 [PATCH] pinctrl: sprd: Add CM4 sleep mode support Baolin Wang
@ 2019-10-16 14:01 ` Linus Walleij
0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2019-10-16 14:01 UTC (permalink / raw)
To: Baolin Wang
Cc: Orson Zhai, Lyra Zhang, bruce.chen, open list:GPIO SUBSYSTEM,
linux-kernel
On Wed, Oct 16, 2019 at 2:24 PM Baolin Wang <baolin.wang@linaro.org> wrote:
> From: Bruce Chen <bruce.chen@unisoc.com>
>
> For the new Spreadtrum pin controller, it expands 6bits to describe the
> pin sleep mode with adding one CM4_SLEEP mode, which means the pin sleep
> related configuration will be loaded automatically by hardware when the
> CM4 system goes into deep sleep mode.
>
> Signed-off-by: Bruce Chen <bruce.chen@unisoc.com>
> Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Patch applied.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-16 14:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16 12:23 [PATCH] pinctrl: sprd: Add CM4 sleep mode support Baolin Wang
2019-10-16 14:01 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).