leds: lp8550: get backlight scaling factor from platform data
authormakarand.karvekar <makarand.karvekar@motorola.com>
Fri, 4 Mar 2011 16:01:37 +0000 (10:01 -0600)
committerRebecca Schultz Zavin <rebecca@android.com>
Fri, 4 Mar 2011 18:54:29 +0000 (10:54 -0800)
backlight scaling factor varies with display panel

Change-Id: I45ea0d76526d4297412d177481acded082ce7104
Signed-off-by: makarand.karvekar <makarand.karvekar@motorola.com>
drivers/leds/leds-lp8550.c
include/linux/leds-lp8550.h

index 2f4e4f380941c798f9c233a8f82e97a80a9ba8f9..9504ea8785bdc9b0ed0fd24e7540e6567c0e5dcf 100755 (executable)
@@ -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);
                }
index adfcb02a3230200463c37bcc05b246fddba2b20f..1585d7b066ecd4edda848eb775d08a728e80ac21 100755 (executable)
@@ -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__ */