old-commit-hash: 9616b3f717
This commit is contained in:
Comma Device 2024-02-28 20:09:24 -08:00 committed by Adeeb Shihadeh
parent fa8e3f1f39
commit 646861b75a
2 changed files with 9 additions and 10 deletions

View File

@ -97,7 +97,6 @@ CONFIGS = {
AmpConfig("Right DAC input mixer: DAI2 right", 0b1, 0x22, 0, 0b00000001),
AmpConfig("Volume adjustment smoothing disabled", 0b1, 0x49, 6, 0b01000000),
],
"mici": [],
}
class Amplifier:

View File

@ -94,11 +94,7 @@ def get_device_type():
# lru_cache and cache can cause memory leaks when used in classes
with open("/sys/firmware/devicetree/base/model") as f:
model = f.read().strip('\x00')
model = model.split('comma ')[-1]
# TODO: remove this with AGNOS 7+
if model.startswith('Qualcomm'):
model = 'tici'
return model
return model.split('comma ')[-1]
class Tici(HardwareBase):
@cached_property
@ -116,6 +112,8 @@ class Tici(HardwareBase):
@cached_property
def amplifier(self):
if self.get_device_type() == "mici":
return None
return Amplifier()
def get_os_version(self):
@ -374,9 +372,10 @@ class Tici(HardwareBase):
def set_power_save(self, powersave_enabled):
# amplifier, 100mW at idle
self.amplifier.set_global_shutdown(amp_disabled=powersave_enabled)
if not powersave_enabled:
self.amplifier.initialize_configuration(self.get_device_type())
if self.amplifier is not None:
self.amplifier.set_global_shutdown(amp_disabled=powersave_enabled)
if not powersave_enabled:
self.amplifier.initialize_configuration(self.get_device_type())
# *** CPU config ***
@ -414,7 +413,8 @@ class Tici(HardwareBase):
return 0
def initialize_hardware(self):
self.amplifier.initialize_configuration(self.get_device_type())
if self.amplifier is not None:
self.amplifier.initialize_configuration(self.get_device_type())
# Allow thermald to write engagement status to kmsg
os.system("sudo chmod a+w /dev/kmsg")