On Tue, Jul 01, 2008 at 07:46:34PM +0530, Rajendra Nayak wrote: > +#ifdef CONFIG_ARCH_OMAP34XX > +/* save the registers of bank 2-6 */ > +void omap_gpio_save(void) > +{ > + int i; > + /* saving banks from 2-6 only */ > + for (i = 1; i < gpio_bank_count; i++) { > + struct gpio_bank *bank = &gpio_bank[i]; > + gpio_restore_banks[i].gpio_sysconfig = > + __raw_readl(bank->base + OMAP24XX_GPIO_SYSCONFIG); > + gpio_restore_banks[i].gpio_wake_en = > + __raw_readl(bank->base + OMAP24XX_GPIO_WAKE_EN); > + gpio_restore_banks[i].gpio_ctrl = > + __raw_readl(bank->base + OMAP24XX_GPIO_CTRL); > + gpio_restore_banks[i].gpio_oe = > + __raw_readl(bank->base + OMAP24XX_GPIO_OE); > + gpio_restore_banks[i].gpio_leveldetect0 = > + __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0); > + gpio_restore_banks[i].gpio_leveldetect1 = > + __raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1); > + gpio_restore_banks[i].gpio_risingdetect = > + __raw_readl(bank->base + OMAP24XX_GPIO_RISINGDETECT); > + gpio_restore_banks[i].gpio_fallingdetect = > + __raw_readl(bank->base + OMAP24XX_GPIO_FALLINGDETECT); > + gpio_restore_banks[i].gpio_dataout = > + __raw_readl(bank->base + OMAP24XX_GPIO_DATAOUT); > + gpio_restore_banks[i].gpio_setwkuena = > + __raw_readl(bank->base + OMAP24XX_GPIO_SETWKUENA); > + gpio_restore_banks[i].gpio_setdataout = > + __raw_readl(bank->base + OMAP24XX_GPIO_SETDATAOUT); > + } > +} > +EXPORT_SYMBOL(omap_gpio_save); > + > +/* restore the required registers of bank 2-6 */ > +void omap_gpio_restore(void) > +{ > + int i; > + for (i = 1; i < gpio_bank_count; i++) { > + struct gpio_bank *bank = &gpio_bank[i]; > + __raw_writel(gpio_restore_banks[i].gpio_sysconfig, > + bank->base + OMAP24XX_GPIO_SYSCONFIG); > + __raw_writel(gpio_restore_banks[i].gpio_wake_en, > + bank->base + OMAP24XX_GPIO_WAKE_EN); > + __raw_writel(gpio_restore_banks[i].gpio_ctrl, > + bank->base + OMAP24XX_GPIO_CTRL); > + __raw_writel(gpio_restore_banks[i].gpio_oe, > + bank->base + OMAP24XX_GPIO_OE); > + __raw_writel(gpio_restore_banks[i].gpio_leveldetect0, > + bank->base + OMAP24XX_GPIO_LEVELDETECT0); > + __raw_writel(gpio_restore_banks[i].gpio_leveldetect1, > + bank->base + OMAP24XX_GPIO_LEVELDETECT1); > + __raw_writel(gpio_restore_banks[i].gpio_risingdetect, > + bank->base + OMAP24XX_GPIO_RISINGDETECT); > + __raw_writel(gpio_restore_banks[i].gpio_fallingdetect, > + bank->base + OMAP24XX_GPIO_FALLINGDETECT); > + __raw_writel(gpio_restore_banks[i].gpio_dataout, > + bank->base + OMAP24XX_GPIO_DATAOUT); > + __raw_writel(gpio_restore_banks[i].gpio_setwkuena, > + bank->base + OMAP24XX_GPIO_SETWKUENA); > + __raw_writel(gpio_restore_banks[i].gpio_setdataout, > + bank->base + OMAP24XX_GPIO_SETDATAOUT); > + } > +} > +EXPORT_SYMBOL(omap_gpio_restore); #else inline void omap_gpio_save(void) {} inline void omap_gpio_restore(void) {} otherwise ifndef OMAP3 we're gonna get undef reference or maybe do it in the header, but then use static inline, instead of inline only. -- Best Regards, Felipe Balbi me@xxxxxxxxxxxxxxx http://blog.felipebalbi.com -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html