#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/backlight.h>
#include <linux/err.h>
#include <linux/pwm.h>
#include <linux/pwm_backlight.h>
#include <linux/regulator/consumer.h>
#include <linux/slab.h>
struct pwm_bl_data { … };
static void pwm_backlight_power_on(struct pwm_bl_data *pb)
{ … }
static void pwm_backlight_power_off(struct pwm_bl_data *pb)
{ … }
static int compute_duty_cycle(struct pwm_bl_data *pb, int brightness, struct pwm_state *state)
{ … }
static int pwm_backlight_update_status(struct backlight_device *bl)
{ … }
static const struct backlight_ops pwm_backlight_ops = …;
#ifdef CONFIG_OF
#define PWM_LUMINANCE_SHIFT …
#define PWM_LUMINANCE_SCALE …
static u64 cie1931(unsigned int lightness)
{ … }
static
int pwm_backlight_brightness_default(struct device *dev,
struct platform_pwm_backlight_data *data,
unsigned int period)
{ … }
static int pwm_backlight_parse_dt(struct device *dev,
struct platform_pwm_backlight_data *data)
{ … }
static const struct of_device_id pwm_backlight_of_match[] = …;
MODULE_DEVICE_TABLE(of, pwm_backlight_of_match);
#else
static int pwm_backlight_parse_dt(struct device *dev,
struct platform_pwm_backlight_data *data)
{
return -ENODEV;
}
static
int pwm_backlight_brightness_default(struct device *dev,
struct platform_pwm_backlight_data *data,
unsigned int period)
{
return -ENODEV;
}
#endif
static bool pwm_backlight_is_linear(struct platform_pwm_backlight_data *data)
{ … }
static int pwm_backlight_initial_power_state(const struct pwm_bl_data *pb)
{ … }
static int pwm_backlight_probe(struct platform_device *pdev)
{ … }
static void pwm_backlight_remove(struct platform_device *pdev)
{ … }
static void pwm_backlight_shutdown(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int pwm_backlight_suspend(struct device *dev)
{ … }
static int pwm_backlight_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops pwm_backlight_pm_ops = …;
static struct platform_driver pwm_backlight_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;