diff options
| author | Svyatoslav Ryhel <[email protected]> | 2023-07-21 10:50:15 +0300 |
|---|---|---|
| committer | Svyatoslav Ryhel <[email protected]> | 2023-12-19 20:53:53 +0200 |
| commit | 52b6bbf162cb88b2c26fe5567eb32e027081407a (patch) | |
| tree | 18bc4dbaed71cd2dad21774be36e60433b9fa0cd /drivers/power | |
| parent | 6b24c372c1e59e461e2f00e09dd1f8da29263450 (diff) | |
drivers: gpio: implement PALMAS GPIO cell
Add gpio driver for TI Palmas series PMIC. This has 8 gpio which can
work as input/output.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
Diffstat (limited to 'drivers/power')
| -rw-r--r-- | drivers/power/pmic/palmas.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/power/pmic/palmas.c b/drivers/power/pmic/palmas.c index 32f2a938b28..e340a32279f 100644 --- a/drivers/power/pmic/palmas.c +++ b/drivers/power/pmic/palmas.c @@ -46,7 +46,7 @@ static int palmas_read(struct udevice *dev, uint reg, uint8_t *buff, int len) static int palmas_bind(struct udevice *dev) { ofnode pmic_node = ofnode_null(), regulators_node; - ofnode subnode; + ofnode subnode, gpio_node; int children, ret; if (IS_ENABLED(CONFIG_SYSRESET_PALMAS)) { @@ -58,6 +58,14 @@ static int palmas_bind(struct udevice *dev) } } + gpio_node = ofnode_find_subnode(dev_ofnode(dev), "gpio"); + if (ofnode_valid(gpio_node)) { + ret = device_bind_driver_to_node(dev, PALMAS_GPIO_DRIVER, + "gpio", gpio_node, NULL); + if (ret) + log_err("cannot bind GPIOs (ret = %d)\n", ret); + } + dev_for_each_subnode(subnode, dev) { const char *name; char *temp; |
