Home
last modified time | relevance | path

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

12345678910>>...24

/kernel/linux/linux-5.10/drivers/input/touchscreen/
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 …]
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 …]
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 …]
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 …]
/kernel/linux/linux-4.19/drivers/input/touchscreen/
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 …]
Dtps6507x-ts.c51 static int tps6507x_read_u8(struct tps6507x_ts *tsc, u8 reg, u8 *data) in tps6507x_read_u8() argument
53 return tsc->mfd->read_dev(tsc->mfd, reg, 1, data); in tps6507x_read_u8()
56 static int tps6507x_write_u8(struct tps6507x_ts *tsc, u8 reg, u8 data) in tps6507x_write_u8() argument
58 return tsc->mfd->write_dev(tsc->mfd, reg, 1, &data); in tps6507x_write_u8()
61 static s32 tps6507x_adc_conversion(struct tps6507x_ts *tsc, in tps6507x_adc_conversion() argument
70 ret = tps6507x_write_u8(tsc, TPS6507X_REG_TSCMODE, tsc_mode); in tps6507x_adc_conversion()
72 dev_err(tsc->dev, "TSC mode read failed\n"); in tps6507x_adc_conversion()
78 ret = tps6507x_write_u8(tsc, TPS6507X_REG_ADCONFIG, in tps6507x_adc_conversion()
81 dev_err(tsc->dev, "ADC config write failed\n"); in tps6507x_adc_conversion()
86 ret = tps6507x_read_u8(tsc, TPS6507X_REG_ADCONFIG, in tps6507x_adc_conversion()
[all …]
Dlpc32xx_ts.c80 static void lpc32xx_fifo_clear(struct lpc32xx_tsc *tsc) in lpc32xx_fifo_clear() argument
82 while (!(tsc_readl(tsc, LPC32XX_TSC_STAT) & in lpc32xx_fifo_clear()
84 tsc_readl(tsc, LPC32XX_TSC_FIFO); in lpc32xx_fifo_clear()
91 struct lpc32xx_tsc *tsc = dev_id; in lpc32xx_ts_interrupt() local
92 struct input_dev *input = tsc->dev; in lpc32xx_ts_interrupt()
94 tmp = tsc_readl(tsc, LPC32XX_TSC_STAT); in lpc32xx_ts_interrupt()
98 lpc32xx_fifo_clear(tsc); in lpc32xx_ts_interrupt()
109 !(tsc_readl(tsc, LPC32XX_TSC_STAT) & in lpc32xx_ts_interrupt()
111 tmp = tsc_readl(tsc, LPC32XX_TSC_FIFO); in lpc32xx_ts_interrupt()
135 static void lpc32xx_stop_tsc(struct lpc32xx_tsc *tsc) in lpc32xx_stop_tsc() argument
[all …]
Dtsc2007_iio.c45 struct tsc2007 *tsc = iio->ts; in tsc2007_read_raw() local
55 mutex_lock(&tsc->mlock); in tsc2007_read_raw()
59 *val = tsc2007_xfer(tsc, READ_X); in tsc2007_read_raw()
62 *val = tsc2007_xfer(tsc, READ_Y); in tsc2007_read_raw()
65 *val = tsc2007_xfer(tsc, READ_Z1); in tsc2007_read_raw()
68 *val = tsc2007_xfer(tsc, READ_Z2); in tsc2007_read_raw()
71 *val = tsc2007_xfer(tsc, (ADC_ON_12BIT | TSC2007_MEASURE_AUX)); in tsc2007_read_raw()
76 tc.x = tsc2007_xfer(tsc, READ_X); in tsc2007_read_raw()
77 tc.z1 = tsc2007_xfer(tsc, READ_Z1); in tsc2007_read_raw()
78 tc.z2 = tsc2007_xfer(tsc, READ_Z2); in tsc2007_read_raw()
[all …]
/kernel/linux/linux-5.10/drivers/thermal/
Drcar_gen3_thermal.c91 void (*thermal_init)(struct rcar_gen3_thermal_tsc *tsc);
94 static inline u32 rcar_gen3_thermal_read(struct rcar_gen3_thermal_tsc *tsc, in rcar_gen3_thermal_read() argument
97 return ioread32(tsc->base + reg); in rcar_gen3_thermal_read()
100 static inline void rcar_gen3_thermal_write(struct rcar_gen3_thermal_tsc *tsc, in rcar_gen3_thermal_write() argument
103 iowrite32(data, tsc->base + reg); in rcar_gen3_thermal_write()
134 static void rcar_gen3_thermal_calc_coefs(struct rcar_gen3_thermal_tsc *tsc, in rcar_gen3_thermal_calc_coefs() argument
144 tsc->tj_t = (FIXPT_INT((ptat[1] - ptat[2]) * (ths_tj_1 - TJ_3)) in rcar_gen3_thermal_calc_coefs()
147 tsc->coef.a1 = FIXPT_DIV(FIXPT_INT(thcode[1] - thcode[2]), in rcar_gen3_thermal_calc_coefs()
148 tsc->tj_t - FIXPT_INT(TJ_3)); in rcar_gen3_thermal_calc_coefs()
149 tsc->coef.b1 = FIXPT_INT(thcode[2]) - tsc->coef.a1 * TJ_3; in rcar_gen3_thermal_calc_coefs()
[all …]
/kernel/linux/linux-4.19/drivers/thermal/
Drcar_gen3_thermal.c83 void (*thermal_init)(struct rcar_gen3_thermal_tsc *tsc);
86 static inline u32 rcar_gen3_thermal_read(struct rcar_gen3_thermal_tsc *tsc, in rcar_gen3_thermal_read() argument
89 return ioread32(tsc->base + reg); in rcar_gen3_thermal_read()
92 static inline void rcar_gen3_thermal_write(struct rcar_gen3_thermal_tsc *tsc, in rcar_gen3_thermal_write() argument
95 iowrite32(data, tsc->base + reg); in rcar_gen3_thermal_write()
162 struct rcar_gen3_thermal_tsc *tsc = devdata; in rcar_gen3_thermal_get_temp() local
167 reg = rcar_gen3_thermal_read(tsc, REG_GEN3_TEMP) & CTEMP_MASK; in rcar_gen3_thermal_get_temp()
169 val1 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b1, tsc->coef.a1); in rcar_gen3_thermal_get_temp()
170 val2 = FIXPT_DIV(FIXPT_INT(reg) - tsc->coef.b2, tsc->coef.a2); in rcar_gen3_thermal_get_temp()
183 static int rcar_gen3_thermal_mcelsius_to_temp(struct rcar_gen3_thermal_tsc *tsc, in rcar_gen3_thermal_mcelsius_to_temp() argument
[all …]
/kernel/linux/linux-4.19/arch/x86/kernel/
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.
23 #include <asm/tsc.h>
35 * TSC's on different sockets may be reset asynchronously.
36 * This may cause the TSC ADJUST value on socket 0 to be NOT 0.
45 pr_info("tsc: Marking TSC async resets true due to %s\n", reason); in mark_tsc_async_resets()
56 /* Skip unnecessary error messages if TSC already unstable */ in tsc_verify_tsc_adjust()
74 pr_warn(FW_BUG "TSC ADJUST differs: CPU%u %lld --> %lld. Restoring\n", in tsc_verify_tsc_adjust()
92 * the TSC is in sync with the already running cpus. in tsc_sanitize_first_cpu()
[all …]
Dtsc.c31 unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
40 * TSC can be unstable due to cpufreq or due to unsynced TSCs
220 * Fall back to jiffies if there's no TSC available: in native_sched_clock()
221 * ( But note that we still use it if the TSC is marked in native_sched_clock()
233 * Generate a sched_clock if you already have a TSC value.
235 u64 native_sched_clock_from_tsc(u64 tsc) in native_sched_clock_from_tsc() argument
237 return cycles_2_ns(tsc); in native_sched_clock_from_tsc()
273 * disable flag for tsc. Takes effect by clearing the TSC cpu flag
298 __setup("tsc=", tsc_setup);
304 * Read TSC and the reference counters. Take care of SMI disturbance
[all …]
Dtsc_msr.c3 * TSC frequency enumeration via MSR
16 #include <asm/tsc.h>
72 * MSR-based CPU/TSC frequency discovery for certain CPUs.
103 /* TSC frequency = maximum resolved freq * maximum resolved bus ratio */ in cpu_khz_from_msr()
111 * TSC frequency determined by MSR is always considered "known" in cpu_khz_from_msr()
120 * TSC is reliable. We were told by silicon design team that TSC in cpu_khz_from_msr()
121 * on Atom SoCs are always "reliable". TSC is also the only in cpu_khz_from_msr()
123 * or not functional) so mark TSC reliable which removes the in cpu_khz_from_msr()
/kernel/linux/linux-5.10/arch/x86/kernel/
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.
23 #include <asm/tsc.h>
35 * TSC's on different sockets may be reset asynchronously.
36 * This may cause the TSC ADJUST value on socket 0 to be NOT 0.
45 pr_info("tsc: Marking TSC async resets true due to %s\n", reason); in mark_tsc_async_resets()
56 /* Skip unnecessary error messages if TSC already unstable */ in tsc_verify_tsc_adjust()
74 pr_warn(FW_BUG "TSC ADJUST differs: CPU%u %lld --> %lld. Restoring\n", in tsc_verify_tsc_adjust()
92 * the TSC is in sync with the already running cpus. in tsc_sanitize_first_cpu()
[all …]
Dtsc.c32 unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */
41 * TSC can be unstable due to cpufreq or due to unsynced TSCs
227 * Fall back to jiffies if there's no TSC available: in native_sched_clock()
228 * ( But note that we still use it if the TSC is marked in native_sched_clock()
240 * Generate a sched_clock if you already have a TSC value.
242 u64 native_sched_clock_from_tsc(u64 tsc) in native_sched_clock_from_tsc() argument
244 return cycles_2_ns(tsc); in native_sched_clock_from_tsc()
280 * disable flag for tsc. Takes effect by clearing the TSC cpu flag
308 __setup("tsc=", tsc_setup);
314 * Read TSC and the reference counters. Take care of any disturbances
[all …]
/kernel/linux/linux-4.19/Documentation/virtual/kvm/
Dtimekeeping.txt9 3) TSC Hardware
34 First we discuss the basic hardware devices available. TSC and the related
312 3) TSC Hardware
314 The TSC or time stamp counter is relatively simple in theory; it counts
319 The TSC is represented internally as a 64-bit MSR which can be read with the
321 limitations made it possible to write the TSC, but generally on old hardware it
326 write the TSC MSR is not an architectural guarantee.
328 The TSC is accessible from CPL-0 and conditionally, for CPL > 0 software by
329 means of the CR4.TSD bit, which when enabled, disables CPL > 0 TSC access.
332 atomically not just the TSC, but an indicator which corresponds to the
[all …]
/kernel/linux/linux-5.10/Documentation/virt/kvm/
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 …]
/kernel/linux/linux-4.19/tools/power/cpupower/utils/idle_monitor/
Dmperf_monitor.c64 * 1) calculated after measurements if we know TSC ticks at mperf/P0 frequency
80 static int mperf_get_tsc(unsigned long long *tsc) in mperf_get_tsc() argument
84 ret = read_msr(base_cpu, MSR_TSC, tsc); in mperf_get_tsc()
86 dprint("Reading TSC MSR failed, returning %llu\n", *tsc); in mperf_get_tsc()
136 dprint("%s: TSC Ref - mperf_diff: %llu, tsc_diff: %llu\n", in mperf_get_count_percent()
170 /* Calculate max_freq from TSC count */ in mperf_get_count_freq()
179 (max_freq_mode == MAX_FREQ_TSC_REF) ? "TSC calculated" : "sysfs read"); in mperf_get_count_freq()
199 dprint("TSC diff: %llu\n", dbg - tsc_at_measure_start); in mperf_start()
215 dprint("TSC diff: %llu\n", dbg - tsc_at_measure_end); in mperf_stop()
224 * we use TSC counter if it reliably ticks at P0/mperf frequency.
[all …]
/kernel/linux/linux-5.10/tools/power/cpupower/utils/idle_monitor/
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()
237 dprint("TSC diff: %llu\n", dbg - tsc_at_measure_start); in mperf_start()
253 dprint("TSC diff: %llu\n", dbg - tsc_at_measure_end); in mperf_stop()
262 * we use TSC counter if it reliably ticks at P0/mperf frequency.
[all …]
/kernel/linux/linux-4.19/Documentation/devicetree/bindings/input/touchscreen/
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";
Dimx6ul_tsc.txt4 - compatible: must be "fsl,imx6ul-tsc".
8 - clock-names; must be "tsc" and "adc".
24 tsc: tsc@2040000 {
25 compatible = "fsl,imx6ul-tsc";
31 clock-names = "tsc", "adc";
/kernel/linux/linux-5.10/Documentation/devicetree/bindings/input/touchscreen/
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";
Dimx6ul_tsc.txt4 - compatible: must be "fsl,imx6ul-tsc".
8 - clock-names; must be "tsc" and "adc".
24 tsc: tsc@2040000 {
25 compatible = "fsl,imx6ul-tsc";
31 clock-names = "tsc", "adc";
/kernel/linux/linux-5.10/arch/x86/include/asm/xen/
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
/kernel/linux/linux-4.19/arch/x86/include/asm/xen/
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

12345678910>>...24