mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-03 23:41:21 +00:00 
			
		
		
		
	cpufreq: add missing get_driver() method
Add a method to read the name of the driver for cpufreq policy for a cpu.
This commit is contained in:
		
				
					committed by
					
						
						setrofim
					
				
			
			
				
	
			
			
			
						parent
						
							1e839028a1
						
					
				
				
					commit
					7e39ecf142
				
			@@ -442,6 +442,18 @@ class CpufreqModule(Module):
 | 
			
		||||
 | 
			
		||||
        return [int(c) for c in self.target.read_value(sysfile).split()]
 | 
			
		||||
 | 
			
		||||
    @memoized
 | 
			
		||||
    def get_driver(self, cpu):
 | 
			
		||||
        """
 | 
			
		||||
        Get the name of the driver used by this cpufreq policy.
 | 
			
		||||
        """
 | 
			
		||||
        if isinstance(cpu, int):
 | 
			
		||||
            cpu = 'cpu{}'.format(cpu)
 | 
			
		||||
 | 
			
		||||
        sysfile = '/sys/devices/system/cpu/{}/cpufreq/scaling_driver'.format(cpu)
 | 
			
		||||
 | 
			
		||||
        return self.target.read_value(sysfile).strip()
 | 
			
		||||
 | 
			
		||||
    def iter_domains(self):
 | 
			
		||||
        """
 | 
			
		||||
        Iterate over the frequency domains in the system
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user