#if defined(__i386__) || defined(__x86_64__) #include #include #include #include #include "helpers/helpers.h" /* Intel specific MSRs */ #define MSR_IA32_PERF_STATUS 0x198 #define MSR_IA32_MISC_ENABLES 0x1a0 #define MSR_IA32_ENERGY_PERF_BIAS 0x1b0 #define MSR_NEHALEM_TURBO_RATIO_LIMIT 0x1ad /* * read_msr * * Will return 0 on success and -1 on failure. * Possible errno values could be: * EFAULT -If the read/write did not fully complete * EIO -If the CPU does not support MSRs * ENXIO -If the CPU does not exist */ int read_msr(int cpu, unsigned int idx, unsigned long long *val) { int fd; char msr_file_name[64]; sprintf(msr_file_name, "/dev/cpu/%d/msr", cpu); fd = open(msr_file_name, O_RDONLY); if (fd < 0) return -1; if (lseek(fd, idx, SEEK_CUR) == -1) goto err; if (read(fd, val, sizeof *val) != sizeof *val) goto err; close(fd); return 0; err: close(fd); return -1; } /* * write_msr * * Will return 0 on success and -1 on failure. * Possible errno values could be: * EFAULT -If the read/write did not fully complete * EIO -If the CPU does not support MSRs * ENXIO -If the CPU does not exist */ int write_msr(int cpu, unsigned int idx, unsigned long long val) { int fd; char msr_file_name[64]; sprintf(msr_file_name, "/dev/cpu/%d/msr", cpu); fd = open(msr_file_name, O_WRONLY); if (fd < 0) return -1; if (lseek(fd, idx, SEEK_CUR) == -1) goto err; if (write(fd, &val, sizeof val) != sizeof val) goto err; close(fd); return 0; err: close(fd); return -1; } int msr_intel_get_perf_bias(unsigned int cpu) { unsigned long long val; int ret; if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_PERF_BIAS)) return -1; ret = read_msr(cpu, MSR_IA32_ENERGY_PERF_BIAS, &val); if (ret) return ret; return val; } int msr_intel_set_perf_bias(unsigned int cpu, unsigned int val) { int ret; if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_PERF_BIAS)) return -1; ret = write_msr(cpu, MSR_IA32_ENERGY_PERF_BIAS, val); if (ret) return ret; return 0; } unsigned long long msr_intel_get_turbo_ratio(unsigned int cpu) { unsigned long long val; int ret; if (!(cpupower_cpu_info.caps & CPUPOWER_CAP_HAS_TURBO_RATIO)) return -1; ret = read_msr(cpu, MSR_NEHALEM_TURBO_RATIO_LIMIT, &val); if (ret) return ret; return val; } #endif ame='id' value='0a019a28e0ca0af7dc2691d1a9527960b07ad2bb'/>
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2017-01-29 21:00:48 -0800
committerOlof Johansson <olof@lixom.net>2017-01-29 21:00:48 -0800
commit0a019a28e0ca0af7dc2691d1a9527960b07ad2bb (patch)
tree5ee1db9aacacd6af6701fb290e8a294ef3cc2bf2 /sound/soc/codecs/da732x.h
parentec026b5020688a8bde5fae9a69ae3c59b66ba3ae (diff)
parent8413299cb3933dade6186bbee8363f190032107e (diff)
Merge tag 'sti-dt-for-v4.10-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti into fixes
STi DT fix: Since v4.10-rc1, xhci is complaining in loop with : [ 801.953836] usb usb6-port1: Cannot enable. Maybe the USB cable is bad? [ 801.960455] xhci-hcd xhci-hcd.0.auto: Cannot set link state. [ 801.966611] usb usb6-port1: cannot disable (err = -32) set property "snps,dis_u3_susphy_quirk" in DT fix it. * tag 'sti-dt-for-v4.10-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/pchotard/sti: ARM: dts: STiH407-family: set snps,dis_u3_susphy_quirk Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'sound/soc/codecs/da732x.h')