mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 23:23:53 +02:00
backlight:add pre_div parameter
This commit is contained in:
parent
b618612b88
commit
eb5cba4889
|
|
@ -50,6 +50,7 @@ struct rk29_bl_info {
|
|||
int (*pwm_resume)(void);
|
||||
int min_brightness; /* 0 ~ 255 */
|
||||
unsigned int delay_ms; /* in milliseconds */
|
||||
int pre_div;
|
||||
};
|
||||
|
||||
struct rk29_io_t {
|
||||
|
|
|
|||
|
|
@ -219,6 +219,7 @@ static int rk29_backlight_probe(struct platform_device *pdev)
|
|||
u32 divh, div_total;
|
||||
unsigned long pwm_clk_rate;
|
||||
struct backlight_properties props;
|
||||
int pre_div = PWM_APB_PRE_DIV;
|
||||
|
||||
if (rk29_bl) {
|
||||
printk(KERN_CRIT "%s: backlight device register has existed \n",
|
||||
|
|
@ -236,6 +237,9 @@ static int rk29_backlight_probe(struct platform_device *pdev)
|
|||
rk29_bl_info->io_init();
|
||||
}
|
||||
|
||||
if(rk29_bl_info->pre_div > 0)
|
||||
pre_div = rk29_bl_info->pre_div;
|
||||
|
||||
memset(&props, 0, sizeof(struct backlight_properties));
|
||||
props.type = BACKLIGHT_RAW;
|
||||
props.max_brightness = BL_STEP;
|
||||
|
|
@ -259,7 +263,7 @@ static int rk29_backlight_probe(struct platform_device *pdev)
|
|||
return -ENODEV;
|
||||
}
|
||||
pwm_clk_rate = clk_get_rate(pwm_clk);
|
||||
div_total = pwm_clk_rate / PWM_APB_PRE_DIV;
|
||||
div_total = pwm_clk_rate / pre_div;
|
||||
|
||||
div_total >>= (1 + (PWM_DIV >> 9));
|
||||
div_total = (div_total) ? div_total : 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user