hh.org updates
[hh.org.git] / arch / arm / mach-pxa / hx4700 / hx4700_bl.c
blobbd75f1cc815ebbe17abfc5134fa215abcaa8c0cf
1 /*
2 * LCD backlight support for iPAQ HX4700
4 * Copyright (c) 2005 Ian Molton
5 * Copyright (c) 2005 SDG Systems, LLC
6 * Copyright (c) 2006 Todd Blumer <todd@sdgsystems.com>
8 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file COPYING in the main directory of this archive for
10 * more details.
12 * 2006-10-07 Anton Vorontsov <cbou@mail.ru>
13 * Convert backlight control code to use corgi-bl driver.
16 #include <linux/platform_device.h>
17 #include <linux/corgi_bl.h>
18 #include <asm/arch/hardware.h>
19 #include <asm/arch/pxa-regs.h>
21 static
22 void hx4700_set_bl_intensity(int intensity)
24 if (intensity < 7) intensity = 0;
25 PWM_CTRL1 = 1;
26 PWM_PERVAL1 = 0xC8;
27 PWM_PWDUTY1 = intensity;
28 return;
31 static
32 struct corgibl_machinfo hx4700_bl_machinfo = {
33 .max_intensity = 0xC8,
34 .default_intensity = 0xC8/4,
35 .limit_mask = 0xFF,
36 .set_bl_intensity = hx4700_set_bl_intensity
39 struct platform_device hx4700_bl = {
40 .name = "corgi-bl",
41 .dev = {
42 .platform_data = &hx4700_bl_machinfo