From 5f85017d20c33b64307e04e0235b66931d4f6762 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 15 Mar 2006 16:03:03 +0000 Subject: [PATCH] --- yaml --- r: 21053 b: refs/heads/master c: 4ebf2d00260bac5213c5dfb8d257e15e40503725 h: refs/heads/master i: 21051: 9197db8736479ab7d1598659ba0b6f8545a422fd v: v3 --- [refs] | 2 +- trunk/arch/arm/common/locomo.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 745b9bd1687c..44c238923c4a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 17320a9644a45ccac51ce4ff4333276844abf72d +refs/heads/master: 4ebf2d00260bac5213c5dfb8d257e15e40503725 diff --git a/trunk/arch/arm/common/locomo.c b/trunk/arch/arm/common/locomo.c index 159ad7ed7a40..d31b1cb7eea0 100644 --- a/trunk/arch/arm/common/locomo.c +++ b/trunk/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 */