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. 18
      system/hardware/tici/hardware.py

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

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

Loading…
Cancel
Save