2 * PWM BACKLIGHT driver for Board based on EXYNOS.
4 * Author: Donghwa Lee <dh09.lee@samsung.com>
6 * Derived from linux/drivers/video/backlight/pwm_backlight.c
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #include <linux/types.h>
27 #include <asm/arch/cpu.h>
28 #include <asm/arch/gpio.h>
29 #include <asm/arch/pwm.h>
30 #include <asm/arch/pwm_backlight.h>
32 static struct pwm_backlight_data *pwm;
34 static int exynos_pwm_backlight_update_status(void)
36 int brightness = pwm->brightness;
37 int max = pwm->max_brightness;
39 if (brightness == 0) {
40 pwm_config(pwm->pwm_id, 0, pwm->period);
41 pwm_disable(pwm->pwm_id);
43 pwm_config(pwm->pwm_id,
44 brightness * pwm->period / max, pwm->period);
45 pwm_enable(pwm->pwm_id);
50 int exynos_pwm_backlight_init(struct pwm_backlight_data *pd)
54 exynos_pwm_backlight_update_status();