From cbdfcbc03fed16519309d5ab5d4e4b73b7ecb4ff Mon Sep 17 00:00:00 2001 From: "makarand.karvekar" Date: Fri, 4 Mar 2011 10:01:37 -0600 Subject: [PATCH] leds: lp8550: get backlight scaling factor from platform data backlight scaling factor varies with display panel Change-Id: I45ea0d76526d4297412d177481acded082ce7104 Signed-off-by: makarand.karvekar --- drivers/leds/leds-lp8550.c | 4 ++-- include/linux/leds-lp8550.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/leds/leds-lp8550.c b/drivers/leds/leds-lp8550.c index 2f4e4f380941..9504ea8785bd 100755 --- a/drivers/leds/leds-lp8550.c +++ b/drivers/leds/leds-lp8550.c @@ -257,9 +257,9 @@ static void lp8550_brightness_write(struct lp8550_data *led_data) if (led_data->led_pdata->dev_ctrl_config == LP8550_BRT_MODE_PWM) { - //scale the brightness to prevent more than 19mA per LED + /* scale the brightness to prevent more than 19mA per LED */ if (lp8550_write_reg(led_data, LP8550_EEPROM_A0, - (brightness * 625) / 1000)) + (brightness * led_data->led_pdata->scaling_factor) / 1000)) pr_err("%s:Failed to set brightness:%d\n", __func__, error); } diff --git a/include/linux/leds-lp8550.h b/include/linux/leds-lp8550.h index adfcb02a3230..1585d7b066ec 100755 --- a/include/linux/leds-lp8550.h +++ b/include/linux/leds-lp8550.h @@ -36,6 +36,7 @@ struct lp8550_platform_data { u8 direct_ctrl; struct lp8550_eeprom_data *eeprom_table; int eeprom_tbl_sz; + int scaling_factor; }; #endif /* __KERNEL__ */ -- 2.34.1