From: Nishanth Menon Date: Mon, 29 Aug 2011 13:24:50 +0000 (+0530) Subject: gpio/omap: restore OE only after setting the output level X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=6d13eaaf33436e20d1a41122f28434bcc37999dc;p=linux-beck.git gpio/omap: restore OE only after setting the output level Setup the dataout register before restoring OE. This is to make sure that we have valid data in dataout register which would be made available in output pins as soon as OE is enabled. Else, there is risk of unknown data getting out into gpio pins. Signed-off-by: Nishanth Menon Signed-off-by: Tarun Kanti DebBarma Reviewed-by: Santosh Shilimkar Reviewed-by: Kevin Hilman Signed-off-by: Kevin Hilman --- diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 41265e823b23..e0fd2e4b2b9c 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c @@ -1355,7 +1355,6 @@ static void omap_gpio_restore_context(struct gpio_bank *bank) __raw_writel(bank->context.wake_en, bank->base + bank->regs->wkup_en); __raw_writel(bank->context.ctrl, bank->base + bank->regs->ctrl); - __raw_writel(bank->context.oe, bank->base + bank->regs->direction); __raw_writel(bank->context.leveldetect0, bank->base + bank->regs->leveldetect0); __raw_writel(bank->context.leveldetect1, @@ -1365,6 +1364,8 @@ static void omap_gpio_restore_context(struct gpio_bank *bank) __raw_writel(bank->context.fallingdetect, bank->base + bank->regs->fallingdetect); __raw_writel(bank->context.dataout, bank->base + bank->regs->dataout); + __raw_writel(bank->context.oe, bank->base + bank->regs->direction); + if (bank->dbck_enable_mask) { __raw_writel(bank->context.debounce, bank->base + bank->regs->debounce);