public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH v1 1/6] rockchip: gpio: rk_gpio: use ROCKCHIP_GPIOS_PER_BANK as divider
@ 2023-03-16 16:46 Johan Jonker
  2023-03-16 16:47 ` [PATCH v1 2/6] arm: dts: rockchip: rk3066a-u-boot: add gpio-ranges Johan Jonker
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: Johan Jonker @ 2023-03-16 16:46 UTC (permalink / raw)
  To: kever.yang; +Cc: sjg, philipp.tomsich, u-boot

The current divider to calculate the bank ID can change.
Use a constant ROCKCHIP_GPIOS_PER_BANK as fixed divider.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpio/rk_gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpio/rk_gpio.c b/drivers/gpio/rk_gpio.c
index f7ad4d68..0a2acf18 100644
--- a/drivers/gpio/rk_gpio.c
+++ b/drivers/gpio/rk_gpio.c
@@ -160,7 +160,7 @@ static int rockchip_gpio_probe(struct udevice *dev)
 					     0, &args);
 	if (!ret || ret != -ENOENT) {
 		uc_priv->gpio_count = args.args[2];
-		priv->bank = args.args[1] / args.args[2];
+		priv->bank = args.args[1] / ROCKCHIP_GPIOS_PER_BANK;
 	} else {
 		uc_priv->gpio_count = ROCKCHIP_GPIOS_PER_BANK;
 		end = strrchr(dev->name, '@');
--
2.20.1


^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2023-03-20  8:54 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-16 16:46 [PATCH v1 1/6] rockchip: gpio: rk_gpio: use ROCKCHIP_GPIOS_PER_BANK as divider Johan Jonker
2023-03-16 16:47 ` [PATCH v1 2/6] arm: dts: rockchip: rk3066a-u-boot: add gpio-ranges Johan Jonker
2023-03-18 20:20   ` Simon Glass
2023-03-19 15:46   ` Jonas Karlman
2023-03-16 16:47 ` [PATCH v1 3/6] arm: dts: rockchip: rk3188-u-boot: " Johan Jonker
2023-03-18 20:20   ` Simon Glass
2023-03-16 16:47 ` [PATCH v1 4/6] arm: dts: rockchip: sync rk3066/rk3188 DT files from linux-next v6.2-rc4 Johan Jonker
2023-03-18 20:20   ` Simon Glass
2023-03-16 16:48 ` [PATCH v1 5/6] rockchip: configs: mk808: change CONFIG_TPL_TEXT_BASE Johan Jonker
2023-03-18 20:20   ` Simon Glass
2023-03-16 16:48 ` [PATCH v1 6/6] rockchip: configs: mk808: enable usb support Johan Jonker
2023-03-18 20:20   ` Simon Glass
2023-03-18 20:20 ` [PATCH v1 1/6] rockchip: gpio: rk_gpio: use ROCKCHIP_GPIOS_PER_BANK as divider Simon Glass
2023-03-19 11:34   ` Johan Jonker
2023-03-19 12:20     ` Jonas Karlman
2023-03-19 12:55       ` Johan Jonker
2023-03-19 13:51         ` Jonas Karlman
2023-03-19 14:56           ` Jonas Karlman
2023-03-20  1:32     ` Kever Yang
2023-03-20  8:54       ` Johan Jonker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox