#include #include #include #include "../../perf.h" #include #include "../../util/debug.h" #include "../../util/tsc.h" int perf_read_tsc_conversion(const struct perf_event_mmap_page *pc, struct perf_tsc_conversion *tc) { bool cap_user_time_zero; u32 seq; int i = 0; while (1) { seq = pc->lock; rmb(); tc->time_mult = pc->time_mult; tc->time_shift = pc->time_shift; tc->time_zero = pc->time_zero; cap_user_time_zero = pc->cap_user_time_zero; rmb(); if (pc->lock == seq && !(seq & 1)) break; if (++i > 10000) { pr_debug("failed to get perf_event_mmap_page lock\n"); return -EINVAL; } } if (!cap_user_time_zero) return -EOPNOTSUPP; return 0; } u64 rdtsc(void) { unsigned int low, high; asm volatile("rdtsc" : "=a" (low), "=d" (high)); return low | ((u64)high) << 32; } int perf_event__synth_time_conv(const struct perf_event_mmap_page *pc, struct perf_tool *tool, perf_event__handler_t process, struct machine *machine) { union perf_event event = { .time_conv = { .header = { .type = PERF_RECORD_TIME_CONV, .size = sizeof(struct time_conv_event), }, }, }; struct perf_tsc_conversion tc; int err; if (!pc) return 0; err = perf_read_tsc_conversion(pc, &tc); if (err == -EOPNOTSUPP) return 0; if (err) return err; pr_debug2("Synthesizing TSC conversion information\n"); event.time_conv.time_mult = tc.time_mult; event.time_conv.time_shift = tc.time_shift; event.time_conv.time_zero = tc.time_zero; return process(tool, &event, NULL, machine); } class='tabs'> summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-02 16:59:44 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-02 16:59:44 +0100
commit890b73af6b008a7d59bdbab2dd59bd7b212dbc60 (patch)
tree871704f4aec3e77d4d13b3d2878928f0e078cacb /include/sound/da9055.h
parent0c744ea4f77d72b3dcebb7a8f2684633ec79be88 (diff)
parent65e4345c8ef8811bbb4860fe5f2df10646b7f2e1 (diff)
Merge tag 'iio-fixes-for-4.10a' of git://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio into staging-linus
Jonathan writes: First round of IIO fixes for the 4.10 cycle. * 104-quad-8 - Fix selecting wrong register when the index control register is desired. - Fix an off by one error when addressing the input/output control register. - Fix inverted logic on the active high / low control * bmi160 - Sleep for worst case rather than best case amount of time after cmd execution begins. * max44000 - typo fix in illuminance_integration_time_available listing. * st-sensors - Fix channel data passing. This one took a while to get tested on 24bit parts. Definitely one for stable asap as the bug broke quite a few parts. - lis3lv02 needs a data alignment bit set and the scaling was wrong. * ti_am335x - depend on HAS_DMA
Diffstat (limited to 'include/sound/da9055.h')