/* * (C) 2003 - 2004 Dominik Brodowski * * Licensed under the terms of the GNU GPL License version 2. * * Based on code found in * linux/arch/i386/kernel/cpu/cpufreq/speedstep-centrino.c * and originally developed by Jeremy Fitzhardinge. * * USAGE: simply run it to decode the current settings on CPU 0, * or pass the CPU number as argument, or pass the MSR content * as argument. */ #include #include #include #include #include #include #include #include #define MCPU 32 #define MSR_IA32_PERF_STATUS 0x198 static int rdmsr(unsigned int cpu, unsigned int msr, unsigned int *lo, unsigned int *hi) { int fd; char file[20]; unsigned long long val; int retval = -1; *lo = *hi = 0; if (cpu > MCPU) goto err1; sprintf(file, "/dev/cpu/%d/msr", cpu); fd = open(file, O_RDONLY); if (fd < 0) goto err1; if (lseek(fd, msr, SEEK_CUR) == -1) goto err2; if (read(fd, &val, 8) != 8) goto err2; *lo = (uint32_t )(val & 0xffffffffull); *hi = (uint32_t )(val>>32 & 0xffffffffull); retval = 0; err2: close(fd); err1: return retval; } static void decode (unsigned int msr) { unsigned int multiplier; unsigned int mv; multiplier = ((msr >> 8) & 0xFF); mv = (((msr & 0xFF) * 16) + 700); printf("0x%x means multiplier %d @ %d mV\n", msr, multiplier, mv); } static int decode_live(unsigned int cpu) { unsigned int lo, hi; int err; err = rdmsr(cpu, MSR_IA32_PERF_STATUS, &lo, &hi); if (err) { printf("can't get MSR_IA32_PERF_STATUS for cpu %d\n", cpu); printf("Possible trouble: you don't run an Enhanced SpeedStep capable cpu\n"); printf("or you are not root, or the msr driver is not present\n"); return 1; } decode(lo); return 0; } int main (int argc, char **argv) { unsigned int cpu, mode = 0; if (argc < 2) cpu = 0; else { cpu = strtoul(argv[1], NULL, 0); if (cpu >= MCPU) mode = 1; } if (mode) decode(cpu); else decode_live(cpu); return 0; } rdma/ib_pack.h?id=d0e287a401d9acf67b75180b26e2d62b7d482652'>diff
diff options
context:
space:
mode:
authorRask Ingemann Lambertsen <rask@formelder.dk>2017-01-21 17:11:43 +0100
committerMark Brown <broonie@kernel.org>2017-01-23 18:10:05 +0000
commitd0e287a401d9acf67b75180b26e2d62b7d482652 (patch)
treef1ba3cd0583e38846c4f6e32eee74a25a2739a31 /include/rdma/ib_pack.h
parentd00b74613fb18dfd0a5aa99270ee2e72d5c808d7 (diff)
regulator: axp20x: AXP806: Fix dcdcb being set instead of dcdce
A typo or copy-paste bug means that the register access intended for regulator dcdce goes to dcdcb instead. This patch corrects it. Fixes: 2ca342d391e3 (regulator: axp20x: Support AXP806 variant) Signed-off-by: Rask Ingemann Lambertsen <rask@formelder.dk> Acked-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
Diffstat (limited to 'include/rdma/ib_pack.h')