/* * Generic PWM backlight driver data - see drivers/video/backlight/pwm_bl.c * * Copyright (c) 2013-2017, NVIDIA CORPORATION, All rights reserved. * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ #ifndef __LINUX_PWM_BACKLIGHT_H #define __LINUX_PWM_BACKLIGHT_H #include struct pwm_bl_data { struct pwm_device *pwm; struct device *dev; unsigned int period; unsigned int lth_brightness; unsigned int *levels; bool enabled; struct regulator *power_supply; struct gpio_desc *enable_gpio; unsigned int scale; bool legacy; unsigned int pwm_gpio; u8 *bl_measured; int (*notify)(struct device *, int brightness); void (*notify_after)(struct device *, int brightness); int (*check_fb)(struct device *, struct fb_info *); void (*exit)(struct device *); }; struct pwm_bl_data_dt_ops { int (*init)(struct device *dev); int (*notify)(struct device *, int brightness); void (*notify_after)(struct device *, int brightness); int (*check_fb)(struct device *, struct fb_info *); void (*exit)(struct device *); const char *blnode_compatible; }; struct platform_pwm_backlight_data { int pwm_id; const char *name; unsigned int max_brightness; unsigned int dft_brightness; unsigned int lth_brightness; unsigned int pwm_period_ns; unsigned int *levels; /* TODO remove once all users are switched to gpiod_* API */ int enable_gpio; unsigned int pwm_gpio; u8 *bl_measured; int (*init)(struct device *dev); int (*notify)(struct device *dev, int brightness); void (*notify_after)(struct device *dev, int brightness); void (*exit)(struct device *dev); int (*check_fb)(struct device *dev, struct fb_info *info); }; #endif