Home
last modified time | relevance | path

Searched full:tsc (Results 1 – 25 of 375) sorted by relevance

12345678910>>...15

/linux/drivers/input/touchscreen/
H A Dimx6ul_tsc.c57 /* TSC registers */
68 /* TSC configuration registers field define */
100 * TSC module need ADC to get the measure value. So
101 * before config TSC, we should initialize ADC module.
103 static int imx6ul_adc_init(struct imx6ul_tsc *tsc) in imx6ul_adc_init() argument
111 reinit_completion(&tsc->completion); in imx6ul_adc_init()
113 adc_cfg = readl(tsc->adc_regs + REG_ADC_CFG); in imx6ul_adc_init()
118 if (tsc->average_enable) { in imx6ul_adc_init()
120 adc_cfg |= (tsc->average_select) << ADC_AVGS_SHIFT; in imx6ul_adc_init()
123 writel(adc_cfg, tsc->adc_regs + REG_ADC_CFG); in imx6ul_adc_init()
[all …]
H A Dtps6507x-ts.c50 static int tps6507x_read_u8(struct tps6507x_ts *tsc, u8 reg, u8 *data) in tps6507x_read_u8() argument
52 return tsc->mfd->read_dev(tsc->mfd, reg, 1, data); in tps6507x_read_u8()
55 static int tps6507x_write_u8(struct tps6507x_ts *tsc, u8 reg, u8 data) in tps6507x_write_u8() argument
57 return tsc->mfd->write_dev(tsc->mfd, reg, 1, &data); in tps6507x_write_u8()
60 static s32 tps6507x_adc_conversion(struct tps6507x_ts *tsc, in tps6507x_adc_conversion() argument
69 ret = tps6507x_write_u8(tsc, TPS6507X_REG_TSCMODE, tsc_mode); in tps6507x_adc_conversion()
71 dev_err(tsc->dev, "TSC mode read failed\n"); in tps6507x_adc_conversion()
77 ret = tps6507x_write_u8(tsc, TPS6507X_REG_ADCONFIG, in tps6507x_adc_conversion()
80 dev_err(tsc->dev, "ADC config write failed\n"); in tps6507x_adc_conversion()
85 ret = tps6507x_read_u8(tsc, TPS6507X_REG_ADCONFIG, in tps6507x_adc_conversion()
[all …]
H A Dlpc32xx_ts.c71 static void lpc32xx_fifo_clear(struct lpc32xx_tsc *tsc) in lpc32xx_fifo_clear() argument
73 while (!(tsc_readl(tsc, LPC32XX_TSC_STAT) & in lpc32xx_fifo_clear()
75 tsc_readl(tsc, LPC32XX_TSC_FIFO); in lpc32xx_fifo_clear()
82 struct lpc32xx_tsc *tsc = dev_id; in lpc32xx_ts_interrupt() local
83 struct input_dev *input = tsc->dev; in lpc32xx_ts_interrupt()
85 tmp = tsc_readl(tsc, LPC32XX_TSC_STAT); in lpc32xx_ts_interrupt()
89 lpc32xx_fifo_clear(tsc); in lpc32xx_ts_interrupt()
100 !(tsc_readl(tsc, LPC32XX_TSC_STAT) & in lpc32xx_ts_interrupt()
102 tmp = tsc_readl(tsc, LPC32XX_TSC_FIFO); in lpc32xx_ts_interrupt()
126 static void lpc32xx_stop_tsc(struct lpc32xx_tsc *tsc) in lpc32xx_stop_tsc() argument
[all …]
H A Dtsc2007_iio.c42 struct tsc2007 *tsc = iio->ts; in tsc2007_read_raw() local
52 mutex_lock(&tsc->mlock); in tsc2007_read_raw()
56 *val = tsc2007_xfer(tsc, READ_X); in tsc2007_read_raw()
59 *val = tsc2007_xfer(tsc, READ_Y); in tsc2007_read_raw()
62 *val = tsc2007_xfer(tsc, READ_Z1); in tsc2007_read_raw()
65 *val = tsc2007_xfer(tsc, READ_Z2); in tsc2007_read_raw()
68 *val = tsc2007_xfer(tsc, (ADC_ON_12BIT | TSC2007_MEASURE_AUX)); in tsc2007_read_raw()
73 tc.x = tsc2007_xfer(tsc, READ_X); in tsc2007_read_raw()
74 tc.z1 = tsc2007_xfer(tsc, READ_Z1); in tsc2007_read_raw()
75 tc.z2 = tsc2007_xfer(tsc, READ_Z2); in tsc2007_read_raw()
[all …]
H A Dcy8ctmg110_ts.c61 static int cy8ctmg110_write_regs(struct cy8ctmg110 *tsc, unsigned char reg, in cy8ctmg110_write_regs() argument
64 struct i2c_client *client = tsc->client; in cy8ctmg110_write_regs()
82 static int cy8ctmg110_read_regs(struct cy8ctmg110 *tsc, in cy8ctmg110_read_regs() argument
85 struct i2c_client *client = tsc->client; in cy8ctmg110_read_regs()
110 static int cy8ctmg110_touch_pos(struct cy8ctmg110 *tsc) in cy8ctmg110_touch_pos() argument
112 struct input_dev *input = tsc->input; in cy8ctmg110_touch_pos()
118 if (cy8ctmg110_read_regs(tsc, reg_p, 9, CY8CTMG110_TOUCH_X1) != 0) in cy8ctmg110_touch_pos()
156 struct cy8ctmg110 *tsc = dev_id; in cy8ctmg110_irq_thread() local
158 cy8ctmg110_touch_pos(tsc); in cy8ctmg110_irq_thread()
H A Dtsc2007_core.c31 int tsc2007_xfer(struct tsc2007 *tsc, u8 cmd) in tsc2007_xfer() argument
36 data = i2c_smbus_read_word_data(tsc->client, cmd); in tsc2007_xfer()
38 dev_err(&tsc->client->dev, "i2c io error: %d\n", data); in tsc2007_xfer()
48 dev_dbg(&tsc->client->dev, "data: 0x%x, val: 0x%x\n", data, val); in tsc2007_xfer()
53 static void tsc2007_read_values(struct tsc2007 *tsc, struct ts_event *tc) in tsc2007_read_values() argument
56 tc->y = tsc2007_xfer(tsc, READ_Y); in tsc2007_read_values()
59 tc->x = tsc2007_xfer(tsc, READ_X); in tsc2007_read_values()
62 tc->z1 = tsc2007_xfer(tsc, READ_Z1); in tsc2007_read_values()
63 tc->z2 = tsc2007_xfer(tsc, READ_Z2); in tsc2007_read_values()
66 tsc2007_xfer(tsc, PWRDOWN); in tsc2007_read_values()
[all …]
/linux/drivers/thermal/renesas/
H A Drcar_gen3_thermal.c103 static inline u32 rcar_gen3_thermal_read(struct rcar_gen3_thermal_tsc *tsc, in rcar_gen3_thermal_read() argument
106 return ioread32(tsc->base + reg); in rcar_gen3_thermal_read()
109 static inline void rcar_gen3_thermal_write(struct rcar_gen3_thermal_tsc *tsc, in rcar_gen3_thermal_write() argument
112 iowrite32(data, tsc->base + reg); in rcar_gen3_thermal_write()
146 struct rcar_gen3_thermal_tsc *tsc) in rcar_gen3_thermal_tsc_coefs() argument
148 tsc->coef.below.a = priv->info->scale * (priv->ptat[2] - priv->ptat[1]); in rcar_gen3_thermal_tsc_coefs()
149 tsc->coef.above.a = priv->info->scale * (priv->ptat[0] - priv->ptat[1]); in rcar_gen3_thermal_tsc_coefs()
151 tsc->coef.below.b = (priv->ptat[2] - priv->ptat[0]) * (tsc->thcode[2] - tsc->thcode[1]); in rcar_gen3_thermal_tsc_coefs()
152 tsc->coef.above.b = (priv->ptat[0] - priv->ptat[2]) * (tsc->thcode[1] - tsc->thcode[0]); in rcar_gen3_thermal_tsc_coefs()
157 struct rcar_gen3_thermal_tsc *tsc = thermal_zone_device_priv(tz); in rcar_gen3_thermal_get_temp() local
[all …]
/linux/arch/x86/kernel/
H A Dtsc_sync.c3 * check TSC synchronization.
7 * We check whether all boot CPUs have their TSC's synchronized,
8 * print a warning if not and turn off the TSC clock-source.
24 #include <asm/tsc.h>
37 * TSC's on different sockets may be reset asynchronously.
38 * This may cause the TSC ADJUST value on socket 0 to be NOT 0.
47 pr_info("tsc: Marking TSC async resets true due to %s\n", reason); in mark_tsc_async_resets()
58 /* Skip unnecessary error messages if TSC already unstable */ in tsc_verify_tsc_adjust()
76 pr_warn(FW_BUG "TSC ADJUST differs: CPU%u %lld --> %lld. Restoring\n", in tsc_verify_tsc_adjust()
134 * the TSC is in sync with the already running cpus. in tsc_sanitize_first_cpu()
[all …]
H A Dtsc.c34 unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
43 * TSC can be unstable due to cpufreq or due to unsynced TSCs
242 * Fall back to jiffies if there's no TSC available: in native_sched_clock()
243 * ( But note that we still use it if the TSC is marked in native_sched_clock()
255 * Generate a sched_clock if you already have a TSC value.
257 u64 native_sched_clock_from_tsc(u64 tsc) in native_sched_clock_from_tsc() argument
259 return cycles_2_ns(tsc); in native_sched_clock_from_tsc()
303 * disable flag for tsc. Takes effect by clearing the TSC cpu flag
330 pr_alert("%s: Overriding earlier tsc=watchdog with tsc=nowatchdog\n", in tsc_setup()
338 pr_alert("%s: tsc=watchdog overridden by earlier tsc=nowatchdog\n", in tsc_setup()
[all …]
/linux/Documentation/virt/kvm/x86/
H A Dtimekeeping.rst14 3) TSC Hardware
37 First we discuss the basic hardware devices available. TSC and the related
324 3. TSC Hardware
327 The TSC or time stamp counter is relatively simple in theory; it counts
332 The TSC is represented internally as a 64-bit MSR which can be read with the
334 limitations made it possible to write the TSC, but generally on old hardware it
339 write the TSC MSR is not an architectural guarantee.
341 The TSC is accessible from CPL-0 and conditionally, for CPL > 0 software by
342 means of the CR4.TSD bit, which when enabled, disables CPL > 0 TSC access.
345 atomically not just the TSC, but an indicator which corresponds to the
[all …]
/linux/tools/perf/arch/x86/util/
H A Dtsc.c8 #include "../../../util/tsc.h"
21 * Derive the TSC frequency in Hz from the /proc/cpuinfo, for example:
36 pr_err("Failed to read /proc/cpuinfo for TSC frequency\n"); in cpuinfo_tsc_freq()
51 pr_err("Failed to find TSC frequency in /proc/cpuinfo\n"); in cpuinfo_tsc_freq()
62 static double tsc; in arch_get_tsc_freq() local
66 return tsc; in arch_get_tsc_freq()
78 tsc = cpuinfo_tsc_freq(); in arch_get_tsc_freq()
79 return tsc; in arch_get_tsc_freq()
83 /* TSC frequency is not enumerated */ in arch_get_tsc_freq()
85 tsc = cpuinfo_tsc_freq(); in arch_get_tsc_freq()
[all …]
/linux/drivers/thermal/tegra/
H A Dtegra30-tsensor.c163 const struct tegra_tsensor_channel *tsc = thermal_zone_device_priv(tz); in tegra_tsensor_get_temp() local
164 const struct tegra_tsensor *ts = tsc->ts; in tegra_tsensor_get_temp()
172 err = readl_relaxed_poll_timeout(tsc->regs + TSENSOR_SENSOR0_STATUS0, val, in tegra_tsensor_get_temp()
177 dev_err_once(ts->dev, "ch%u: counter invalid\n", tsc->id); in tegra_tsensor_get_temp()
181 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_TS_STATUS1); in tegra_tsensor_get_temp()
190 dev_err_once(ts->dev, "ch%u: counter overflow\n", tsc->id); in tegra_tsensor_get_temp()
221 const struct tegra_tsensor_channel *tsc = thermal_zone_device_priv(tz); in tegra_tsensor_set_trips() local
222 const struct tegra_tsensor *ts = tsc->ts; in tegra_tsensor_set_trips()
232 val = readl_relaxed(tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_set_trips()
237 writel_relaxed(val, tsc->regs + TSENSOR_SENSOR0_CONFIG1); in tegra_tsensor_set_trips()
[all …]
/linux/tools/testing/selftests/kvm/x86_64/
H A Dvmx_nested_tsc_scaling_test.c7 * This test case verifies that nested TSC scaling behaves as expected when
32 * This function checks whether the "actual" TSC frequency of a guest matches
33 * its expected frequency. In order to account for delays in taking the TSC
46 "TSC freq is expected to be between %"PRIu64" and %"PRIu64 in compare_tsc_freq()
50 "TSC freq is expected to be between %"PRIu64" and %"PRIu64 in compare_tsc_freq()
60 * Reading the TSC twice with about a second's difference should give in check_tsc_freq()
61 * us an approximation of the TSC frequency from the guest's in check_tsc_freq()
96 /* enable TSC offsetting and TSC scaling for L2 */ in l1_guest_code()
152 printf("real TSC frequency is around: %"PRIu64"\n", l0_tsc_freq); in main()
161 /* scale down L1's TSC frequency */ in main()
[all …]
H A Dhyperv_clock.c88 /* Compare TSC page clocksource with HV_X64_MSR_TIME_REF_COUNT */ in check_tsc_msr_tsc_page()
114 /* Set up TSC page is disabled state, check that it's clean */ in guest_main()
122 /* Set up TSC page is enabled state */ in guest_main()
133 /* Call KVM_SET_CLOCK from userspace, check that TSC page was updated */ in guest_main()
136 /* Sanity check TSC page timestamp, it should be close to 0 */ in guest_main()
144 * Enable Re-enlightenment and check that TSC page stays constant across in guest_main()
160 * Disable re-enlightenment and TSC page, check that KVM doesn't update in guest_main()
182 TEST_ASSERT(tsc_freq > 0, "TSC frequency must be nonzero"); in host_check_tsc_msr_rdtsc()
202 "Elapsed time does not match (MSR=%ld, TSC=%ld)", in host_check_tsc_msr_rdtsc()
224 "TSC page has to be page aligned"); in main()
[all …]
H A Dvmx_preemption_timer_test.c139 * tsc deadlines so that host can verify they are as expected in l1_guest_code()
210 pr_info("Stage %d: L1 PT expiry TSC (%lu) , L1 TSC deadline (%lu)\n", in main()
213 pr_info("Stage %d: L2 PT expiry TSC (%lu) , L2 TSC deadline (%lu)\n", in main()
217 "Stage %d: L1 PT expiry TSC (%lu) < L1 TSC deadline (%lu)", in main()
221 "Stage %d: L2 PT expiry TSC (%lu) > L2 TSC deadline (%lu)", in main()
/linux/drivers/clocksource/
H A Dhyperv_timer.c145 * it depends on the slow VM Reference Counter MSR (the Hyper-V TSC in hv_stimer_init()
146 * page is not enbled in such a VM because the VM uses Invariant TSC in hv_stimer_init()
148 * TSC page shared in very early boot). in hv_stimer_init()
399 * the other that uses the TSC reference page feature as defined in the
401 * Hyper-V and 32-bit x86. The TSC reference page version is preferred.
430 * subsection Refererence Counter, guarantees that the TSC and MSR in read_hv_clock_tsc()
432 * to the MSR in case the TSC page indicates unavailability. in read_hv_clock_tsc()
455 /* Disable the TSC page */ in suspend_hv_clock_tsc()
466 /* Re-enable the TSC page */ in resume_hv_clock_tsc()
539 * If Hyper-V offers TSC_INVARIANT, then the virtualized TSC correctly in hv_init_tsc_clocksource()
[all …]
H A Dtimer-tegra186.c89 struct clocksource tsc; member
298 tsc); in tegra186_timer_tsc_read()
304 * The 56-bit value of the TSC is spread across two registers that are in tegra186_timer_tsc_read()
321 tegra->tsc.name = "tsc"; in tegra186_timer_tsc_init()
322 tegra->tsc.rating = 300; in tegra186_timer_tsc_init()
323 tegra->tsc.read = tegra186_timer_tsc_read; in tegra186_timer_tsc_init()
324 tegra->tsc.mask = CLOCKSOURCE_MASK(56); in tegra186_timer_tsc_init()
325 tegra->tsc.flags = CLOCK_SOURCE_IS_CONTINUOUS; in tegra186_timer_tsc_init()
327 return clocksource_register_hz(&tegra->tsc, 31250000); in tegra186_timer_tsc_init()
415 dev_err(dev, "failed to register TSC counter: %d\n", err); in tegra186_timer_probe()
[all …]
/linux/tools/power/cpupower/utils/idle_monitor/
H A Dmperf_monitor.c67 * 1) calculated after measurements if we know TSC ticks at mperf/P0 frequency
83 static int mperf_get_tsc(unsigned long long *tsc) in mperf_get_tsc() argument
87 ret = read_msr(base_cpu, MSR_TSC, tsc); in mperf_get_tsc()
89 dprint("Reading TSC MSR failed, returning %llu\n", *tsc); in mperf_get_tsc()
174 dprint("%s: TSC Ref - mperf_diff: %llu, tsc_diff: %llu\n", in mperf_get_count_percent()
208 /* Calculate max_freq from TSC count */ in mperf_get_count_freq()
217 (max_freq_mode == MAX_FREQ_TSC_REF) ? "TSC calculated" : "sysfs read"); in mperf_get_count_freq()
256 * we use TSC counter if it reliably ticks at P0/mperf frequency.
260 * on older Intel HW without invariant TSC feature.
261 * Or on AMD machines where TSC does not tick at P0 (do not exist yet, but
[all …]
H A Dnhm_idle.c27 enum intel_nhm_id { C3 = 0, C6, PC3, PC6, TSC = 0xFFFF }; enumerator
89 case TSC: in nhm_get_count()
131 nhm_get_count(TSC, &tsc_at_measure_start, base_cpu); in nhm_start()
139 nhm_get_count(TSC, &dbg, base_cpu); in nhm_start()
140 dprint("TSC diff: %llu\n", dbg - tsc_at_measure_start); in nhm_start()
150 nhm_get_count(TSC, &tsc_at_measure_end, base_cpu); in nhm_stop()
158 nhm_get_count(TSC, &dbg, base_cpu); in nhm_stop()
159 dprint("TSC diff: %llu\n", dbg - tsc_at_measure_end); in nhm_stop()
212 .overflow_s = 922000000 /* 922337203 seconds TSC overflow
/linux/tools/perf/tests/
H A Dperf-time-to-tsc.c20 #include "tsc.h"
26 * Except x86_64/i386 and Arm64, other archs don't support TSC in perf. Just
61 * test__perf_time_to_tsc - test converting perf time to TSC.
64 * to and from TSC is consistent with the order of events. If the test passes
65 * %0 is returned, otherwise %-1 is returned. If TSC conversion is not
184 pr_debug("1st event perf time %"PRIu64" tsc %"PRIu64"\n", in test__perf_time_to_tsc()
186 pr_debug("rdtsc time %"PRIu64" tsc %"PRIu64"\n", in test__perf_time_to_tsc()
188 pr_debug("2nd event perf time %"PRIu64" tsc %"PRIu64"\n", in test__perf_time_to_tsc()
209 TEST_CASE_REASON("TSC support", tsc_is_supported,
211 TEST_CASE_REASON("Perf time to TSC", perf_time_to_tsc,
[all …]
/linux/drivers/cpufreq/
H A Damd-pstate-trace.h33 u64 tsc,
45 tsc,
58 __field(unsigned long long, tsc)
71 __entry->tsc = tsc;
77 …TP_printk("amd_min_perf=%lu amd_des_perf=%lu amd_max_perf=%lu freq=%llu mperf=%llu aperf=%llu tsc=…
84 (unsigned long long)__entry->tsc,
/linux/Documentation/devicetree/bindings/input/touchscreen/
H A Dlpc32xx-tsc.txt1 * NXP LPC32xx SoC Touchscreen Controller (TSC)
4 - compatible: must be "nxp,lpc3220-tsc"
7 - interrupts: The TSC/ADC interrupt
11 tsc@40048000 {
12 compatible = "nxp,lpc3220-tsc";
/linux/arch/x86/include/asm/xen/
H A Dcpuid.h78 * Sub-leaf 0: EAX: bit 0: emulated tsc
79 * bit 1: host tsc is known to be reliable
83 * ECX: guest tsc frequency in kHz
84 * EDX: guest tsc incarnation (migration count)
85 * Sub-leaf 1: EAX: tsc offset low part
86 * EBX: tsc offset high part
87 * ECX: multiplicator for tsc->ns conversion
88 * EDX: shift amount for tsc->ns conversion
89 * Sub-leaf 2: EAX: host tsc frequency in kHz
/linux/tools/perf/util/intel-pt-decoder/
H A Dintel-pt-decoder.c362 * A TSC packet can slip past MTC packets so that the timestamp appears in intel_pt_decoder_new()
364 * cycles, which is certainly less than 0x1000 TSC ticks, but accept in intel_pt_decoder_new()
879 * For now, do not support using TSC packets - refer in intel_pt_calc_cyc_cb()
965 intel_pt_log("Timestamp: calculated %g TSC ticks per cycle too big (c.f. CBR-based value %g), pos " x64_fmt "\n", in intel_pt_calc_cyc_cb()
974 intel_pt_log("Timestamp: calculated %g TSC ticks per cycle c.f. CBR-based value %g, pos " x64_fmt "\n", in intel_pt_calc_cyc_cb()
977 intel_pt_log("Timestamp: calculated %g TSC ticks per cycle c.f. unknown CBR-based value, pos " x64_fmt "\n", in intel_pt_calc_cyc_cb()
1002 * For now, do not support using TSC packets for at least the reasons: in intel_pt_calc_cyc_to_tsc()
1004 * 2) TSC packets within PSB+ can slip against CYC packets in intel_pt_calc_cyc_to_tsc()
2320 bool tsc, pip, vmcs, tma, psbend;
2343 data->tsc in intel_pt_vm_psb_lookahead_cb()
2318 bool tsc, pip, vmcs, tma, psbend; global() member
4172 intel_pt_next_tsc(unsigned char * buf,size_t len,uint64_t * tsc,size_t * rem) intel_pt_next_tsc() argument
4412 uint64_t tsc; intel_pt_ff_cb() local
4489 uint64_t tsc; intel_pt_fast_forward() local
[all...]
/linux/Documentation/virt/kvm/devices/
H A Dvcpu.rst206 :Parameters: 64-bit unsigned TSC offset
216 Specifies the guest's TSC offset relative to the host's TSC. The guest's
217 TSC is then derived by the following equation:
221 This attribute is useful to adjust the guest's TSC on live migration,
222 so that the TSC counts the time during which the VM was paused. The
227 1. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_src),
232 guest TSC offset (ofs_src[i]).
235 guest's TSC (freq).
251 5. Invoke the KVM_GET_CLOCK ioctl to record the host TSC (tsc_dest) and
254 6. Adjust the guest TSC offsets for every vCPU to account for (1) time
[all …]

12345678910>>...15