diff options
author | Tarun Kanti DebBarma <tarun.kanti@ti.com> | 2011-08-30 05:54:27 -0400 |
---|---|---|
committer | Tarun Kanti DebBarma <tarun.kanti@ti.com> | 2012-02-06 03:43:42 -0500 |
commit | ae10f2336b9c0c8da73da2878eba684ab876eb8f (patch) | |
tree | 442d2f48b9544153a63b7690a8eef27939f04419 /drivers/gpio | |
parent | 9ea14d8cbbf1c8fc941e8e8a12aa0a3edc5c336e (diff) |
gpio/omap: remove hardcoded offsets in context save/restore
It is not required to use hard-coded offsets any more in context save and
restore functions and instead use the generic offsets which have been correctly
initialized during device registration.
Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Signed-off-by: Charulatha V <charu@ti.com>
Reviewed-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Kevin Hilman <khilman@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/gpio-omap.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 991dd39f6eda..ceb9edf16dab 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -1369,45 +1369,43 @@ void omap2_gpio_resume_after_idle(void) | |||
1369 | static void omap_gpio_save_context(struct gpio_bank *bank) | 1369 | static void omap_gpio_save_context(struct gpio_bank *bank) |
1370 | { | 1370 | { |
1371 | bank->context.irqenable1 = | 1371 | bank->context.irqenable1 = |
1372 | __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE1); | 1372 | __raw_readl(bank->base + bank->regs->irqenable); |
1373 | bank->context.irqenable2 = | 1373 | bank->context.irqenable2 = |
1374 | __raw_readl(bank->base + OMAP24XX_GPIO_IRQENABLE2); | 1374 | __raw_readl(bank->base + bank->regs->irqenable2); |
1375 | bank->context.wake_en = | 1375 | bank->context.wake_en = |
1376 | __raw_readl(bank->base + OMAP24XX_GPIO_WAKE_EN); | 1376 | __raw_readl(bank->base + bank->regs->wkup_en); |
1377 | bank->context.ctrl = __raw_readl(bank->base + OMAP24XX_GPIO_CTRL); | 1377 | bank->context.ctrl = __raw_readl(bank->base + bank->regs->ctrl); |
1378 | bank->context.oe = __raw_readl(bank->base + OMAP24XX_GPIO_OE); | 1378 | bank->context.oe = __raw_readl(bank->base + bank->regs->direction); |
1379 | bank->context.leveldetect0 = | 1379 | bank->context.leveldetect0 = |
1380 | __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0); | 1380 | __raw_readl(bank->base + bank->regs->leveldetect0); |
1381 | bank->context.leveldetect1 = | 1381 | bank->context.leveldetect1 = |
1382 | __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1); | 1382 | __raw_readl(bank->base + bank->regs->leveldetect1); |
1383 | bank->context.risingdetect = | 1383 | bank->context.risingdetect = |
1384 | __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT); | 1384 | __raw_readl(bank->base + bank->regs->risingdetect); |
1385 | bank->context.fallingdetect = | 1385 | bank->context.fallingdetect = |
1386 | __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT); | 1386 | __raw_readl(bank->base + bank->regs->fallingdetect); |
1387 | bank->context.dataout = | 1387 | bank->context.dataout = __raw_readl(bank->base + bank->regs->dataout); |
1388 | __raw_readl(bank->base + OMAP24XX_GPIO_DATAOUT); | ||
1389 | } | 1388 | } |
1390 | 1389 | ||
1391 | static void omap_gpio_restore_context(struct gpio_bank *bank) | 1390 | static void omap_gpio_restore_context(struct gpio_bank *bank) |
1392 | { | 1391 | { |
1393 | __raw_writel(bank->context.irqenable1, | 1392 | __raw_writel(bank->context.irqenable1, |
1394 | bank->base + OMAP24XX_GPIO_IRQENABLE1); | 1393 | bank->base + bank->regs->irqenable); |
1395 | __raw_writel(bank->context.irqenable2, | 1394 | __raw_writel(bank->context.irqenable2, |
1396 | bank->base + OMAP24XX_GPIO_IRQENABLE2); | 1395 | bank->base + bank->regs->irqenable2); |
1397 | __raw_writel(bank->context.wake_en, | 1396 | __raw_writel(bank->context.wake_en, |
1398 | bank->base + OMAP24XX_GPIO_WAKE_EN); | 1397 | bank->base + bank->regs->wkup_en); |
1399 | __raw_writel(bank->context.ctrl, bank->base + OMAP24XX_GPIO_CTRL); | 1398 | __raw_writel(bank->context.ctrl, bank->base + bank->regs->ctrl); |
1400 | __raw_writel(bank->context.oe, bank->base + OMAP24XX_GPIO_OE); | 1399 | __raw_writel(bank->context.oe, bank->base + bank->regs->direction); |
1401 | __raw_writel(bank->context.leveldetect0, | 1400 | __raw_writel(bank->context.leveldetect0, |
1402 | bank->base + OMAP24XX_GPIO_LEVELDETECT0); | 1401 | bank->base + bank->regs->leveldetect0); |
1403 | __raw_writel(bank->context.leveldetect1, | 1402 | __raw_writel(bank->context.leveldetect1, |
1404 | bank->base + OMAP24XX_GPIO_LEVELDETECT1); | 1403 | bank->base + bank->regs->leveldetect1); |
1405 | __raw_writel(bank->context.risingdetect, | 1404 | __raw_writel(bank->context.risingdetect, |
1406 | bank->base + OMAP24XX_GPIO_RISINGDETECT); | 1405 | bank->base + bank->regs->risingdetect); |
1407 | __raw_writel(bank->context.fallingdetect, | 1406 | __raw_writel(bank->context.fallingdetect, |
1408 | bank->base + OMAP24XX_GPIO_FALLINGDETECT); | 1407 | bank->base + bank->regs->fallingdetect); |
1409 | __raw_writel(bank->context.dataout, | 1408 | __raw_writel(bank->context.dataout, bank->base + bank->regs->dataout); |
1410 | bank->base + OMAP24XX_GPIO_DATAOUT); | ||
1411 | } | 1409 | } |
1412 | #endif | 1410 | #endif |
1413 | 1411 | ||