All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Crispin <blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
To: Matthias Brugger <matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	"Steven Liu (劉人豪)"
	<steven.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>
Subject: [PATCH 2/2] soc: mediatek: PMIC wrap: INT_EN mask may vary
Date: Tue,  5 Jan 2016 17:29:03 +0100	[thread overview]
Message-ID: <1452011343-28502-2-git-send-email-blogic@openwrt.org> (raw)
In-Reply-To: <1452011343-28502-1-git-send-email-blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>

The MT7623 and possible other SoCs have a different INT_EN mask. Change
the driver so that it handles the interrupt mask in the same was as
arb_en_all.

Signed-off-by: John Crispin <blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
---
 drivers/soc/mediatek/mtk-pmic-wrap.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
index f3fccea..82350d0 100644
--- a/drivers/soc/mediatek/mtk-pmic-wrap.c
+++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
@@ -404,6 +404,7 @@ struct pmic_wrapper_type {
 	u32 dew_base;
 	enum pwrap_type type;
 	u32 arb_en_all;
+	u32 int_en_all;
 };
 
 static struct pmic_wrapper_type pwrap_mt8135 = {
@@ -412,6 +413,7 @@ static struct pmic_wrapper_type pwrap_mt8135 = {
 	.dew_base = 0xbc00,
 	.type = PWRAP_MT8135,
 	.arb_en_all = 0x1ff,
+	.int_en_all = BIT(31) | BIT(1),
 };
 
 static struct pmic_wrapper_type pwrap_mt8173 = {
@@ -420,6 +422,7 @@ static struct pmic_wrapper_type pwrap_mt8173 = {
 	.dew_base = 0xbc00,
 	.type = PWRAP_MT8173,
 	.arb_en_all = 0x3f,
+	.int_en_all = BIT(31) | BIT(1),
 };
 
 struct pmic_wrapper {
@@ -431,6 +434,7 @@ struct pmic_wrapper {
 	u32 dew_base;
 	enum pwrap_type type;
 	u32 arb_en_all;
+	u32 int_en_all;
 	struct clk *clk_spi;
 	struct clk *clk_wrap;
 	struct reset_control *rstc;
@@ -900,6 +904,7 @@ static int pwrap_probe(struct platform_device *pdev)
 	wrp->dew_regs = type->dew_regs;
 	wrp->dew_base = type->dew_base;
 	wrp->arb_en_all = type->arb_en_all;
+	wrp->int_en_all = type->int_en_all;
 	wrp->dev = &pdev->dev;
 
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pwrap");
@@ -974,7 +979,7 @@ static int pwrap_probe(struct platform_device *pdev)
 	pwrap_writel(wrp, 0xf, PWRAP_WDT_UNIT);
 	pwrap_writel(wrp, 0xffffffff, PWRAP_WDT_SRC_EN);
 	pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
-	pwrap_writel(wrp, ~((1 << 31) | (1 << 1)), PWRAP_INT_EN);
+	pwrap_writel(wrp, ~wrp->int_en_all, PWRAP_INT_EN);
 
 	irq = platform_get_irq(pdev, 0);
 	ret = devm_request_irq(wrp->dev, irq, pwrap_interrupt, IRQF_TRIGGER_HIGH,
-- 
1.7.10.4

      parent reply	other threads:[~2016-01-05 16:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-05 16:29 [PATCH 1/2] soc: mediatek: PMIC wrap: DEW base addr may vary John Crispin
     [not found] ` <1452011343-28502-1-git-send-email-blogic-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2016-01-05 16:29   ` John Crispin [this message]

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=1452011343-28502-2-git-send-email-blogic@openwrt.org \
    --to=blogic-p3rkhjxn3npafugrpc6u6w@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=steven.liu-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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.