drivers/video/backlight/tps65217_bl.c add default brightness value option
Signed-off-by: Matus Ujhelyi <matus.ujhelyi@streamunlimited.com> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
17e45db62a
commit
4d22f8c306
3 changed files with 18 additions and 1 deletions
|
@ -9,6 +9,7 @@ Required properties:
|
||||||
- backlight: node for specifying WLED1 and WLED2 lines in TPS65217
|
- backlight: node for specifying WLED1 and WLED2 lines in TPS65217
|
||||||
- isel: selection bit, valid values: 1 for ISEL1 (low-level) and 2 for ISEL2 (high-level)
|
- isel: selection bit, valid values: 1 for ISEL1 (low-level) and 2 for ISEL2 (high-level)
|
||||||
- fdim: PWM dimming frequency, valid values: 100, 200, 500, 1000
|
- fdim: PWM dimming frequency, valid values: 100, 200, 500, 1000
|
||||||
|
- default-brightness: valid values: 0-100
|
||||||
|
|
||||||
Each regulator is defined using the standard binding for regulators.
|
Each regulator is defined using the standard binding for regulators.
|
||||||
|
|
||||||
|
@ -20,5 +21,7 @@ Example:
|
||||||
backlight {
|
backlight {
|
||||||
isel = <1>; /* 1 - ISET1, 2 ISET2 */
|
isel = <1>; /* 1 - ISET1, 2 ISET2 */
|
||||||
fdim = <100>; /* TPS65217_BL_FDIM_100HZ */
|
fdim = <100>; /* TPS65217_BL_FDIM_100HZ */
|
||||||
|
default-brightness = <50>;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -245,6 +245,18 @@ tps65217_bl_parse_dt(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!of_property_read_u32(node, "default-brightness", &val)) {
|
||||||
|
if (val < 0 ||
|
||||||
|
val > 100) {
|
||||||
|
dev_err(&pdev->dev,
|
||||||
|
"invalid 'default-brightness' value in the device tree\n");
|
||||||
|
err = ERR_PTR(-EINVAL);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
pdata->dft_brightness = val;
|
||||||
|
}
|
||||||
|
|
||||||
of_node_put(node);
|
of_node_put(node);
|
||||||
|
|
||||||
return pdata;
|
return pdata;
|
||||||
|
@ -311,7 +323,8 @@ static int tps65217_bl_probe(struct platform_device *pdev)
|
||||||
return PTR_ERR(tps65217_bl->bl);
|
return PTR_ERR(tps65217_bl->bl);
|
||||||
}
|
}
|
||||||
|
|
||||||
tps65217_bl->bl->props.brightness = 0;
|
tps65217_bl->bl->props.brightness = pdata->dft_brightness;
|
||||||
|
backlight_update_status(tps65217_bl->bl);
|
||||||
platform_set_drvdata(pdev, tps65217_bl);
|
platform_set_drvdata(pdev, tps65217_bl);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -228,6 +228,7 @@ enum tps65217_bl_fdim {
|
||||||
struct tps65217_bl_pdata {
|
struct tps65217_bl_pdata {
|
||||||
enum tps65217_bl_isel isel;
|
enum tps65217_bl_isel isel;
|
||||||
enum tps65217_bl_fdim fdim;
|
enum tps65217_bl_fdim fdim;
|
||||||
|
int dft_brightness;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue