old-commit-hash: 9616b3f717
chrysler-long2
Comma Device 1 year ago committed by Adeeb Shihadeh
parent fa8e3f1f39
commit 646861b75a
  1. 1
      system/hardware/tici/amplifier.py
  2. 10
      system/hardware/tici/hardware.py

@ -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:

@ -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,6 +372,7 @@ class Tici(HardwareBase):
def set_power_save(self, powersave_enabled):
# amplifier, 100mW at idle
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())
@ -414,6 +413,7 @@ class Tici(HardwareBase):
return 0
def initialize_hardware(self):
if self.amplifier is not None:
self.amplifier.initialize_configuration(self.get_device_type())
# Allow thermald to write engagement status to kmsg

Loading…
Cancel
Save