mirror of
https://github.com/Evolution-X-Devices/device_xiaomi_sm6150-common
synced 2026-01-27 12:07:36 +00:00
sm6150-common: camera: Cap max_brightness
* Our maximum brightness is 500. * However, for safety related reason, I have capped this to 255. * 255 is more than sufficient, and I do not want to be responsible for LED damage. * Finding the default percentage took some trial and error, in this case, 59% correlated to 75. Co-authored-by: rahul <rahul@aospa.co> Change-Id: Ie20969362c531391e4c51b22365b74d62ccb8e5e Signed-off-by: John Galt <johngaltfirstrun@gmail.com> Signed-off-by: therealmharc <therealmharc@gmail.com>
This commit is contained in:
@@ -47,14 +47,15 @@ bool supportsSetTorchModeExt() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int32_t getTorchDefaultStrengthLevelExt() {
|
int32_t getTorchDefaultStrengthLevelExt() {
|
||||||
return 80;
|
// Our default value is 75. This corresponds to 15%.
|
||||||
|
// As we have changed the maximum value, 59% now corresponds to 75.
|
||||||
|
return 59;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t getTorchMaxStrengthLevelExt() {
|
int32_t getTorchMaxStrengthLevelExt() {
|
||||||
// In our device, both LEDs has same maximum value
|
// 255 out of 500 is a sane brightness.
|
||||||
// so get from one.
|
// Let's cap it to 255 as max, we can go much higher, but I don't want to test this.
|
||||||
auto node = kTorchLedPaths[0] + "/" + TORCH_MAX_BRIGHTNESS;
|
return 255;
|
||||||
return get(node, 0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t getTorchStrengthLevelExt() {
|
int32_t getTorchStrengthLevelExt() {
|
||||||
|
|||||||
Reference in New Issue
Block a user