0037-soc-mediatek-PMIC-wrap-move-wdt_src-into-the-pmic_wr.patch 2.4 KB

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