Skip to content

Commit 3124c7a

Browse files
Ayush1325nashif
authored andcommitted
drivers: gpio: davinci: Fix for RAM MMIO
Move the direction reset to config init function. This ensures that regs is read after the DEVICE_MMIO_NAMED_MAP is called, which is where the init for RAM MMIO takes place Tested on PocketBeagle 2 A53s. Signed-off-by: Ayush Singh <ayush@beagleboard.org>
1 parent b1b586c commit 3124c7a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

drivers/gpio/gpio_davinci.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,10 @@ static DEVICE_API(gpio, gpio_davinci_driver_api) = {
153153
static int gpio_davinci_init(const struct device *dev)
154154
{
155155
const struct gpio_davinci_config *config = DEV_CFG(dev);
156-
volatile struct gpio_davinci_regs *regs = DEV_GPIO_CFG_BASE(dev);
157156
int ret;
158157

159158
DEVICE_MMIO_NAMED_MAP(dev, port_base, K_MEM_CACHE_NONE);
160159

161-
regs->dir = GPIO_DAVINCI_DIR_RESET_VAL;
162-
163160
config->bank_config(dev);
164161

165162
ret = pinctrl_apply_state(config->pcfg, PINCTRL_STATE_DEFAULT);
@@ -174,7 +171,7 @@ static int gpio_davinci_init(const struct device *dev)
174171
static void gpio_davinci_bank_##n##_config(const struct device *dev) \
175172
{ \
176173
volatile struct gpio_davinci_regs *regs = DEV_GPIO_CFG_BASE(dev); \
177-
ARG_UNUSED(regs); \
174+
regs->dir = GPIO_DAVINCI_DIR_RESET_VAL; \
178175
}
179176

180177
#define GPIO_DAVINCI_INIT(n) \

0 commit comments

Comments
 (0)