Lines Matching +full:pwm +full:- +full:backlight
1 // SPDX-License-Identifier: GPL-2.0
6 // Common infrastructure for PWM Backlight for Samsung boards
15 #include "gpio-cfg.h"
17 #include "backlight-s3c64xx.h"
27 struct platform_pwm_backlight_data *pdata = dev->platform_data; in samsung_bl_init()
30 struct samsung_bl_gpio_info *bl_gpio_info = drvdata->gpio_info; in samsung_bl_init()
32 ret = gpio_request(bl_gpio_info->no, "Backlight"); in samsung_bl_init()
34 printk(KERN_ERR "failed to request GPIO for LCD Backlight\n"); in samsung_bl_init()
38 /* Configure GPIO pin with specific GPIO function for PWM timer */ in samsung_bl_init()
39 s3c_gpio_cfgpin(bl_gpio_info->no, bl_gpio_info->func); in samsung_bl_init()
46 struct platform_pwm_backlight_data *pdata = dev->platform_data; in samsung_bl_exit()
49 struct samsung_bl_gpio_info *bl_gpio_info = drvdata->gpio_info; in samsung_bl_exit()
51 s3c_gpio_cfgpin(bl_gpio_info->no, S3C_GPIO_OUTPUT); in samsung_bl_exit()
52 gpio_free(bl_gpio_info->no); in samsung_bl_exit()
57 * board-specific values sent from machine file.
74 .name = "pwm-backlight",
77 /* samsung_bl_set - Set board specific data (if any) provided by user for
78 * PWM Backlight control and register specific PWM and backlight device.
79 * @gpio_info: structure containing GPIO info for PWM timer
80 * @bl_data: structure containing Backlight control data
100 samsung_bl_device->dev.platform_data = &samsung_bl_drvdata->plat_data; in samsung_bl_set()
101 samsung_bl_drvdata->gpio_info = gpio_info; in samsung_bl_set()
102 samsung_bl_data = &samsung_bl_drvdata->plat_data; in samsung_bl_set()
105 samsung_bl_device->dev.parent = &samsung_device_pwm.dev; in samsung_bl_set()
107 if (bl_data->max_brightness) in samsung_bl_set()
108 samsung_bl_data->max_brightness = bl_data->max_brightness; in samsung_bl_set()
109 if (bl_data->dft_brightness) in samsung_bl_set()
110 samsung_bl_data->dft_brightness = bl_data->dft_brightness; in samsung_bl_set()
111 if (bl_data->lth_brightness) in samsung_bl_set()
112 samsung_bl_data->lth_brightness = bl_data->lth_brightness; in samsung_bl_set()
113 if (bl_data->init) in samsung_bl_set()
114 samsung_bl_data->init = bl_data->init; in samsung_bl_set()
115 if (bl_data->notify) in samsung_bl_set()
116 samsung_bl_data->notify = bl_data->notify; in samsung_bl_set()
117 if (bl_data->notify_after) in samsung_bl_set()
118 samsung_bl_data->notify_after = bl_data->notify_after; in samsung_bl_set()
119 if (bl_data->exit) in samsung_bl_set()
120 samsung_bl_data->exit = bl_data->exit; in samsung_bl_set()
121 if (bl_data->check_fb) in samsung_bl_set()
122 samsung_bl_data->check_fb = bl_data->check_fb; in samsung_bl_set()
124 /* Register the Backlight dev */ in samsung_bl_set()
127 printk(KERN_ERR "failed to register backlight device: %d\n", ret); in samsung_bl_set()