130-regulator-mcp16502-lpm-pin-can-be-optional-on-some-p.patch 1.3 KB

123456789101112131415161718192021222324252627282930
  1. From 763fe72f607d4e929d2c710c88e5c6978dd6ad97 Mon Sep 17 00:00:00 2001
  2. From: Claudiu Beznea <[email protected]>
  3. Date: Thu, 7 Jan 2021 16:15:26 +0200
  4. Subject: [PATCH 130/247] regulator: mcp16502: lpm pin can be optional on some
  5. platforms
  6. On some platform (e.g. SAMA7G5) LPM pin should be optional as it can
  7. be controlled explicitly (via shutdown controller registers) in the
  8. platform specific power saving code to decrease the power consumption
  9. while suspended as this SoC pin may be connected to other devices that
  10. could take power saving actions based on its value.
  11. Signed-off-by: Claudiu Beznea <[email protected]>
  12. Link: https://lore.kernel.org/r/[email protected]
  13. Signed-off-by: Mark Brown <[email protected]>
  14. ---
  15. drivers/regulator/mcp16502.c | 2 +-
  16. 1 file changed, 1 insertion(+), 1 deletion(-)
  17. --- a/drivers/regulator/mcp16502.c
  18. +++ b/drivers/regulator/mcp16502.c
  19. @@ -550,7 +550,7 @@ static int mcp16502_probe(struct i2c_cli
  20. config.regmap = rmap;
  21. config.driver_data = mcp;
  22. - mcp->lpm = devm_gpiod_get(dev, "lpm", GPIOD_OUT_LOW);
  23. + mcp->lpm = devm_gpiod_get_optional(dev, "lpm", GPIOD_OUT_LOW);
  24. if (IS_ERR(mcp->lpm)) {
  25. dev_err(dev, "failed to get lpm pin: %ld\n", PTR_ERR(mcp->lpm));
  26. return PTR_ERR(mcp->lpm);