aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/flash.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-omap1/flash.c')
-rw-r--r--arch/arm/mach-omap1/flash.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/arch/arm/mach-omap1/flash.c b/arch/arm/mach-omap1/flash.c
index 1749cb37dda0..4665bfcd2ce9 100644
--- a/arch/arm/mach-omap1/flash.c
+++ b/arch/arm/mach-omap1/flash.c
@@ -15,20 +15,12 @@
15 15
16void omap1_set_vpp(struct platform_device *pdev, int enable) 16void omap1_set_vpp(struct platform_device *pdev, int enable)
17{ 17{
18 static int count;
19 u32 l; 18 u32 l;
20 19
21 if (enable) { 20 l = omap_readl(EMIFS_CONFIG);
22 if (count++ == 0) { 21 if (enable)
23 l = omap_readl(EMIFS_CONFIG); 22 l |= OMAP_EMIFS_CONFIG_WP;
24 l |= OMAP_EMIFS_CONFIG_WP; 23 else
25 omap_writel(l, EMIFS_CONFIG); 24 l &= ~OMAP_EMIFS_CONFIG_WP;
26 } 25 omap_writel(l, EMIFS_CONFIG);
27 } else {
28 if (count && (--count == 0)) {
29 l = omap_readl(EMIFS_CONFIG);
30 l &= ~OMAP_EMIFS_CONFIG_WP;
31 omap_writel(l, EMIFS_CONFIG);
32 }
33 }
34} 26}