summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorPavel Machek <pavel@ucw.cz>2006-03-15 16:03:03 +0000
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-03-15 16:03:03 +0000
commit4ebf2d00260bac5213c5dfb8d257e15e40503725 (patch)
treef2df0561bb029d54dd19716b14468063b6d886f9 /arch
parent17320a9644a45ccac51ce4ff4333276844abf72d (diff)
downloadlinux-4ebf2d00260bac5213c5dfb8d257e15e40503725.tar.bz2
[ARM] 3357/1: enable frontlight on collie
Patch from Pavel Machek Enable frontlight during collie bootup, so that display is actually readable in anything other than bright sunlight. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/common/locomo.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
index 159ad7ed7a40..d31b1cb7eea0 100644
--- a/arch/arm/common/locomo.c
+++ b/arch/arm/common/locomo.c
@@ -629,6 +629,22 @@ static int locomo_resume(struct platform_device *dev)
}
#endif
+
+#define LCM_ALC_EN 0x8000
+
+void frontlight_set(struct locomo *lchip, int duty, int vr, int bpwf)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&lchip->lock, flags);
+ locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
+ udelay(100);
+ locomo_writel(duty, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
+ locomo_writel(bpwf | LCM_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
+ spin_unlock_irqrestore(&lchip->lock, flags);
+}
+
+
/**
* locomo_probe - probe for a single LoCoMo chip.
* @phys_addr: physical address of device.
@@ -688,6 +704,11 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
/* FrontLight */
locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD);
+
+ /* Same constants can be used for collie and poodle
+ (depending on CONFIG options in original sharp code)? */
+ frontlight_set(lchip, 163, 0, 148);
+
/* Longtime timer */
locomo_writel(0, lchip->base + LOCOMO_LTINT);
/* SPI */