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 * SPDX-License-Identifier: GPL-2.0+
13 #include <linux/types.h>
15 #include <asm/arch/cpu.h>
16 #include <asm/arch/gpio.h>
17 #include <asm/arch/pwm.h>
18 #include <asm/arch/pwm_backlight.h>
20 static struct pwm_backlight_data *pwm;
22 static int exynos_pwm_backlight_update_status(void)
24 int brightness = pwm->brightness;
25 int max = pwm->max_brightness;
27 if (brightness == 0) {
28 pwm_config(pwm->pwm_id, 0, pwm->period);
29 pwm_disable(pwm->pwm_id);
31 pwm_config(pwm->pwm_id,
32 brightness * pwm->period / max, pwm->period);
33 pwm_enable(pwm->pwm_id);
38 int exynos_pwm_backlight_init(struct pwm_backlight_data *pd)
42 exynos_pwm_backlight_update_status();