12679a20bda4183847e172d6465e0001c15b7997
[openwrt/openwrt.git] / target / linux / at91 / patches-5.15 / 130-regulator-mcp16502-lpm-pin-can-be-optional-on-some-p.patch
1 From 763fe72f607d4e929d2c710c88e5c6978dd6ad97 Mon Sep 17 00:00:00 2001
2 From: Claudiu Beznea <claudiu.beznea@microchip.com>
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
7 On some platform (e.g. SAMA7G5) LPM pin should be optional as it can
8 be controlled explicitly (via shutdown controller registers) in the
9 platform specific power saving code to decrease the power consumption
10 while suspended as this SoC pin may be connected to other devices that
11 could take power saving actions based on its value.
12
13 Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
14 Link: https://lore.kernel.org/r/1610028927-9842-3-git-send-email-claudiu.beznea@microchip.com
15 Signed-off-by: Mark Brown <broonie@kernel.org>
16 ---
17 drivers/regulator/mcp16502.c | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20 --- a/drivers/regulator/mcp16502.c
21 +++ b/drivers/regulator/mcp16502.c
22 @@ -550,7 +550,7 @@ static int mcp16502_probe(struct i2c_cli
23 config.regmap = rmap;
24 config.driver_data = mcp;
25
26 - mcp->lpm = devm_gpiod_get(dev, "lpm", GPIOD_OUT_LOW);
27 + mcp->lpm = devm_gpiod_get_optional(dev, "lpm", GPIOD_OUT_LOW);
28 if (IS_ERR(mcp->lpm)) {
29 dev_err(dev, "failed to get lpm pin: %ld\n", PTR_ERR(mcp->lpm));
30 return PTR_ERR(mcp->lpm);