diff options
Diffstat (limited to 'arch/arm/common/locomo.c')
| -rw-r--r-- | arch/arm/common/locomo.c | 21 |
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) | |||
| 629 | } | 629 | } |
| 630 | #endif | 630 | #endif |
| 631 | 631 | ||
| 632 | |||
| 633 | #define LCM_ALC_EN 0x8000 | ||
| 634 | |||
| 635 | void frontlight_set(struct locomo *lchip, int duty, int vr, int bpwf) | ||
| 636 | { | ||
| 637 | unsigned long flags; | ||
| 638 | |||
| 639 | spin_lock_irqsave(&lchip->lock, flags); | ||
| 640 | locomo_writel(bpwf, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS); | ||
| 641 | udelay(100); | ||
| 642 | locomo_writel(duty, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD); | ||
| 643 | locomo_writel(bpwf | LCM_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS); | ||
| 644 | spin_unlock_irqrestore(&lchip->lock, flags); | ||
| 645 | } | ||
| 646 | |||
| 647 | |||
| 632 | /** | 648 | /** |
| 633 | * locomo_probe - probe for a single LoCoMo chip. | 649 | * locomo_probe - probe for a single LoCoMo chip. |
| 634 | * @phys_addr: physical address of device. | 650 | * @phys_addr: physical address of device. |
| @@ -688,6 +704,11 @@ __locomo_probe(struct device *me, struct resource *mem, int irq) | |||
| 688 | /* FrontLight */ | 704 | /* FrontLight */ |
| 689 | locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS); | 705 | locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS); |
| 690 | locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD); | 706 | locomo_writel(0, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALD); |
| 707 | |||
| 708 | /* Same constants can be used for collie and poodle | ||
| 709 | (depending on CONFIG options in original sharp code)? */ | ||
| 710 | frontlight_set(lchip, 163, 0, 148); | ||
| 711 | |||
| 691 | /* Longtime timer */ | 712 | /* Longtime timer */ |
| 692 | locomo_writel(0, lchip->base + LOCOMO_LTINT); | 713 | locomo_writel(0, lchip->base + LOCOMO_LTINT); |
| 693 | /* SPI */ | 714 | /* SPI */ |
