[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250107102735.317446-3-noltari@gmail.com>
Date: Tue, 7 Jan 2025 11:27:35 +0100
From: Álvaro Fernández Rojas <noltari@...il.com>
To: jonas.gorski@...il.com,
kylehendrydev@...il.com,
florian.fainelli@...adcom.com,
linus.walleij@...aro.org,
bcm-kernel-feedback-list@...adcom.com,
linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: Álvaro Fernández Rojas <noltari@...il.com>
Subject: [PATCH 2/2] pinctrl: bcm63xx: implement gpio_regmap request/free
Implement pinctrl gpio request/free functions on gpio_regmap, which ensures
calling gpio_request_enable on bcm63xx pinctrl drivers when a gpio is
requested.
Signed-off-by: Álvaro Fernández Rojas <noltari@...il.com>
---
drivers/pinctrl/bcm/pinctrl-bcm63xx.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/pinctrl/bcm/pinctrl-bcm63xx.c b/drivers/pinctrl/bcm/pinctrl-bcm63xx.c
index 59d2ce8462d8..4abd52613dfe 100644
--- a/drivers/pinctrl/bcm/pinctrl-bcm63xx.c
+++ b/drivers/pinctrl/bcm/pinctrl-bcm63xx.c
@@ -6,10 +6,12 @@
* Copyright (C) 2016 Jonas Gorski <jonas.gorski@...il.com>
*/
+#include <linux/gpio/driver.h>
#include <linux/gpio/regmap.h>
#include <linux/mfd/syscon.h>
#include <linux/mod_devicetable.h>
#include <linux/of.h>
+#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include "pinctrl-bcm63xx.h"
@@ -32,6 +34,16 @@ static int bcm63xx_reg_mask_xlate(struct gpio_regmap *gpio,
return 0;
}
+static int bcm63xx_request(struct gpio_chip *chip, unsigned int offset)
+{
+ return pinctrl_gpio_request(chip, offset);
+}
+
+static void bcm63xx_free(struct gpio_chip *chip, unsigned int offset)
+{
+ pinctrl_gpio_free(chip, offset);
+}
+
static const struct of_device_id bcm63xx_gpio_of_match[] = {
{ .compatible = "brcm,bcm6318-gpio", },
{ .compatible = "brcm,bcm6328-gpio", },
@@ -57,6 +69,8 @@ static int bcm63xx_gpio_probe(struct device *dev, struct device_node *node,
grc.reg_dir_out_base = BCM63XX_DIROUT_REG;
grc.reg_set_base = BCM63XX_DATA_REG;
grc.reg_mask_xlate = bcm63xx_reg_mask_xlate;
+ grc.request = bcm63xx_request;
+ grc.free = bcm63xx_free;
return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(dev, &grc));
}
--
2.39.5
Powered by blists - more mailing lists