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:
John Galt
2025-02-07 15:13:46 +00:00
committed by therealmharc
parent 1df19d885b
commit cff093c1e3

View File

@@ -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() {