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 f9bf78d4fdfb..401eb3c080c2 100644
--- a/arch/arm/mach-omap1/flash.c
+++ b/arch/arm/mach-omap1/flash.c
@@ -17,20 +17,12 @@
17 17
18void omap1_set_vpp(struct platform_device *pdev, int enable) 18void omap1_set_vpp(struct platform_device *pdev, int enable)
19{ 19{
20 static int count;
21 u32 l; 20 u32 l;
22 21
23 if (enable) { 22 l = omap_readl(EMIFS_CONFIG);
24 if (count++ == 0) { 23 if (enable)
25 l = omap_readl(EMIFS_CONFIG); 24 l |= OMAP_EMIFS_CONFIG_WP;
26 l |= OMAP_EMIFS_CONFIG_WP; 25 else
27 omap_writel(l, EMIFS_CONFIG); 26 l &= ~OMAP_EMIFS_CONFIG_WP;
28 } 27 omap_writel(l, EMIFS_CONFIG);
29 } else {
30 if (count && (--count == 0)) {
31 l = omap_readl(EMIFS_CONFIG);
32 l &= ~OMAP_EMIFS_CONFIG_WP;
33 omap_writel(l, EMIFS_CONFIG);
34 }
35 }
36} 28}