- irq-gpios: GPIO specifiers for fault interrupt pin.
- pwms: PWM specifiers for backlight control.
- slope-time-ms: Lighting effect. Slope time from 0 to 500.
+ - names: Array of backlight driver name strings, in order, for each LED group.
+ - max-input-brt: Maximum expected brightness value passed to the driver.
+ This value is used to scale requested brightness values to the device's
+ actual maximum brightness.
+ - init-brt: Initial backlight brightness (applied to all LED groups). Must be
+ scaled to max-input-brt, if provided, or otherwise max device brightness.
Example 1)
I2C for device configuration, map region 0 to all LEDs and PWM input for
{
struct lp88xx_bl *bl = bl_get_data(bldev);
struct lp88xx *lp = bl->lp;
- u16 val = bldev->props.brightness;
+ u32 val = bldev->props.brightness;
int duty;
int ret;
+ val = val * lp->max_dev_brt / lp->max_input_brt;
+
if (val > 0)
lp88xx_bl_on(lp, 1);
else
struct device *dev = lp->dev;
struct backlight_properties props;
char name[64];
+ const char *pname;
unsigned int reg_brt[] = {
[LP88XX_REGION_BASE] = LP88XX_REG_BRT_BASE,
[LP88XX_REGION_LED1] = LP88XX_REG_BRT_LED1,
bl->is_db_used = lp88xx_is_db_used(id);
memset(name, 0, sizeof(name));
- snprintf(name, sizeof(name), "%s:%d", DEFAULT_BL_NAME, id);
+ if (!of_property_read_string_index(dev->of_node, "names",
+ id, &pname))
+ snprintf(name, sizeof(name), "%s", pname);
+ else
+ snprintf(name, sizeof(name), "%s:%d", DEFAULT_BL_NAME, id);
+
props.type = BACKLIGHT_PLATFORM;
- props.max_brightness = lp->max_dev_brt;
+ props.max_brightness = lp->max_input_brt;
props.brightness = 0;
+ of_property_read_s32(dev->of_node, "init-brt", &props.brightness);
bl->bldev = devm_backlight_device_register(dev, name, dev, bl,
&lp88xx_bl_ops, &props);
lp->max_dev_brt = (1U << val) - 1;
}
+ if (of_property_read_u32(dev->of_node, "max-input-brt",
+ &lp->max_input_brt))
+ lp->max_input_brt = lp->max_dev_brt;
+
for (i = 0; i < size; i++) {
if (!lp88xx_is_valid_region(region[i])) {
dev_err(dev, "Invalid region ID: %d\n", region[i]);