[PATCH] backlight: LOCOMO Backlight Driver updates
Add backlight intensity control to the LOCOMO lcd/backlight driver using the backlight class and add basic power management support. This is a reimplementation and improvement of patches by John Lenz and Pavel Machek Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Antonino Daplas <adaplas@pol.net> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
committed by
Linus Torvalds
parent
f8020dc560
commit
e442378185
@@ -629,21 +629,6 @@ 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.
|
||||
@@ -698,14 +683,10 @@ __locomo_probe(struct device *me, struct resource *mem, int irq)
|
||||
, lchip->base + LOCOMO_GPD);
|
||||
locomo_writel(0, lchip->base + LOCOMO_GIE);
|
||||
|
||||
/* FrontLight */
|
||||
/* 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 */
|
||||
@@ -1062,6 +1043,30 @@ void locomo_m62332_senddata(struct locomo_dev *ldev, unsigned int dac_data, int
|
||||
spin_unlock_irqrestore(&lchip->lock, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* Frontlight control
|
||||
*/
|
||||
|
||||
static struct locomo *locomo_chip_driver(struct locomo_dev *ldev);
|
||||
|
||||
void locomo_frontlight_set(struct locomo_dev *dev, int duty, int vr, int bpwf)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct locomo *lchip = locomo_chip_driver(dev);
|
||||
|
||||
if (vr)
|
||||
locomo_gpio_write(dev, LOCOMO_GPIO_FL_VR, 1);
|
||||
else
|
||||
locomo_gpio_write(dev, LOCOMO_GPIO_FL_VR, 0);
|
||||
|
||||
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 | LOCOMO_ALC_EN, lchip->base + LOCOMO_FRONTLIGHT + LOCOMO_ALS);
|
||||
spin_unlock_irqrestore(&lchip->lock, flags);
|
||||
}
|
||||
|
||||
/*
|
||||
* LoCoMo "Register Access Bus."
|
||||
*
|
||||
|
Reference in New Issue
Block a user