* [PATCH 0/2] memory: omap-gpmc: improve the GPIO chip implementation
@ 2025-04-07 7:21 Bartosz Golaszewski
2025-04-07 7:21 ` [PATCH 1/2] memory: omap-gpmc: use the dedicated define for GPIO direction Bartosz Golaszewski
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2025-04-07 7:21 UTC (permalink / raw)
To: Roger Quadros, Tony Lindgren, Krzysztof Kozlowski, Linus Walleij,
Bartosz Golaszewski
Cc: linux-omap, linux-kernel, linux-gpio, Bartosz Golaszewski
struct gpio_chip now has callbacks for setting line values that return
an integer, allowing to indicate failures. We're in the process of
converting all GPIO drivers to using the new API. However, this
driver doesn't even need the set() callback so let's remove it
altogether.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
Bartosz Golaszewski (2):
memory: omap-gpmc: use the dedicated define for GPIO direction
memory: omap-gpmc: remove GPIO set() and direction_output() callbacks
drivers/memory/omap-gpmc.c | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
---
base-commit: 0af2f6be1b4281385b618cb86ad946eded089ac8
change-id: 20250327-gpiochip-set-rv-memory-87bf23c66b7a
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH 1/2] memory: omap-gpmc: use the dedicated define for GPIO direction
2025-04-07 7:21 [PATCH 0/2] memory: omap-gpmc: improve the GPIO chip implementation Bartosz Golaszewski
@ 2025-04-07 7:21 ` Bartosz Golaszewski
2025-04-07 7:21 ` [PATCH 2/2] memory: omap-gpmc: remove GPIO set() and direction_output() callbacks Bartosz Golaszewski
2025-04-15 6:20 ` [PATCH 0/2] memory: omap-gpmc: improve the GPIO chip implementation Krzysztof Kozlowski
2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2025-04-07 7:21 UTC (permalink / raw)
To: Roger Quadros, Tony Lindgren, Krzysztof Kozlowski, Linus Walleij,
Bartosz Golaszewski
Cc: linux-omap, linux-kernel, linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
We have a constant defined for this purpose in the gpio/driver.h header
so use it instead of a magic value.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/memory/omap-gpmc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index 53f1888cc84f..d4fe4c5a57e7 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -2376,7 +2376,7 @@ static void gpmc_probe_dt_children(struct platform_device *pdev)
static int gpmc_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
{
- return 1; /* we're input only */
+ return GPIO_LINE_DIRECTION_IN; /* we're input only */
}
static int gpmc_gpio_direction_input(struct gpio_chip *chip,
--
2.45.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* [PATCH 2/2] memory: omap-gpmc: remove GPIO set() and direction_output() callbacks
2025-04-07 7:21 [PATCH 0/2] memory: omap-gpmc: improve the GPIO chip implementation Bartosz Golaszewski
2025-04-07 7:21 ` [PATCH 1/2] memory: omap-gpmc: use the dedicated define for GPIO direction Bartosz Golaszewski
@ 2025-04-07 7:21 ` Bartosz Golaszewski
2025-04-15 6:20 ` [PATCH 0/2] memory: omap-gpmc: improve the GPIO chip implementation Krzysztof Kozlowski
2 siblings, 0 replies; 4+ messages in thread
From: Bartosz Golaszewski @ 2025-04-07 7:21 UTC (permalink / raw)
To: Roger Quadros, Tony Lindgren, Krzysztof Kozlowski, Linus Walleij,
Bartosz Golaszewski
Cc: linux-omap, linux-kernel, linux-gpio, Bartosz Golaszewski
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
This driver implements an input-only GPIO controller. There's no need to
implement the set() and direction_output() callbacks in this case, the
GPIO core will handle it.
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
drivers/memory/omap-gpmc.c | 13 -------------
1 file changed, 13 deletions(-)
diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c
index d4fe4c5a57e7..a61e71c31f20 100644
--- a/drivers/memory/omap-gpmc.c
+++ b/drivers/memory/omap-gpmc.c
@@ -2385,17 +2385,6 @@ static int gpmc_gpio_direction_input(struct gpio_chip *chip,
return 0; /* we're input only */
}
-static int gpmc_gpio_direction_output(struct gpio_chip *chip,
- unsigned int offset, int value)
-{
- return -EINVAL; /* we're input only */
-}
-
-static void gpmc_gpio_set(struct gpio_chip *chip, unsigned int offset,
- int value)
-{
-}
-
static int gpmc_gpio_get(struct gpio_chip *chip, unsigned int offset)
{
u32 reg;
@@ -2417,8 +2406,6 @@ static int gpmc_gpio_init(struct gpmc_device *gpmc)
gpmc->gpio_chip.ngpio = gpmc_nr_waitpins;
gpmc->gpio_chip.get_direction = gpmc_gpio_get_direction;
gpmc->gpio_chip.direction_input = gpmc_gpio_direction_input;
- gpmc->gpio_chip.direction_output = gpmc_gpio_direction_output;
- gpmc->gpio_chip.set = gpmc_gpio_set;
gpmc->gpio_chip.get = gpmc_gpio_get;
gpmc->gpio_chip.base = -1;
--
2.45.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH 0/2] memory: omap-gpmc: improve the GPIO chip implementation
2025-04-07 7:21 [PATCH 0/2] memory: omap-gpmc: improve the GPIO chip implementation Bartosz Golaszewski
2025-04-07 7:21 ` [PATCH 1/2] memory: omap-gpmc: use the dedicated define for GPIO direction Bartosz Golaszewski
2025-04-07 7:21 ` [PATCH 2/2] memory: omap-gpmc: remove GPIO set() and direction_output() callbacks Bartosz Golaszewski
@ 2025-04-15 6:20 ` Krzysztof Kozlowski
2 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-15 6:20 UTC (permalink / raw)
To: Roger Quadros, Tony Lindgren, Krzysztof Kozlowski, Linus Walleij,
Bartosz Golaszewski
Cc: linux-omap, linux-kernel, linux-gpio, Bartosz Golaszewski
On Mon, 07 Apr 2025 09:21:18 +0200, Bartosz Golaszewski wrote:
> struct gpio_chip now has callbacks for setting line values that return
> an integer, allowing to indicate failures. We're in the process of
> converting all GPIO drivers to using the new API. However, this
> driver doesn't even need the set() callback so let's remove it
> altogether.
>
>
> [...]
Applied, thanks!
[1/2] memory: omap-gpmc: use the dedicated define for GPIO direction
https://git.kernel.org/krzk/linux-mem-ctrl/c/a63f9903a56fabe17a0c71dd0c291499d28214c5
[2/2] memory: omap-gpmc: remove GPIO set() and direction_output() callbacks
https://git.kernel.org/krzk/linux-mem-ctrl/c/1f34b5a9f09696eaf464c6ed06a055ed9cde3425
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-04-15 6:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-07 7:21 [PATCH 0/2] memory: omap-gpmc: improve the GPIO chip implementation Bartosz Golaszewski
2025-04-07 7:21 ` [PATCH 1/2] memory: omap-gpmc: use the dedicated define for GPIO direction Bartosz Golaszewski
2025-04-07 7:21 ` [PATCH 2/2] memory: omap-gpmc: remove GPIO set() and direction_output() callbacks Bartosz Golaszewski
2025-04-15 6:20 ` [PATCH 0/2] memory: omap-gpmc: improve the GPIO chip implementation Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).