sm6150-common: camera: Add enabled bool for finished workarounds

Change-Id: Iede122113f17789cdf88896cb32bc30f574ec54f
Signed-off-by: John Galt <johngaltfirstrun@gmail.com>
Signed-off-by: therealmharc <therealmharc@gmail.com>
This commit is contained in:
John Galt
2025-01-28 14:48:15 -05:00
committed by therealmharc
parent 1037de338f
commit e04e71b5a8

View File

@@ -47,7 +47,7 @@ bool supportsSetTorchModeExt() {
}
int32_t getTorchDefaultStrengthLevelExt() {
return 7;
return 50;
}
int32_t getTorchMaxStrengthLevelExt() {
@@ -64,17 +64,17 @@ int32_t getTorchStrengthLevelExt() {
return get(node, 0);
}
void setTorchStrengthLevelExt(int32_t torchStrength) {
void setTorchStrengthLevelExt(int32_t torchStrength, bool enabled) {
set(TOGGLE_SWITCH, 0);
for (auto& path : kTorchLedPaths) {
auto node = path + "/" + TORCH_BRIGHTNESS;
set(node, torchStrength);
}
if (torchStrength > 0)
if (enabled)
set(TOGGLE_SWITCH, 255);
}
void setTorchModeExt(bool enabled) {
int32_t strength = getTorchDefaultStrengthLevelExt();
setTorchStrengthLevelExt(enabled ? strength : 0);
setTorchStrengthLevelExt(enabled ? strength : 0, enabled);
}