Thread (52 messages) 52 messages, 6 authors, 2018-05-29

Re: [PATCH 16/21] regulator: wm8994: Pass descriptor instead of GPIO number

From: Charles Keepax <ckeepax@opensource.cirrus.com>
Date: 2018-02-13 12:00:31
Also in: lkml

On Mon, Feb 12, 2018 at 02:17:12PM +0100, Linus Walleij wrote:
Instead of passing a global GPIO number for the enable GPIO, pass
a descriptor looked up from the device tree node or the board file
decriptor table for the regulator.

There is a single board file passing the GPIOs for LDO1 and LDO2
through platform data, so augment this to pass descriptors
associated with the i2c device as well.

Cc: patches@opensource.cirrus.com
Cc: Charles Keepax <ckeepax@opensource.cirrus.com>
Cc: Lee Jones <redacted>
Signed-off-by: Linus Walleij <redacted>
---
+	/* Look up LDO enable GPIO from the parent device node */
+	gpiod = devm_gpiod_get_optional(pdev->dev.parent,
+					id ? "wlf,ldo2ena" : "wlf,ldo1ena",
+					GPIOD_OUT_LOW);
+	if (IS_ERR(gpiod))
+		return PTR_ERR(gpiod);
+	config.ena_gpiod = gpiod;
Likewise here the DT bindings for these parts have no -gpio
suffix on them so this will break the DT case.

Thanks,
Charles
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help