sm8350-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>
Signed-off-by: rahul <rahul@aospa.co>
This commit is contained in:
John Galt
2025-02-07 15:13:46 +00:00
committed by Joey Huab
parent 350205af4c
commit e45b610ee1

View File

@@ -43,14 +43,15 @@ bool supportsSetTorchModeExt() {
}
int32_t getTorchDefaultStrengthLevelExt() {
return 50;
// 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() {
// In our device, both LEDs has same maximum value
// so get from one.
auto node = kTorchLedPath + "/" + TORCH_MAX_BRIGHTNESS;
return get(node, 0);
// 255 out of 500 is a sane brightness.
// Let's cap it to 255 as max, we can go much higher, but I don't want to test this.
return 255;
}
int32_t getTorchStrengthLevelExt() {