mediatek: bump to v4.4
[openwrt.git] / target / linux / mediatek / patches-4.4 / 0037-soc-mediatek-PMIC-wrap-move-wdt_src-into-the-pmic_wr.patch
1 From 50bd0c152a0c33000ae88d0828f320eb603fd535 Mon Sep 17 00:00:00 2001
2 From: John Crispin <blogic@openwrt.org>
3 Date: Wed, 20 Jan 2016 10:48:35 +0100
4 Subject: [PATCH 37/53] soc: mediatek: PMIC wrap: move wdt_src into the
5  pmic_wrapper_type struct
6
7 Different SoCs will use different bitmask for the wdt_src. This patch
8 defines the bitmask in the pmic_wrapper_type struct. This allows us to
9 support new SoCs with a different bitmask to the one currently used.
10
11 Signed-off-by: John Crispin <blogic@openwrt.org>
12 ---
13  drivers/soc/mediatek/mtk-pmic-wrap.c |    9 +++++----
14  1 file changed, 5 insertions(+), 4 deletions(-)
15
16 diff --git a/drivers/soc/mediatek/mtk-pmic-wrap.c b/drivers/soc/mediatek/mtk-pmic-wrap.c
17 index 8ce1bad..aa54df3 100644
18 --- a/drivers/soc/mediatek/mtk-pmic-wrap.c
19 +++ b/drivers/soc/mediatek/mtk-pmic-wrap.c
20 @@ -373,6 +373,7 @@ struct pmic_wrapper_type {
21         u32 arb_en_all;
22         u32 int_en_all;
23         u32 spi_w;
24 +       u32 wdt_src;
25         int (*init_reg_clock)(struct pmic_wrapper *wrp);
26         int (*init_soc_specific)(struct pmic_wrapper *wrp);
27  };
28 @@ -829,6 +830,7 @@ static struct pmic_wrapper_type pwrap_mt8135 = {
29         .arb_en_all = 0x1ff,
30         .int_en_all = ~(BIT(31) | BIT(1)),
31         .spi_w = PWRAP_MAN_CMD_SPI_WRITE,
32 +       .wdt_src = PWRAP_WDT_SRC_MASK_ALL,
33         .init_reg_clock = pwrap_mt8135_init_reg_clock,
34         .init_soc_specific = pwrap_mt8135_init_soc_specific,
35  };
36 @@ -839,6 +841,7 @@ static struct pmic_wrapper_type pwrap_mt8173 = {
37         .arb_en_all = 0x3f,
38         .int_en_all = ~(BIT(31) | BIT(1)),
39         .spi_w = PWRAP_MAN_CMD_SPI_WRITE,
40 +       .wdt_src = PWRAP_WDT_SRC_MASK_NO_STAUPD,
41         .init_reg_clock = pwrap_mt8173_init_reg_clock,
42         .init_soc_specific = pwrap_mt8173_init_soc_specific,
43  };
44 @@ -858,7 +861,7 @@ MODULE_DEVICE_TABLE(of, of_pwrap_match_tbl);
45  
46  static int pwrap_probe(struct platform_device *pdev)
47  {
48 -       int ret, irq, wdt_src;
49 +       int ret, irq;
50         struct pmic_wrapper *wrp;
51         struct device_node *np = pdev->dev.of_node;
52         const struct of_device_id *of_id =
53 @@ -948,9 +951,7 @@ static int pwrap_probe(struct platform_device *pdev)
54          * Since STAUPD was not used on mt8173 platform,
55          * so STAUPD of WDT_SRC which should be turned off
56          */
57 -       wdt_src = pwrap_is_mt8173(wrp) ?
58 -                       PWRAP_WDT_SRC_MASK_NO_STAUPD : PWRAP_WDT_SRC_MASK_ALL;
59 -       pwrap_writel(wrp, wdt_src, PWRAP_WDT_SRC_EN);
60 +       pwrap_writel(wrp, wrp->master->wdt_src, PWRAP_WDT_SRC_EN);
61         pwrap_writel(wrp, 0x1, PWRAP_TIMER_EN);
62         pwrap_writel(wrp, wrp->master->int_en_all, PWRAP_INT_EN);
63  
64 -- 
65 1.7.10.4
66