|
|
|
@ -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") |
|
|
|
|