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

Change-Id: Iede122113f17789cdf88896cb32bc30f574ec54f
Signed-off-by: Cyber Knight <cyberknight755@gmail.com>
This commit is contained in:
John Galt 2025-01-28 14:48:15 -05:00 committed by DigiGoon
parent bc536c0647
commit d25addbc31

View file

@ -43,7 +43,7 @@ bool supportsSetTorchModeExt() {
} }
int32_t getTorchDefaultStrengthLevelExt() { int32_t getTorchDefaultStrengthLevelExt() {
return 7; return 50;
} }
int32_t getTorchMaxStrengthLevelExt() { int32_t getTorchMaxStrengthLevelExt() {
@ -60,15 +60,15 @@ int32_t getTorchStrengthLevelExt() {
return get(node, 0); return get(node, 0);
} }
void setTorchStrengthLevelExt(int32_t torchStrength) { void setTorchStrengthLevelExt(int32_t torchStrength, bool enabled) {
set(TOGGLE_SWITCH, 0); set(TOGGLE_SWITCH, 0);
auto node = kTorchLedPath + "/" + TORCH_BRIGHTNESS; auto node = kTorchLedPath + "/" + TORCH_BRIGHTNESS;
set(node, torchStrength); set(node, torchStrength);
if (torchStrength > 0) if (enabled)
set(TOGGLE_SWITCH, 255); set(TOGGLE_SWITCH, 255);
} }
void setTorchModeExt(bool enabled) { void setTorchModeExt(bool enabled) {
int32_t strength = getTorchDefaultStrengthLevelExt(); int32_t strength = getTorchDefaultStrengthLevelExt();
setTorchStrengthLevelExt(enabled ? strength : 0); setTorchStrengthLevelExt(enabled ? strength : 0, enabled);
} }