Searched refs:ts (Results 1 - 200 of 574) sorted by relevance

123

/linux-4.1.27/drivers/input/touchscreen/
H A Dipaq-micro-ts.c32 struct touchscreen_data *ts = data; micro_ts_receive() local
35 input_report_abs(ts->input, ABS_X, micro_ts_receive()
37 input_report_abs(ts->input, ABS_Y, micro_ts_receive()
39 input_report_key(ts->input, BTN_TOUCH, 1); micro_ts_receive()
40 input_sync(ts->input); micro_ts_receive()
42 input_report_abs(ts->input, ABS_X, 0); micro_ts_receive()
43 input_report_abs(ts->input, ABS_Y, 0); micro_ts_receive()
44 input_report_key(ts->input, BTN_TOUCH, 0); micro_ts_receive()
45 input_sync(ts->input); micro_ts_receive()
49 static void micro_ts_toggle_receive(struct touchscreen_data *ts, bool enable) micro_ts_toggle_receive() argument
51 struct ipaq_micro *micro = ts->micro; micro_ts_toggle_receive()
56 micro->ts = micro_ts_receive; micro_ts_toggle_receive()
57 micro->ts_data = ts; micro_ts_toggle_receive()
59 micro->ts = NULL; micro_ts_toggle_receive()
63 spin_unlock_irq(&ts->micro->lock); micro_ts_toggle_receive()
68 struct touchscreen_data *ts = input_get_drvdata(input); micro_ts_open() local
70 micro_ts_toggle_receive(ts, true); micro_ts_open()
77 struct touchscreen_data *ts = input_get_drvdata(input); micro_ts_close() local
79 micro_ts_toggle_receive(ts, false); micro_ts_close()
85 struct touchscreen_data *ts; micro_ts_probe() local
88 ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL); micro_ts_probe()
89 if (!ts) micro_ts_probe()
92 ts->micro = micro; micro_ts_probe()
94 ts->input = devm_input_allocate_device(&pdev->dev); micro_ts_probe()
95 if (!ts->input) { micro_ts_probe()
100 ts->input->name = "ipaq micro ts"; micro_ts_probe()
101 ts->input->open = micro_ts_open; micro_ts_probe()
102 ts->input->close = micro_ts_close; micro_ts_probe()
104 input_set_drvdata(ts->input, ts); micro_ts_probe()
106 input_set_capability(ts->input, EV_KEY, BTN_TOUCH); micro_ts_probe()
107 input_set_capability(ts->input, EV_ABS, ABS_X); micro_ts_probe()
108 input_set_capability(ts->input, EV_ABS, ABS_Y); micro_ts_probe()
109 input_set_abs_params(ts->input, ABS_X, 0, 1023, 0, 0); micro_ts_probe()
110 input_set_abs_params(ts->input, ABS_Y, 0, 1023, 0, 0); micro_ts_probe()
112 error = input_register_device(ts->input); micro_ts_probe()
118 platform_set_drvdata(pdev, ts); micro_ts_probe()
127 struct touchscreen_data *ts = dev_get_drvdata(dev); micro_ts_suspend() local
129 micro_ts_toggle_receive(ts, false); micro_ts_suspend()
136 struct touchscreen_data *ts = dev_get_drvdata(dev); micro_ts_resume() local
137 struct input_dev *input = ts->input; micro_ts_resume()
142 micro_ts_toggle_receive(ts, true); micro_ts_resume()
155 .name = "ipaq-micro-ts",
164 MODULE_ALIAS("platform:ipaq-micro-ts");
H A Dad7879.c138 static int ad7879_read(struct ad7879 *ts, u8 reg) ad7879_read() argument
140 return ts->bops->read(ts->dev, reg); ad7879_read()
143 static int ad7879_multi_read(struct ad7879 *ts, u8 first_reg, u8 count, u16 *buf) ad7879_multi_read() argument
145 return ts->bops->multi_read(ts->dev, first_reg, count, buf); ad7879_multi_read()
148 static int ad7879_write(struct ad7879 *ts, u8 reg, u16 val) ad7879_write() argument
150 return ts->bops->write(ts->dev, reg, val); ad7879_write()
153 static int ad7879_report(struct ad7879 *ts) ad7879_report() argument
155 struct input_dev *input_dev = ts->input; ad7879_report()
159 x = ts->conversion_data[AD7879_SEQ_XPOS] & MAX_12BIT; ad7879_report()
160 y = ts->conversion_data[AD7879_SEQ_YPOS] & MAX_12BIT; ad7879_report()
161 z1 = ts->conversion_data[AD7879_SEQ_Z1] & MAX_12BIT; ad7879_report()
162 z2 = ts->conversion_data[AD7879_SEQ_Z2] & MAX_12BIT; ad7879_report()
164 if (ts->swap_xy) ad7879_report()
181 Rt = (z2 - z1) * x * ts->x_plate_ohms; ad7879_report()
189 if (Rt > ts->pressure_max) ad7879_report()
198 if (timer_pending(&ts->timer)) { ad7879_report()
201 input_report_abs(input_dev, ABS_X, ts->x); ad7879_report()
202 input_report_abs(input_dev, ABS_Y, ts->y); ad7879_report()
203 input_report_abs(input_dev, ABS_PRESSURE, ts->Rt); ad7879_report()
207 ts->x = x; ad7879_report()
208 ts->y = y; ad7879_report()
209 ts->Rt = Rt; ad7879_report()
217 static void ad7879_ts_event_release(struct ad7879 *ts) ad7879_ts_event_release() argument
219 struct input_dev *input_dev = ts->input; ad7879_ts_event_release()
228 struct ad7879 *ts = (void *)handle; ad7879_timer() local
230 ad7879_ts_event_release(ts); ad7879_timer()
235 struct ad7879 *ts = handle; ad7879_irq() local
237 ad7879_multi_read(ts, AD7879_REG_XPLUS, AD7879_NR_SENSE, ts->conversion_data); ad7879_irq()
239 if (!ad7879_report(ts)) ad7879_irq()
240 mod_timer(&ts->timer, jiffies + TS_PEN_UP_TIMEOUT); ad7879_irq()
245 static void __ad7879_enable(struct ad7879 *ts) __ad7879_enable() argument
247 ad7879_write(ts, AD7879_REG_CTRL2, ts->cmd_crtl2); __ad7879_enable()
248 ad7879_write(ts, AD7879_REG_CTRL3, ts->cmd_crtl3); __ad7879_enable()
249 ad7879_write(ts, AD7879_REG_CTRL1, ts->cmd_crtl1); __ad7879_enable()
251 enable_irq(ts->irq); __ad7879_enable()
254 static void __ad7879_disable(struct ad7879 *ts) __ad7879_disable() argument
256 u16 reg = (ts->cmd_crtl2 & ~AD7879_PM(-1)) | __ad7879_disable()
258 disable_irq(ts->irq); __ad7879_disable()
260 if (del_timer_sync(&ts->timer)) __ad7879_disable()
261 ad7879_ts_event_release(ts); __ad7879_disable()
263 ad7879_write(ts, AD7879_REG_CTRL2, reg); __ad7879_disable()
269 struct ad7879 *ts = input_get_drvdata(input); ad7879_open() local
272 if (!ts->disabled && !ts->suspended) ad7879_open()
273 __ad7879_enable(ts); ad7879_open()
280 struct ad7879 *ts = input_get_drvdata(input); ad7879_close() local
283 if (!ts->disabled && !ts->suspended) ad7879_close()
284 __ad7879_disable(ts); ad7879_close()
289 struct ad7879 *ts = dev_get_drvdata(dev); ad7879_suspend() local
291 mutex_lock(&ts->input->mutex); ad7879_suspend()
293 if (!ts->suspended && !ts->disabled && ts->input->users) ad7879_suspend()
294 __ad7879_disable(ts); ad7879_suspend()
296 ts->suspended = true; ad7879_suspend()
298 mutex_unlock(&ts->input->mutex); ad7879_suspend()
305 struct ad7879 *ts = dev_get_drvdata(dev); ad7879_resume() local
307 mutex_lock(&ts->input->mutex); ad7879_resume()
309 if (ts->suspended && !ts->disabled && ts->input->users) ad7879_resume()
310 __ad7879_enable(ts); ad7879_resume()
312 ts->suspended = false; ad7879_resume()
314 mutex_unlock(&ts->input->mutex); ad7879_resume()
322 static void ad7879_toggle(struct ad7879 *ts, bool disable) ad7879_toggle() argument
324 mutex_lock(&ts->input->mutex); ad7879_toggle()
326 if (!ts->suspended && ts->input->users != 0) { ad7879_toggle()
329 if (ts->disabled) ad7879_toggle()
330 __ad7879_enable(ts); ad7879_toggle()
332 if (!ts->disabled) ad7879_toggle()
333 __ad7879_disable(ts); ad7879_toggle()
337 ts->disabled = disable; ad7879_toggle()
339 mutex_unlock(&ts->input->mutex); ad7879_toggle()
345 struct ad7879 *ts = dev_get_drvdata(dev); ad7879_disable_show() local
347 return sprintf(buf, "%u\n", ts->disabled); ad7879_disable_show()
354 struct ad7879 *ts = dev_get_drvdata(dev); ad7879_disable_store() local
362 ad7879_toggle(ts, val); ad7879_disable_store()
382 struct ad7879 *ts = container_of(chip, struct ad7879, gc); ad7879_gpio_direction_input() local
385 mutex_lock(&ts->mutex); ad7879_gpio_direction_input()
386 ts->cmd_crtl2 |= AD7879_GPIO_EN | AD7879_GPIODIR | AD7879_GPIOPOL; ad7879_gpio_direction_input()
387 err = ad7879_write(ts, AD7879_REG_CTRL2, ts->cmd_crtl2); ad7879_gpio_direction_input()
388 mutex_unlock(&ts->mutex); ad7879_gpio_direction_input()
396 struct ad7879 *ts = container_of(chip, struct ad7879, gc); ad7879_gpio_direction_output() local
399 mutex_lock(&ts->mutex); ad7879_gpio_direction_output()
400 ts->cmd_crtl2 &= ~AD7879_GPIODIR; ad7879_gpio_direction_output()
401 ts->cmd_crtl2 |= AD7879_GPIO_EN | AD7879_GPIOPOL; ad7879_gpio_direction_output()
403 ts->cmd_crtl2 |= AD7879_GPIO_DATA; ad7879_gpio_direction_output()
405 ts->cmd_crtl2 &= ~AD7879_GPIO_DATA; ad7879_gpio_direction_output()
407 err = ad7879_write(ts, AD7879_REG_CTRL2, ts->cmd_crtl2); ad7879_gpio_direction_output()
408 mutex_unlock(&ts->mutex); ad7879_gpio_direction_output()
415 struct ad7879 *ts = container_of(chip, struct ad7879, gc); ad7879_gpio_get_value() local
418 mutex_lock(&ts->mutex); ad7879_gpio_get_value()
419 val = ad7879_read(ts, AD7879_REG_CTRL2); ad7879_gpio_get_value()
420 mutex_unlock(&ts->mutex); ad7879_gpio_get_value()
428 struct ad7879 *ts = container_of(chip, struct ad7879, gc); ad7879_gpio_set_value() local
430 mutex_lock(&ts->mutex); ad7879_gpio_set_value()
432 ts->cmd_crtl2 |= AD7879_GPIO_DATA; ad7879_gpio_set_value()
434 ts->cmd_crtl2 &= ~AD7879_GPIO_DATA; ad7879_gpio_set_value()
436 ad7879_write(ts, AD7879_REG_CTRL2, ts->cmd_crtl2); ad7879_gpio_set_value()
437 mutex_unlock(&ts->mutex); ad7879_gpio_set_value()
440 static int ad7879_gpio_add(struct ad7879 *ts, ad7879_gpio_add() argument
445 mutex_init(&ts->mutex); ad7879_gpio_add()
448 ts->gc.direction_input = ad7879_gpio_direction_input; ad7879_gpio_add()
449 ts->gc.direction_output = ad7879_gpio_direction_output; ad7879_gpio_add()
450 ts->gc.get = ad7879_gpio_get_value; ad7879_gpio_add()
451 ts->gc.set = ad7879_gpio_set_value; ad7879_gpio_add()
452 ts->gc.can_sleep = 1; ad7879_gpio_add()
453 ts->gc.base = pdata->gpio_base; ad7879_gpio_add()
454 ts->gc.ngpio = 1; ad7879_gpio_add()
455 ts->gc.label = "AD7879-GPIO"; ad7879_gpio_add()
456 ts->gc.owner = THIS_MODULE; ad7879_gpio_add()
457 ts->gc.dev = ts->dev; ad7879_gpio_add()
459 ret = gpiochip_add(&ts->gc); ad7879_gpio_add()
461 dev_err(ts->dev, "failed to register gpio %d\n", ad7879_gpio_add()
462 ts->gc.base); ad7879_gpio_add()
468 static void ad7879_gpio_remove(struct ad7879 *ts) ad7879_gpio_remove() argument
470 const struct ad7879_platform_data *pdata = dev_get_platdata(ts->dev); ad7879_gpio_remove()
473 gpiochip_remove(&ts->gc); ad7879_gpio_remove()
477 static inline int ad7879_gpio_add(struct ad7879 *ts, ad7879_gpio_add() argument
483 static inline void ad7879_gpio_remove(struct ad7879 *ts) ad7879_gpio_remove() argument
492 struct ad7879 *ts; ad7879_probe() local
509 ts = kzalloc(sizeof(*ts), GFP_KERNEL); ad7879_probe()
511 if (!ts || !input_dev) { ad7879_probe()
516 ts->bops = bops; ad7879_probe()
517 ts->dev = dev; ad7879_probe()
518 ts->input = input_dev; ad7879_probe()
519 ts->irq = irq; ad7879_probe()
520 ts->swap_xy = pdata->swap_xy; ad7879_probe()
522 setup_timer(&ts->timer, ad7879_timer, (unsigned long) ts); ad7879_probe()
524 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400; ad7879_probe()
525 ts->pressure_max = pdata->pressure_max ? : ~0; ad7879_probe()
527 ts->first_conversion_delay = pdata->first_conversion_delay; ad7879_probe()
528 ts->acquisition_time = pdata->acquisition_time; ad7879_probe()
529 ts->averaging = pdata->averaging; ad7879_probe()
530 ts->pen_down_acc_interval = pdata->pen_down_acc_interval; ad7879_probe()
531 ts->median = pdata->median; ad7879_probe()
533 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(dev)); ad7879_probe()
536 input_dev->phys = ts->phys; ad7879_probe()
543 input_set_drvdata(input_dev, ts); ad7879_probe()
564 err = ad7879_write(ts, AD7879_REG_CTRL2, AD7879_RESET); ad7879_probe()
570 revid = ad7879_read(ts, AD7879_REG_REVID); ad7879_probe()
580 ts->cmd_crtl3 = AD7879_YPLUS_BIT | ad7879_probe()
588 ts->cmd_crtl2 = AD7879_PM(AD7879_PM_DYN) | AD7879_DFR | ad7879_probe()
589 AD7879_AVG(ts->averaging) | ad7879_probe()
590 AD7879_MFS(ts->median) | ad7879_probe()
591 AD7879_FCD(ts->first_conversion_delay); ad7879_probe()
593 ts->cmd_crtl1 = AD7879_MODE_INT | AD7879_MODE_SEQ1 | ad7879_probe()
594 AD7879_ACQ(ts->acquisition_time) | ad7879_probe()
595 AD7879_TMR(ts->pen_down_acc_interval); ad7879_probe()
597 err = request_threaded_irq(ts->irq, NULL, ad7879_irq, ad7879_probe()
599 dev_name(dev), ts); ad7879_probe()
601 dev_err(dev, "irq %d busy?\n", ts->irq); ad7879_probe()
605 __ad7879_disable(ts); ad7879_probe()
611 err = ad7879_gpio_add(ts, pdata); ad7879_probe()
619 return ts; ad7879_probe()
622 ad7879_gpio_remove(ts); ad7879_probe()
626 free_irq(ts->irq, ts); ad7879_probe()
629 kfree(ts); ad7879_probe()
635 void ad7879_remove(struct ad7879 *ts) ad7879_remove() argument
637 ad7879_gpio_remove(ts); ad7879_remove()
638 sysfs_remove_group(&ts->dev->kobj, &ad7879_attr_group); ad7879_remove()
639 free_irq(ts->irq, ts); ad7879_remove()
640 input_unregister_device(ts->input); ad7879_remove()
641 kfree(ts); ad7879_remove()
H A Dcyttsp_core.c80 static int ttsp_read_block_data(struct cyttsp *ts, u8 command, ttsp_read_block_data() argument
87 error = ts->bus_ops->read(ts->dev, ts->xfer_buf, command, ttsp_read_block_data()
98 static int ttsp_write_block_data(struct cyttsp *ts, u8 command, ttsp_write_block_data() argument
105 error = ts->bus_ops->write(ts->dev, ts->xfer_buf, command, ttsp_write_block_data()
116 static int ttsp_send_command(struct cyttsp *ts, u8 cmd) ttsp_send_command() argument
118 return ttsp_write_block_data(ts, CY_REG_BASE, sizeof(cmd), &cmd); ttsp_send_command()
121 static int cyttsp_handshake(struct cyttsp *ts) cyttsp_handshake() argument
123 if (ts->pdata->use_hndshk) cyttsp_handshake()
124 return ttsp_send_command(ts, cyttsp_handshake()
125 ts->xy_data.hst_mode ^ CY_HNDSHK_BIT); cyttsp_handshake()
130 static int cyttsp_load_bl_regs(struct cyttsp *ts) cyttsp_load_bl_regs() argument
132 memset(&ts->bl_data, 0, sizeof(ts->bl_data)); cyttsp_load_bl_regs()
133 ts->bl_data.bl_status = 0x10; cyttsp_load_bl_regs()
135 return ttsp_read_block_data(ts, CY_REG_BASE, cyttsp_load_bl_regs()
136 sizeof(ts->bl_data), &ts->bl_data); cyttsp_load_bl_regs()
139 static int cyttsp_exit_bl_mode(struct cyttsp *ts) cyttsp_exit_bl_mode() argument
145 if (ts->pdata->bl_keys) cyttsp_exit_bl_mode()
147 ts->pdata->bl_keys, CY_NUM_BL_KEYS); cyttsp_exit_bl_mode()
149 error = ttsp_write_block_data(ts, CY_REG_BASE, cyttsp_exit_bl_mode()
157 error = cyttsp_load_bl_regs(ts); cyttsp_exit_bl_mode()
161 if (GET_BOOTLOADERMODE(ts->bl_data.bl_status)) cyttsp_exit_bl_mode()
167 static int cyttsp_set_operational_mode(struct cyttsp *ts) cyttsp_set_operational_mode() argument
171 error = ttsp_send_command(ts, CY_OPERATE_MODE); cyttsp_set_operational_mode()
176 error = ttsp_read_block_data(ts, CY_REG_BASE, cyttsp_set_operational_mode()
177 sizeof(ts->xy_data), &ts->xy_data); cyttsp_set_operational_mode()
181 error = cyttsp_handshake(ts); cyttsp_set_operational_mode()
185 return ts->xy_data.act_dist == CY_ACT_DIST_DFLT ? -EIO : 0; cyttsp_set_operational_mode()
188 static int cyttsp_set_sysinfo_mode(struct cyttsp *ts) cyttsp_set_sysinfo_mode() argument
192 memset(&ts->sysinfo_data, 0, sizeof(ts->sysinfo_data)); cyttsp_set_sysinfo_mode()
195 error = ttsp_send_command(ts, CY_SYSINFO_MODE); cyttsp_set_sysinfo_mode()
201 error = ttsp_read_block_data(ts, CY_REG_BASE, sizeof(ts->sysinfo_data), cyttsp_set_sysinfo_mode()
202 &ts->sysinfo_data); cyttsp_set_sysinfo_mode()
206 error = cyttsp_handshake(ts); cyttsp_set_sysinfo_mode()
210 if (!ts->sysinfo_data.tts_verh && !ts->sysinfo_data.tts_verl) cyttsp_set_sysinfo_mode()
216 static int cyttsp_set_sysinfo_regs(struct cyttsp *ts) cyttsp_set_sysinfo_regs() argument
220 if (ts->pdata->act_intrvl != CY_ACT_INTRVL_DFLT || cyttsp_set_sysinfo_regs()
221 ts->pdata->tch_tmout != CY_TCH_TMOUT_DFLT || cyttsp_set_sysinfo_regs()
222 ts->pdata->lp_intrvl != CY_LP_INTRVL_DFLT) { cyttsp_set_sysinfo_regs()
225 ts->pdata->act_intrvl, cyttsp_set_sysinfo_regs()
226 ts->pdata->tch_tmout, cyttsp_set_sysinfo_regs()
227 ts->pdata->lp_intrvl cyttsp_set_sysinfo_regs()
231 retval = ttsp_write_block_data(ts, CY_REG_ACT_INTRVL, cyttsp_set_sysinfo_regs()
239 static int cyttsp_soft_reset(struct cyttsp *ts) cyttsp_soft_reset() argument
245 reinit_completion(&ts->bl_ready); cyttsp_soft_reset()
246 ts->state = CY_BL_STATE; cyttsp_soft_reset()
248 enable_irq(ts->irq); cyttsp_soft_reset()
250 retval = ttsp_send_command(ts, CY_SOFT_RESET_MODE); cyttsp_soft_reset()
254 timeout = wait_for_completion_timeout(&ts->bl_ready, cyttsp_soft_reset()
259 ts->state = CY_IDLE_STATE; cyttsp_soft_reset()
260 disable_irq(ts->irq); cyttsp_soft_reset()
264 static int cyttsp_act_dist_setup(struct cyttsp *ts) cyttsp_act_dist_setup() argument
266 u8 act_dist_setup = ts->pdata->act_dist; cyttsp_act_dist_setup()
269 return ttsp_write_block_data(ts, CY_REG_ACT_DIST, cyttsp_act_dist_setup()
298 static void cyttsp_report_tchdata(struct cyttsp *ts) cyttsp_report_tchdata() argument
300 struct cyttsp_xydata *xy_data = &ts->xy_data; cyttsp_report_tchdata()
301 struct input_dev *input = ts->input; cyttsp_report_tchdata()
311 dev_dbg(ts->dev, "%s: Large area detected\n", __func__); cyttsp_report_tchdata()
315 dev_dbg(ts->dev, "%s: Num touch error detected\n", __func__); cyttsp_report_tchdata()
319 dev_dbg(ts->dev, "%s: Invalid buffer detected\n", __func__); cyttsp_report_tchdata()
351 struct cyttsp *ts = handle; cyttsp_irq() local
354 if (unlikely(ts->state == CY_BL_STATE)) { cyttsp_irq()
355 complete(&ts->bl_ready); cyttsp_irq()
360 error = ttsp_read_block_data(ts, CY_REG_BASE, cyttsp_irq()
361 sizeof(struct cyttsp_xydata), &ts->xy_data); cyttsp_irq()
366 error = cyttsp_handshake(ts); cyttsp_irq()
370 if (unlikely(ts->state == CY_IDLE_STATE)) cyttsp_irq()
373 if (GET_BOOTLOADERMODE(ts->xy_data.tt_mode)) { cyttsp_irq()
378 error = cyttsp_exit_bl_mode(ts); cyttsp_irq()
380 dev_err(ts->dev, cyttsp_irq()
383 ts->state = CY_IDLE_STATE; cyttsp_irq()
386 cyttsp_report_tchdata(ts); cyttsp_irq()
393 static int cyttsp_power_on(struct cyttsp *ts) cyttsp_power_on() argument
397 error = cyttsp_soft_reset(ts); cyttsp_power_on()
401 error = cyttsp_load_bl_regs(ts); cyttsp_power_on()
405 if (GET_BOOTLOADERMODE(ts->bl_data.bl_status) && cyttsp_power_on()
406 IS_VALID_APP(ts->bl_data.bl_status)) { cyttsp_power_on()
407 error = cyttsp_exit_bl_mode(ts); cyttsp_power_on()
412 if (GET_HSTMODE(ts->bl_data.bl_file) != CY_OPERATE_MODE || cyttsp_power_on()
413 IS_OPERATIONAL_ERR(ts->bl_data.bl_status)) { cyttsp_power_on()
417 error = cyttsp_set_sysinfo_mode(ts); cyttsp_power_on()
421 error = cyttsp_set_sysinfo_regs(ts); cyttsp_power_on()
425 error = cyttsp_set_operational_mode(ts); cyttsp_power_on()
430 error = cyttsp_act_dist_setup(ts); cyttsp_power_on()
434 ts->state = CY_ACTIVE_STATE; cyttsp_power_on()
439 static int cyttsp_enable(struct cyttsp *ts) cyttsp_enable() argument
449 error = ttsp_read_block_data(ts, CY_REG_BASE, cyttsp_enable()
450 sizeof(ts->xy_data), &ts->xy_data); cyttsp_enable()
454 if (GET_HSTMODE(ts->xy_data.hst_mode)) cyttsp_enable()
457 enable_irq(ts->irq); cyttsp_enable()
462 static int cyttsp_disable(struct cyttsp *ts) cyttsp_disable() argument
466 error = ttsp_send_command(ts, CY_LOW_POWER_MODE); cyttsp_disable()
470 disable_irq(ts->irq); cyttsp_disable()
477 struct cyttsp *ts = dev_get_drvdata(dev); cyttsp_suspend() local
480 mutex_lock(&ts->input->mutex); cyttsp_suspend()
482 if (ts->input->users) { cyttsp_suspend()
483 retval = cyttsp_disable(ts); cyttsp_suspend()
485 ts->suspended = true; cyttsp_suspend()
488 mutex_unlock(&ts->input->mutex); cyttsp_suspend()
495 struct cyttsp *ts = dev_get_drvdata(dev); cyttsp_resume() local
497 mutex_lock(&ts->input->mutex); cyttsp_resume()
499 if (ts->input->users) cyttsp_resume()
500 cyttsp_enable(ts); cyttsp_resume()
502 ts->suspended = false; cyttsp_resume()
504 mutex_unlock(&ts->input->mutex); cyttsp_resume()
514 struct cyttsp *ts = input_get_drvdata(dev); cyttsp_open() local
517 if (!ts->suspended) cyttsp_open()
518 retval = cyttsp_enable(ts); cyttsp_open()
525 struct cyttsp *ts = input_get_drvdata(dev); cyttsp_close() local
527 if (!ts->suspended) cyttsp_close()
528 cyttsp_disable(ts); cyttsp_close()
535 struct cyttsp *ts; cyttsp_probe() local
544 ts = kzalloc(sizeof(*ts) + xfer_buf_size, GFP_KERNEL); cyttsp_probe()
546 if (!ts || !input_dev) { cyttsp_probe()
551 ts->dev = dev; cyttsp_probe()
552 ts->input = input_dev; cyttsp_probe()
553 ts->pdata = dev_get_platdata(dev); cyttsp_probe()
554 ts->bus_ops = bus_ops; cyttsp_probe()
555 ts->irq = irq; cyttsp_probe()
557 init_completion(&ts->bl_ready); cyttsp_probe()
558 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(dev)); cyttsp_probe()
563 dev_err(ts->dev, "platform init failed, err: %d\n", cyttsp_probe()
570 input_dev->phys = ts->phys; cyttsp_probe()
572 input_dev->dev.parent = ts->dev; cyttsp_probe()
577 input_set_drvdata(input_dev, ts); cyttsp_probe()
589 error = request_threaded_irq(ts->irq, NULL, cyttsp_irq, cyttsp_probe()
591 pdata->name, ts); cyttsp_probe()
593 dev_err(ts->dev, "failed to request IRQ %d, err: %d\n", cyttsp_probe()
594 ts->irq, error); cyttsp_probe()
598 disable_irq(ts->irq); cyttsp_probe()
600 error = cyttsp_power_on(ts); cyttsp_probe()
606 dev_err(ts->dev, "failed to register input device: %d\n", cyttsp_probe()
611 return ts; cyttsp_probe()
614 free_irq(ts->irq, ts); cyttsp_probe()
620 kfree(ts); cyttsp_probe()
626 void cyttsp_remove(struct cyttsp *ts) cyttsp_remove() argument
628 free_irq(ts->irq, ts); cyttsp_remove()
629 input_unregister_device(ts->input); cyttsp_remove()
630 if (ts->pdata->exit) cyttsp_remove()
631 ts->pdata->exit(); cyttsp_remove()
632 kfree(ts); cyttsp_remove()
H A Dgoodix.c92 static int goodix_ts_read_input_report(struct goodix_ts_data *ts, u8 *data) goodix_ts_read_input_report() argument
97 error = goodix_i2c_read(ts->client, GOODIX_READ_COOR_ADDR, data, goodix_ts_read_input_report()
100 dev_err(&ts->client->dev, "I2C transfer error: %d\n", error); goodix_ts_read_input_report()
105 if (touch_num > ts->max_touch_num) goodix_ts_read_input_report()
110 error = goodix_i2c_read(ts->client, goodix_ts_read_input_report()
122 static void goodix_ts_report_touch(struct goodix_ts_data *ts, u8 *coor_data) goodix_ts_report_touch() argument
129 input_mt_slot(ts->input_dev, id); goodix_ts_report_touch()
130 input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true); goodix_ts_report_touch()
131 input_report_abs(ts->input_dev, ABS_MT_POSITION_X, input_x); goodix_ts_report_touch()
132 input_report_abs(ts->input_dev, ABS_MT_POSITION_Y, input_y); goodix_ts_report_touch()
133 input_report_abs(ts->input_dev, ABS_MT_TOUCH_MAJOR, input_w); goodix_ts_report_touch()
134 input_report_abs(ts->input_dev, ABS_MT_WIDTH_MAJOR, input_w); goodix_ts_report_touch()
140 * @ts: our goodix_ts_data pointer
145 static void goodix_process_events(struct goodix_ts_data *ts) goodix_process_events() argument
147 u8 point_data[1 + GOODIX_CONTACT_SIZE * ts->max_touch_num]; goodix_process_events()
151 touch_num = goodix_ts_read_input_report(ts, point_data); goodix_process_events()
156 goodix_ts_report_touch(ts, goodix_process_events()
159 input_mt_sync_frame(ts->input_dev); goodix_process_events()
160 input_sync(ts->input_dev); goodix_process_events()
176 struct goodix_ts_data *ts = dev_id; goodix_ts_irq_handler() local
178 goodix_process_events(ts); goodix_ts_irq_handler()
180 if (i2c_master_send(ts->client, end_cmd, sizeof(end_cmd)) < 0) goodix_ts_irq_handler()
181 dev_err(&ts->client->dev, "I2C write end_cmd error\n"); goodix_ts_irq_handler()
189 * @ts: our goodix_ts_data pointer
193 static void goodix_read_config(struct goodix_ts_data *ts) goodix_read_config() argument
198 error = goodix_i2c_read(ts->client, GOODIX_REG_CONFIG_DATA, goodix_read_config()
202 dev_warn(&ts->client->dev, goodix_read_config()
205 ts->abs_x_max = GOODIX_MAX_WIDTH; goodix_read_config()
206 ts->abs_y_max = GOODIX_MAX_HEIGHT; goodix_read_config()
207 ts->int_trigger_type = GOODIX_INT_TRIGGER; goodix_read_config()
208 ts->max_touch_num = GOODIX_MAX_CONTACTS; goodix_read_config()
212 ts->abs_x_max = get_unaligned_le16(&config[RESOLUTION_LOC]); goodix_read_config()
213 ts->abs_y_max = get_unaligned_le16(&config[RESOLUTION_LOC + 2]); goodix_read_config()
214 ts->int_trigger_type = config[TRIGGER_LOC] & 0x03; goodix_read_config()
215 ts->max_touch_num = config[MAX_CONTACTS_LOC] & 0x0f; goodix_read_config()
216 if (!ts->abs_x_max || !ts->abs_y_max || !ts->max_touch_num) { goodix_read_config()
217 dev_err(&ts->client->dev, goodix_read_config()
219 ts->abs_x_max = GOODIX_MAX_WIDTH; goodix_read_config()
220 ts->abs_y_max = GOODIX_MAX_HEIGHT; goodix_read_config()
221 ts->max_touch_num = GOODIX_MAX_CONTACTS; goodix_read_config()
278 * @ts: our goodix_ts_data pointer
282 static int goodix_request_input_dev(struct goodix_ts_data *ts) goodix_request_input_dev() argument
286 ts->input_dev = devm_input_allocate_device(&ts->client->dev); goodix_request_input_dev()
287 if (!ts->input_dev) { goodix_request_input_dev()
288 dev_err(&ts->client->dev, "Failed to allocate input device."); goodix_request_input_dev()
292 ts->input_dev->evbit[0] = BIT_MASK(EV_SYN) | goodix_request_input_dev()
296 input_set_abs_params(ts->input_dev, ABS_MT_POSITION_X, 0, goodix_request_input_dev()
297 ts->abs_x_max, 0, 0); goodix_request_input_dev()
298 input_set_abs_params(ts->input_dev, ABS_MT_POSITION_Y, 0, goodix_request_input_dev()
299 ts->abs_y_max, 0, 0); goodix_request_input_dev()
300 input_set_abs_params(ts->input_dev, ABS_MT_WIDTH_MAJOR, 0, 255, 0, 0); goodix_request_input_dev()
301 input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); goodix_request_input_dev()
303 input_mt_init_slots(ts->input_dev, ts->max_touch_num, goodix_request_input_dev()
306 ts->input_dev->name = "Goodix Capacitive TouchScreen"; goodix_request_input_dev()
307 ts->input_dev->phys = "input/ts"; goodix_request_input_dev()
308 ts->input_dev->id.bustype = BUS_I2C; goodix_request_input_dev()
309 ts->input_dev->id.vendor = 0x0416; goodix_request_input_dev()
310 ts->input_dev->id.product = 0x1001; goodix_request_input_dev()
311 ts->input_dev->id.version = 10427; goodix_request_input_dev()
313 error = input_register_device(ts->input_dev); goodix_request_input_dev()
315 dev_err(&ts->client->dev, goodix_request_input_dev()
326 struct goodix_ts_data *ts; goodix_ts_probe() local
338 ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL); goodix_ts_probe()
339 if (!ts) goodix_ts_probe()
342 ts->client = client; goodix_ts_probe()
343 i2c_set_clientdata(client, ts); goodix_ts_probe()
357 goodix_read_config(ts); goodix_ts_probe()
359 error = goodix_request_input_dev(ts); goodix_ts_probe()
363 irq_flags = goodix_irq_flags[ts->int_trigger_type] | IRQF_ONESHOT; goodix_ts_probe()
364 error = devm_request_threaded_irq(&ts->client->dev, client->irq, goodix_ts_probe()
366 irq_flags, client->name, ts); goodix_ts_probe()
H A Dsun4i-ts.c21 * The sun4i-ts controller is capable of detecting a second touch, but when a
127 static void sun4i_ts_irq_handle_input(struct sun4i_ts_data *ts, u32 reg_val) sun4i_ts_irq_handle_input() argument
132 x = readl(ts->base + TP_DATA); sun4i_ts_irq_handle_input()
133 y = readl(ts->base + TP_DATA); sun4i_ts_irq_handle_input()
135 if (!ts->ignore_fifo_data) { sun4i_ts_irq_handle_input()
136 input_report_abs(ts->input, ABS_X, x); sun4i_ts_irq_handle_input()
137 input_report_abs(ts->input, ABS_Y, y); sun4i_ts_irq_handle_input()
143 input_report_key(ts->input, BTN_TOUCH, 1); sun4i_ts_irq_handle_input()
144 input_sync(ts->input); sun4i_ts_irq_handle_input()
146 ts->ignore_fifo_data = false; sun4i_ts_irq_handle_input()
151 ts->ignore_fifo_data = true; sun4i_ts_irq_handle_input()
152 input_report_key(ts->input, BTN_TOUCH, 0); sun4i_ts_irq_handle_input()
153 input_sync(ts->input); sun4i_ts_irq_handle_input()
159 struct sun4i_ts_data *ts = dev_id; sun4i_ts_irq() local
162 reg_val = readl(ts->base + TP_INT_FIFOS); sun4i_ts_irq()
165 ts->temp_data = readl(ts->base + TEMP_DATA); sun4i_ts_irq()
167 if (ts->input) sun4i_ts_irq()
168 sun4i_ts_irq_handle_input(ts, reg_val); sun4i_ts_irq()
170 writel(reg_val, ts->base + TP_INT_FIFOS); sun4i_ts_irq()
177 struct sun4i_ts_data *ts = input_get_drvdata(dev); sun4i_ts_open() local
181 TP_UP_IRQ_EN(1), ts->base + TP_INT_FIFOC); sun4i_ts_open()
188 struct sun4i_ts_data *ts = input_get_drvdata(dev); sun4i_ts_close() local
191 writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC); sun4i_ts_close()
194 static int sun4i_get_temp(const struct sun4i_ts_data *ts, long *temp) sun4i_get_temp() argument
197 if (ts->temp_data == -1) sun4i_get_temp()
200 *temp = ts->temp_data * ts->temp_step - ts->temp_offset; sun4i_get_temp()
217 struct sun4i_ts_data *ts = dev_get_drvdata(dev); show_temp() local
221 error = sun4i_get_temp(ts, &temp); show_temp()
246 struct sun4i_ts_data *ts; sun4i_ts_probe() local
256 ts = devm_kzalloc(dev, sizeof(struct sun4i_ts_data), GFP_KERNEL); sun4i_ts_probe()
257 if (!ts) sun4i_ts_probe()
260 ts->dev = dev; sun4i_ts_probe()
261 ts->ignore_fifo_data = true; sun4i_ts_probe()
262 ts->temp_data = -1; sun4i_ts_probe()
263 if (of_device_is_compatible(np, "allwinner,sun6i-a31-ts")) { sun4i_ts_probe()
265 ts->temp_offset = 271000; sun4i_ts_probe()
266 ts->temp_step = 167; sun4i_ts_probe()
267 } else if (of_device_is_compatible(np, "allwinner,sun4i-a10-ts")) { sun4i_ts_probe()
274 ts->temp_offset = 257000; sun4i_ts_probe()
275 ts->temp_step = 133; sun4i_ts_probe()
288 ts->temp_offset = 144700; sun4i_ts_probe()
289 ts->temp_step = 100; sun4i_ts_probe()
292 ts_attached = of_property_read_bool(np, "allwinner,ts-attached"); sun4i_ts_probe()
294 ts->input = devm_input_allocate_device(dev); sun4i_ts_probe()
295 if (!ts->input) sun4i_ts_probe()
298 ts->input->name = pdev->name; sun4i_ts_probe()
299 ts->input->phys = "sun4i_ts/input0"; sun4i_ts_probe()
300 ts->input->open = sun4i_ts_open; sun4i_ts_probe()
301 ts->input->close = sun4i_ts_close; sun4i_ts_probe()
302 ts->input->id.bustype = BUS_HOST; sun4i_ts_probe()
303 ts->input->id.vendor = 0x0001; sun4i_ts_probe()
304 ts->input->id.product = 0x0001; sun4i_ts_probe()
305 ts->input->id.version = 0x0100; sun4i_ts_probe()
306 ts->input->evbit[0] = BIT(EV_SYN) | BIT(EV_KEY) | BIT(EV_ABS); sun4i_ts_probe()
307 __set_bit(BTN_TOUCH, ts->input->keybit); sun4i_ts_probe()
308 input_set_abs_params(ts->input, ABS_X, 0, 4095, 0, 0); sun4i_ts_probe()
309 input_set_abs_params(ts->input, ABS_Y, 0, 4095, 0, 0); sun4i_ts_probe()
310 input_set_drvdata(ts->input, ts); sun4i_ts_probe()
313 ts->base = devm_ioremap_resource(dev, sun4i_ts_probe()
315 if (IS_ERR(ts->base)) sun4i_ts_probe()
316 return PTR_ERR(ts->base); sun4i_ts_probe()
318 ts->irq = platform_get_irq(pdev, 0); sun4i_ts_probe()
319 error = devm_request_irq(dev, ts->irq, sun4i_ts_irq, 0, "sun4i-ts", ts); sun4i_ts_probe()
328 ts->base + TP_CTRL0); sun4i_ts_probe()
337 ts->base + TP_CTRL2); sun4i_ts_probe()
344 writel(FILTER_EN(1) | FILTER_TYPE(filter_type), ts->base + TP_CTRL3); sun4i_ts_probe()
347 writel(TEMP_ENABLE(1) | TEMP_PERIOD(1953), ts->base + TP_TPR); sun4i_ts_probe()
354 if (of_device_is_compatible(np, "allwinner,sun6i-a31-ts")) sun4i_ts_probe()
358 writel(reg, ts->base + TP_CTRL1); sun4i_ts_probe()
364 hwmon = devm_hwmon_device_register_with_groups(ts->dev, "sun4i_ts", sun4i_ts_probe()
365 ts, sun4i_ts_groups); sun4i_ts_probe()
369 ts->tz = thermal_zone_of_sensor_register(ts->dev, 0, ts, sun4i_ts_probe()
371 if (IS_ERR(ts->tz)) sun4i_ts_probe()
372 ts->tz = NULL; sun4i_ts_probe()
374 writel(TEMP_IRQ_EN(1), ts->base + TP_INT_FIFOC); sun4i_ts_probe()
377 error = input_register_device(ts->input); sun4i_ts_probe()
379 writel(0, ts->base + TP_INT_FIFOC); sun4i_ts_probe()
380 thermal_zone_of_sensor_unregister(ts->dev, ts->tz); sun4i_ts_probe()
385 platform_set_drvdata(pdev, ts); sun4i_ts_probe()
391 struct sun4i_ts_data *ts = platform_get_drvdata(pdev); sun4i_ts_remove() local
394 if (ts->input) sun4i_ts_remove()
395 input_unregister_device(ts->input); sun4i_ts_remove()
397 thermal_zone_of_sensor_unregister(ts->dev, ts->tz); sun4i_ts_remove()
400 writel(0, ts->base + TP_INT_FIFOC); sun4i_ts_remove()
406 { .compatible = "allwinner,sun4i-a10-ts", },
407 { .compatible = "allwinner,sun5i-a13-ts", },
408 { .compatible = "allwinner,sun6i-a31-ts", },
415 .name = "sun4i-ts",
H A Dtsc2005.c161 static int tsc2005_cmd(struct tsc2005 *ts, u8 cmd) tsc2005_cmd() argument
175 error = spi_sync(ts->spi, &msg); tsc2005_cmd()
177 dev_err(&ts->spi->dev, "%s: failed, command: %x, error: %d\n", tsc2005_cmd()
185 static int tsc2005_write(struct tsc2005 *ts, u8 reg, u16 value) tsc2005_write() argument
199 error = spi_sync(ts->spi, &msg); tsc2005_write()
201 dev_err(&ts->spi->dev, tsc2005_write()
222 static int tsc2005_read(struct tsc2005 *ts, u8 reg, u16 *value) tsc2005_read() argument
233 error = spi_sync(ts->spi, &msg); tsc2005_read()
241 static void tsc2005_update_pen_state(struct tsc2005 *ts, tsc2005_update_pen_state() argument
245 input_report_abs(ts->idev, ABS_X, x); tsc2005_update_pen_state()
246 input_report_abs(ts->idev, ABS_Y, y); tsc2005_update_pen_state()
247 input_report_abs(ts->idev, ABS_PRESSURE, pressure); tsc2005_update_pen_state()
248 if (!ts->pen_down) { tsc2005_update_pen_state()
249 input_report_key(ts->idev, BTN_TOUCH, !!pressure); tsc2005_update_pen_state()
250 ts->pen_down = true; tsc2005_update_pen_state()
253 input_report_abs(ts->idev, ABS_PRESSURE, 0); tsc2005_update_pen_state()
254 if (ts->pen_down) { tsc2005_update_pen_state()
255 input_report_key(ts->idev, BTN_TOUCH, 0); tsc2005_update_pen_state()
256 ts->pen_down = false; tsc2005_update_pen_state()
259 input_sync(ts->idev); tsc2005_update_pen_state()
260 dev_dbg(&ts->spi->dev, "point(%4d,%4d), pressure (%4d)\n", x, y, tsc2005_update_pen_state()
266 struct tsc2005 *ts = _ts; tsc2005_irq_thread() local
274 error = spi_sync(ts->spi, &ts->spi_read_msg); tsc2005_irq_thread()
278 x = ts->spi_x.spi_rx; tsc2005_irq_thread()
279 y = ts->spi_y.spi_rx; tsc2005_irq_thread()
280 z1 = ts->spi_z1.spi_rx; tsc2005_irq_thread()
281 z2 = ts->spi_z2.spi_rx; tsc2005_irq_thread()
295 if (!ts->pen_down && tsc2005_irq_thread()
296 ts->in_x == x && ts->in_y == y && tsc2005_irq_thread()
297 ts->in_z1 == z1 && ts->in_z2 == z2) { tsc2005_irq_thread()
305 ts->in_x = x; tsc2005_irq_thread()
306 ts->in_y = y; tsc2005_irq_thread()
307 ts->in_z1 = z1; tsc2005_irq_thread()
308 ts->in_z2 = z2; tsc2005_irq_thread()
312 pressure = pressure * ts->x_plate_ohm / 4096; tsc2005_irq_thread()
316 spin_lock_irqsave(&ts->lock, flags); tsc2005_irq_thread()
318 tsc2005_update_pen_state(ts, x, y, pressure); tsc2005_irq_thread()
319 mod_timer(&ts->penup_timer, tsc2005_irq_thread()
322 spin_unlock_irqrestore(&ts->lock, flags); tsc2005_irq_thread()
324 ts->last_valid_interrupt = jiffies; tsc2005_irq_thread()
331 struct tsc2005 *ts = (struct tsc2005 *)data; tsc2005_penup_timer() local
334 spin_lock_irqsave(&ts->lock, flags); tsc2005_penup_timer()
335 tsc2005_update_pen_state(ts, 0, 0, 0); tsc2005_penup_timer()
336 spin_unlock_irqrestore(&ts->lock, flags); tsc2005_penup_timer()
339 static void tsc2005_start_scan(struct tsc2005 *ts) tsc2005_start_scan() argument
341 tsc2005_write(ts, TSC2005_REG_CFR0, TSC2005_CFR0_INITVALUE); tsc2005_start_scan()
342 tsc2005_write(ts, TSC2005_REG_CFR1, TSC2005_CFR1_INITVALUE); tsc2005_start_scan()
343 tsc2005_write(ts, TSC2005_REG_CFR2, TSC2005_CFR2_INITVALUE); tsc2005_start_scan()
344 tsc2005_cmd(ts, TSC2005_CMD_NORMAL); tsc2005_start_scan()
347 static void tsc2005_stop_scan(struct tsc2005 *ts) tsc2005_stop_scan() argument
349 tsc2005_cmd(ts, TSC2005_CMD_STOP); tsc2005_stop_scan()
352 static void tsc2005_set_reset(struct tsc2005 *ts, bool enable) tsc2005_set_reset() argument
354 if (ts->reset_gpio >= 0) tsc2005_set_reset()
355 gpio_set_value(ts->reset_gpio, enable); tsc2005_set_reset()
356 else if (ts->set_reset) tsc2005_set_reset()
357 ts->set_reset(enable); tsc2005_set_reset()
360 /* must be called with ts->mutex held */ __tsc2005_disable()
361 static void __tsc2005_disable(struct tsc2005 *ts) __tsc2005_disable() argument
363 tsc2005_stop_scan(ts); __tsc2005_disable()
365 disable_irq(ts->spi->irq); __tsc2005_disable()
366 del_timer_sync(&ts->penup_timer); __tsc2005_disable()
368 cancel_delayed_work_sync(&ts->esd_work); __tsc2005_disable()
370 enable_irq(ts->spi->irq); __tsc2005_disable()
373 /* must be called with ts->mutex held */ __tsc2005_enable()
374 static void __tsc2005_enable(struct tsc2005 *ts) __tsc2005_enable() argument
376 tsc2005_start_scan(ts); __tsc2005_enable()
378 if (ts->esd_timeout && (ts->set_reset || ts->reset_gpio)) { __tsc2005_enable()
379 ts->last_valid_interrupt = jiffies; __tsc2005_enable()
380 schedule_delayed_work(&ts->esd_work, __tsc2005_enable()
382 msecs_to_jiffies(ts->esd_timeout))); __tsc2005_enable()
392 struct tsc2005 *ts = spi_get_drvdata(spi); tsc2005_selftest_show() local
399 mutex_lock(&ts->mutex); tsc2005_selftest_show()
404 __tsc2005_disable(ts); tsc2005_selftest_show()
406 error = tsc2005_read(ts, TSC2005_REG_TEMP_HIGH, &temp_high_orig); tsc2005_selftest_show()
415 error = tsc2005_write(ts, TSC2005_REG_TEMP_HIGH, temp_high_test); tsc2005_selftest_show()
422 error = tsc2005_read(ts, TSC2005_REG_TEMP_HIGH, &temp_high); tsc2005_selftest_show()
437 tsc2005_set_reset(ts, false); tsc2005_selftest_show()
439 tsc2005_set_reset(ts, true); tsc2005_selftest_show()
445 error = tsc2005_read(ts, TSC2005_REG_TEMP_HIGH, &temp_high); tsc2005_selftest_show()
460 __tsc2005_enable(ts); tsc2005_selftest_show()
461 mutex_unlock(&ts->mutex); tsc2005_selftest_show()
478 struct tsc2005 *ts = spi_get_drvdata(spi); tsc2005_attr_is_visible() local
482 if (!ts->set_reset && !ts->reset_gpio) tsc2005_attr_is_visible()
496 struct tsc2005 *ts = container_of(work, struct tsc2005, esd_work.work); tsc2005_esd_work() local
500 if (!mutex_trylock(&ts->mutex)) { tsc2005_esd_work()
509 if (time_is_after_jiffies(ts->last_valid_interrupt + tsc2005_esd_work()
510 msecs_to_jiffies(ts->esd_timeout))) tsc2005_esd_work()
514 error = tsc2005_read(ts, TSC2005_REG_CFR0, &r); tsc2005_esd_work()
525 dev_info(&ts->spi->dev, "TSC2005 not responding - resetting\n"); tsc2005_esd_work()
527 disable_irq(ts->spi->irq); tsc2005_esd_work()
528 del_timer_sync(&ts->penup_timer); tsc2005_esd_work()
530 tsc2005_update_pen_state(ts, 0, 0, 0); tsc2005_esd_work()
532 tsc2005_set_reset(ts, false); tsc2005_esd_work()
534 tsc2005_set_reset(ts, true); tsc2005_esd_work()
536 enable_irq(ts->spi->irq); tsc2005_esd_work()
537 tsc2005_start_scan(ts); tsc2005_esd_work()
540 mutex_unlock(&ts->mutex); tsc2005_esd_work()
543 schedule_delayed_work(&ts->esd_work, tsc2005_esd_work()
545 msecs_to_jiffies(ts->esd_timeout))); tsc2005_esd_work()
550 struct tsc2005 *ts = input_get_drvdata(input); tsc2005_open() local
552 mutex_lock(&ts->mutex); tsc2005_open()
554 if (!ts->suspended) tsc2005_open()
555 __tsc2005_enable(ts); tsc2005_open()
557 ts->opened = true; tsc2005_open()
559 mutex_unlock(&ts->mutex); tsc2005_open()
566 struct tsc2005 *ts = input_get_drvdata(input); tsc2005_close() local
568 mutex_lock(&ts->mutex); tsc2005_close()
570 if (!ts->suspended) tsc2005_close()
571 __tsc2005_disable(ts); tsc2005_close()
573 ts->opened = false; tsc2005_close()
575 mutex_unlock(&ts->mutex); tsc2005_close()
578 static void tsc2005_setup_spi_xfer(struct tsc2005 *ts) tsc2005_setup_spi_xfer() argument
580 tsc2005_setup_read(&ts->spi_x, TSC2005_REG_X, false); tsc2005_setup_spi_xfer()
581 tsc2005_setup_read(&ts->spi_y, TSC2005_REG_Y, false); tsc2005_setup_spi_xfer()
582 tsc2005_setup_read(&ts->spi_z1, TSC2005_REG_Z1, false); tsc2005_setup_spi_xfer()
583 tsc2005_setup_read(&ts->spi_z2, TSC2005_REG_Z2, true); tsc2005_setup_spi_xfer()
585 spi_message_init(&ts->spi_read_msg); tsc2005_setup_spi_xfer()
586 spi_message_add_tail(&ts->spi_x.spi_xfer, &ts->spi_read_msg); tsc2005_setup_spi_xfer()
587 spi_message_add_tail(&ts->spi_y.spi_xfer, &ts->spi_read_msg); tsc2005_setup_spi_xfer()
588 spi_message_add_tail(&ts->spi_z1.spi_xfer, &ts->spi_read_msg); tsc2005_setup_spi_xfer()
589 spi_message_add_tail(&ts->spi_z2.spi_xfer, &ts->spi_read_msg); tsc2005_setup_spi_xfer()
597 struct tsc2005 *ts; tsc2005_probe() local
645 ts = devm_kzalloc(&spi->dev, sizeof(*ts), GFP_KERNEL); tsc2005_probe()
646 if (!ts) tsc2005_probe()
653 ts->spi = spi; tsc2005_probe()
654 ts->idev = input_dev; tsc2005_probe()
656 ts->x_plate_ohm = x_plate_ohm; tsc2005_probe()
657 ts->esd_timeout = esd_timeout; tsc2005_probe()
660 ts->reset_gpio = of_get_named_gpio(np, "reset-gpios", 0); tsc2005_probe()
661 if (ts->reset_gpio == -EPROBE_DEFER) tsc2005_probe()
662 return ts->reset_gpio; tsc2005_probe()
663 if (ts->reset_gpio < 0) { tsc2005_probe()
665 ts->reset_gpio); tsc2005_probe()
666 return ts->reset_gpio; tsc2005_probe()
669 error = devm_gpio_request_one(&spi->dev, ts->reset_gpio, 0, tsc2005_probe()
677 ts->vio = devm_regulator_get(&spi->dev, "vio"); tsc2005_probe()
678 if (IS_ERR(ts->vio)) { tsc2005_probe()
679 error = PTR_ERR(ts->vio); tsc2005_probe()
684 ts->reset_gpio = -1; tsc2005_probe()
685 ts->set_reset = pdata->set_reset; tsc2005_probe()
688 mutex_init(&ts->mutex); tsc2005_probe()
690 spin_lock_init(&ts->lock); tsc2005_probe()
691 setup_timer(&ts->penup_timer, tsc2005_penup_timer, (unsigned long)ts); tsc2005_probe()
693 INIT_DELAYED_WORK(&ts->esd_work, tsc2005_esd_work); tsc2005_probe()
695 tsc2005_setup_spi_xfer(ts); tsc2005_probe()
697 snprintf(ts->phys, sizeof(ts->phys), tsc2005_probe()
698 "%s/input-ts", dev_name(&spi->dev)); tsc2005_probe()
701 input_dev->phys = ts->phys; tsc2005_probe()
717 input_set_drvdata(input_dev, ts); tsc2005_probe()
720 tsc2005_stop_scan(ts); tsc2005_probe()
725 "tsc2005", ts); tsc2005_probe()
732 if (ts->vio) { tsc2005_probe()
733 error = regulator_enable(ts->vio); tsc2005_probe()
738 spi_set_drvdata(spi, ts); tsc2005_probe()
746 error = input_register_device(ts->idev); tsc2005_probe()
759 if (ts->vio) tsc2005_probe()
760 regulator_disable(ts->vio); tsc2005_probe()
766 struct tsc2005 *ts = spi_get_drvdata(spi); tsc2005_remove() local
770 if (ts->vio) tsc2005_remove()
771 regulator_disable(ts->vio); tsc2005_remove()
779 struct tsc2005 *ts = spi_get_drvdata(spi); tsc2005_suspend() local
781 mutex_lock(&ts->mutex); tsc2005_suspend()
783 if (!ts->suspended && ts->opened) tsc2005_suspend()
784 __tsc2005_disable(ts); tsc2005_suspend()
786 ts->suspended = true; tsc2005_suspend()
788 mutex_unlock(&ts->mutex); tsc2005_suspend()
796 struct tsc2005 *ts = spi_get_drvdata(spi); tsc2005_resume() local
798 mutex_lock(&ts->mutex); tsc2005_resume()
800 if (ts->suspended && ts->opened) tsc2005_resume()
801 __tsc2005_enable(ts); tsc2005_resume()
803 ts->suspended = false; tsc2005_resume()
805 mutex_unlock(&ts->mutex); tsc2005_resume()
H A Ds3c2410_ts.c89 static struct s3c2410ts ts; variable in typeref:struct:s3c2410ts
111 data0 = readl(ts.io + S3C2410_ADCDAT0); touch_timer_fire()
112 data1 = readl(ts.io + S3C2410_ADCDAT1); touch_timer_fire()
117 if (ts.count == (1 << ts.shift)) { touch_timer_fire()
118 ts.xp >>= ts.shift; touch_timer_fire()
119 ts.yp >>= ts.shift; touch_timer_fire()
121 dev_dbg(ts.dev, "%s: X=%lu, Y=%lu, count=%d\n", touch_timer_fire()
122 __func__, ts.xp, ts.yp, ts.count); touch_timer_fire()
124 input_report_abs(ts.input, ABS_X, ts.xp); touch_timer_fire()
125 input_report_abs(ts.input, ABS_Y, ts.yp); touch_timer_fire()
127 input_report_key(ts.input, BTN_TOUCH, 1); touch_timer_fire()
128 input_sync(ts.input); touch_timer_fire()
130 ts.xp = 0; touch_timer_fire()
131 ts.yp = 0; touch_timer_fire()
132 ts.count = 0; touch_timer_fire()
135 s3c_adc_start(ts.client, 0, 1 << ts.shift); touch_timer_fire()
137 ts.xp = 0; touch_timer_fire()
138 ts.yp = 0; touch_timer_fire()
139 ts.count = 0; touch_timer_fire()
141 input_report_key(ts.input, BTN_TOUCH, 0); touch_timer_fire()
142 input_sync(ts.input); touch_timer_fire()
144 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); touch_timer_fire()
163 data0 = readl(ts.io + S3C2410_ADCDAT0); stylus_irq()
164 data1 = readl(ts.io + S3C2410_ADCDAT1); stylus_irq()
173 s3c_adc_start(ts.client, 0, 1 << ts.shift); stylus_irq()
175 dev_dbg(ts.dev, "%s: count=%d\n", __func__, ts.count); stylus_irq()
177 if (ts.features & FEAT_PEN_IRQ) { stylus_irq()
179 writel(0x0, ts.io + S3C64XX_ADCCLRINTPNDNUP); stylus_irq()
198 dev_dbg(ts.dev, "%s: %d,%d\n", __func__, data0, data1); s3c24xx_ts_conversion()
200 ts.xp += data0; s3c24xx_ts_conversion()
201 ts.yp += data1; s3c24xx_ts_conversion()
203 ts.count++; s3c24xx_ts_conversion()
226 ts.io + S3C2410_ADCTSC); s3c24xx_ts_select()
229 writel(WAIT4INT | INT_UP, ts.io + S3C2410_ADCTSC); s3c24xx_ts_select()
249 memset(&ts, 0, sizeof(struct s3c2410ts)); s3c2410ts_probe()
251 ts.dev = dev; s3c2410ts_probe()
261 ts.clock = clk_get(dev, "adc"); s3c2410ts_probe()
262 if (IS_ERR(ts.clock)) { s3c2410ts_probe()
267 clk_prepare_enable(ts.clock); s3c2410ts_probe()
270 ts.irq_tc = ret = platform_get_irq(pdev, 0); s3c2410ts_probe()
283 ts.io = ioremap(res->start, resource_size(res)); s3c2410ts_probe()
284 if (ts.io == NULL) { s3c2410ts_probe()
292 info->cfg_gpio(to_platform_device(ts.dev)); s3c2410ts_probe()
294 ts.client = s3c_adc_register(pdev, s3c24xx_ts_select, s3c2410ts_probe()
296 if (IS_ERR(ts.client)) { s3c2410ts_probe()
298 ret = PTR_ERR(ts.client); s3c2410ts_probe()
304 writel(info->delay & 0xffff, ts.io + S3C2410_ADCDLY); s3c2410ts_probe()
306 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); s3c2410ts_probe()
315 ts.input = input_dev; s3c2410ts_probe()
316 ts.input->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); s3c2410ts_probe()
317 ts.input->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); s3c2410ts_probe()
318 input_set_abs_params(ts.input, ABS_X, 0, 0x3FF, 0, 0); s3c2410ts_probe()
319 input_set_abs_params(ts.input, ABS_Y, 0, 0x3FF, 0, 0); s3c2410ts_probe()
321 ts.input->name = "S3C24XX TouchScreen"; s3c2410ts_probe()
322 ts.input->id.bustype = BUS_HOST; s3c2410ts_probe()
323 ts.input->id.vendor = 0xDEAD; s3c2410ts_probe()
324 ts.input->id.product = 0xBEEF; s3c2410ts_probe()
325 ts.input->id.version = 0x0102; s3c2410ts_probe()
327 ts.shift = info->oversampling_shift; s3c2410ts_probe()
328 ts.features = platform_get_device_id(pdev)->driver_data; s3c2410ts_probe()
330 ret = request_irq(ts.irq_tc, stylus_irq, 0, s3c2410ts_probe()
331 "s3c2410_ts_pen", ts.input); s3c2410ts_probe()
340 ret = input_register_device(ts.input); s3c2410ts_probe()
350 free_irq(ts.irq_tc, ts.input); s3c2410ts_probe()
352 input_free_device(ts.input); s3c2410ts_probe()
354 iounmap(ts.io); s3c2410ts_probe()
357 clk_put(ts.clock); s3c2410ts_probe()
369 free_irq(ts.irq_tc, ts.input); s3c2410ts_remove()
372 clk_disable_unprepare(ts.clock); s3c2410ts_remove()
373 clk_put(ts.clock); s3c2410ts_remove()
375 input_unregister_device(ts.input); s3c2410ts_remove()
376 iounmap(ts.io); s3c2410ts_remove()
384 writel(TSC_SLEEP, ts.io + S3C2410_ADCTSC); s3c2410ts_suspend()
385 disable_irq(ts.irq_tc); s3c2410ts_suspend()
386 clk_disable(ts.clock); s3c2410ts_suspend()
396 clk_enable(ts.clock); s3c2410ts_resume()
397 enable_irq(ts.irq_tc); s3c2410ts_resume()
401 writel(info->delay & 0xffff, ts.io + S3C2410_ADCDLY); s3c2410ts_resume()
403 writel(WAIT4INT | INT_DOWN, ts.io + S3C2410_ADCTSC); s3c2410ts_resume()
415 { "s3c2410-ts", 0 },
416 { "s3c2440-ts", 0 },
417 { "s3c64xx-ts", FEAT_PEN_IRQ },
424 .name = "samsung-ts",
H A Dads7846.c202 /* Must be called with ts->lock held */ ads7846_stop()
203 static void ads7846_stop(struct ads7846 *ts) ads7846_stop() argument
205 if (!ts->disabled && !ts->suspended) { ads7846_stop()
207 ts->stopped = true; ads7846_stop()
209 wake_up(&ts->wait); ads7846_stop()
210 disable_irq(ts->spi->irq); ads7846_stop()
214 /* Must be called with ts->lock held */ ads7846_restart()
215 static void ads7846_restart(struct ads7846 *ts) ads7846_restart() argument
217 if (!ts->disabled && !ts->suspended) { ads7846_restart()
219 ts->stopped = false; ads7846_restart()
221 enable_irq(ts->spi->irq); ads7846_restart()
225 /* Must be called with ts->lock held */ __ads7846_disable()
226 static void __ads7846_disable(struct ads7846 *ts) __ads7846_disable() argument
228 ads7846_stop(ts); __ads7846_disable()
229 regulator_disable(ts->reg); __ads7846_disable()
237 /* Must be called with ts->lock held */ __ads7846_enable()
238 static void __ads7846_enable(struct ads7846 *ts) __ads7846_enable() argument
242 error = regulator_enable(ts->reg); __ads7846_enable()
244 dev_err(&ts->spi->dev, "Failed to enable supply: %d\n", error); __ads7846_enable()
246 ads7846_restart(ts); __ads7846_enable()
249 static void ads7846_disable(struct ads7846 *ts) ads7846_disable() argument
251 mutex_lock(&ts->lock); ads7846_disable()
253 if (!ts->disabled) { ads7846_disable()
255 if (!ts->suspended) ads7846_disable()
256 __ads7846_disable(ts); ads7846_disable()
258 ts->disabled = true; ads7846_disable()
261 mutex_unlock(&ts->lock); ads7846_disable()
264 static void ads7846_enable(struct ads7846 *ts) ads7846_enable() argument
266 mutex_lock(&ts->lock); ads7846_enable()
268 if (ts->disabled) { ads7846_enable()
270 ts->disabled = false; ads7846_enable()
272 if (!ts->suspended) ads7846_enable()
273 __ads7846_enable(ts); ads7846_enable()
276 mutex_unlock(&ts->lock); ads7846_enable()
315 struct ads7846 *ts = dev_get_drvdata(dev); ads7846_read12_ser() local
326 if (ts->use_internal) { ads7846_read12_ser()
336 req->xfer[1].delay_usecs = ts->vref_delay_usecs; ads7846_read12_ser()
369 mutex_lock(&ts->lock); ads7846_read12_ser()
370 ads7846_stop(ts); ads7846_read12_ser()
372 ads7846_restart(ts); ads7846_read12_ser()
373 mutex_unlock(&ts->lock); ads7846_read12_ser()
389 struct ads7846 *ts = dev_get_drvdata(dev); ads7845_read12_ser() local
405 mutex_lock(&ts->lock); ads7845_read12_ser()
406 ads7846_stop(ts); ads7845_read12_ser()
408 ads7846_restart(ts); ads7845_read12_ser()
409 mutex_unlock(&ts->lock); ads7845_read12_ser()
427 struct ads7846 *ts = dev_get_drvdata(dev); \
428 ssize_t v = ads7846_read12_ser(&ts->spi->dev, \
432 return sprintf(buf, "%u\n", adjust(ts, v)); \
442 static inline unsigned null_adjust(struct ads7846 *ts, ssize_t v) null_adjust() argument
455 static inline unsigned vaux_adjust(struct ads7846 *ts, ssize_t v) vaux_adjust() argument
460 retval *= ts->vref_mv; vaux_adjust()
466 static inline unsigned vbatt_adjust(struct ads7846 *ts, ssize_t v) vbatt_adjust() argument
468 unsigned retval = vaux_adjust(ts, v); vbatt_adjust()
471 if (ts->model == 7846) vbatt_adjust()
484 struct ads7846 *ts = dev_get_drvdata(dev); ads7846_is_visible() local
486 if (ts->model == 7843 && index < 2) /* in0, in1 */ ads7846_is_visible()
488 if (ts->model == 7845 && index != 2) /* in0 */ ads7846_is_visible()
508 static int ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts) ads784x_hwmon_register() argument
511 switch (ts->model) { ads784x_hwmon_register()
513 if (!ts->vref_mv) { ads784x_hwmon_register()
515 ts->vref_mv = 2500; ads784x_hwmon_register()
516 ts->use_internal = true; ads784x_hwmon_register()
521 if (!ts->vref_mv) { ads784x_hwmon_register()
524 ts->model); ads784x_hwmon_register()
530 ts->hwmon = hwmon_device_register_with_groups(&spi->dev, spi->modalias, ads784x_hwmon_register()
531 ts, ads7846_attr_groups); ads784x_hwmon_register()
532 if (IS_ERR(ts->hwmon)) ads784x_hwmon_register()
533 return PTR_ERR(ts->hwmon); ads784x_hwmon_register()
539 struct ads7846 *ts) ads784x_hwmon_unregister()
541 if (ts->hwmon) ads784x_hwmon_unregister()
542 hwmon_device_unregister(ts->hwmon); ads784x_hwmon_unregister()
547 struct ads7846 *ts) ads784x_hwmon_register()
553 struct ads7846 *ts) ads784x_hwmon_unregister()
561 struct ads7846 *ts = dev_get_drvdata(dev); ads7846_pen_down_show() local
563 return sprintf(buf, "%u\n", ts->pendown); ads7846_pen_down_show()
571 struct ads7846 *ts = dev_get_drvdata(dev); ads7846_disable_show() local
573 return sprintf(buf, "%u\n", ts->disabled); ads7846_disable_show()
580 struct ads7846 *ts = dev_get_drvdata(dev); ads7846_disable_store() local
589 ads7846_disable(ts); ads7846_disable_store()
591 ads7846_enable(ts); ads7846_disable_store()
610 static int get_pendown_state(struct ads7846 *ts) get_pendown_state() argument
612 if (ts->get_pendown_state) get_pendown_state()
613 return ts->get_pendown_state(); get_pendown_state()
615 return !gpio_get_value(ts->gpio_pendown); get_pendown_state()
624 struct ads7846 *ts = ads; ads7846_debounce_filter() local
626 if (!ts->read_cnt || (abs(ts->last_read - *val) > ts->debounce_tol)) { ads7846_debounce_filter()
628 ts->read_rep = 0; ads7846_debounce_filter()
633 if (ts->read_cnt < ts->debounce_max) { ads7846_debounce_filter()
634 ts->last_read = *val; ads7846_debounce_filter()
635 ts->read_cnt++; ads7846_debounce_filter()
644 ts->read_cnt = 0; ads7846_debounce_filter()
648 if (++ts->read_rep > ts->debounce_rep) { ads7846_debounce_filter()
653 ts->read_cnt = 0; ads7846_debounce_filter()
654 ts->read_rep = 0; ads7846_debounce_filter()
658 ts->read_cnt++; ads7846_debounce_filter()
669 static int ads7846_get_value(struct ads7846 *ts, struct spi_message *m) ads7846_get_value() argument
674 if (ts->model == 7845) { ads7846_get_value()
693 static void ads7846_read_state(struct ads7846 *ts) ads7846_read_state() argument
695 struct ads7846_packet *packet = ts->packet; ads7846_read_state()
702 while (msg_idx < ts->msg_count) { ads7846_read_state()
704 ts->wait_for_sync(); ads7846_read_state()
706 m = &ts->msg[msg_idx]; ads7846_read_state()
707 error = spi_sync(ts->spi, m); ads7846_read_state()
709 dev_err(&ts->spi->dev, "spi_sync --> %d\n", error); ads7846_read_state()
718 if (msg_idx < ts->msg_count - 1) { ads7846_read_state()
720 val = ads7846_get_value(ts, m); ads7846_read_state()
722 action = ts->filter(ts->filter_data, msg_idx, &val); ads7846_read_state()
729 msg_idx = ts->msg_count - 1; ads7846_read_state()
747 static void ads7846_report_state(struct ads7846 *ts) ads7846_report_state() argument
749 struct ads7846_packet *packet = ts->packet; ads7846_report_state()
758 if (ts->model == 7845) { ads7846_report_state()
774 if (ts->model == 7843) { ads7846_report_state()
775 Rt = ts->pressure_max / 2; ads7846_report_state()
776 } else if (ts->model == 7845) { ads7846_report_state()
777 if (get_pendown_state(ts)) ads7846_report_state()
778 Rt = ts->pressure_max / 2; ads7846_report_state()
781 dev_vdbg(&ts->spi->dev, "x/y: %d/%d, PD %d\n", x, y, Rt); ads7846_report_state()
787 Rt *= ts->x_plate_ohms; ads7846_report_state()
799 if (packet->tc.ignore || Rt > ts->pressure_max) { ads7846_report_state()
800 dev_vdbg(&ts->spi->dev, "ignored %d pressure %d\n", ads7846_report_state()
809 if (ts->penirq_recheck_delay_usecs) { ads7846_report_state()
810 udelay(ts->penirq_recheck_delay_usecs); ads7846_report_state()
811 if (!get_pendown_state(ts)) ads7846_report_state()
825 struct input_dev *input = ts->input; ads7846_report_state()
827 if (ts->swap_xy) ads7846_report_state()
830 if (!ts->pendown) { ads7846_report_state()
832 ts->pendown = true; ads7846_report_state()
833 dev_vdbg(&ts->spi->dev, "DOWN\n"); ads7846_report_state()
838 input_report_abs(input, ABS_PRESSURE, ts->pressure_max - Rt); ads7846_report_state()
841 dev_vdbg(&ts->spi->dev, "%4d/%4d/%4d\n", x, y, Rt); ads7846_report_state()
847 struct ads7846 *ts = handle; ads7846_hard_irq() local
849 return get_pendown_state(ts) ? IRQ_WAKE_THREAD : IRQ_HANDLED; ads7846_hard_irq()
855 struct ads7846 *ts = handle; ads7846_irq() local
860 while (!ts->stopped && get_pendown_state(ts)) { ads7846_irq()
863 ads7846_read_state(ts); ads7846_irq()
865 if (!ts->stopped) ads7846_irq()
866 ads7846_report_state(ts); ads7846_irq()
868 wait_event_timeout(ts->wait, ts->stopped, ads7846_irq()
872 if (ts->pendown) { ads7846_irq()
873 struct input_dev *input = ts->input; ads7846_irq()
879 ts->pendown = false; ads7846_irq()
880 dev_vdbg(&ts->spi->dev, "UP\n"); ads7846_irq()
888 struct ads7846 *ts = dev_get_drvdata(dev); ads7846_suspend() local
890 mutex_lock(&ts->lock); ads7846_suspend()
892 if (!ts->suspended) { ads7846_suspend()
894 if (!ts->disabled) ads7846_suspend()
895 __ads7846_disable(ts); ads7846_suspend()
897 if (device_may_wakeup(&ts->spi->dev)) ads7846_suspend()
898 enable_irq_wake(ts->spi->irq); ads7846_suspend()
900 ts->suspended = true; ads7846_suspend()
903 mutex_unlock(&ts->lock); ads7846_suspend()
910 struct ads7846 *ts = dev_get_drvdata(dev); ads7846_resume() local
912 mutex_lock(&ts->lock); ads7846_resume()
914 if (ts->suspended) { ads7846_resume()
916 ts->suspended = false; ads7846_resume()
918 if (device_may_wakeup(&ts->spi->dev)) ads7846_resume()
919 disable_irq_wake(ts->spi->irq); ads7846_resume()
921 if (!ts->disabled) ads7846_resume()
922 __ads7846_enable(ts); ads7846_resume()
925 mutex_unlock(&ts->lock); ads7846_resume()
933 struct ads7846 *ts, ads7846_setup_pendown()
945 ts->get_pendown_state = pdata->get_pendown_state; ads7846_setup_pendown()
957 ts->gpio_pendown = pdata->gpio_pendown; ads7846_setup_pendown()
974 static void ads7846_setup_spi_msg(struct ads7846 *ts, ads7846_setup_spi_msg() argument
977 struct spi_message *m = &ts->msg[0]; ads7846_setup_spi_msg()
978 struct spi_transfer *x = ts->xfer; ads7846_setup_spi_msg()
979 struct ads7846_packet *packet = ts->packet; ads7846_setup_spi_msg()
982 if (ts->model == 7873) { ads7846_setup_spi_msg()
988 ts->model = 7846; ads7846_setup_spi_msg()
992 ts->msg_count = 1; ads7846_setup_spi_msg()
994 m->context = ts; ads7846_setup_spi_msg()
996 if (ts->model == 7845) { ads7846_setup_spi_msg()
1036 ts->msg_count++; ads7846_setup_spi_msg()
1039 m->context = ts; ads7846_setup_spi_msg()
1041 if (ts->model == 7845) { ads7846_setup_spi_msg()
1080 if (ts->model == 7846) { ads7846_setup_spi_msg()
1081 ts->msg_count++; ads7846_setup_spi_msg()
1084 m->context = ts; ads7846_setup_spi_msg()
1112 ts->msg_count++; ads7846_setup_spi_msg()
1115 m->context = ts; ads7846_setup_spi_msg()
1145 ts->msg_count++; ads7846_setup_spi_msg()
1148 m->context = ts; ads7846_setup_spi_msg()
1150 if (ts->model == 7845) { ads7846_setup_spi_msg()
1254 struct ads7846 *ts; ads7846_probe() local
1283 ts = kzalloc(sizeof(struct ads7846), GFP_KERNEL); ads7846_probe()
1286 if (!ts || !packet || !input_dev) { ads7846_probe()
1291 spi_set_drvdata(spi, ts); ads7846_probe()
1293 ts->packet = packet; ads7846_probe()
1294 ts->spi = spi; ads7846_probe()
1295 ts->input = input_dev; ads7846_probe()
1297 mutex_init(&ts->lock); ads7846_probe()
1298 init_waitqueue_head(&ts->wait); ads7846_probe()
1309 ts->model = pdata->model ? : 7846; ads7846_probe()
1310 ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100; ads7846_probe()
1311 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400; ads7846_probe()
1312 ts->pressure_max = pdata->pressure_max ? : ~0; ads7846_probe()
1314 ts->vref_mv = pdata->vref_mv; ads7846_probe()
1315 ts->swap_xy = pdata->swap_xy; ads7846_probe()
1319 err = pdata->filter_init(pdata, &ts->filter_data); ads7846_probe()
1323 ts->filter = pdata->filter; ads7846_probe()
1324 ts->filter_cleanup = pdata->filter_cleanup; ads7846_probe()
1326 ts->debounce_max = pdata->debounce_max; ads7846_probe()
1327 if (ts->debounce_max < 2) ads7846_probe()
1328 ts->debounce_max = 2; ads7846_probe()
1329 ts->debounce_tol = pdata->debounce_tol; ads7846_probe()
1330 ts->debounce_rep = pdata->debounce_rep; ads7846_probe()
1331 ts->filter = ads7846_debounce_filter; ads7846_probe()
1332 ts->filter_data = ts; ads7846_probe()
1334 ts->filter = ads7846_no_filter; ads7846_probe()
1337 err = ads7846_setup_pendown(spi, ts, pdata); ads7846_probe()
1342 ts->penirq_recheck_delay_usecs = ads7846_probe()
1345 ts->wait_for_sync = pdata->wait_for_sync ? : null_wait_for_sync; ads7846_probe()
1347 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev)); ads7846_probe()
1348 snprintf(ts->name, sizeof(ts->name), "ADS%d Touchscreen", ts->model); ads7846_probe()
1350 input_dev->name = ts->name; ads7846_probe()
1351 input_dev->phys = ts->phys; ads7846_probe()
1367 ads7846_setup_spi_msg(ts, pdata); ads7846_probe()
1369 ts->reg = regulator_get(&spi->dev, "vcc"); ads7846_probe()
1370 if (IS_ERR(ts->reg)) { ads7846_probe()
1371 err = PTR_ERR(ts->reg); ads7846_probe()
1376 err = regulator_enable(ts->reg); ads7846_probe()
1386 irq_flags, spi->dev.driver->name, ts); ads7846_probe()
1393 irq_flags, spi->dev.driver->name, ts); ads7846_probe()
1401 err = ads784x_hwmon_register(spi, ts); ads7846_probe()
1411 if (ts->model == 7845) ads7846_probe()
1438 ads784x_hwmon_unregister(spi, ts); ads7846_probe()
1440 free_irq(spi->irq, ts); ads7846_probe()
1442 regulator_disable(ts->reg); ads7846_probe()
1444 regulator_put(ts->reg); ads7846_probe()
1446 if (!ts->get_pendown_state) ads7846_probe()
1447 gpio_free(ts->gpio_pendown); ads7846_probe()
1449 if (ts->filter_cleanup) ads7846_probe()
1450 ts->filter_cleanup(ts->filter_data); ads7846_probe()
1454 kfree(ts); ads7846_probe()
1460 struct ads7846 *ts = spi_get_drvdata(spi); ads7846_remove() local
1466 ads7846_disable(ts); ads7846_remove()
1467 free_irq(ts->spi->irq, ts); ads7846_remove()
1469 input_unregister_device(ts->input); ads7846_remove()
1471 ads784x_hwmon_unregister(spi, ts); ads7846_remove()
1473 regulator_disable(ts->reg); ads7846_remove()
1474 regulator_put(ts->reg); ads7846_remove()
1476 if (!ts->get_pendown_state) { ads7846_remove()
1481 gpio_free(ts->gpio_pendown); ads7846_remove()
1484 if (ts->filter_cleanup) ads7846_remove()
1485 ts->filter_cleanup(ts->filter_data); ads7846_remove()
1487 kfree(ts->packet); ads7846_remove()
1488 kfree(ts); ads7846_remove()
538 ads784x_hwmon_unregister(struct spi_device *spi, struct ads7846 *ts) ads784x_hwmon_unregister() argument
546 ads784x_hwmon_register(struct spi_device *spi, struct ads7846 *ts) ads784x_hwmon_register() argument
552 ads784x_hwmon_unregister(struct spi_device *spi, struct ads7846 *ts) ads784x_hwmon_unregister() argument
932 ads7846_setup_pendown(struct spi_device *spi, struct ads7846 *ts, const struct ads7846_platform_data *pdata) ads7846_setup_pendown() argument
H A Dtsc2007.c151 static bool tsc2007_is_pen_down(struct tsc2007 *ts) tsc2007_is_pen_down() argument
167 if (!ts->get_pendown_state) tsc2007_is_pen_down()
170 return ts->get_pendown_state(&ts->client->dev); tsc2007_is_pen_down()
175 struct tsc2007 *ts = handle; tsc2007_soft_irq() local
176 struct input_dev *input = ts->input; tsc2007_soft_irq()
180 while (!ts->stopped && tsc2007_is_pen_down(ts)) { tsc2007_soft_irq()
183 tsc2007_read_values(ts, &tc); tsc2007_soft_irq()
185 rt = tsc2007_calculate_pressure(ts, &tc); tsc2007_soft_irq()
187 if (!rt && !ts->get_pendown_state) { tsc2007_soft_irq()
196 if (rt <= ts->max_rt) { tsc2007_soft_irq()
197 dev_dbg(&ts->client->dev, tsc2007_soft_irq()
214 dev_dbg(&ts->client->dev, "ignored pressure %d\n", rt); tsc2007_soft_irq()
217 wait_event_timeout(ts->wait, ts->stopped, ts->poll_period); tsc2007_soft_irq()
220 dev_dbg(&ts->client->dev, "UP\n"); tsc2007_soft_irq()
226 if (ts->clear_penirq) tsc2007_soft_irq()
227 ts->clear_penirq(); tsc2007_soft_irq()
234 struct tsc2007 *ts = handle; tsc2007_hard_irq() local
236 if (tsc2007_is_pen_down(ts)) tsc2007_hard_irq()
239 if (ts->clear_penirq) tsc2007_hard_irq()
240 ts->clear_penirq(); tsc2007_hard_irq()
245 static void tsc2007_stop(struct tsc2007 *ts) tsc2007_stop() argument
247 ts->stopped = true; tsc2007_stop()
249 wake_up(&ts->wait); tsc2007_stop()
251 disable_irq(ts->irq); tsc2007_stop()
256 struct tsc2007 *ts = input_get_drvdata(input_dev); tsc2007_open() local
259 ts->stopped = false; tsc2007_open()
262 enable_irq(ts->irq); tsc2007_open()
265 err = tsc2007_xfer(ts, PWRDOWN); tsc2007_open()
267 tsc2007_stop(ts); tsc2007_open()
276 struct tsc2007 *ts = input_get_drvdata(input_dev); tsc2007_close() local
278 tsc2007_stop(ts); tsc2007_close()
285 struct tsc2007 *ts = i2c_get_clientdata(client); tsc2007_get_pendown_state_gpio() local
287 return !gpio_get_value(ts->gpio); tsc2007_get_pendown_state_gpio()
290 static int tsc2007_probe_dt(struct i2c_client *client, struct tsc2007 *ts) tsc2007_probe_dt() argument
302 ts->max_rt = val32; tsc2007_probe_dt()
304 ts->max_rt = MAX_12BIT; tsc2007_probe_dt()
307 ts->fuzzx = val32; tsc2007_probe_dt()
310 ts->fuzzy = val32; tsc2007_probe_dt()
313 ts->fuzzz = val32; tsc2007_probe_dt()
316 ts->poll_period = msecs_to_jiffies(val64); tsc2007_probe_dt()
318 ts->poll_period = msecs_to_jiffies(1); tsc2007_probe_dt()
321 ts->x_plate_ohms = val32; tsc2007_probe_dt()
327 ts->gpio = of_get_gpio(np, 0); tsc2007_probe_dt()
328 if (gpio_is_valid(ts->gpio)) tsc2007_probe_dt()
329 ts->get_pendown_state = tsc2007_get_pendown_state_gpio; tsc2007_probe_dt()
333 ts->gpio); tsc2007_probe_dt()
338 static int tsc2007_probe_dt(struct i2c_client *client, struct tsc2007 *ts) tsc2007_probe_dt() argument
345 static int tsc2007_probe_pdev(struct i2c_client *client, struct tsc2007 *ts, tsc2007_probe_pdev() argument
349 ts->model = pdata->model; tsc2007_probe_pdev()
350 ts->x_plate_ohms = pdata->x_plate_ohms; tsc2007_probe_pdev()
351 ts->max_rt = pdata->max_rt ? : MAX_12BIT; tsc2007_probe_pdev()
352 ts->poll_period = msecs_to_jiffies(pdata->poll_period ? : 1); tsc2007_probe_pdev()
353 ts->get_pendown_state = pdata->get_pendown_state; tsc2007_probe_pdev()
354 ts->clear_penirq = pdata->clear_penirq; tsc2007_probe_pdev()
355 ts->fuzzx = pdata->fuzzx; tsc2007_probe_pdev()
356 ts->fuzzy = pdata->fuzzy; tsc2007_probe_pdev()
357 ts->fuzzz = pdata->fuzzz; tsc2007_probe_pdev()
379 struct tsc2007 *ts; tsc2007_probe() local
387 ts = devm_kzalloc(&client->dev, sizeof(struct tsc2007), GFP_KERNEL); tsc2007_probe()
388 if (!ts) tsc2007_probe()
392 err = tsc2007_probe_pdev(client, ts, pdata, id); tsc2007_probe()
394 err = tsc2007_probe_dt(client, ts); tsc2007_probe()
402 i2c_set_clientdata(client, ts); tsc2007_probe()
404 ts->client = client; tsc2007_probe()
405 ts->irq = client->irq; tsc2007_probe()
406 ts->input = input_dev; tsc2007_probe()
407 init_waitqueue_head(&ts->wait); tsc2007_probe()
409 snprintf(ts->phys, sizeof(ts->phys), tsc2007_probe()
413 input_dev->phys = ts->phys; tsc2007_probe()
419 input_set_drvdata(input_dev, ts); tsc2007_probe()
424 input_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, ts->fuzzx, 0); tsc2007_probe()
425 input_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, ts->fuzzy, 0); tsc2007_probe()
427 ts->fuzzz, 0); tsc2007_probe()
446 err = devm_request_threaded_irq(&client->dev, ts->irq, tsc2007_probe()
449 client->dev.driver->name, ts); tsc2007_probe()
452 ts->irq, err); tsc2007_probe()
456 tsc2007_stop(ts); tsc2007_probe()
H A Dstmpe-ts.c63 #define STMPE_TS_NAME "stmpe-ts"
100 struct stmpe_touch *ts = stmpe_work() local
103 int_sta = stmpe_reg_read(ts->stmpe, STMPE_REG_INT_STA); stmpe_work()
114 int_sta = stmpe_reg_read(ts->stmpe, STMPE_REG_INT_STA); stmpe_work()
119 __stmpe_reset_fifo(ts->stmpe); stmpe_work()
121 input_report_abs(ts->idev, ABS_PRESSURE, 0); stmpe_work()
122 input_report_key(ts->idev, BTN_TOUCH, 0); stmpe_work()
123 input_sync(ts->idev); stmpe_work()
130 struct stmpe_touch *ts = data; stmpe_ts_handler() local
136 cancel_delayed_work_sync(&ts->work); stmpe_ts_handler()
144 stmpe_set_bits(ts->stmpe, STMPE_REG_TSC_CTRL, stmpe_ts_handler()
147 stmpe_block_read(ts->stmpe, STMPE_REG_TSC_DATA_XYZ, 4, data_set); stmpe_ts_handler()
153 input_report_abs(ts->idev, ABS_X, x); stmpe_ts_handler()
154 input_report_abs(ts->idev, ABS_Y, y); stmpe_ts_handler()
155 input_report_abs(ts->idev, ABS_PRESSURE, z); stmpe_ts_handler()
156 input_report_key(ts->idev, BTN_TOUCH, 1); stmpe_ts_handler()
157 input_sync(ts->idev); stmpe_ts_handler()
160 __stmpe_reset_fifo(ts->stmpe); stmpe_ts_handler()
163 stmpe_set_bits(ts->stmpe, STMPE_REG_TSC_CTRL, stmpe_ts_handler()
167 schedule_delayed_work(&ts->work, msecs_to_jiffies(50)); stmpe_ts_handler()
172 static int stmpe_init_hw(struct stmpe_touch *ts) stmpe_init_hw() argument
176 struct stmpe *stmpe = ts->stmpe; stmpe_init_hw()
177 struct device *dev = ts->dev; stmpe_init_hw()
185 adc_ctrl1 = SAMPLE_TIME(ts->sample_time) | MOD_12B(ts->mod_12b) | stmpe_init_hw()
186 REF_SEL(ts->ref_sel); stmpe_init_hw()
197 ADC_FREQ(0xff), ADC_FREQ(ts->adc_freq)); stmpe_init_hw()
203 tsc_cfg = AVE_CTRL(ts->ave_ctrl) | DET_DELAY(ts->touch_det_delay) | stmpe_init_hw()
204 SETTLING(ts->settling); stmpe_init_hw()
214 FRACTION_Z(0xff), FRACTION_Z(ts->fraction_z)); stmpe_init_hw()
221 I_DRIVE(0xff), I_DRIVE(ts->i_drive)); stmpe_init_hw()
246 struct stmpe_touch *ts = input_get_drvdata(dev); stmpe_ts_open() local
249 ret = __stmpe_reset_fifo(ts->stmpe); stmpe_ts_open()
253 return stmpe_set_bits(ts->stmpe, STMPE_REG_TSC_CTRL, stmpe_ts_open()
259 struct stmpe_touch *ts = input_get_drvdata(dev); stmpe_ts_close() local
261 cancel_delayed_work_sync(&ts->work); stmpe_ts_close()
263 stmpe_set_bits(ts->stmpe, STMPE_REG_TSC_CTRL, stmpe_ts_close()
268 struct stmpe_touch *ts) stmpe_ts_get_platform_info()
274 ts->stmpe = stmpe; stmpe_ts_get_platform_info()
276 if (stmpe->pdata && stmpe->pdata->ts) { stmpe_ts_get_platform_info()
277 ts_pdata = stmpe->pdata->ts; stmpe_ts_get_platform_info()
279 ts->sample_time = ts_pdata->sample_time; stmpe_ts_get_platform_info()
280 ts->mod_12b = ts_pdata->mod_12b; stmpe_ts_get_platform_info()
281 ts->ref_sel = ts_pdata->ref_sel; stmpe_ts_get_platform_info()
282 ts->adc_freq = ts_pdata->adc_freq; stmpe_ts_get_platform_info()
283 ts->ave_ctrl = ts_pdata->ave_ctrl; stmpe_ts_get_platform_info()
284 ts->touch_det_delay = ts_pdata->touch_det_delay; stmpe_ts_get_platform_info()
285 ts->settling = ts_pdata->settling; stmpe_ts_get_platform_info()
286 ts->fraction_z = ts_pdata->fraction_z; stmpe_ts_get_platform_info()
287 ts->i_drive = ts_pdata->i_drive; stmpe_ts_get_platform_info()
292 ts->sample_time = val; stmpe_ts_get_platform_info()
294 ts->mod_12b = val; stmpe_ts_get_platform_info()
296 ts->ref_sel = val; stmpe_ts_get_platform_info()
298 ts->adc_freq = val; stmpe_ts_get_platform_info()
300 ts->ave_ctrl = val; stmpe_ts_get_platform_info()
302 ts->touch_det_delay = val; stmpe_ts_get_platform_info()
304 ts->settling = val; stmpe_ts_get_platform_info()
306 ts->fraction_z = val; stmpe_ts_get_platform_info()
308 ts->i_drive = val; stmpe_ts_get_platform_info()
314 struct stmpe_touch *ts; stmpe_input_probe() local
323 ts = devm_kzalloc(&pdev->dev, sizeof(*ts), GFP_KERNEL); stmpe_input_probe()
324 if (!ts) stmpe_input_probe()
331 platform_set_drvdata(pdev, ts); stmpe_input_probe()
332 ts->idev = idev; stmpe_input_probe()
333 ts->dev = &pdev->dev; stmpe_input_probe()
335 stmpe_ts_get_platform_info(pdev, ts); stmpe_input_probe()
337 INIT_DELAYED_WORK(&ts->work, stmpe_work); stmpe_input_probe()
341 IRQF_ONESHOT, STMPE_TS_NAME, ts); stmpe_input_probe()
347 error = stmpe_init_hw(ts); stmpe_input_probe()
360 input_set_drvdata(idev, ts); stmpe_input_probe()
377 struct stmpe_touch *ts = platform_get_drvdata(pdev); stmpe_ts_remove() local
379 stmpe_disable(ts->stmpe, STMPE_BLOCK_TOUCHSCREEN); stmpe_ts_remove()
267 stmpe_ts_get_platform_info(struct platform_device *pdev, struct stmpe_touch *ts) stmpe_ts_get_platform_info() argument
H A Dad7877.c270 struct ad7877 *ts = spi_get_drvdata(spi); ad7877_read_adc() local
284 AD7877_POL(ts->stopacq_polarity) | ad7877_read_adc()
286 AD7877_ACQ(ts->acquisition_time) | AD7877_FCD(0); ad7877_read_adc()
298 req->xfer[1].delay_usecs = ts->vref_delay_usecs; ad7877_read_adc()
303 req->xfer[2].delay_usecs = ts->vref_delay_usecs; ad7877_read_adc()
310 req->xfer[4].tx_buf = &ts->cmd_crtl2; /*REF OFF*/ ad7877_read_adc()
314 req->xfer[5].tx_buf = &ts->cmd_crtl1; /*DEFAULT*/ ad7877_read_adc()
331 static int ad7877_process_data(struct ad7877 *ts) ad7877_process_data() argument
333 struct input_dev *input_dev = ts->input; ad7877_process_data()
337 x = ts->conversion_data[AD7877_SEQ_XPOS] & MAX_12BIT; ad7877_process_data()
338 y = ts->conversion_data[AD7877_SEQ_YPOS] & MAX_12BIT; ad7877_process_data()
339 z1 = ts->conversion_data[AD7877_SEQ_Z1] & MAX_12BIT; ad7877_process_data()
340 z2 = ts->conversion_data[AD7877_SEQ_Z2] & MAX_12BIT; ad7877_process_data()
354 Rt = (z2 - z1) * x * ts->x_plate_ohms; ad7877_process_data()
362 if (Rt > ts->pressure_max) ad7877_process_data()
365 if (!timer_pending(&ts->timer)) ad7877_process_data()
379 static inline void ad7877_ts_event_release(struct ad7877 *ts) ad7877_ts_event_release() argument
381 struct input_dev *input_dev = ts->input; ad7877_ts_event_release()
390 struct ad7877 *ts = (void *)handle; ad7877_timer() local
393 spin_lock_irqsave(&ts->lock, flags); ad7877_timer()
394 ad7877_ts_event_release(ts); ad7877_timer()
395 spin_unlock_irqrestore(&ts->lock, flags); ad7877_timer()
400 struct ad7877 *ts = handle; ad7877_irq() local
404 error = spi_sync(ts->spi, &ts->msg); ad7877_irq()
406 dev_err(&ts->spi->dev, "spi_sync --> %d\n", error); ad7877_irq()
410 spin_lock_irqsave(&ts->lock, flags); ad7877_irq()
411 error = ad7877_process_data(ts); ad7877_irq()
413 mod_timer(&ts->timer, jiffies + TS_PEN_UP_TIMEOUT); ad7877_irq()
414 spin_unlock_irqrestore(&ts->lock, flags); ad7877_irq()
420 static void ad7877_disable(struct ad7877 *ts) ad7877_disable() argument
422 mutex_lock(&ts->mutex); ad7877_disable()
424 if (!ts->disabled) { ad7877_disable()
425 ts->disabled = true; ad7877_disable()
426 disable_irq(ts->spi->irq); ad7877_disable()
428 if (del_timer_sync(&ts->timer)) ad7877_disable()
429 ad7877_ts_event_release(ts); ad7877_disable()
437 mutex_unlock(&ts->mutex); ad7877_disable()
440 static void ad7877_enable(struct ad7877 *ts) ad7877_enable() argument
442 mutex_lock(&ts->mutex); ad7877_enable()
444 if (ts->disabled) { ad7877_enable()
445 ts->disabled = false; ad7877_enable()
446 enable_irq(ts->spi->irq); ad7877_enable()
449 mutex_unlock(&ts->mutex); ad7877_enable()
455 struct ad7877 *ts = dev_get_drvdata(dev); \
456 ssize_t v = ad7877_read_adc(ts->spi, \
475 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_disable_show() local
477 return sprintf(buf, "%u\n", ts->disabled); ad7877_disable_show()
484 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_disable_store() local
493 ad7877_disable(ts); ad7877_disable_store()
495 ad7877_enable(ts); ad7877_disable_store()
505 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_dac_show() local
507 return sprintf(buf, "%u\n", ts->dac); ad7877_dac_show()
514 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_dac_store() local
522 mutex_lock(&ts->mutex); ad7877_dac_store()
523 ts->dac = val & 0xFF; ad7877_dac_store()
524 ad7877_write(ts->spi, AD7877_REG_DAC, (ts->dac << 4) | AD7877_DAC_CONF); ad7877_dac_store()
525 mutex_unlock(&ts->mutex); ad7877_dac_store()
535 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_gpio3_show() local
537 return sprintf(buf, "%u\n", ts->gpio3); ad7877_gpio3_show()
544 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_gpio3_store() local
552 mutex_lock(&ts->mutex); ad7877_gpio3_store()
553 ts->gpio3 = !!val; ad7877_gpio3_store()
554 ad7877_write(ts->spi, AD7877_REG_EXTWRITE, AD7877_EXTW_GPIO_DATA | ad7877_gpio3_store()
555 (ts->gpio4 << 4) | (ts->gpio3 << 5)); ad7877_gpio3_store()
556 mutex_unlock(&ts->mutex); ad7877_gpio3_store()
566 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_gpio4_show() local
568 return sprintf(buf, "%u\n", ts->gpio4); ad7877_gpio4_show()
575 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_gpio4_store() local
583 mutex_lock(&ts->mutex); ad7877_gpio4_store()
584 ts->gpio4 = !!val; ad7877_gpio4_store()
585 ad7877_write(ts->spi, AD7877_REG_EXTWRITE, AD7877_EXTW_GPIO_DATA | ad7877_gpio4_store()
586 (ts->gpio4 << 4) | (ts->gpio3 << 5)); ad7877_gpio4_store()
587 mutex_unlock(&ts->mutex); ad7877_gpio4_store()
630 static void ad7877_setup_ts_def_msg(struct spi_device *spi, struct ad7877 *ts) ad7877_setup_ts_def_msg() argument
635 ts->cmd_crtl2 = AD7877_WRITEADD(AD7877_REG_CTRL2) | ad7877_setup_ts_def_msg()
636 AD7877_POL(ts->stopacq_polarity) | ad7877_setup_ts_def_msg()
637 AD7877_AVG(ts->averaging) | AD7877_PM(1) | ad7877_setup_ts_def_msg()
638 AD7877_TMR(ts->pen_down_acc_interval) | ad7877_setup_ts_def_msg()
639 AD7877_ACQ(ts->acquisition_time) | ad7877_setup_ts_def_msg()
640 AD7877_FCD(ts->first_conversion_delay); ad7877_setup_ts_def_msg()
642 ad7877_write(spi, AD7877_REG_CTRL2, ts->cmd_crtl2); ad7877_setup_ts_def_msg()
644 ts->cmd_crtl1 = AD7877_WRITEADD(AD7877_REG_CTRL1) | ad7877_setup_ts_def_msg()
648 ad7877_write(spi, AD7877_REG_CTRL1, ts->cmd_crtl1); ad7877_setup_ts_def_msg()
650 ts->cmd_dummy = 0; ad7877_setup_ts_def_msg()
652 m = &ts->msg; ad7877_setup_ts_def_msg()
656 m->context = ts; ad7877_setup_ts_def_msg()
658 ts->xfer[0].tx_buf = &ts->cmd_crtl1; ad7877_setup_ts_def_msg()
659 ts->xfer[0].len = 2; ad7877_setup_ts_def_msg()
660 ts->xfer[0].cs_change = 1; ad7877_setup_ts_def_msg()
662 spi_message_add_tail(&ts->xfer[0], m); ad7877_setup_ts_def_msg()
664 ts->xfer[1].tx_buf = &ts->cmd_dummy; /* Send ZERO */ ad7877_setup_ts_def_msg()
665 ts->xfer[1].len = 2; ad7877_setup_ts_def_msg()
666 ts->xfer[1].cs_change = 1; ad7877_setup_ts_def_msg()
668 spi_message_add_tail(&ts->xfer[1], m); ad7877_setup_ts_def_msg()
671 ts->xfer[i + 2].rx_buf = &ts->conversion_data[AD7877_SEQ_YPOS + i]; ad7877_setup_ts_def_msg()
672 ts->xfer[i + 2].len = 2; ad7877_setup_ts_def_msg()
674 ts->xfer[i + 2].cs_change = 1; ad7877_setup_ts_def_msg()
675 spi_message_add_tail(&ts->xfer[i + 2], m); ad7877_setup_ts_def_msg()
681 struct ad7877 *ts; ad7877_probe() local
710 ts = kzalloc(sizeof(struct ad7877), GFP_KERNEL); ad7877_probe()
712 if (!ts || !input_dev) { ad7877_probe()
717 spi_set_drvdata(spi, ts); ad7877_probe()
718 ts->spi = spi; ad7877_probe()
719 ts->input = input_dev; ad7877_probe()
721 setup_timer(&ts->timer, ad7877_timer, (unsigned long) ts); ad7877_probe()
722 mutex_init(&ts->mutex); ad7877_probe()
723 spin_lock_init(&ts->lock); ad7877_probe()
725 ts->model = pdata->model ? : 7877; ad7877_probe()
726 ts->vref_delay_usecs = pdata->vref_delay_usecs ? : 100; ad7877_probe()
727 ts->x_plate_ohms = pdata->x_plate_ohms ? : 400; ad7877_probe()
728 ts->pressure_max = pdata->pressure_max ? : ~0; ad7877_probe()
730 ts->stopacq_polarity = pdata->stopacq_polarity; ad7877_probe()
731 ts->first_conversion_delay = pdata->first_conversion_delay; ad7877_probe()
732 ts->acquisition_time = pdata->acquisition_time; ad7877_probe()
733 ts->averaging = pdata->averaging; ad7877_probe()
734 ts->pen_down_acc_interval = pdata->pen_down_acc_interval; ad7877_probe()
736 snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev)); ad7877_probe()
739 input_dev->phys = ts->phys; ad7877_probe()
774 ad7877_setup_ts_def_msg(spi, ts); ad7877_probe()
780 spi->dev.driver->name, ts); ad7877_probe()
799 free_irq(spi->irq, ts); ad7877_probe()
802 kfree(ts); ad7877_probe()
808 struct ad7877 *ts = spi_get_drvdata(spi); ad7877_remove() local
812 ad7877_disable(ts); ad7877_remove()
813 free_irq(ts->spi->irq, ts); ad7877_remove()
815 input_unregister_device(ts->input); ad7877_remove()
816 kfree(ts); ad7877_remove()
825 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_suspend() local
827 ad7877_disable(ts); ad7877_suspend()
834 struct ad7877 *ts = dev_get_drvdata(dev); ad7877_resume() local
836 ad7877_enable(ts); ad7877_resume()
H A Dzforce_ts.c142 static int zforce_command(struct zforce_ts *ts, u8 cmd) zforce_command() argument
144 struct i2c_client *client = ts->client; zforce_command()
154 mutex_lock(&ts->access_mutex); zforce_command()
156 mutex_unlock(&ts->access_mutex); zforce_command()
165 static int zforce_send_wait(struct zforce_ts *ts, const char *buf, int len) zforce_send_wait() argument
167 struct i2c_client *client = ts->client; zforce_send_wait()
170 ret = mutex_trylock(&ts->command_mutex); zforce_send_wait()
179 ts->command_waiting = buf[2]; zforce_send_wait()
181 mutex_lock(&ts->access_mutex); zforce_send_wait()
183 mutex_unlock(&ts->access_mutex); zforce_send_wait()
191 if (wait_for_completion_timeout(&ts->command_done, WAIT_TIMEOUT) == 0) { zforce_send_wait()
196 ret = ts->command_result; zforce_send_wait()
199 mutex_unlock(&ts->command_mutex); zforce_send_wait()
203 static int zforce_command_wait(struct zforce_ts *ts, u8 cmd) zforce_command_wait() argument
205 struct i2c_client *client = ts->client; zforce_command_wait()
215 ret = zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf)); zforce_command_wait()
224 static int zforce_resolution(struct zforce_ts *ts, u16 x, u16 y) zforce_resolution() argument
226 struct i2c_client *client = ts->client; zforce_resolution()
233 return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf)); zforce_resolution()
236 static int zforce_scan_frequency(struct zforce_ts *ts, u16 idle, u16 finger, zforce_scan_frequency() argument
239 struct i2c_client *client = ts->client; zforce_scan_frequency()
249 return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf)); zforce_scan_frequency()
252 static int zforce_setconfig(struct zforce_ts *ts, char b1) zforce_setconfig() argument
254 struct i2c_client *client = ts->client; zforce_setconfig()
260 return zforce_send_wait(ts, &buf[0], ARRAY_SIZE(buf)); zforce_setconfig()
263 static int zforce_start(struct zforce_ts *ts) zforce_start() argument
265 struct i2c_client *client = ts->client; zforce_start()
266 const struct zforce_ts_platdata *pdata = ts->pdata; zforce_start()
271 ret = zforce_command_wait(ts, COMMAND_INITIALIZE); zforce_start()
277 ret = zforce_resolution(ts, pdata->x_max, pdata->y_max); zforce_start()
283 ret = zforce_scan_frequency(ts, 10, 50, 50); zforce_start()
290 ret = zforce_setconfig(ts, SETCONFIG_DUALTOUCH); zforce_start()
297 ret = zforce_command(ts, COMMAND_DATAREQUEST); zforce_start()
312 zforce_command_wait(ts, COMMAND_DEACTIVATE); zforce_start()
316 static int zforce_stop(struct zforce_ts *ts) zforce_stop() argument
318 struct i2c_client *client = ts->client; zforce_stop()
324 ret = zforce_command_wait(ts, COMMAND_DEACTIVATE); zforce_stop()
334 static int zforce_touch_event(struct zforce_ts *ts, u8 *payload) zforce_touch_event() argument
336 struct i2c_client *client = ts->client; zforce_touch_event()
337 const struct zforce_ts_platdata *pdata = ts->pdata; zforce_touch_event()
384 input_mt_slot(ts->input, point.id - 1); zforce_touch_event()
386 input_mt_report_slot_state(ts->input, MT_TOOL_FINGER, zforce_touch_event()
390 input_report_abs(ts->input, ABS_MT_POSITION_X, zforce_touch_event()
392 input_report_abs(ts->input, ABS_MT_POSITION_Y, zforce_touch_event()
394 input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR, zforce_touch_event()
396 input_report_abs(ts->input, ABS_MT_TOUCH_MINOR, zforce_touch_event()
398 input_report_abs(ts->input, ABS_MT_ORIENTATION, zforce_touch_event()
404 input_mt_sync_frame(ts->input); zforce_touch_event()
406 input_mt_report_finger_count(ts->input, num); zforce_touch_event()
408 input_sync(ts->input); zforce_touch_event()
413 static int zforce_read_packet(struct zforce_ts *ts, u8 *buf) zforce_read_packet() argument
415 struct i2c_client *client = ts->client; zforce_read_packet()
418 mutex_lock(&ts->access_mutex); zforce_read_packet()
451 mutex_unlock(&ts->access_mutex); zforce_read_packet()
455 static void zforce_complete(struct zforce_ts *ts, int cmd, int result) zforce_complete() argument
457 struct i2c_client *client = ts->client; zforce_complete()
459 if (ts->command_waiting == cmd) { zforce_complete()
461 ts->command_result = result; zforce_complete()
462 complete(&ts->command_done); zforce_complete()
470 struct zforce_ts *ts = dev_id; zforce_irq() local
471 struct i2c_client *client = ts->client; zforce_irq()
473 if (ts->suspended && device_may_wakeup(&client->dev)) zforce_irq()
481 struct zforce_ts *ts = dev_id; zforce_irq_thread() local
482 struct i2c_client *client = ts->client; zforce_irq_thread()
483 const struct zforce_ts_platdata *pdata = ts->pdata; zforce_irq_thread()
492 if (ts->suspended) { zforce_irq_thread()
500 if (!ts->suspending && device_may_wakeup(&client->dev)) zforce_irq_thread()
504 ret = zforce_read_packet(ts, payload_buffer); zforce_irq_thread()
519 if (ts->suspending && device_may_wakeup(&client->dev)) zforce_irq_thread()
521 zforce_touch_event(ts, &payload[RESPONSE_DATA]); zforce_irq_thread()
525 ts->boot_complete = payload[RESPONSE_DATA]; zforce_irq_thread()
526 zforce_complete(ts, payload[RESPONSE_ID], 0); zforce_irq_thread()
534 zforce_complete(ts, payload[RESPONSE_ID], zforce_irq_thread()
543 ts->version_major = (payload[RESPONSE_DATA + 1] << 8) | zforce_irq_thread()
545 ts->version_minor = (payload[RESPONSE_DATA + 3] << 8) | zforce_irq_thread()
547 ts->version_build = (payload[RESPONSE_DATA + 5] << 8) | zforce_irq_thread()
549 ts->version_rev = (payload[RESPONSE_DATA + 7] << 8) | zforce_irq_thread()
551 dev_dbg(&ts->client->dev, zforce_irq_thread()
553 ts->version_major, ts->version_minor, zforce_irq_thread()
554 ts->version_build, ts->version_rev); zforce_irq_thread()
556 zforce_complete(ts, payload[RESPONSE_ID], 0); zforce_irq_thread()
560 dev_err(&ts->client->dev, "invalid command: 0x%x\n", zforce_irq_thread()
565 dev_err(&ts->client->dev, zforce_irq_thread()
572 if (!ts->suspending && device_may_wakeup(&client->dev)) zforce_irq_thread()
582 struct zforce_ts *ts = input_get_drvdata(dev); zforce_input_open() local
585 ret = zforce_start(ts); zforce_input_open()
594 struct zforce_ts *ts = input_get_drvdata(dev); zforce_input_close() local
595 struct i2c_client *client = ts->client; zforce_input_close()
598 ret = zforce_stop(ts); zforce_input_close()
608 struct zforce_ts *ts = i2c_get_clientdata(client); zforce_suspend() local
609 struct input_dev *input = ts->input; zforce_suspend()
613 ts->suspending = true; zforce_suspend()
624 ret = zforce_start(ts); zforce_suspend()
634 ret = zforce_stop(ts); zforce_suspend()
641 ts->suspended = true; zforce_suspend()
644 ts->suspending = false; zforce_suspend()
653 struct zforce_ts *ts = i2c_get_clientdata(client); zforce_resume() local
654 struct input_dev *input = ts->input; zforce_resume()
659 ts->suspended = false; zforce_resume()
668 ret = zforce_stop(ts); zforce_resume()
677 ret = zforce_start(ts); zforce_resume()
692 struct zforce_ts *ts = data; zforce_reset() local
694 gpio_set_value(ts->pdata->gpio_rst, 0); zforce_reset()
698 if (!IS_ERR(ts->reg_vdd)) zforce_reset()
699 regulator_disable(ts->reg_vdd); zforce_reset()
745 struct zforce_ts *ts; zforce_probe() local
755 ts = devm_kzalloc(&client->dev, sizeof(struct zforce_ts), GFP_KERNEL); zforce_probe()
756 if (!ts) zforce_probe()
775 ts->reg_vdd = devm_regulator_get_optional(&client->dev, "vdd"); zforce_probe()
776 if (IS_ERR(ts->reg_vdd)) { zforce_probe()
777 ret = PTR_ERR(ts->reg_vdd); zforce_probe()
781 ret = regulator_enable(ts->reg_vdd); zforce_probe()
792 ret = devm_add_action(&client->dev, zforce_reset, ts); zforce_probe()
798 if (!IS_ERR(ts->reg_vdd)) zforce_probe()
799 regulator_disable(ts->reg_vdd); zforce_probe()
804 snprintf(ts->phys, sizeof(ts->phys), zforce_probe()
813 mutex_init(&ts->access_mutex); zforce_probe()
814 mutex_init(&ts->command_mutex); zforce_probe()
816 ts->pdata = pdata; zforce_probe()
817 ts->client = client; zforce_probe()
818 ts->input = input_dev; zforce_probe()
821 input_dev->phys = ts->phys; zforce_probe()
844 input_set_drvdata(ts->input, ts); zforce_probe()
846 init_completion(&ts->command_done); zforce_probe()
858 input_dev->name, ts); zforce_probe()
864 i2c_set_clientdata(client, ts); zforce_probe()
869 ts->command_waiting = NOTIFICATION_BOOTCOMPLETE; zforce_probe()
870 if (wait_for_completion_timeout(&ts->command_done, WAIT_TIMEOUT) == 0) zforce_probe()
874 ret = zforce_command_wait(ts, COMMAND_INITIALIZE); zforce_probe()
881 ret = zforce_command_wait(ts, COMMAND_STATUS); zforce_probe()
884 zforce_stop(ts); zforce_probe()
889 ret = zforce_stop(ts); zforce_probe()
906 { "zforce-ts", 0 },
922 .name = "zforce-ts",
H A Dcy8ctmg110_ts.c68 static void cy8ctmg110_power(struct cy8ctmg110 *ts, bool poweron) cy8ctmg110_power() argument
70 if (ts->reset_pin) cy8ctmg110_power()
71 gpio_direction_output(ts->reset_pin, 1 - poweron); cy8ctmg110_power()
152 static int cy8ctmg110_set_sleepmode(struct cy8ctmg110 *ts, bool sleep) cy8ctmg110_set_sleepmode() argument
166 return cy8ctmg110_write_regs(ts, CY8CTMG110_TOUCH_WAKEUP_TIME, 3, reg_p); cy8ctmg110_set_sleepmode()
182 struct cy8ctmg110 *ts; cy8ctmg110_probe() local
196 ts = kzalloc(sizeof(struct cy8ctmg110), GFP_KERNEL); cy8ctmg110_probe()
198 if (!ts || !input_dev) { cy8ctmg110_probe()
203 ts->client = client; cy8ctmg110_probe()
204 ts->input = input_dev; cy8ctmg110_probe()
205 ts->reset_pin = pdata->reset_pin; cy8ctmg110_probe()
206 ts->irq_pin = pdata->irq_pin; cy8ctmg110_probe()
208 snprintf(ts->phys, sizeof(ts->phys), cy8ctmg110_probe()
212 input_dev->phys = ts->phys; cy8ctmg110_probe()
224 if (ts->reset_pin) { cy8ctmg110_probe()
225 err = gpio_request(ts->reset_pin, NULL); cy8ctmg110_probe()
229 ts->reset_pin); cy8ctmg110_probe()
234 cy8ctmg110_power(ts, true); cy8ctmg110_probe()
235 cy8ctmg110_set_sleepmode(ts, false); cy8ctmg110_probe()
237 err = gpio_request(ts->irq_pin, "touch_irq_key"); cy8ctmg110_probe()
241 ts->irq_pin, err); cy8ctmg110_probe()
245 err = gpio_direction_input(ts->irq_pin); cy8ctmg110_probe()
249 ts->irq_pin, err); cy8ctmg110_probe()
253 client->irq = gpio_to_irq(ts->irq_pin); cy8ctmg110_probe()
258 ts->irq_pin, err); cy8ctmg110_probe()
264 "touch_reset_key", ts); cy8ctmg110_probe()
275 i2c_set_clientdata(client, ts); cy8ctmg110_probe()
280 free_irq(client->irq, ts); cy8ctmg110_probe()
282 gpio_free(ts->irq_pin); cy8ctmg110_probe()
284 cy8ctmg110_set_sleepmode(ts, true); cy8ctmg110_probe()
285 cy8ctmg110_power(ts, false); cy8ctmg110_probe()
286 if (ts->reset_pin) cy8ctmg110_probe()
287 gpio_free(ts->reset_pin); cy8ctmg110_probe()
290 kfree(ts); cy8ctmg110_probe()
297 struct cy8ctmg110 *ts = i2c_get_clientdata(client); cy8ctmg110_suspend() local
302 cy8ctmg110_set_sleepmode(ts, true); cy8ctmg110_suspend()
303 cy8ctmg110_power(ts, false); cy8ctmg110_suspend()
311 struct cy8ctmg110 *ts = i2c_get_clientdata(client); cy8ctmg110_resume() local
316 cy8ctmg110_power(ts, true); cy8ctmg110_resume()
317 cy8ctmg110_set_sleepmode(ts, false); cy8ctmg110_resume()
326 struct cy8ctmg110 *ts = i2c_get_clientdata(client); cy8ctmg110_remove() local
328 cy8ctmg110_set_sleepmode(ts, true); cy8ctmg110_remove()
329 cy8ctmg110_power(ts, false); cy8ctmg110_remove()
331 free_irq(client->irq, ts); cy8ctmg110_remove()
332 input_unregister_device(ts->input); cy8ctmg110_remove()
333 gpio_free(ts->irq_pin); cy8ctmg110_remove()
334 if (ts->reset_pin) cy8ctmg110_remove()
335 gpio_free(ts->reset_pin); cy8ctmg110_remove()
336 kfree(ts); cy8ctmg110_remove()
H A Dauo-pixcir-ts.c33 #include <linux/input/auo-pixcir-ts.h>
134 static int auo_pixcir_collect_data(struct auo_pixcir_ts *ts, auo_pixcir_collect_data() argument
137 struct i2c_client *client = ts->client; auo_pixcir_collect_data()
138 const struct auo_pixcir_ts_platdata *pdata = ts->pdata; auo_pixcir_collect_data()
183 struct auo_pixcir_ts *ts = dev_id; auo_pixcir_interrupt() local
184 const struct auo_pixcir_ts_platdata *pdata = ts->pdata; auo_pixcir_interrupt()
191 while (!ts->stopped) { auo_pixcir_interrupt()
194 if (ts->touch_ind_mode) { auo_pixcir_interrupt()
196 input_mt_sync(ts->input); auo_pixcir_interrupt()
197 input_report_key(ts->input, BTN_TOUCH, 0); auo_pixcir_interrupt()
198 input_sync(ts->input); auo_pixcir_interrupt()
203 ret = auo_pixcir_collect_data(ts, point); auo_pixcir_interrupt()
206 if (!ts->touch_ind_mode) auo_pixcir_interrupt()
209 wait_event_timeout(ts->wait, ts->stopped, auo_pixcir_interrupt()
216 input_report_abs(ts->input, ABS_MT_POSITION_X, auo_pixcir_interrupt()
218 input_report_abs(ts->input, ABS_MT_POSITION_Y, auo_pixcir_interrupt()
220 input_report_abs(ts->input, ABS_MT_TOUCH_MAJOR, auo_pixcir_interrupt()
222 input_report_abs(ts->input, ABS_MT_TOUCH_MINOR, auo_pixcir_interrupt()
224 input_report_abs(ts->input, ABS_MT_ORIENTATION, auo_pixcir_interrupt()
226 input_mt_sync(ts->input); auo_pixcir_interrupt()
239 input_report_key(ts->input, BTN_TOUCH, fingers > 0); auo_pixcir_interrupt()
242 input_report_abs(ts->input, ABS_X, point[abs].coord_x); auo_pixcir_interrupt()
243 input_report_abs(ts->input, ABS_Y, point[abs].coord_y); auo_pixcir_interrupt()
246 input_sync(ts->input); auo_pixcir_interrupt()
249 if (!ts->touch_ind_mode) auo_pixcir_interrupt()
252 wait_event_timeout(ts->wait, ts->stopped, auo_pixcir_interrupt()
266 static int auo_pixcir_power_mode(struct auo_pixcir_ts *ts, int mode) auo_pixcir_power_mode() argument
268 struct i2c_client *client = ts->client; auo_pixcir_power_mode()
291 static int auo_pixcir_int_config(struct auo_pixcir_ts *ts, auo_pixcir_int_config() argument
294 struct i2c_client *client = ts->client; auo_pixcir_int_config()
295 const struct auo_pixcir_ts_platdata *pdata = ts->pdata; auo_pixcir_int_config()
317 ts->touch_ind_mode = pdata->int_setting == AUO_PIXCIR_INT_TOUCH_IND; auo_pixcir_int_config()
323 static int auo_pixcir_int_toggle(struct auo_pixcir_ts *ts, bool enable) auo_pixcir_int_toggle() argument
325 struct i2c_client *client = ts->client; auo_pixcir_int_toggle()
351 static int auo_pixcir_start(struct auo_pixcir_ts *ts) auo_pixcir_start() argument
353 struct i2c_client *client = ts->client; auo_pixcir_start()
356 ret = auo_pixcir_power_mode(ts, AUO_PIXCIR_POWER_ACTIVE); auo_pixcir_start()
363 ts->stopped = false; auo_pixcir_start()
367 ret = auo_pixcir_int_toggle(ts, 1); auo_pixcir_start()
378 static int auo_pixcir_stop(struct auo_pixcir_ts *ts) auo_pixcir_stop() argument
380 struct i2c_client *client = ts->client; auo_pixcir_stop()
383 ret = auo_pixcir_int_toggle(ts, 0); auo_pixcir_stop()
392 ts->stopped = true; auo_pixcir_stop()
394 wake_up(&ts->wait); auo_pixcir_stop()
396 return auo_pixcir_power_mode(ts, AUO_PIXCIR_POWER_DEEP_SLEEP); auo_pixcir_stop()
401 struct auo_pixcir_ts *ts = input_get_drvdata(dev); auo_pixcir_input_open() local
404 ret = auo_pixcir_start(ts); auo_pixcir_input_open()
413 struct auo_pixcir_ts *ts = input_get_drvdata(dev); auo_pixcir_input_close() local
415 auo_pixcir_stop(ts); auo_pixcir_input_close()
423 struct auo_pixcir_ts *ts = i2c_get_clientdata(client); auo_pixcir_suspend() local
424 struct input_dev *input = ts->input; auo_pixcir_suspend()
435 ret = auo_pixcir_start(ts); auo_pixcir_suspend()
441 ret = auo_pixcir_power_mode(ts, AUO_PIXCIR_POWER_SLEEP); auo_pixcir_suspend()
443 ret = auo_pixcir_stop(ts); auo_pixcir_suspend()
455 struct auo_pixcir_ts *ts = i2c_get_clientdata(client); auo_pixcir_resume() local
456 struct input_dev *input = ts->input; auo_pixcir_resume()
466 ret = auo_pixcir_stop(ts); auo_pixcir_resume()
473 ret = auo_pixcir_start(ts); auo_pixcir_resume()
536 struct auo_pixcir_ts *ts = data; auo_pixcir_reset() local
538 gpio_set_value(ts->pdata->gpio_rst, 0); auo_pixcir_reset()
545 struct auo_pixcir_ts *ts; auo_pixcir_probe() local
557 ts = devm_kzalloc(&client->dev, auo_pixcir_probe()
559 if (!ts) auo_pixcir_probe()
568 ts->pdata = pdata; auo_pixcir_probe()
569 ts->client = client; auo_pixcir_probe()
570 ts->input = input_dev; auo_pixcir_probe()
571 ts->touch_ind_mode = 0; auo_pixcir_probe()
572 ts->stopped = true; auo_pixcir_probe()
573 init_waitqueue_head(&ts->wait); auo_pixcir_probe()
575 snprintf(ts->phys, sizeof(ts->phys), auo_pixcir_probe()
579 input_dev->phys = ts->phys; auo_pixcir_probe()
605 input_set_drvdata(ts->input, ts); auo_pixcir_probe()
624 error = devm_add_action(&client->dev, auo_pixcir_reset, ts); auo_pixcir_probe()
626 auo_pixcir_reset(ts); auo_pixcir_probe()
642 error = auo_pixcir_int_config(ts, pdata->int_setting); auo_pixcir_probe()
649 input_dev->name, ts); auo_pixcir_probe()
657 error = auo_pixcir_stop(ts); auo_pixcir_probe()
668 i2c_set_clientdata(client, ts); auo_pixcir_probe()
H A Dst1232.c34 #define ST1232_TS_NAME "st1232-ts"
58 static int st1232_ts_read_data(struct st1232_ts_data *ts) st1232_ts_read_data() argument
60 struct st1232_ts_finger *finger = ts->finger; st1232_ts_read_data()
61 struct i2c_client *client = ts->client; st1232_ts_read_data()
74 msg[1].addr = ts->client->addr; st1232_ts_read_data()
105 struct st1232_ts_data *ts = dev_id; st1232_ts_irq_handler() local
106 struct st1232_ts_finger *finger = ts->finger; st1232_ts_irq_handler()
107 struct input_dev *input_dev = ts->input_dev; st1232_ts_irq_handler()
111 ret = st1232_ts_read_data(ts); st1232_ts_irq_handler()
130 if (ts->low_latency_req.dev) { st1232_ts_irq_handler()
131 dev_pm_qos_remove_request(&ts->low_latency_req); st1232_ts_irq_handler()
132 ts->low_latency_req.dev = NULL; st1232_ts_irq_handler()
134 } else if (!ts->low_latency_req.dev) { st1232_ts_irq_handler()
136 dev_pm_qos_add_ancestor_request(&ts->client->dev, st1232_ts_irq_handler()
137 &ts->low_latency_req, st1232_ts_irq_handler()
148 static void st1232_ts_power(struct st1232_ts_data *ts, bool poweron) st1232_ts_power() argument
150 if (gpio_is_valid(ts->reset_gpio)) st1232_ts_power()
151 gpio_direction_output(ts->reset_gpio, poweron); st1232_ts_power()
157 struct st1232_ts_data *ts; st1232_ts_probe() local
172 ts = devm_kzalloc(&client->dev, sizeof(*ts), GFP_KERNEL); st1232_ts_probe()
173 if (!ts) st1232_ts_probe()
180 ts->client = client; st1232_ts_probe()
181 ts->input_dev = input_dev; st1232_ts_probe()
184 ts->reset_gpio = pdata->reset_gpio; st1232_ts_probe()
186 ts->reset_gpio = of_get_gpio(client->dev.of_node, 0); st1232_ts_probe()
188 ts->reset_gpio = -ENODEV; st1232_ts_probe()
190 if (gpio_is_valid(ts->reset_gpio)) { st1232_ts_probe()
191 error = devm_gpio_request(&client->dev, ts->reset_gpio, NULL); st1232_ts_probe()
195 ts->reset_gpio); st1232_ts_probe()
200 st1232_ts_power(ts, true); st1232_ts_probe()
217 client->name, ts); st1232_ts_probe()
223 error = input_register_device(ts->input_dev); st1232_ts_probe()
230 i2c_set_clientdata(client, ts); st1232_ts_probe()
238 struct st1232_ts_data *ts = i2c_get_clientdata(client); st1232_ts_remove() local
241 st1232_ts_power(ts, false); st1232_ts_remove()
249 struct st1232_ts_data *ts = i2c_get_clientdata(client); st1232_ts_suspend() local
255 st1232_ts_power(ts, false); st1232_ts_suspend()
264 struct st1232_ts_data *ts = i2c_get_clientdata(client); st1232_ts_resume() local
269 st1232_ts_power(ts, true); st1232_ts_resume()
H A DMakefile7 wm97xx-ts-y := wm97xx-core.o
10 obj-$(CONFIG_TOUCHSCREEN_88PM860X) += 88pm860x-ts.o
18 obj-$(CONFIG_TOUCHSCREEN_AUO_PIXCIR) += auo-pixcir-ts.o
28 obj-$(CONFIG_TOUCHSCREEN_DA9034) += da9034-ts.o
54 obj-$(CONFIG_TOUCHSCREEN_IPAQ_MICRO) += ipaq-micro-ts.o
62 obj-$(CONFIG_TOUCHSCREEN_STMPE) += stmpe-ts.o
63 obj-$(CONFIG_TOUCHSCREEN_SUN4I) += sun4i-ts.o
75 obj-$(CONFIG_TOUCHSCREEN_WM831X) += wm831x-ts.o
76 obj-$(CONFIG_TOUCHSCREEN_WM97XX) += wm97xx-ts.o
77 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o
78 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o
79 wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o
85 obj-$(CONFIG_TOUCHSCREEN_TPS6507X) += tps6507x-ts.o
H A Delants_i2c.c224 static int elants_i2c_calibrate(struct elants_data *ts) elants_i2c_calibrate() argument
226 struct i2c_client *client = ts->client; elants_i2c_calibrate()
234 ts->state = ELAN_WAIT_RECALIBRATION; elants_i2c_calibrate()
235 reinit_completion(&ts->cmd_done); elants_i2c_calibrate()
242 ret = wait_for_completion_interruptible_timeout(&ts->cmd_done, elants_i2c_calibrate()
245 ts->state = ELAN_STATE_NORMAL; elants_i2c_calibrate()
255 if (memcmp(rek_resp, ts->cmd_resp, sizeof(rek_resp))) { elants_i2c_calibrate()
258 (int)sizeof(ts->cmd_resp), ts->cmd_resp); elants_i2c_calibrate()
291 static int elants_i2c_query_fw_id(struct elants_data *ts) elants_i2c_query_fw_id() argument
293 struct i2c_client *client = ts->client; elants_i2c_query_fw_id()
302 ts->hw_version = elants_i2c_parse_version(resp); elants_i2c_query_fw_id()
303 if (ts->hw_version != 0xffff) elants_i2c_query_fw_id()
317 static int elants_i2c_query_fw_version(struct elants_data *ts) elants_i2c_query_fw_version() argument
319 struct i2c_client *client = ts->client; elants_i2c_query_fw_version()
328 ts->fw_version = elants_i2c_parse_version(resp); elants_i2c_query_fw_version()
329 if (ts->fw_version != 0x0000 && elants_i2c_query_fw_version()
330 ts->fw_version != 0xffff) elants_i2c_query_fw_version()
344 static int elants_i2c_query_test_version(struct elants_data *ts) elants_i2c_query_test_version() argument
346 struct i2c_client *client = ts->client; elants_i2c_query_test_version()
357 ts->test_version = version >> 8; elants_i2c_query_test_version()
358 ts->solution_version = version & 0xff; elants_i2c_query_test_version()
373 static int elants_i2c_query_bc_version(struct elants_data *ts) elants_i2c_query_bc_version() argument
375 struct i2c_client *client = ts->client; elants_i2c_query_bc_version()
391 ts->bc_version = version >> 8; elants_i2c_query_bc_version()
392 ts->iap_version = version & 0xff; elants_i2c_query_bc_version()
397 static int elants_i2c_query_ts_info(struct elants_data *ts) elants_i2c_query_ts_info() argument
399 struct i2c_client *client = ts->client; elants_i2c_query_ts_info()
474 ts->x_max = ELAN_TS_RESOLUTION(rows, osr); elants_i2c_query_ts_info()
475 ts->x_res = DIV_ROUND_CLOSEST(ts->x_max, phy_x); elants_i2c_query_ts_info()
476 ts->y_max = ELAN_TS_RESOLUTION(cols, osr); elants_i2c_query_ts_info()
477 ts->y_res = DIV_ROUND_CLOSEST(ts->y_max, phy_y); elants_i2c_query_ts_info()
498 static int elants_i2c_initialize(struct elants_data *ts) elants_i2c_initialize() argument
500 struct i2c_client *client = ts->client; elants_i2c_initialize()
529 ts->iap_mode = ELAN_IAP_OPERATIONAL; elants_i2c_initialize()
547 error = elants_i2c_query_fw_id(ts); elants_i2c_initialize()
549 error = elants_i2c_query_fw_version(ts); elants_i2c_initialize()
552 ts->iap_mode = ELAN_IAP_RECOVERY; elants_i2c_initialize()
554 elants_i2c_query_test_version(ts); elants_i2c_initialize()
555 elants_i2c_query_bc_version(ts); elants_i2c_initialize()
556 elants_i2c_query_ts_info(ts); elants_i2c_initialize()
695 static int elants_i2c_fw_update(struct elants_data *ts) elants_i2c_fw_update() argument
697 struct i2c_client *client = ts->client; elants_i2c_fw_update()
702 fw_name = kasprintf(GFP_KERNEL, "elants_i2c_%04x.bin", ts->hw_version); elants_i2c_fw_update()
725 ts->iap_mode == ELAN_IAP_RECOVERY); elants_i2c_fw_update()
728 ts->iap_mode = ELAN_IAP_RECOVERY; elants_i2c_fw_update()
732 error = elants_i2c_initialize(ts); elants_i2c_fw_update()
737 ts->iap_mode = ELAN_IAP_RECOVERY; elants_i2c_fw_update()
741 ts->iap_mode = ELAN_IAP_OPERATIONAL; elants_i2c_fw_update()
744 ts->state = ELAN_STATE_NORMAL; elants_i2c_fw_update()
749 elants_i2c_calibrate(ts); elants_i2c_fw_update()
759 static void elants_i2c_mt_event(struct elants_data *ts, u8 *buf) elants_i2c_mt_event() argument
761 struct input_dev *input = ts->input; elants_i2c_mt_event()
770 dev_dbg(&ts->client->dev, elants_i2c_mt_event()
784 dev_dbg(&ts->client->dev, "i=%d x=%d y=%d p=%d w=%d\n", elants_i2c_mt_event()
815 static void elants_i2c_event(struct elants_data *ts, u8 *buf) elants_i2c_event() argument
820 dev_warn(&ts->client->dev, elants_i2c_event()
825 dev_warn(&ts->client->dev, elants_i2c_event()
829 elants_i2c_mt_event(ts, buf); elants_i2c_event()
835 struct elants_data *ts = _dev; elants_i2c_irq() local
836 struct i2c_client *client = ts->client; elants_i2c_irq()
841 len = i2c_master_recv(client, ts->buf, sizeof(ts->buf)); elants_i2c_irq()
849 __func__, HEADER_SIZE, ts->buf); elants_i2c_irq()
851 switch (ts->state) { elants_i2c_irq()
853 if (ts->buf[FW_HDR_TYPE] == CMD_HEADER_REK) { elants_i2c_irq()
854 memcpy(ts->cmd_resp, ts->buf, sizeof(ts->cmd_resp)); elants_i2c_irq()
855 complete(&ts->cmd_done); elants_i2c_irq()
856 ts->state = ELAN_STATE_NORMAL; elants_i2c_irq()
861 if (ts->buf[FW_HDR_TYPE] != QUEUE_HEADER_NORMAL) elants_i2c_irq()
864 ts->state = ELAN_STATE_NORMAL; elants_i2c_irq()
869 switch (ts->buf[FW_HDR_TYPE]) { elants_i2c_irq()
876 if (memcmp(ts->buf, wait_packet, sizeof(wait_packet))) { elants_i2c_irq()
879 HEADER_SIZE, ts->buf); elants_i2c_irq()
881 ts->state = ELAN_WAIT_QUEUE_HEADER; elants_i2c_irq()
887 elants_i2c_event(ts, &ts->buf[HEADER_SIZE]); elants_i2c_irq()
891 report_count = ts->buf[FW_HDR_COUNT]; elants_i2c_irq()
895 HEADER_SIZE, ts->buf); elants_i2c_irq()
899 report_len = ts->buf[FW_HDR_LENGTH] / report_count; elants_i2c_irq()
903 HEADER_SIZE, ts->buf); elants_i2c_irq()
908 u8 *buf = ts->buf + HEADER_SIZE + elants_i2c_irq()
910 elants_i2c_event(ts, buf); elants_i2c_irq()
916 HEADER_SIZE, ts->buf); elants_i2c_irq()
934 struct elants_data *ts = i2c_get_clientdata(client); calibrate_store() local
937 error = mutex_lock_interruptible(&ts->sysfs_mutex); calibrate_store()
941 error = elants_i2c_calibrate(ts); calibrate_store()
943 mutex_unlock(&ts->sysfs_mutex); calibrate_store()
952 struct elants_data *ts = i2c_get_clientdata(client); write_update_fw() local
955 error = mutex_lock_interruptible(&ts->sysfs_mutex); write_update_fw()
959 error = elants_i2c_fw_update(ts); write_update_fw()
962 mutex_unlock(&ts->sysfs_mutex); write_update_fw()
970 struct elants_data *ts = i2c_get_clientdata(client); show_iap_mode() local
973 ts->iap_mode == ELAN_IAP_OPERATIONAL ? show_iap_mode()
1005 struct elants_data *ts = i2c_get_clientdata(client); elants_version_attribute_show() local
1008 u8 *field = (u8 *)((char *)ts + attr->field_offset); elants_version_attribute_show()
1050 struct elants_data *ts = _data; elants_i2c_remove_sysfs_group() local
1052 sysfs_remove_group(&ts->client->dev.kobj, &elants_attribute_group); elants_i2c_remove_sysfs_group()
1059 struct elants_data *ts; elants_i2c_probe() local
1076 ts = devm_kzalloc(&client->dev, sizeof(struct elants_data), GFP_KERNEL); elants_i2c_probe()
1077 if (!ts) elants_i2c_probe()
1080 mutex_init(&ts->sysfs_mutex); elants_i2c_probe()
1081 init_completion(&ts->cmd_done); elants_i2c_probe()
1083 ts->client = client; elants_i2c_probe()
1084 i2c_set_clientdata(client, ts); elants_i2c_probe()
1086 error = elants_i2c_initialize(ts); elants_i2c_probe()
1092 ts->input = devm_input_allocate_device(&client->dev); elants_i2c_probe()
1093 if (!ts->input) { elants_i2c_probe()
1098 ts->input->name = "Elan Touchscreen"; elants_i2c_probe()
1099 ts->input->id.bustype = BUS_I2C; elants_i2c_probe()
1101 __set_bit(BTN_TOUCH, ts->input->keybit); elants_i2c_probe()
1102 __set_bit(EV_ABS, ts->input->evbit); elants_i2c_probe()
1103 __set_bit(EV_KEY, ts->input->evbit); elants_i2c_probe()
1106 input_set_abs_params(ts->input, ABS_X, 0, ts->x_max, 0, 0); elants_i2c_probe()
1107 input_set_abs_params(ts->input, ABS_Y, 0, ts->y_max, 0, 0); elants_i2c_probe()
1108 input_set_abs_params(ts->input, ABS_PRESSURE, 0, 255, 0, 0); elants_i2c_probe()
1109 input_abs_set_res(ts->input, ABS_X, ts->x_res); elants_i2c_probe()
1110 input_abs_set_res(ts->input, ABS_Y, ts->y_res); elants_i2c_probe()
1113 error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM, elants_i2c_probe()
1121 input_set_abs_params(ts->input, ABS_MT_POSITION_X, 0, ts->x_max, 0, 0); elants_i2c_probe()
1122 input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, ts->y_max, 0, 0); elants_i2c_probe()
1123 input_set_abs_params(ts->input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); elants_i2c_probe()
1124 input_set_abs_params(ts->input, ABS_MT_PRESSURE, 0, 255, 0, 0); elants_i2c_probe()
1125 input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res); elants_i2c_probe()
1126 input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res); elants_i2c_probe()
1128 input_set_drvdata(ts->input, ts); elants_i2c_probe()
1130 error = input_register_device(ts->input); elants_i2c_probe()
1146 client->name, ts); elants_i2c_probe()
1167 elants_i2c_remove_sysfs_group, ts); elants_i2c_probe()
1169 elants_i2c_remove_sysfs_group(ts); elants_i2c_probe()
1182 struct elants_data *ts = i2c_get_clientdata(client); elants_i2c_suspend() local
1188 if (ts->iap_mode != ELAN_IAP_OPERATIONAL) elants_i2c_suspend()
1203 ts->wake_irq_enabled = (enable_irq_wake(client->irq) == 0); elants_i2c_suspend()
1211 struct elants_data *ts = i2c_get_clientdata(client); elants_i2c_resume() local
1216 if (device_may_wakeup(dev) && ts->wake_irq_enabled) elants_i2c_resume()
1228 ts->state = ELAN_STATE_NORMAL; elants_i2c_resume()
H A Dad7879-i2c.c60 struct ad7879 *ts; ad7879_i2c_probe() local
68 ts = ad7879_probe(&client->dev, AD7879_DEVID, client->irq, ad7879_i2c_probe()
70 if (IS_ERR(ts)) ad7879_i2c_probe()
71 return PTR_ERR(ts); ad7879_i2c_probe()
73 i2c_set_clientdata(client, ts); ad7879_i2c_probe()
80 struct ad7879 *ts = i2c_get_clientdata(client); ad7879_i2c_remove() local
82 ad7879_remove(ts); ad7879_i2c_remove()
H A Dcyttsp_i2c.c42 struct cyttsp *ts; cyttsp_i2c_probe() local
49 ts = cyttsp_probe(&cyttsp_i2c_bus_ops, &client->dev, client->irq, cyttsp_i2c_probe()
52 if (IS_ERR(ts)) cyttsp_i2c_probe()
53 return PTR_ERR(ts); cyttsp_i2c_probe()
55 i2c_set_clientdata(client, ts); cyttsp_i2c_probe()
61 struct cyttsp *ts = i2c_get_clientdata(client); cyttsp_i2c_remove() local
63 cyttsp_remove(ts); cyttsp_i2c_remove()
H A Dpixcir_i2c_ts.c108 static void pixcir_ts_report(struct pixcir_i2c_ts_data *ts, pixcir_ts_report() argument
115 struct device *dev = &ts->client->dev; pixcir_ts_report()
116 const struct pixcir_i2c_chip_data *chip = &ts->pdata->chip; pixcir_ts_report()
129 input_mt_assign_slots(ts->input, slots, pos, n, 0); pixcir_ts_report()
136 slot = input_mt_get_slot_by_key(ts->input, touch->id); pixcir_ts_report()
146 input_mt_slot(ts->input, slot); pixcir_ts_report()
147 input_mt_report_slot_state(ts->input, pixcir_ts_report()
150 input_event(ts->input, EV_ABS, ABS_MT_POSITION_X, touch->x); pixcir_ts_report()
151 input_event(ts->input, EV_ABS, ABS_MT_POSITION_Y, touch->y); pixcir_ts_report()
157 input_mt_sync_frame(ts->input); pixcir_ts_report()
158 input_sync(ts->input); pixcir_ts_report()
192 static int pixcir_set_power_mode(struct pixcir_i2c_ts_data *ts, pixcir_set_power_mode() argument
195 struct device *dev = &ts->client->dev; pixcir_set_power_mode()
198 ret = i2c_smbus_read_byte_data(ts->client, PIXCIR_REG_POWER_MODE); pixcir_set_power_mode()
211 ret = i2c_smbus_write_byte_data(ts->client, PIXCIR_REG_POWER_MODE, ret); pixcir_set_power_mode()
226 static int pixcir_set_int_mode(struct pixcir_i2c_ts_data *ts, pixcir_set_int_mode() argument
229 struct device *dev = &ts->client->dev; pixcir_set_int_mode()
232 ret = i2c_smbus_read_byte_data(ts->client, PIXCIR_REG_INT_MODE); pixcir_set_int_mode()
247 ret = i2c_smbus_write_byte_data(ts->client, PIXCIR_REG_INT_MODE, ret); pixcir_set_int_mode()
260 static int pixcir_int_enable(struct pixcir_i2c_ts_data *ts, bool enable) pixcir_int_enable() argument
262 struct device *dev = &ts->client->dev; pixcir_int_enable()
265 ret = i2c_smbus_read_byte_data(ts->client, PIXCIR_REG_INT_MODE); pixcir_int_enable()
277 ret = i2c_smbus_write_byte_data(ts->client, PIXCIR_REG_INT_MODE, ret); pixcir_int_enable()
287 static int pixcir_start(struct pixcir_i2c_ts_data *ts) pixcir_start() argument
289 struct device *dev = &ts->client->dev; pixcir_start()
293 error = pixcir_set_int_mode(ts, PIXCIR_INT_LEVEL_TOUCH, 0); pixcir_start()
299 ts->running = true; pixcir_start()
303 error = pixcir_int_enable(ts, true); pixcir_start()
313 static int pixcir_stop(struct pixcir_i2c_ts_data *ts) pixcir_stop() argument
318 error = pixcir_int_enable(ts, false); pixcir_stop()
320 dev_err(&ts->client->dev, pixcir_stop()
327 ts->running = false; pixcir_stop()
331 synchronize_irq(ts->client->irq); pixcir_stop()
338 struct pixcir_i2c_ts_data *ts = input_get_drvdata(dev); pixcir_input_open() local
340 return pixcir_start(ts); pixcir_input_open()
345 struct pixcir_i2c_ts_data *ts = input_get_drvdata(dev); pixcir_input_close() local
347 pixcir_stop(ts); pixcir_input_close()
353 struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); pixcir_i2c_ts_suspend() local
354 struct input_dev *input = ts->input; pixcir_i2c_ts_suspend()
361 ret = pixcir_start(ts); pixcir_i2c_ts_suspend()
370 ret = pixcir_stop(ts); pixcir_i2c_ts_suspend()
382 struct pixcir_i2c_ts_data *ts = i2c_get_clientdata(client); pixcir_i2c_ts_resume() local
383 struct input_dev *input = ts->input; pixcir_i2c_ts_resume()
392 ret = pixcir_stop(ts); pixcir_i2c_ts_resume()
399 ret = pixcir_start(ts); pixcir_i2c_ts_resume()
H A Dcyttsp4_i2c.c43 struct cyttsp4 *ts; cyttsp4_i2c_probe() local
50 ts = cyttsp4_probe(&cyttsp4_i2c_bus_ops, &client->dev, client->irq, cyttsp4_i2c_probe()
53 if (IS_ERR(ts)) cyttsp4_i2c_probe()
54 return PTR_ERR(ts); cyttsp4_i2c_probe()
61 struct cyttsp4 *ts = i2c_get_clientdata(client); cyttsp4_i2c_remove() local
63 cyttsp4_remove(ts); cyttsp4_i2c_remove()
H A Dad7879-spi.c115 struct ad7879 *ts; ad7879_spi_probe() local
131 ts = ad7879_probe(&spi->dev, AD7879_DEVID, spi->irq, &ad7879_spi_bus_ops); ad7879_spi_probe()
132 if (IS_ERR(ts)) ad7879_spi_probe()
133 return PTR_ERR(ts); ad7879_spi_probe()
135 spi_set_drvdata(spi, ts); ad7879_spi_probe()
142 struct ad7879 *ts = spi_get_drvdata(spi); ad7879_spi_remove() local
144 ad7879_remove(ts); ad7879_spi_remove()
H A Degalax_ts.c69 struct egalax_ts *ts = dev_id; egalax_ts_interrupt() local
70 struct input_dev *input_dev = ts->input_dev; egalax_ts_interrupt()
71 struct i2c_client *client = ts->client; egalax_ts_interrupt()
170 struct egalax_ts *ts; egalax_ts_probe() local
174 ts = devm_kzalloc(&client->dev, sizeof(struct egalax_ts), GFP_KERNEL); egalax_ts_probe()
175 if (!ts) { egalax_ts_probe()
186 ts->client = client; egalax_ts_probe()
187 ts->input_dev = input_dev; egalax_ts_probe()
217 input_set_drvdata(input_dev, ts); egalax_ts_probe()
222 "egalax_ts", ts); egalax_ts_probe()
228 error = input_register_device(ts->input_dev); egalax_ts_probe()
232 i2c_set_clientdata(client, ts); egalax_ts_probe()
H A Dcyttsp_spi.c150 struct cyttsp *ts; cyttsp_spi_probe() local
163 ts = cyttsp_probe(&cyttsp_spi_bus_ops, &spi->dev, spi->irq, cyttsp_spi_probe()
165 if (IS_ERR(ts)) cyttsp_spi_probe()
166 return PTR_ERR(ts); cyttsp_spi_probe()
168 spi_set_drvdata(spi, ts); cyttsp_spi_probe()
175 struct cyttsp *ts = spi_get_drvdata(spi); cyttsp_spi_remove() local
177 cyttsp_remove(ts); cyttsp_spi_remove()
H A Dcyttsp4_spi.c158 struct cyttsp4 *ts; cyttsp4_spi_probe() local
171 ts = cyttsp4_probe(&cyttsp_spi_bus_ops, &spi->dev, spi->irq, cyttsp4_spi_probe()
174 return PTR_ERR_OR_ZERO(ts); cyttsp4_spi_probe()
179 struct cyttsp4 *ts = spi_get_drvdata(spi); cyttsp4_spi_remove() local
180 cyttsp4_remove(ts); cyttsp4_spi_remove()
H A Dcyttsp4_core.h451 static inline int cyttsp4_adap_read(struct cyttsp4 *ts, u16 addr, int size, cyttsp4_adap_read() argument
454 return ts->bus_ops->read(ts->dev, ts->xfer_buf, addr, size, buf); cyttsp4_adap_read()
457 static inline int cyttsp4_adap_write(struct cyttsp4 *ts, u16 addr, int size, cyttsp4_adap_write() argument
460 return ts->bus_ops->write(ts->dev, ts->xfer_buf, addr, size, buf); cyttsp4_adap_write()
465 extern int cyttsp4_remove(struct cyttsp4 *ts);
/linux-4.1.27/drivers/mfd/
H A Ducb1x00-ts.c57 static inline void ucb1x00_ts_evt_add(struct ucb1x00_ts *ts, u16 pressure, u16 x, u16 y) ucb1x00_ts_evt_add() argument
59 struct input_dev *idev = ts->idev; ucb1x00_ts_evt_add()
68 static inline void ucb1x00_ts_event_release(struct ucb1x00_ts *ts) ucb1x00_ts_event_release() argument
70 struct input_dev *idev = ts->idev; ucb1x00_ts_event_release()
80 static inline void ucb1x00_ts_mode_int(struct ucb1x00_ts *ts) ucb1x00_ts_mode_int() argument
82 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_mode_int()
92 static inline unsigned int ucb1x00_ts_read_pressure(struct ucb1x00_ts *ts) ucb1x00_ts_read_pressure() argument
95 ucb1x00_io_write(ts->ucb, COLLIE_TC35143_GPIO_TBL_CHK, 0); ucb1x00_ts_read_pressure()
96 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_pressure()
102 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_AD2, ts->adcsync); ucb1x00_ts_read_pressure()
104 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_pressure()
109 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_TSPY, ts->adcsync); ucb1x00_ts_read_pressure()
119 static inline unsigned int ucb1x00_ts_read_xpos(struct ucb1x00_ts *ts) ucb1x00_ts_read_xpos() argument
122 ucb1x00_io_write(ts->ucb, 0, COLLIE_TC35143_GPIO_TBL_CHK); ucb1x00_ts_read_xpos()
124 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_xpos()
127 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_xpos()
131 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_xpos()
137 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_TSPY, ts->adcsync); ucb1x00_ts_read_xpos()
146 static inline unsigned int ucb1x00_ts_read_ypos(struct ucb1x00_ts *ts) ucb1x00_ts_read_ypos() argument
149 ucb1x00_io_write(ts->ucb, 0, COLLIE_TC35143_GPIO_TBL_CHK); ucb1x00_ts_read_ypos()
151 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_ypos()
154 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_ypos()
159 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_ypos()
165 return ucb1x00_adc_read(ts->ucb, UCB_ADC_INP_TSPX, ts->adcsync); ucb1x00_ts_read_ypos()
172 static inline unsigned int ucb1x00_ts_read_xres(struct ucb1x00_ts *ts) ucb1x00_ts_read_xres() argument
174 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_xres()
177 return ucb1x00_adc_read(ts->ucb, 0, ts->adcsync); ucb1x00_ts_read_xres()
184 static inline unsigned int ucb1x00_ts_read_yres(struct ucb1x00_ts *ts) ucb1x00_ts_read_yres() argument
186 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, ucb1x00_ts_read_yres()
189 return ucb1x00_adc_read(ts->ucb, 0, ts->adcsync); ucb1x00_ts_read_yres()
192 static inline int ucb1x00_ts_pen_down(struct ucb1x00_ts *ts) ucb1x00_ts_pen_down() argument
194 unsigned int val = ucb1x00_reg_read(ts->ucb, UCB_TS_CR); ucb1x00_ts_pen_down()
209 struct ucb1x00_ts *ts = _ts; ucb1x00_thread() local
215 add_wait_queue(&ts->irq_wait, &wait); ucb1x00_thread()
223 ucb1x00_adc_enable(ts->ucb); ucb1x00_thread()
225 x = ucb1x00_ts_read_xpos(ts); ucb1x00_thread()
226 y = ucb1x00_ts_read_ypos(ts); ucb1x00_thread()
227 p = ucb1x00_ts_read_pressure(ts); ucb1x00_thread()
232 ucb1x00_ts_mode_int(ts); ucb1x00_thread()
233 ucb1x00_adc_disable(ts->ucb); ucb1x00_thread()
237 ucb1x00_enable(ts->ucb); ucb1x00_thread()
240 if (ucb1x00_ts_pen_down(ts)) { ucb1x00_thread()
243 spin_lock_irq(&ts->irq_lock); ucb1x00_thread()
244 if (ts->irq_disabled) { ucb1x00_thread()
245 ts->irq_disabled = 0; ucb1x00_thread()
246 enable_irq(ts->ucb->irq_base + UCB_IRQ_TSPX); ucb1x00_thread()
248 spin_unlock_irq(&ts->irq_lock); ucb1x00_thread()
249 ucb1x00_disable(ts->ucb); ucb1x00_thread()
256 ucb1x00_ts_event_release(ts); ucb1x00_thread()
262 ucb1x00_disable(ts->ucb); ucb1x00_thread()
270 ucb1x00_ts_evt_add(ts, p, x, y); ucb1x00_thread()
281 remove_wait_queue(&ts->irq_wait, &wait); ucb1x00_thread()
283 ts->rtask = NULL; ucb1x00_thread()
293 struct ucb1x00_ts *ts = id; ucb1x00_ts_irq() local
295 spin_lock(&ts->irq_lock); ucb1x00_ts_irq()
296 ts->irq_disabled = 1; ucb1x00_ts_irq()
297 disable_irq_nosync(ts->ucb->irq_base + UCB_IRQ_TSPX); ucb1x00_ts_irq()
298 spin_unlock(&ts->irq_lock); ucb1x00_ts_irq()
299 wake_up(&ts->irq_wait); ucb1x00_ts_irq()
306 struct ucb1x00_ts *ts = input_get_drvdata(idev); ucb1x00_ts_open() local
310 BUG_ON(ts->rtask); ucb1x00_ts_open()
317 ts->irq_disabled = 0; ucb1x00_ts_open()
319 init_waitqueue_head(&ts->irq_wait); ucb1x00_ts_open()
320 ret = request_irq(ts->ucb->irq_base + UCB_IRQ_TSPX, ucb1x00_ts_irq, ucb1x00_ts_open()
321 flags, "ucb1x00-ts", ts); ucb1x00_ts_open()
329 ucb1x00_adc_enable(ts->ucb); ucb1x00_ts_open()
330 ts->x_res = ucb1x00_ts_read_xres(ts); ucb1x00_ts_open()
331 ts->y_res = ucb1x00_ts_read_yres(ts); ucb1x00_ts_open()
332 ucb1x00_adc_disable(ts->ucb); ucb1x00_ts_open()
334 ts->rtask = kthread_run(ucb1x00_thread, ts, "ktsd"); ucb1x00_ts_open()
335 if (!IS_ERR(ts->rtask)) { ucb1x00_ts_open()
338 free_irq(ts->ucb->irq_base + UCB_IRQ_TSPX, ts); ucb1x00_ts_open()
339 ts->rtask = NULL; ucb1x00_ts_open()
352 struct ucb1x00_ts *ts = input_get_drvdata(idev); ucb1x00_ts_close() local
354 if (ts->rtask) ucb1x00_ts_close()
355 kthread_stop(ts->rtask); ucb1x00_ts_close()
357 ucb1x00_enable(ts->ucb); ucb1x00_ts_close()
358 free_irq(ts->ucb->irq_base + UCB_IRQ_TSPX, ts); ucb1x00_ts_close()
359 ucb1x00_reg_write(ts->ucb, UCB_TS_CR, 0); ucb1x00_ts_close()
360 ucb1x00_disable(ts->ucb); ucb1x00_ts_close()
369 struct ucb1x00_ts *ts; ucb1x00_ts_add() local
373 ts = kzalloc(sizeof(struct ucb1x00_ts), GFP_KERNEL); ucb1x00_ts_add()
375 if (!ts || !idev) { ucb1x00_ts_add()
380 ts->ucb = dev->ucb; ucb1x00_ts_add()
381 ts->idev = idev; ucb1x00_ts_add()
382 ts->adcsync = adcsync ? UCB_SYNC : UCB_NOSYNC; ucb1x00_ts_add()
383 spin_lock_init(&ts->irq_lock); ucb1x00_ts_add()
386 idev->id.product = ts->ucb->id; ucb1x00_ts_add()
389 idev->dev.parent = &ts->ucb->dev; ucb1x00_ts_add()
394 input_set_drvdata(idev, ts); ucb1x00_ts_add()
396 ucb1x00_adc_enable(ts->ucb); ucb1x00_ts_add()
397 ts->x_res = ucb1x00_ts_read_xres(ts); ucb1x00_ts_add()
398 ts->y_res = ucb1x00_ts_read_yres(ts); ucb1x00_ts_add()
399 ucb1x00_adc_disable(ts->ucb); ucb1x00_ts_add()
401 input_set_abs_params(idev, ABS_X, 0, ts->x_res, 0, 0); ucb1x00_ts_add()
402 input_set_abs_params(idev, ABS_Y, 0, ts->y_res, 0, 0); ucb1x00_ts_add()
409 dev->priv = ts; ucb1x00_ts_add()
415 kfree(ts); ucb1x00_ts_add()
421 struct ucb1x00_ts *ts = dev->priv; ucb1x00_ts_remove() local
423 input_unregister_device(ts->idev); ucb1x00_ts_remove()
424 kfree(ts); ucb1x00_ts_remove()
/linux-4.1.27/include/linux/
H A Dtimekeeping.h13 extern int do_settimeofday64(const struct timespec64 *ts);
29 extern void getrawmonotonic64(struct timespec64 *ts);
30 extern void ktime_get_ts64(struct timespec64 *ts);
36 extern void getboottime64(struct timespec64 *ts);
42 static inline int do_settimeofday(const struct timespec *ts) do_settimeofday() argument
44 return do_settimeofday64(ts); do_settimeofday()
47 static inline int __getnstimeofday(struct timespec *ts) __getnstimeofday() argument
49 return __getnstimeofday64(ts); __getnstimeofday()
52 static inline void getnstimeofday(struct timespec *ts) getnstimeofday() argument
54 getnstimeofday64(ts); getnstimeofday()
57 static inline void ktime_get_ts(struct timespec *ts) ktime_get_ts() argument
59 ktime_get_ts64(ts); ktime_get_ts()
62 static inline void ktime_get_real_ts(struct timespec *ts) ktime_get_real_ts() argument
64 getnstimeofday64(ts); ktime_get_real_ts()
67 static inline void getrawmonotonic(struct timespec *ts) getrawmonotonic() argument
69 getrawmonotonic64(ts); getrawmonotonic()
77 static inline void getboottime(struct timespec *ts) getboottime() argument
79 return getboottime64(ts); getboottime()
85 static inline int do_settimeofday(const struct timespec *ts) do_settimeofday() argument
89 ts64 = timespec_to_timespec64(*ts); do_settimeofday()
93 static inline int __getnstimeofday(struct timespec *ts) __getnstimeofday() argument
98 *ts = timespec64_to_timespec(ts64); __getnstimeofday()
102 static inline void getnstimeofday(struct timespec *ts) getnstimeofday() argument
107 *ts = timespec64_to_timespec(ts64); getnstimeofday()
110 static inline void ktime_get_ts(struct timespec *ts) ktime_get_ts() argument
115 *ts = timespec64_to_timespec(ts64); ktime_get_ts()
118 static inline void ktime_get_real_ts(struct timespec *ts) ktime_get_real_ts() argument
123 *ts = timespec64_to_timespec(ts64); ktime_get_real_ts()
126 static inline void getrawmonotonic(struct timespec *ts) getrawmonotonic() argument
131 *ts = timespec64_to_timespec(ts64); getrawmonotonic()
139 static inline void getboottime(struct timespec *ts) getboottime() argument
144 *ts = timespec64_to_timespec(ts64); getboottime()
148 #define do_posix_clock_monotonic_gettime(ts) ktime_get_ts(ts)
149 #define ktime_get_real_ts64(ts) getnstimeofday64(ts)
233 static inline void get_monotonic_boottime(struct timespec *ts) get_monotonic_boottime() argument
235 *ts = ktime_to_timespec(ktime_get_boottime()); get_monotonic_boottime()
238 static inline void get_monotonic_boottime64(struct timespec64 *ts) get_monotonic_boottime64() argument
240 *ts = ktime_to_timespec64(ktime_get_boottime()); get_monotonic_boottime64()
243 static inline void timekeeping_clocktai(struct timespec *ts) timekeeping_clocktai() argument
245 *ts = ktime_to_timespec(ktime_get_clocktai()); timekeeping_clocktai()
267 extern void read_persistent_clock(struct timespec *ts);
268 extern void read_persistent_clock64(struct timespec64 *ts);
269 extern void read_boot_clock(struct timespec *ts);
270 extern void read_boot_clock64(struct timespec64 *ts);
H A Dpps_kernel.h103 struct pps_event_time *ts, int event, void *data);
108 struct timespec ts) timespec_to_pps_ktime()
110 kt->sec = ts.tv_sec; timespec_to_pps_ktime()
111 kt->nsec = ts.tv_nsec; timespec_to_pps_ktime()
116 static inline void pps_get_ts(struct pps_event_time *ts) pps_get_ts() argument
118 getnstime_raw_and_real(&ts->ts_raw, &ts->ts_real); pps_get_ts()
123 static inline void pps_get_ts(struct pps_event_time *ts) pps_get_ts() argument
125 getnstimeofday(&ts->ts_real); pps_get_ts()
131 static inline void pps_sub_ts(struct pps_event_time *ts, struct timespec delta) pps_sub_ts() argument
133 ts->ts_real = timespec_sub(ts->ts_real, delta); pps_sub_ts()
135 ts->ts_raw = timespec_sub(ts->ts_raw, delta); pps_sub_ts()
107 timespec_to_pps_ktime(struct pps_ktime *kt, struct timespec ts) timespec_to_pps_ktime() argument
H A Dtime64.h41 static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) timespec_to_timespec64() argument
43 return ts; timespec_to_timespec64()
69 static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) timespec_to_timespec64() argument
73 ret.tv_sec = ts.tv_sec; timespec_to_timespec64()
74 ret.tv_nsec = ts.tv_nsec; timespec_to_timespec64()
98 extern void set_normalized_timespec64(struct timespec64 *ts, time64_t sec, s64 nsec);
133 static inline bool timespec64_valid(const struct timespec64 *ts) timespec64_valid() argument
136 if (ts->tv_sec < 0) timespec64_valid()
139 if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC) timespec64_valid()
144 static inline bool timespec64_valid_strict(const struct timespec64 *ts) timespec64_valid_strict() argument
146 if (!timespec64_valid(ts)) timespec64_valid_strict()
149 if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX) timespec64_valid_strict()
156 * @ts: pointer to the timespec64 variable to be converted
161 static inline s64 timespec64_to_ns(const struct timespec64 *ts) timespec64_to_ns() argument
163 return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; timespec64_to_ns()
H A Dtime.h57 extern void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec);
92 static inline bool timespec_valid(const struct timespec *ts) timespec_valid() argument
95 if (ts->tv_sec < 0) timespec_valid()
98 if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC) timespec_valid()
103 static inline bool timespec_valid_strict(const struct timespec *ts) timespec_valid_strict() argument
105 if (!timespec_valid(ts)) timespec_valid_strict()
108 if ((unsigned long long)ts->tv_sec >= KTIME_SEC_MAX) timespec_valid_strict()
186 * @ts: pointer to the timespec variable to be converted
191 static inline s64 timespec_to_ns(const struct timespec *ts) timespec_to_ns() argument
193 return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec; timespec_to_ns()
198 * @ts: pointer to the timeval variable to be converted
H A Dktime.h81 static inline ktime_t timespec_to_ktime(struct timespec ts) timespec_to_ktime() argument
83 return ktime_set(ts.tv_sec, ts.tv_nsec); timespec_to_ktime()
87 static inline ktime_t timespec64_to_ktime(struct timespec64 ts) timespec64_to_ktime() argument
89 return ktime_set(ts.tv_sec, ts.tv_nsec); timespec64_to_ktime()
240 * @ts: the timespec variable to store the result in
245 struct timespec *ts)
248 *ts = ktime_to_timespec(kt);
259 * @ts: the timespec variable to store the result in
264 struct timespec64 *ts)
267 *ts = ktime_to_timespec64(kt);
H A Dring_buffer.h121 ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts,
124 ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts,
134 ring_buffer_iter_peek(struct ring_buffer_iter *iter, u64 *ts);
136 ring_buffer_read(struct ring_buffer_iter *iter, u64 *ts);
180 int cpu, u64 *ts);
H A Dposix-clock.h62 int (*clock_gettime)(struct posix_clock *pc, struct timespec *ts);
64 int (*clock_getres) (struct posix_clock *pc, struct timespec *ts);
67 const struct timespec *ts);
H A Dptp_clock_kernel.h68 * parameter ts: Holds the result.
71 * parameter ts: Time value to set.
107 int (*gettime64)(struct ptp_clock_info *ptp, struct timespec64 *ts);
108 int (*settime64)(struct ptp_clock_info *p, const struct timespec64 *ts);
/linux-4.1.27/tools/perf/util/
H A Dthread-stack.c108 static int thread_stack__grow(struct thread_stack *ts) thread_stack__grow() argument
113 new_sz = ts->sz + STACK_GROWTH; thread_stack__grow()
116 new_stack = realloc(ts->stack, sz); thread_stack__grow()
120 ts->stack = new_stack; thread_stack__grow()
121 ts->sz = new_sz; thread_stack__grow()
129 struct thread_stack *ts; thread_stack__new() local
131 ts = zalloc(sizeof(struct thread_stack)); thread_stack__new()
132 if (!ts) thread_stack__new()
135 if (thread_stack__grow(ts)) { thread_stack__new()
136 free(ts); thread_stack__new()
141 ts->kernel_start = machine__kernel_start(thread->mg->machine); thread_stack__new()
143 ts->kernel_start = 1ULL << 63; thread_stack__new()
144 ts->crp = crp; thread_stack__new()
146 return ts; thread_stack__new()
149 static int thread_stack__push(struct thread_stack *ts, u64 ret_addr) thread_stack__push() argument
153 if (ts->cnt == ts->sz) { thread_stack__push()
154 err = thread_stack__grow(ts); thread_stack__push()
157 ts->cnt = 0; thread_stack__push()
161 ts->stack[ts->cnt++].ret_addr = ret_addr; thread_stack__push()
166 static void thread_stack__pop(struct thread_stack *ts, u64 ret_addr) thread_stack__pop() argument
179 for (i = ts->cnt; i; ) { thread_stack__pop()
180 if (ts->stack[--i].ret_addr == ret_addr) { thread_stack__pop()
181 ts->cnt = i; thread_stack__pop()
187 static bool thread_stack__in_kernel(struct thread_stack *ts) thread_stack__in_kernel() argument
189 if (!ts->cnt) thread_stack__in_kernel()
192 return ts->stack[ts->cnt - 1].cp->in_kernel; thread_stack__in_kernel()
196 struct thread_stack *ts, size_t idx, thread_stack__call_return()
199 struct call_return_processor *crp = ts->crp; thread_stack__call_return()
203 .comm = ts->comm, thread_stack__call_return()
207 tse = &ts->stack[idx]; thread_stack__call_return()
211 cr.branch_count = ts->branch_count - tse->branch_count; thread_stack__call_return()
222 static int thread_stack__flush(struct thread *thread, struct thread_stack *ts) thread_stack__flush() argument
224 struct call_return_processor *crp = ts->crp; thread_stack__flush()
228 ts->cnt = 0; thread_stack__flush()
232 while (ts->cnt) { thread_stack__flush()
233 err = thread_stack__call_return(thread, ts, --ts->cnt, thread_stack__flush()
234 ts->last_time, 0, true); thread_stack__flush()
237 ts->cnt = 0; thread_stack__flush()
251 if (!thread->ts) { thread_stack__event()
252 thread->ts = thread_stack__new(thread, NULL); thread_stack__event()
253 if (!thread->ts) { thread_stack__event()
257 thread->ts->trace_nr = trace_nr; thread_stack__event()
265 if (trace_nr != thread->ts->trace_nr) { thread_stack__event()
266 if (thread->ts->trace_nr) thread_stack__event()
267 thread_stack__flush(thread, thread->ts); thread_stack__event()
268 thread->ts->trace_nr = trace_nr; thread_stack__event()
272 if (thread->ts->crp) thread_stack__event()
283 return thread_stack__push(thread->ts, ret_addr); thread_stack__event()
287 thread_stack__pop(thread->ts, to_ip); thread_stack__event()
295 if (!thread || !thread->ts) thread_stack__set_trace_nr()
298 if (trace_nr != thread->ts->trace_nr) { thread_stack__set_trace_nr()
299 if (thread->ts->trace_nr) thread_stack__set_trace_nr()
300 thread_stack__flush(thread, thread->ts); thread_stack__set_trace_nr()
301 thread->ts->trace_nr = trace_nr; thread_stack__set_trace_nr()
307 if (thread->ts) { thread_stack__free()
308 thread_stack__flush(thread, thread->ts); thread_stack__free()
309 zfree(&thread->ts->stack); thread_stack__free()
310 zfree(&thread->ts); thread_stack__free()
319 if (!thread || !thread->ts) thread_stack__sample()
322 chain->nr = min(sz, thread->ts->cnt + 1); thread_stack__sample()
327 chain->ips[i] = thread->ts->stack[thread->ts->cnt - i].ret_addr; thread_stack__sample()
461 static int thread_stack__push_cp(struct thread_stack *ts, u64 ret_addr, thread_stack__push_cp() argument
468 if (ts->cnt == ts->sz) { thread_stack__push_cp()
469 err = thread_stack__grow(ts); thread_stack__push_cp()
474 tse = &ts->stack[ts->cnt++]; thread_stack__push_cp()
478 tse->branch_count = ts->branch_count; thread_stack__push_cp()
485 static int thread_stack__pop_cp(struct thread *thread, struct thread_stack *ts, thread_stack__pop_cp() argument
491 if (!ts->cnt) thread_stack__pop_cp()
494 if (ts->cnt == 1) { thread_stack__pop_cp()
495 struct thread_stack_entry *tse = &ts->stack[0]; thread_stack__pop_cp()
498 return thread_stack__call_return(thread, ts, --ts->cnt, thread_stack__pop_cp()
502 if (ts->stack[ts->cnt - 1].ret_addr == ret_addr) { thread_stack__pop_cp()
503 return thread_stack__call_return(thread, ts, --ts->cnt, thread_stack__pop_cp()
506 size_t i = ts->cnt - 1; thread_stack__pop_cp()
509 if (ts->stack[i].ret_addr != ret_addr) thread_stack__pop_cp()
512 while (ts->cnt > i) { thread_stack__pop_cp()
513 err = thread_stack__call_return(thread, ts, thread_stack__pop_cp()
514 --ts->cnt, thread_stack__pop_cp()
520 return thread_stack__call_return(thread, ts, --ts->cnt, thread_stack__pop_cp()
528 static int thread_stack__bottom(struct thread *thread, struct thread_stack *ts, thread_stack__bottom() argument
533 struct call_path_root *cpr = ts->crp->cpr; thread_stack__bottom()
549 ts->kernel_start); thread_stack__bottom()
553 return thread_stack__push_cp(thread->ts, ip, sample->time, ref, cp, thread_stack__bottom()
558 struct thread_stack *ts, thread_stack__no_call_return()
563 struct call_path_root *cpr = ts->crp->cpr; thread_stack__no_call_return()
565 u64 ks = ts->kernel_start; thread_stack__no_call_return()
570 while (thread_stack__in_kernel(ts)) { thread_stack__no_call_return()
571 err = thread_stack__call_return(thread, ts, --ts->cnt, thread_stack__no_call_return()
579 if (!ts->cnt) { thread_stack__no_call_return()
582 ts->kernel_start); thread_stack__no_call_return()
585 return thread_stack__push_cp(ts, 0, sample->time, ref, thread_stack__no_call_return()
588 } else if (thread_stack__in_kernel(ts) && sample->ip < ks) { thread_stack__no_call_return()
590 while (thread_stack__in_kernel(ts)) { thread_stack__no_call_return()
591 err = thread_stack__call_return(thread, ts, --ts->cnt, thread_stack__no_call_return()
599 if (ts->cnt) thread_stack__no_call_return()
600 parent = ts->stack[ts->cnt - 1].cp; thread_stack__no_call_return()
606 ts->kernel_start); thread_stack__no_call_return()
610 err = thread_stack__push_cp(ts, sample->addr, sample->time, ref, cp, thread_stack__no_call_return()
615 return thread_stack__pop_cp(thread, ts, sample->addr, sample->time, ref, thread_stack__no_call_return()
620 struct thread_stack *ts, u64 timestamp, thread_stack__trace_begin()
626 if (!ts->cnt) thread_stack__trace_begin()
630 tse = &ts->stack[ts->cnt - 1]; thread_stack__trace_begin()
632 err = thread_stack__call_return(thread, ts, --ts->cnt, thread_stack__trace_begin()
641 static int thread_stack__trace_end(struct thread_stack *ts, thread_stack__trace_end() argument
644 struct call_path_root *cpr = ts->crp->cpr; thread_stack__trace_end()
649 if (!ts->cnt || (ts->cnt == 1 && ts->stack[0].ref == ref)) thread_stack__trace_end()
652 cp = call_path__findnew(cpr, ts->stack[ts->cnt - 1].cp, NULL, 0, thread_stack__trace_end()
653 ts->kernel_start); thread_stack__trace_end()
659 return thread_stack__push_cp(ts, ret_addr, sample->time, ref, cp, thread_stack__trace_end()
669 struct thread_stack *ts = thread->ts; thread_stack__process() local
672 if (ts) { thread_stack__process()
673 if (!ts->crp) { thread_stack__process()
676 thread->ts = thread_stack__new(thread, crp); thread_stack__process()
677 if (!thread->ts) thread_stack__process()
679 ts = thread->ts; thread_stack__process()
680 ts->comm = comm; thread_stack__process()
683 thread->ts = thread_stack__new(thread, crp); thread_stack__process()
684 if (!thread->ts) thread_stack__process()
686 ts = thread->ts; thread_stack__process()
687 ts->comm = comm; thread_stack__process()
691 if (ts->comm != comm && thread->pid_ == thread->tid) { thread_stack__process()
692 err = thread_stack__flush(thread, ts); thread_stack__process()
695 ts->comm = comm; thread_stack__process()
699 if (!ts->cnt) { thread_stack__process()
700 err = thread_stack__bottom(thread, ts, sample, from_al, to_al, thread_stack__process()
706 ts->branch_count += 1; thread_stack__process()
707 ts->last_time = sample->time; thread_stack__process()
710 struct call_path_root *cpr = ts->crp->cpr; thread_stack__process()
721 cp = call_path__findnew(cpr, ts->stack[ts->cnt - 1].cp, thread_stack__process()
723 ts->kernel_start); thread_stack__process()
726 err = thread_stack__push_cp(ts, ret_addr, sample->time, ref, thread_stack__process()
732 err = thread_stack__pop_cp(thread, ts, sample->addr, thread_stack__process()
737 err = thread_stack__no_call_return(thread, ts, sample, thread_stack__process()
741 err = thread_stack__trace_begin(thread, ts, sample->time, ref); thread_stack__process()
743 err = thread_stack__trace_end(ts, sample, ref); thread_stack__process()
195 thread_stack__call_return(struct thread *thread, struct thread_stack *ts, size_t idx, u64 timestamp, u64 ref, bool no_return) thread_stack__call_return() argument
557 thread_stack__no_call_return(struct thread *thread, struct thread_stack *ts, struct perf_sample *sample, struct addr_location *from_al, struct addr_location *to_al, u64 ref) thread_stack__no_call_return() argument
619 thread_stack__trace_begin(struct thread *thread, struct thread_stack *ts, u64 timestamp, u64 ref) thread_stack__trace_begin() argument
/linux-4.1.27/drivers/gpio/
H A Dgpio-max730x.c53 struct max7301 *ts = container_of(chip, struct max7301, chip); max7301_direction_input() local
62 config = &ts->port_config[offset >> 2]; max7301_direction_input()
64 if (ts->input_pullup_active & BIT(offset)) max7301_direction_input()
69 mutex_lock(&ts->lock); max7301_direction_input()
74 ret = ts->write(ts->dev, 0x08 + (offset >> 2), *config); max7301_direction_input()
76 mutex_unlock(&ts->lock); max7301_direction_input()
81 static int __max7301_set(struct max7301 *ts, unsigned offset, int value) __max7301_set() argument
84 ts->out_level |= 1 << offset; __max7301_set()
85 return ts->write(ts->dev, 0x20 + offset, 0x01); __max7301_set()
87 ts->out_level &= ~(1 << offset); __max7301_set()
88 return ts->write(ts->dev, 0x20 + offset, 0x00); __max7301_set()
95 struct max7301 *ts = container_of(chip, struct max7301, chip); max7301_direction_output() local
104 config = &ts->port_config[offset >> 2]; max7301_direction_output()
106 mutex_lock(&ts->lock); max7301_direction_output()
111 ret = __max7301_set(ts, offset, value); max7301_direction_output()
114 ret = ts->write(ts->dev, 0x08 + (offset >> 2), *config); max7301_direction_output()
116 mutex_unlock(&ts->lock); max7301_direction_output()
123 struct max7301 *ts = container_of(chip, struct max7301, chip); max7301_get() local
129 mutex_lock(&ts->lock); max7301_get()
131 config = (ts->port_config[offset >> 2] >> ((offset & 3) << 1)) max7301_get()
137 level = !!(ts->out_level & (1 << offset)); max7301_get()
142 level = ts->read(ts->dev, 0x20 + offset) & 0x01; max7301_get()
144 mutex_unlock(&ts->lock); max7301_get()
151 struct max7301 *ts = container_of(chip, struct max7301, chip); max7301_set() local
156 mutex_lock(&ts->lock); max7301_set()
158 __max7301_set(ts, offset, value); max7301_set()
160 mutex_unlock(&ts->lock); max7301_set()
163 int __max730x_probe(struct max7301 *ts) __max730x_probe() argument
165 struct device *dev = ts->dev; __max730x_probe()
171 mutex_init(&ts->lock); __max730x_probe()
172 dev_set_drvdata(dev, ts); __max730x_probe()
175 ts->write(dev, 0x04, 0x01); __max730x_probe()
178 ts->input_pullup_active = pdata->input_pullup_active; __max730x_probe()
179 ts->chip.base = pdata->base; __max730x_probe()
181 ts->chip.base = -1; __max730x_probe()
183 ts->chip.label = dev->driver->name; __max730x_probe()
185 ts->chip.direction_input = max7301_direction_input; __max730x_probe()
186 ts->chip.get = max7301_get; __max730x_probe()
187 ts->chip.direction_output = max7301_direction_output; __max730x_probe()
188 ts->chip.set = max7301_set; __max730x_probe()
190 ts->chip.ngpio = PIN_NUMBER; __max730x_probe()
191 ts->chip.can_sleep = true; __max730x_probe()
192 ts->chip.dev = dev; __max730x_probe()
193 ts->chip.owner = THIS_MODULE; __max730x_probe()
207 ts->port_config[i] = 0xAA; __max730x_probe()
210 ret = max7301_direction_input(&ts->chip, offset); __max730x_probe()
216 ret = gpiochip_add(&ts->chip); __max730x_probe()
223 mutex_destroy(&ts->lock); __max730x_probe()
230 struct max7301 *ts = dev_get_drvdata(dev); __max730x_remove() local
232 if (ts == NULL) __max730x_remove()
236 ts->write(dev, 0x04, 0x00); __max730x_remove()
237 gpiochip_remove(&ts->chip); __max730x_remove()
238 mutex_destroy(&ts->lock); __max730x_remove()
239 kfree(ts); __max730x_remove()
H A Dgpio-max7300.c37 struct max7301 *ts; max7300_probe() local
43 ts = devm_kzalloc(&client->dev, sizeof(struct max7301), GFP_KERNEL); max7300_probe()
44 if (!ts) max7300_probe()
47 ts->read = max7300_i2c_read; max7300_probe()
48 ts->write = max7300_i2c_write; max7300_probe()
49 ts->dev = &client->dev; max7300_probe()
51 return __max730x_probe(ts); max7300_probe()
H A Dgpio-max7301.c55 struct max7301 *ts; max7301_probe() local
64 ts = devm_kzalloc(&spi->dev, sizeof(struct max7301), GFP_KERNEL); max7301_probe()
65 if (!ts) max7301_probe()
68 ts->read = max7301_spi_read; max7301_probe()
69 ts->write = max7301_spi_write; max7301_probe()
70 ts->dev = &spi->dev; max7301_probe()
72 ret = __max730x_probe(ts); max7301_probe()
/linux-4.1.27/arch/arm/vdso/
H A Dvgettimeofday.c65 register struct timespec *ts asm("r1") = _ts; clock_gettime_fallback()
73 : "r" (clkid), "r" (ts), "r" (nr) clock_gettime_fallback()
79 static notrace int do_realtime_coarse(struct timespec *ts, do_realtime_coarse() argument
87 ts->tv_sec = vdata->xtime_coarse_sec; do_realtime_coarse()
88 ts->tv_nsec = vdata->xtime_coarse_nsec; do_realtime_coarse()
95 static notrace int do_monotonic_coarse(struct timespec *ts, do_monotonic_coarse() argument
104 ts->tv_sec = vdata->xtime_coarse_sec; do_monotonic_coarse()
105 ts->tv_nsec = vdata->xtime_coarse_nsec; do_monotonic_coarse()
112 ts->tv_sec += tomono.tv_sec; do_monotonic_coarse()
113 timespec_add_ns(ts, tomono.tv_nsec); do_monotonic_coarse()
136 static notrace int do_realtime(struct timespec *ts, struct vdso_data *vdata) do_realtime() argument
147 ts->tv_sec = vdata->xtime_clock_sec; do_realtime()
152 ts->tv_nsec = 0; do_realtime()
153 timespec_add_ns(ts, nsecs); do_realtime()
158 static notrace int do_monotonic(struct timespec *ts, struct vdso_data *vdata) do_monotonic() argument
170 ts->tv_sec = vdata->xtime_clock_sec; do_monotonic()
178 ts->tv_sec += tomono.tv_sec; do_monotonic()
179 ts->tv_nsec = 0; do_monotonic()
180 timespec_add_ns(ts, nsecs + tomono.tv_nsec); do_monotonic()
187 static notrace int do_realtime(struct timespec *ts, struct vdso_data *vdata) do_realtime() argument
192 static notrace int do_monotonic(struct timespec *ts, struct vdso_data *vdata) do_monotonic() argument
199 notrace int __vdso_clock_gettime(clockid_t clkid, struct timespec *ts) __vdso_clock_gettime() argument
208 ret = do_realtime_coarse(ts, vdata); __vdso_clock_gettime()
211 ret = do_monotonic_coarse(ts, vdata); __vdso_clock_gettime()
214 ret = do_realtime(ts, vdata); __vdso_clock_gettime()
217 ret = do_monotonic(ts, vdata); __vdso_clock_gettime()
224 ret = clock_gettime_fallback(clkid, ts); __vdso_clock_gettime()
248 struct timespec ts; __vdso_gettimeofday() local
254 ret = do_realtime(&ts, vdata); __vdso_gettimeofday()
259 tv->tv_sec = ts.tv_sec; __vdso_gettimeofday()
260 tv->tv_usec = ts.tv_nsec / 1000; __vdso_gettimeofday()
/linux-4.1.27/kernel/time/
H A Dtick-sched.c134 static void tick_sched_handle(struct tick_sched *ts, struct pt_regs *regs) tick_sched_handle() argument
145 if (ts->tick_stopped) { tick_sched_handle()
148 ts->idle_jiffies++; tick_sched_handle()
200 static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now);
208 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); __tick_nohz_full_check() local
211 if (ts->tick_stopped && !is_idle_task(current)) { __tick_nohz_full_check()
213 tick_nohz_restart_sched_tick(ts, ktime_get()); __tick_nohz_full_check()
451 update_ts_time_stats(int cpu, struct tick_sched *ts, ktime_t now, u64 *last_update_time) update_ts_time_stats() argument
455 if (ts->idle_active) { update_ts_time_stats()
456 delta = ktime_sub(now, ts->idle_entrytime); update_ts_time_stats()
458 ts->iowait_sleeptime = ktime_add(ts->iowait_sleeptime, delta); update_ts_time_stats()
460 ts->idle_sleeptime = ktime_add(ts->idle_sleeptime, delta); update_ts_time_stats()
461 ts->idle_entrytime = now; update_ts_time_stats()
469 static void tick_nohz_stop_idle(struct tick_sched *ts, ktime_t now) tick_nohz_stop_idle() argument
471 update_ts_time_stats(smp_processor_id(), ts, now, NULL); tick_nohz_stop_idle() local
472 ts->idle_active = 0; tick_nohz_stop_idle()
477 static ktime_t tick_nohz_start_idle(struct tick_sched *ts) tick_nohz_start_idle() argument
481 ts->idle_entrytime = now; tick_nohz_start_idle()
482 ts->idle_active = 1; tick_nohz_start_idle()
503 struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); get_cpu_idle_time_us() local
511 update_ts_time_stats(cpu, ts, now, last_update_time); get_cpu_idle_time_us()
512 idle = ts->idle_sleeptime; get_cpu_idle_time_us()
514 if (ts->idle_active && !nr_iowait_cpu(cpu)) { get_cpu_idle_time_us()
515 ktime_t delta = ktime_sub(now, ts->idle_entrytime); get_cpu_idle_time_us()
517 idle = ktime_add(ts->idle_sleeptime, delta); get_cpu_idle_time_us()
519 idle = ts->idle_sleeptime; get_cpu_idle_time_us()
544 struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); get_cpu_iowait_time_us() local
552 update_ts_time_stats(cpu, ts, now, last_update_time); get_cpu_iowait_time_us()
553 iowait = ts->iowait_sleeptime; get_cpu_iowait_time_us()
555 if (ts->idle_active && nr_iowait_cpu(cpu) > 0) { get_cpu_iowait_time_us()
556 ktime_t delta = ktime_sub(now, ts->idle_entrytime); get_cpu_iowait_time_us()
558 iowait = ktime_add(ts->iowait_sleeptime, delta); get_cpu_iowait_time_us()
560 iowait = ts->iowait_sleeptime; get_cpu_iowait_time_us()
568 static ktime_t tick_nohz_stop_sched_tick(struct tick_sched *ts, tick_nohz_stop_sched_tick() argument
604 if (!ts->tick_stopped && delta_jiffies <= 1) tick_nohz_stop_sched_tick()
625 ts->do_timer_last = 1; tick_nohz_stop_sched_tick()
628 ts->do_timer_last = 0; tick_nohz_stop_sched_tick()
629 } else if (!ts->do_timer_last) { tick_nohz_stop_sched_tick()
634 if (!ts->inidle) { tick_nohz_stop_sched_tick()
665 if (ts->tick_stopped && ktime_equal(expires, dev->next_event)) tick_nohz_stop_sched_tick()
677 if (!ts->tick_stopped) { tick_nohz_stop_sched_tick()
681 ts->last_tick = hrtimer_get_expires(&ts->sched_timer); tick_nohz_stop_sched_tick()
682 ts->tick_stopped = 1; tick_nohz_stop_sched_tick()
691 if (ts->nohz_mode == NOHZ_MODE_HIGHRES) tick_nohz_stop_sched_tick()
692 hrtimer_cancel(&ts->sched_timer); tick_nohz_stop_sched_tick()
696 if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { tick_nohz_stop_sched_tick()
697 hrtimer_start(&ts->sched_timer, expires, tick_nohz_stop_sched_tick()
700 if (hrtimer_active(&ts->sched_timer)) tick_nohz_stop_sched_tick()
713 ts->next_jiffies = next_jiffies; tick_nohz_stop_sched_tick()
714 ts->last_jiffies = last_jiffies; tick_nohz_stop_sched_tick()
715 ts->sleep_length = ktime_sub(dev->next_event, now); tick_nohz_stop_sched_tick()
720 static void tick_nohz_full_stop_tick(struct tick_sched *ts) tick_nohz_full_stop_tick() argument
728 if (!ts->tick_stopped && ts->nohz_mode == NOHZ_MODE_INACTIVE) tick_nohz_full_stop_tick()
734 tick_nohz_stop_sched_tick(ts, ktime_get(), cpu); tick_nohz_full_stop_tick()
738 static bool can_stop_idle_tick(int cpu, struct tick_sched *ts) can_stop_idle_tick() argument
753 if (unlikely(ts->nohz_mode == NOHZ_MODE_INACTIVE)) { can_stop_idle_tick()
754 ts->sleep_length = (ktime_t) { .tv64 = NSEC_PER_SEC/HZ }; can_stop_idle_tick()
791 static void __tick_nohz_idle_enter(struct tick_sched *ts) __tick_nohz_idle_enter() argument
796 now = tick_nohz_start_idle(ts); __tick_nohz_idle_enter()
798 if (can_stop_idle_tick(cpu, ts)) { __tick_nohz_idle_enter()
799 int was_stopped = ts->tick_stopped; __tick_nohz_idle_enter()
801 ts->idle_calls++; __tick_nohz_idle_enter()
803 expires = tick_nohz_stop_sched_tick(ts, now, cpu); __tick_nohz_idle_enter()
805 ts->idle_sleeps++; __tick_nohz_idle_enter()
806 ts->idle_expires = expires; __tick_nohz_idle_enter()
809 if (!was_stopped && ts->tick_stopped) __tick_nohz_idle_enter()
810 ts->idle_jiffies = ts->last_jiffies; __tick_nohz_idle_enter()
828 struct tick_sched *ts; tick_nohz_idle_enter() local
842 ts = this_cpu_ptr(&tick_cpu_sched); tick_nohz_idle_enter()
843 ts->inidle = 1; tick_nohz_idle_enter()
844 __tick_nohz_idle_enter(ts); tick_nohz_idle_enter()
859 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); tick_nohz_irq_exit() local
861 if (ts->inidle) tick_nohz_irq_exit()
862 __tick_nohz_idle_enter(ts); tick_nohz_irq_exit()
864 tick_nohz_full_stop_tick(ts); tick_nohz_irq_exit()
874 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); tick_nohz_get_sleep_length() local
876 return ts->sleep_length; tick_nohz_get_sleep_length()
879 static void tick_nohz_restart(struct tick_sched *ts, ktime_t now) tick_nohz_restart() argument
881 hrtimer_cancel(&ts->sched_timer); tick_nohz_restart()
882 hrtimer_set_expires(&ts->sched_timer, ts->last_tick); tick_nohz_restart()
886 hrtimer_forward(&ts->sched_timer, now, tick_period); tick_nohz_restart()
888 if (ts->nohz_mode == NOHZ_MODE_HIGHRES) { tick_nohz_restart()
889 hrtimer_start_expires(&ts->sched_timer, tick_nohz_restart()
892 if (hrtimer_active(&ts->sched_timer)) tick_nohz_restart()
896 hrtimer_get_expires(&ts->sched_timer), 0)) tick_nohz_restart()
905 static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now) tick_nohz_restart_sched_tick() argument
916 ts->tick_stopped = 0; tick_nohz_restart_sched_tick()
917 ts->idle_exittime = now; tick_nohz_restart_sched_tick()
919 tick_nohz_restart(ts, now); tick_nohz_restart_sched_tick()
922 static void tick_nohz_account_idle_ticks(struct tick_sched *ts) tick_nohz_account_idle_ticks() argument
934 ticks = jiffies - ts->idle_jiffies; tick_nohz_account_idle_ticks()
952 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); tick_nohz_idle_exit() local
957 WARN_ON_ONCE(!ts->inidle); tick_nohz_idle_exit()
959 ts->inidle = 0; tick_nohz_idle_exit()
961 if (ts->idle_active || ts->tick_stopped) tick_nohz_idle_exit()
964 if (ts->idle_active) tick_nohz_idle_exit()
965 tick_nohz_stop_idle(ts, now); tick_nohz_idle_exit()
967 if (ts->tick_stopped) { tick_nohz_idle_exit()
968 tick_nohz_restart_sched_tick(ts, now); tick_nohz_idle_exit()
969 tick_nohz_account_idle_ticks(ts); tick_nohz_idle_exit()
975 static int tick_nohz_reprogram(struct tick_sched *ts, ktime_t now) tick_nohz_reprogram() argument
977 hrtimer_forward(&ts->sched_timer, now, tick_period); tick_nohz_reprogram()
978 return tick_program_event(hrtimer_get_expires(&ts->sched_timer), 0); tick_nohz_reprogram()
986 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); tick_nohz_handler() local
993 tick_sched_handle(ts, regs); tick_nohz_handler()
996 if (unlikely(ts->tick_stopped)) tick_nohz_handler()
999 while (tick_nohz_reprogram(ts, now)) { tick_nohz_handler()
1010 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); tick_nohz_switch_to_nohz() local
1022 ts->nohz_mode = NOHZ_MODE_LOWRES; tick_nohz_switch_to_nohz()
1025 * Recycle the hrtimer in ts, so we can share the tick_nohz_switch_to_nohz()
1028 hrtimer_init(&ts->sched_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); tick_nohz_switch_to_nohz()
1033 hrtimer_set_expires(&ts->sched_timer, next); tick_nohz_switch_to_nohz()
1052 static void tick_nohz_kick_tick(struct tick_sched *ts, ktime_t now) tick_nohz_kick_tick() argument
1062 delta = ktime_sub(hrtimer_get_expires(&ts->sched_timer), now); tick_nohz_kick_tick()
1066 tick_nohz_restart(ts, now); tick_nohz_kick_tick()
1072 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); tick_nohz_irq_enter() local
1075 if (!ts->idle_active && !ts->tick_stopped) tick_nohz_irq_enter()
1078 if (ts->idle_active) tick_nohz_irq_enter()
1079 tick_nohz_stop_idle(ts, now); tick_nohz_irq_enter()
1080 if (ts->tick_stopped) { tick_nohz_irq_enter()
1082 tick_nohz_kick_tick(ts, now); tick_nohz_irq_enter()
1112 struct tick_sched *ts = tick_sched_timer() local
1124 tick_sched_handle(ts, regs); tick_sched_timer()
1127 if (unlikely(ts->tick_stopped)) tick_sched_timer()
1150 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); tick_setup_sched_timer() local
1156 hrtimer_init(&ts->sched_timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS); tick_setup_sched_timer()
1157 ts->sched_timer.function = tick_sched_timer; tick_setup_sched_timer()
1160 hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update()); tick_setup_sched_timer()
1167 hrtimer_add_expires_ns(&ts->sched_timer, offset); tick_setup_sched_timer()
1171 hrtimer_forward(&ts->sched_timer, now, tick_period); tick_setup_sched_timer()
1172 hrtimer_start_expires(&ts->sched_timer, tick_setup_sched_timer()
1175 if (hrtimer_active(&ts->sched_timer)) tick_setup_sched_timer()
1182 ts->nohz_mode = NOHZ_MODE_HIGHRES; tick_setup_sched_timer()
1192 struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); tick_cancel_sched_timer() local
1195 if (ts->sched_timer.base) tick_cancel_sched_timer()
1196 hrtimer_cancel(&ts->sched_timer); tick_cancel_sched_timer()
1199 memset(ts, 0, sizeof(*ts)); tick_cancel_sched_timer()
1219 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); tick_oneshot_notify() local
1221 set_bit(0, &ts->check_clocks); tick_oneshot_notify()
1234 struct tick_sched *ts = this_cpu_ptr(&tick_cpu_sched); tick_check_oneshot_change() local
1236 if (!test_and_clear_bit(0, &ts->check_clocks)) tick_check_oneshot_change()
1239 if (ts->nohz_mode != NOHZ_MODE_INACTIVE) tick_check_oneshot_change()
H A Dtimekeeping.h15 extern int timekeeping_inject_offset(struct timespec *ts);
18 extern void timekeeping_clocktai(struct timespec *ts);
H A Dtest_udelay.c90 struct timespec ts; udelay_test_show() local
92 ktime_get_ts(&ts); udelay_test_show()
94 loops_per_jiffy, ts.tv_sec, ts.tv_nsec); udelay_test_show()
H A Dtimekeeping.c77 struct timespec64 ts; tk_xtime() local
79 ts.tv_sec = tk->xtime_sec; tk_xtime()
80 ts.tv_nsec = (long)(tk->tkr_mono.xtime_nsec >> tk->tkr_mono.shift); tk_xtime()
81 return ts; tk_xtime()
84 static void tk_set_xtime(struct timekeeper *tk, const struct timespec64 *ts) tk_set_xtime() argument
86 tk->xtime_sec = ts->tv_sec; tk_set_xtime()
87 tk->tkr_mono.xtime_nsec = (u64)ts->tv_nsec << tk->tkr_mono.shift; tk_set_xtime()
90 static void tk_xtime_add(struct timekeeper *tk, const struct timespec64 *ts) tk_xtime_add() argument
92 tk->xtime_sec += ts->tv_sec; tk_xtime_add()
93 tk->tkr_mono.xtime_nsec += (u64)ts->tv_nsec << tk->tkr_mono.shift; tk_xtime_add()
637 * @ts: pointer to the timespec to be set
642 int __getnstimeofday64(struct timespec64 *ts) __getnstimeofday64() argument
651 ts->tv_sec = tk->xtime_sec; __getnstimeofday64()
656 ts->tv_nsec = 0; __getnstimeofday64()
657 timespec64_add_ns(ts, nsecs); __getnstimeofday64()
671 * @ts: pointer to the timespec64 to be set
675 void getnstimeofday64(struct timespec64 *ts) getnstimeofday64() argument
677 WARN_ON(__getnstimeofday64(ts)); getnstimeofday64()
771 * @ts: pointer to timespec variable
775 * in normalized timespec64 format in the variable pointed to by @ts.
777 void ktime_get_ts64(struct timespec64 *ts) ktime_get_ts64() argument
788 ts->tv_sec = tk->xtime_sec; ktime_get_ts64()
794 ts->tv_sec += tomono.tv_sec; ktime_get_ts64()
795 ts->tv_nsec = 0; ktime_get_ts64()
796 timespec64_add_ns(ts, nsec + tomono.tv_nsec); ktime_get_ts64()
904 * @ts: pointer to the timespec64 variable containing the new time
908 int do_settimeofday64(const struct timespec64 *ts) do_settimeofday64() argument
914 if (!timespec64_valid_strict(ts)) do_settimeofday64()
923 ts_delta.tv_sec = ts->tv_sec - xt.tv_sec; do_settimeofday64()
924 ts_delta.tv_nsec = ts->tv_nsec - xt.tv_nsec; do_settimeofday64()
928 tk_set_xtime(tk, ts); do_settimeofday64()
948 int timekeeping_inject_offset(struct timespec *ts) timekeeping_inject_offset() argument
955 if ((unsigned long)ts->tv_nsec >= NSEC_PER_SEC) timekeeping_inject_offset()
958 ts64 = timespec_to_timespec64(*ts); timekeeping_inject_offset()
1095 * @ts: pointer to the timespec64 to be set
1099 void getrawmonotonic64(struct timespec64 *ts) getrawmonotonic64() argument
1114 *ts = ts64; getrawmonotonic64()
1166 void __weak read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
1168 ts->tv_sec = 0; read_persistent_clock()
1169 ts->tv_nsec = 0; read_persistent_clock()
1174 struct timespec ts; read_persistent_clock64() local
1176 read_persistent_clock(&ts); read_persistent_clock64()
1177 *ts64 = timespec_to_timespec64(ts); read_persistent_clock64()
1189 void __weak read_boot_clock(struct timespec *ts) read_boot_clock() argument
1191 ts->tv_sec = 0; read_boot_clock()
1192 ts->tv_nsec = 0; read_boot_clock()
1197 struct timespec ts; read_boot_clock64() local
1199 read_boot_clock(&ts); read_boot_clock64()
1200 *ts64 = timespec_to_timespec64(ts); read_boot_clock64()
1696 struct timespec64 ts; accumulate_nsecs_to_secs() local
1700 ts.tv_sec = leap; accumulate_nsecs_to_secs()
1701 ts.tv_nsec = 0; accumulate_nsecs_to_secs()
1703 timespec64_sub(tk->wall_to_monotonic, ts)); accumulate_nsecs_to_secs()
1850 * @ts: pointer to the timespec64 to be set
1859 void getboottime64(struct timespec64 *ts) getboottime64() argument
1864 *ts = ktime_to_timespec64(t); getboottime64()
1997 struct timespec64 ts; do_adjtimex() local
2017 getnstimeofday64(&ts); do_adjtimex()
2023 ret = __do_adjtimex(txc, &ts, &tai); do_adjtimex()
H A Dtime.c348 * @ts: pointer to timespec variable to be set
359 void set_normalized_timespec(struct timespec *ts, time_t sec, s64 nsec) set_normalized_timespec() argument
376 ts->tv_sec = sec; set_normalized_timespec()
377 ts->tv_nsec = nsec; set_normalized_timespec()
389 struct timespec ts; ns_to_timespec() local
395 ts.tv_sec = div_s64_rem(nsec, NSEC_PER_SEC, &rem); ns_to_timespec()
397 ts.tv_sec--; ns_to_timespec()
400 ts.tv_nsec = rem; ns_to_timespec()
402 return ts; ns_to_timespec()
414 struct timespec ts = ns_to_timespec(nsec); ns_to_timeval() local
417 tv.tv_sec = ts.tv_sec; ns_to_timeval()
418 tv.tv_usec = (suseconds_t) ts.tv_nsec / 1000; ns_to_timeval()
428 * @ts: pointer to timespec variable to be set
439 void set_normalized_timespec64(struct timespec64 *ts, time64_t sec, s64 nsec) set_normalized_timespec64() argument
456 ts->tv_sec = sec; set_normalized_timespec64()
457 ts->tv_nsec = nsec; set_normalized_timespec64()
469 struct timespec64 ts; ns_to_timespec64() local
475 ts.tv_sec = div_s64_rem(nsec, NSEC_PER_SEC, &rem); ns_to_timespec64()
477 ts.tv_sec--; ns_to_timespec64()
480 ts.tv_nsec = rem; ns_to_timespec64()
482 return ts; ns_to_timespec64()
H A Dposix-clock.c300 static int pc_clock_gettime(clockid_t id, struct timespec *ts) pc_clock_gettime() argument
310 err = cd.clk->ops.clock_gettime(cd.clk, ts); pc_clock_gettime()
319 static int pc_clock_getres(clockid_t id, struct timespec *ts) pc_clock_getres() argument
329 err = cd.clk->ops.clock_getres(cd.clk, ts); pc_clock_getres()
338 static int pc_clock_settime(clockid_t id, const struct timespec *ts) pc_clock_settime() argument
353 err = cd.clk->ops.clock_settime(cd.clk, ts); pc_clock_settime()
402 static void pc_timer_gettime(struct k_itimer *kit, struct itimerspec *ts) pc_timer_gettime() argument
411 cd.clk->ops.timer_gettime(cd.clk, kit, ts); pc_timer_gettime()
417 struct itimerspec *ts, struct itimerspec *old) pc_timer_settime()
428 err = cd.clk->ops.timer_settime(cd.clk, kit, flags, ts, old); pc_timer_settime()
416 pc_timer_settime(struct k_itimer *kit, int flags, struct itimerspec *ts, struct itimerspec *old) pc_timer_settime() argument
H A Dntp.c545 static inline void process_adj_status(struct timex *txc, struct timespec64 *ts) process_adj_status() argument
568 struct timespec64 *ts, process_adjtimex_modes()
572 process_adj_status(txc, ts); process_adjtimex_modes()
665 int __do_adjtimex(struct timex *txc, struct timespec64 *ts, s32 *time_tai) __do_adjtimex() argument
682 process_adjtimex_modes(txc, ts, time_tai); __do_adjtimex()
709 txc->time.tv_sec = (time_t)ts->tv_sec; __do_adjtimex()
710 txc->time.tv_usec = ts->tv_nsec; __do_adjtimex()
730 static inline struct pps_normtime pps_normalize_ts(struct timespec ts) pps_normalize_ts() argument
733 .sec = ts.tv_sec, pps_normalize_ts()
734 .nsec = ts.tv_nsec pps_normalize_ts()
567 process_adjtimex_modes(struct timex *txc, struct timespec64 *ts, s32 *time_tai) process_adjtimex_modes() argument
/linux-4.1.27/arch/tile/kernel/vdso/
H A Dvgettimeofday.c64 static inline int do_realtime(struct vdso_data *vdso, struct timespec *ts) do_realtime() argument
71 ts->tv_sec = vdso->wall_time_sec; do_realtime()
77 ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); do_realtime()
78 ts->tv_nsec = ns; do_realtime()
83 static inline int do_monotonic(struct vdso_data *vdso, struct timespec *ts) do_monotonic() argument
90 ts->tv_sec = vdso->monotonic_time_sec; do_monotonic()
96 ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); do_monotonic()
97 ts->tv_nsec = ns; do_monotonic()
103 struct timespec *ts) do_realtime_coarse()
109 ts->tv_sec = vdso->wall_time_coarse_sec; do_realtime_coarse()
110 ts->tv_nsec = vdso->wall_time_coarse_nsec; do_realtime_coarse()
117 struct timespec *ts) do_monotonic_coarse()
123 ts->tv_sec = vdso->monotonic_time_coarse_sec; do_monotonic_coarse()
124 ts->tv_nsec = vdso->monotonic_time_coarse_nsec; do_monotonic_coarse()
159 struct timespec *ts) vdso_fallback_gettime()
165 : "R10" (__NR_clock_gettime), "R00" (clock), "R01" (ts) vdso_fallback_gettime()
174 struct timespec *ts) __vdso_clock_gettime()
181 do_realtime(vdso, ts); __vdso_clock_gettime()
184 do_monotonic(vdso, ts); __vdso_clock_gettime()
187 do_realtime_coarse(vdso, ts); __vdso_clock_gettime()
190 do_monotonic_coarse(vdso, ts); __vdso_clock_gettime()
193 return vdso_fallback_gettime(clock, ts); __vdso_clock_gettime()
197 int clock_gettime(clockid_t clock, struct timespec *ts)
102 do_realtime_coarse(struct vdso_data *vdso, struct timespec *ts) do_realtime_coarse() argument
116 do_monotonic_coarse(struct vdso_data *vdso, struct timespec *ts) do_monotonic_coarse() argument
158 vdso_fallback_gettime(long clock, struct timespec *ts) vdso_fallback_gettime() argument
173 __vdso_clock_gettime(clockid_t clock, struct timespec *ts) __vdso_clock_gettime() argument
/linux-4.1.27/arch/mips/loongson/common/
H A Dtime.c32 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
34 ts->tv_sec = mc146818_get_cmos_time(); read_persistent_clock()
35 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/drivers/net/wireless/ath/
H A Ddfs_pri_detector.c31 * @ts: time stamp in usecs
35 u64 ts; member in struct:pulse_elem
193 if (p->ts >= min_valid_ts) pulse_queue_check_window()
199 static bool pulse_queue_enqueue(struct pri_detector *pde, u64 ts) pulse_queue_enqueue() argument
212 p->ts = ts; pulse_queue_enqueue()
215 pde->last_ts = ts; pulse_queue_enqueue()
223 u64 ts, u32 min_count) pseq_handler_create_sequences()
231 u32 delta_ts = ts - p->ts; pseq_handler_create_sequences()
244 ps.first_ts = p->ts; pseq_handler_create_sequences()
245 ps.last_ts = ts; pseq_handler_create_sequences()
246 ps.pri = ts - p->ts; pseq_handler_create_sequences()
252 min_valid_ts = ts - ps.dur; pseq_handler_create_sequences()
256 if (p2->ts < min_valid_ts) pseq_handler_create_sequences()
260 factor = pde_get_multiple(ps.last_ts - p2->ts, ps.pri, pseq_handler_create_sequences()
264 ps.first_ts = p2->ts; pseq_handler_create_sequences()
299 /* check new ts and add to all matching existing sequences */
301 pseq_handler_add_to_existing_seqs(struct pri_detector *pde, u64 ts) pseq_handler_add_to_existing_seqs() argument
310 if (ts > ps->deadline_ts) { pseq_handler_add_to_existing_seqs()
316 delta_ts = ts - ps->last_ts; pseq_handler_add_to_existing_seqs()
320 ps->last_ts = ts; pseq_handler_add_to_existing_seqs()
355 static void pri_detector_reset(struct pri_detector *pde, u64 ts) pri_detector_reset() argument
368 pde->last_ts = ts; pri_detector_reset()
383 u64 ts = event->ts; pri_detector_add_pulse() local
390 if ((ts - de->last_ts) < rs->max_pri_tolerance) pri_detector_add_pulse()
393 de->last_ts = ts; pri_detector_add_pulse()
395 max_updated_seq = pseq_handler_add_to_existing_seqs(de, ts); pri_detector_add_pulse()
397 if (!pseq_handler_create_sequences(de, ts, max_updated_seq)) { pri_detector_add_pulse()
398 pri_detector_reset(de, ts); pri_detector_add_pulse()
405 pulse_queue_enqueue(de, ts); pri_detector_add_pulse()
222 pseq_handler_create_sequences(struct pri_detector *pde, u64 ts, u32 min_count) pseq_handler_create_sequences() argument
H A Ddfs_pattern_detector.h39 * @ts: pulse time stamp in us
45 u64 ts; member in struct:pulse_event
/linux-4.1.27/arch/x86/vdso/
H A Dvclock_gettime.c25 extern int __vdso_clock_gettime(clockid_t clock, struct timespec *ts);
46 notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) vdso_fallback_gettime() argument
50 "0" (__NR_clock_gettime), "D" (clock), "S" (ts) : "memory"); vdso_fallback_gettime()
135 notrace static long vdso_fallback_gettime(long clock, struct timespec *ts) vdso_fallback_gettime() argument
145 : "0" (__NR_clock_gettime), "g" (clock), "c" (ts) vdso_fallback_gettime()
230 notrace static int __always_inline do_realtime(struct timespec *ts) do_realtime() argument
239 ts->tv_sec = gtod->wall_time_sec; do_realtime()
245 ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); do_realtime()
246 ts->tv_nsec = ns; do_realtime()
251 notrace static int __always_inline do_monotonic(struct timespec *ts) do_monotonic() argument
260 ts->tv_sec = gtod->monotonic_time_sec; do_monotonic()
266 ts->tv_sec += __iter_div_u64_rem(ns, NSEC_PER_SEC, &ns); do_monotonic()
267 ts->tv_nsec = ns; do_monotonic()
272 notrace static void do_realtime_coarse(struct timespec *ts) do_realtime_coarse() argument
277 ts->tv_sec = gtod->wall_time_coarse_sec; do_realtime_coarse()
278 ts->tv_nsec = gtod->wall_time_coarse_nsec; do_realtime_coarse()
282 notrace static void do_monotonic_coarse(struct timespec *ts) do_monotonic_coarse() argument
287 ts->tv_sec = gtod->monotonic_time_coarse_sec; do_monotonic_coarse()
288 ts->tv_nsec = gtod->monotonic_time_coarse_nsec; do_monotonic_coarse()
292 notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts) __vdso_clock_gettime() argument
296 if (do_realtime(ts) == VCLOCK_NONE) __vdso_clock_gettime()
300 if (do_monotonic(ts) == VCLOCK_NONE) __vdso_clock_gettime()
304 do_realtime_coarse(ts); __vdso_clock_gettime()
307 do_monotonic_coarse(ts); __vdso_clock_gettime()
315 return vdso_fallback_gettime(clock, ts); __vdso_clock_gettime()
/linux-4.1.27/include/uapi/linux/
H A Derrqueue.h33 struct timespec ts[3]; member in struct:scm_timestamping
37 * This defines the type of ts[0]. For SCM_TSTAMP_SND only, if ts[0]
38 * is zero, then this is a hardware timestamp and recorded in ts[2].
/linux-4.1.27/samples/bpf/
H A Dtracex4_user.c25 struct timespec ts; time_get_ns() local
27 clock_gettime(CLOCK_MONOTONIC, &ts); time_get_ns()
28 return ts.tv_sec * 1000000000ull + ts.tv_nsec; time_get_ns()
/linux-4.1.27/tools/perf/
H A Dperf.h26 struct timespec ts; rdclock() local
28 clock_gettime(CLOCK_MONOTONIC, &ts); rdclock()
29 return ts.tv_sec * 1000000000ULL + ts.tv_nsec; rdclock()
H A Dbuiltin-lock.c359 static struct lock_seq_stat *get_seq(struct thread_stat *ts, void *addr) get_seq() argument
363 list_for_each_entry(seq, &ts->seq_list, list) { get_seq()
376 list_add(&seq->list, &ts->seq_list); get_seq()
400 struct thread_stat *ts; report_lock_acquire_event() local
414 ts = thread_stat_findnew(sample->tid); report_lock_acquire_event()
415 if (!ts) report_lock_acquire_event()
418 seq = get_seq(ts, addr); report_lock_acquire_event()
472 struct thread_stat *ts; report_lock_acquired_event() local
486 ts = thread_stat_findnew(sample->tid); report_lock_acquired_event()
487 if (!ts) report_lock_acquired_event()
490 seq = get_seq(ts, addr); report_lock_acquired_event()
535 struct thread_stat *ts; report_lock_contended_event() local
548 ts = thread_stat_findnew(sample->tid); report_lock_contended_event()
549 if (!ts) report_lock_contended_event()
552 seq = get_seq(ts, addr); report_lock_contended_event()
590 struct thread_stat *ts; report_lock_release_event() local
603 ts = thread_stat_findnew(sample->tid); report_lock_release_event()
604 if (!ts) report_lock_release_event()
607 seq = get_seq(ts, addr); report_lock_release_event()
/linux-4.1.27/drivers/scsi/aic94xx/
H A Daic94xx_task.c163 struct task_status_struct *ts = &task->task_status; asd_get_response_tasklet() local
187 ts->buf_valid_size = 0; asd_get_response_tasklet()
194 ts->residual = le32_to_cpu(*(__le32 *)r); asd_get_response_tasklet()
198 struct ata_task_resp *resp = (void *) &ts->buf[0]; asd_get_response_tasklet()
200 ts->residual = le32_to_cpu(*(__le32 *)r); asd_get_response_tasklet()
205 ts->buf_valid_size = sizeof(*resp); asd_get_response_tasklet()
216 struct task_status_struct *ts = &task->task_status; asd_task_tasklet_complete() local
225 ts->resp = SAS_TASK_COMPLETE; asd_task_tasklet_complete()
226 ts->stat = SAM_STAT_GOOD; asd_task_tasklet_complete()
229 ts->resp = SAS_TASK_COMPLETE; asd_task_tasklet_complete()
230 ts->stat = SAS_DATA_UNDERRUN; asd_task_tasklet_complete()
231 ts->residual = le32_to_cpu(*(__le32 *)dl->status_block); asd_task_tasklet_complete()
234 ts->resp = SAS_TASK_COMPLETE; asd_task_tasklet_complete()
235 ts->stat = SAS_DATA_OVERRUN; asd_task_tasklet_complete()
236 ts->residual = 0; asd_task_tasklet_complete()
240 ts->resp = SAS_TASK_COMPLETE; asd_task_tasklet_complete()
241 ts->stat = SAS_PROTO_RESPONSE; asd_task_tasklet_complete()
245 ts->resp = SAS_TASK_UNDELIVERED; asd_task_tasklet_complete()
246 ts->stat = SAS_OPEN_REJECT; asd_task_tasklet_complete()
248 ts->open_rej_reason = 1 + dl->status_block[2]; asd_task_tasklet_complete()
250 ts->open_rej_reason = (dl->status_block[2] >> 4)+10; asd_task_tasklet_complete()
252 ts->open_rej_reason = SAS_OREJ_UNKNOWN; asd_task_tasklet_complete()
255 ts->resp = SAS_TASK_UNDELIVERED; asd_task_tasklet_complete()
256 ts->stat = SAS_OPEN_TO; asd_task_tasklet_complete()
260 ts->resp = SAS_TASK_UNDELIVERED; asd_task_tasklet_complete()
261 ts->stat = SAS_PHY_DOWN; asd_task_tasklet_complete()
264 ts->resp = SAS_TASK_COMPLETE; asd_task_tasklet_complete()
265 ts->stat = SAS_PHY_DOWN; asd_task_tasklet_complete()
273 ts->resp = SAS_TASK_COMPLETE; asd_task_tasklet_complete()
274 ts->stat = SAS_INTERRUPTED; asd_task_tasklet_complete()
280 ts->resp = SAS_TASK_UNDELIVERED; asd_task_tasklet_complete()
281 ts->stat = SAS_DEV_NO_RESPONSE; asd_task_tasklet_complete()
284 ts->resp = SAS_TASK_COMPLETE; asd_task_tasklet_complete()
285 ts->stat = SAS_NAK_R_ERR; asd_task_tasklet_complete()
292 ts->resp = SAS_TASK_UNDELIVERED; asd_task_tasklet_complete()
293 ts->stat = SAS_DEVICE_UNKNOWN; asd_task_tasklet_complete()
296 ts->resp = SAS_TASK_UNDELIVERED; asd_task_tasklet_complete()
297 ts->stat = SAS_PENDING; asd_task_tasklet_complete()
301 ts->resp = SAS_TASK_COMPLETE; asd_task_tasklet_complete()
302 ts->stat = SAS_ABORTED_TASK; asd_task_tasklet_complete()
314 ts->resp = SAS_TASK_UNDELIVERED; asd_task_tasklet_complete()
315 ts->stat = SAS_DEV_NO_RESPONSE; asd_task_tasklet_complete()
350 task, opcode, ts->resp, ts->stat); asd_task_tasklet_complete()
/linux-4.1.27/drivers/net/wireless/ath/ath9k/
H A Dar9002_mac.c316 struct ath_tx_status *ts) ar9002_hw_proc_txdesc()
325 ts->ts_tstamp = ads->AR_SendTimestamp; ar9002_hw_proc_txdesc()
326 ts->ts_status = 0; ar9002_hw_proc_txdesc()
327 ts->ts_flags = 0; ar9002_hw_proc_txdesc()
330 ts->ts_status |= ATH9K_TXERR_XTXOP; ar9002_hw_proc_txdesc()
331 ts->tid = MS(status, AR_TxTid); ar9002_hw_proc_txdesc()
332 ts->ts_rateindex = MS(status, AR_FinalTxIdx); ar9002_hw_proc_txdesc()
333 ts->ts_seqnum = MS(status, AR_SeqNum); ar9002_hw_proc_txdesc()
336 ts->ts_rssi_ctl0 = MS(status, AR_TxRSSIAnt00); ar9002_hw_proc_txdesc()
337 ts->ts_rssi_ctl1 = MS(status, AR_TxRSSIAnt01); ar9002_hw_proc_txdesc()
338 ts->ts_rssi_ctl2 = MS(status, AR_TxRSSIAnt02); ar9002_hw_proc_txdesc()
340 ts->ts_flags |= ATH9K_TX_BA; ar9002_hw_proc_txdesc()
341 ts->ba_low = ads->AR_BaBitmapLow; ar9002_hw_proc_txdesc()
342 ts->ba_high = ads->AR_BaBitmapHigh; ar9002_hw_proc_txdesc()
347 ts->ts_status |= ATH9K_TX_ACKED; ar9002_hw_proc_txdesc()
350 ts->ts_status |= ATH9K_TXERR_XRETRY; ar9002_hw_proc_txdesc()
352 ts->ts_status |= ATH9K_TXERR_FILT; ar9002_hw_proc_txdesc()
354 ts->ts_status |= ATH9K_TXERR_FIFO; ar9002_hw_proc_txdesc()
359 ts->ts_status |= ATH9K_TXERR_TIMER_EXPIRED; ar9002_hw_proc_txdesc()
361 ts->ts_flags |= ATH9K_TX_DESC_CFG_ERR; ar9002_hw_proc_txdesc()
363 ts->ts_flags |= ATH9K_TX_DATA_UNDERRUN; ar9002_hw_proc_txdesc()
367 ts->ts_flags |= ATH9K_TX_DELIM_UNDERRUN; ar9002_hw_proc_txdesc()
370 ts->ts_shortretry = MS(status, AR_RTSFailCnt); ar9002_hw_proc_txdesc()
371 ts->ts_longretry = MS(status, AR_DataFailCnt); ar9002_hw_proc_txdesc()
372 ts->ts_virtcol = MS(status, AR_VirtRetryCnt); ar9002_hw_proc_txdesc()
375 ts->ts_rssi = MS(status, AR_TxRSSICombined); ar9002_hw_proc_txdesc()
376 ts->ts_rssi_ext0 = MS(status, AR_TxRSSIAnt10); ar9002_hw_proc_txdesc()
377 ts->ts_rssi_ext1 = MS(status, AR_TxRSSIAnt11); ar9002_hw_proc_txdesc()
378 ts->ts_rssi_ext2 = MS(status, AR_TxRSSIAnt12); ar9002_hw_proc_txdesc()
380 ts->evm0 = ads->AR_TxEVM0; ar9002_hw_proc_txdesc()
381 ts->evm1 = ads->AR_TxEVM1; ar9002_hw_proc_txdesc()
382 ts->evm2 = ads->AR_TxEVM2; ar9002_hw_proc_txdesc()
315 ar9002_hw_proc_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts) ar9002_hw_proc_txdesc() argument
H A Ddynack.h51 * @ts: TX frame timestamp buffer
56 struct ts_info ts[ATH_DYN_BUF]; member in struct:ath_dyn_txbuf
65 * @qlock: ts queue spinlock
66 * @ack_rbf: ACK ts ring buffer
67 * @st_rbf: status ts ring buffer
87 void ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb, u32 ts);
89 struct ath_tx_status *ts);
97 struct sk_buff *skb, u32 ts) {} ath_dynack_sample_tx_ts()
100 struct ath_tx_status *ts) {}
96 ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb, u32 ts) ath_dynack_sample_ack_ts() argument
98 ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, struct ath_tx_status *ts) ath_dynack_sample_tx_ts() argument
H A Dar9003_mac.c355 struct ath_tx_status *ts) ar9003_hw_proc_txdesc()
376 ts->ts_rateindex = MS(status, AR_FinalTxIdx); ar9003_hw_proc_txdesc()
377 ts->ts_seqnum = MS(status, AR_SeqNum); ar9003_hw_proc_txdesc()
378 ts->tid = MS(status, AR_TxTid); ar9003_hw_proc_txdesc()
380 ts->qid = MS(ads->ds_info, AR_TxQcuNum); ar9003_hw_proc_txdesc()
381 ts->desc_id = MS(ads->status1, AR_TxDescId); ar9003_hw_proc_txdesc()
382 ts->ts_tstamp = ads->status4; ar9003_hw_proc_txdesc()
383 ts->ts_status = 0; ar9003_hw_proc_txdesc()
384 ts->ts_flags = 0; ar9003_hw_proc_txdesc()
387 ts->ts_status |= ATH9K_TXERR_XTXOP; ar9003_hw_proc_txdesc()
389 ts->ts_rssi_ctl0 = MS(status, AR_TxRSSIAnt00); ar9003_hw_proc_txdesc()
390 ts->ts_rssi_ctl1 = MS(status, AR_TxRSSIAnt01); ar9003_hw_proc_txdesc()
391 ts->ts_rssi_ctl2 = MS(status, AR_TxRSSIAnt02); ar9003_hw_proc_txdesc()
393 ts->ts_flags |= ATH9K_TX_BA; ar9003_hw_proc_txdesc()
394 ts->ba_low = ads->status5; ar9003_hw_proc_txdesc()
395 ts->ba_high = ads->status6; ar9003_hw_proc_txdesc()
400 ts->ts_status |= ATH9K_TXERR_XRETRY; ar9003_hw_proc_txdesc()
402 ts->ts_status |= ATH9K_TXERR_FILT; ar9003_hw_proc_txdesc()
404 ts->ts_status |= ATH9K_TXERR_FIFO; ar9003_hw_proc_txdesc()
408 ts->ts_status |= ATH9K_TXERR_TIMER_EXPIRED; ar9003_hw_proc_txdesc()
410 ts->ts_flags |= ATH9K_TX_DESC_CFG_ERR; ar9003_hw_proc_txdesc()
412 ts->ts_flags |= ATH9K_TX_DATA_UNDERRUN; ar9003_hw_proc_txdesc()
416 ts->ts_flags |= ATH9K_TX_DELIM_UNDERRUN; ar9003_hw_proc_txdesc()
419 ts->ts_shortretry = MS(status, AR_RTSFailCnt); ar9003_hw_proc_txdesc()
420 ts->ts_longretry = MS(status, AR_DataFailCnt); ar9003_hw_proc_txdesc()
421 ts->ts_virtcol = MS(status, AR_VirtRetryCnt); ar9003_hw_proc_txdesc()
424 ts->ts_rssi = MS(status, AR_TxRSSICombined); ar9003_hw_proc_txdesc()
425 ts->ts_rssi_ext0 = MS(status, AR_TxRSSIAnt10); ar9003_hw_proc_txdesc()
426 ts->ts_rssi_ext1 = MS(status, AR_TxRSSIAnt11); ar9003_hw_proc_txdesc()
427 ts->ts_rssi_ext2 = MS(status, AR_TxRSSIAnt12); ar9003_hw_proc_txdesc()
354 ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds, struct ath_tx_status *ts) ar9003_hw_proc_txdesc() argument
H A Ddynack.c127 st_ts = &da->st_rbf.ts[da->st_rbf.h_rb]; ath_dynack_compute_to()
168 * @ts: tx status info
172 struct ath_tx_status *ts) ath_dynack_sample_tx_ts()
188 if (ts->ts_status & ATH9K_TXERR_XRETRY) { ath_dynack_sample_tx_ts()
202 ridx = ts->ts_rateindex; ath_dynack_sample_tx_ts()
204 da->st_rbf.ts[da->st_rbf.t_rb].tstamp = ts->ts_tstamp; ath_dynack_sample_tx_ts()
205 da->st_rbf.ts[da->st_rbf.t_rb].dur = ts->duration; ath_dynack_sample_tx_ts()
222 da->st_rbf.ts[da->st_rbf.t_rb].dur -= sifs; ath_dynack_sample_tx_ts()
226 hdr->addr1, da->st_rbf.ts[da->st_rbf.t_rb].tstamp, ath_dynack_sample_tx_ts()
227 da->st_rbf.ts[da->st_rbf.t_rb].dur, da->st_rbf.h_rb, ath_dynack_sample_tx_ts()
244 * @ts: rx timestamp
248 u32 ts) ath_dynack_sample_ack_ts()
258 da->ack_rbf.tstamp[da->ack_rbf.t_rb] = ts; ath_dynack_sample_ack_ts()
171 ath_dynack_sample_tx_ts(struct ath_hw *ah, struct sk_buff *skb, struct ath_tx_status *ts) ath_dynack_sample_tx_ts() argument
247 ath_dynack_sample_ack_ts(struct ath_hw *ah, struct sk_buff *skb, u32 ts) ath_dynack_sample_ack_ts() argument
H A Ddfs.c189 pe.ts = mactime; ath9k_dfs_process_phyerr()
194 "ath9k_dfs_process_phyerr: type=%d, freq=%d, ts=%llu, " ath9k_dfs_process_phyerr()
196 ard.pulse_bw_info, pe.freq, pe.ts, pe.width, pe.rssi, ath9k_dfs_process_phyerr()
197 pe.ts - sc->dfs_prev_pulse_ts); ath9k_dfs_process_phyerr()
198 sc->dfs_prev_pulse_ts = pe.ts; ath9k_dfs_process_phyerr()
H A Dxmit.c56 struct ath_tx_status *ts, int txok);
60 struct ath_tx_status *ts, int nframes, int nbad,
244 struct ath_tx_status ts; ath_tx_flush_tid() local
250 memset(&ts, 0, sizeof(ts)); ath_tx_flush_tid()
267 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); ath_tx_flush_tid()
321 struct ath_tx_status ts; ath_tid_drain() local
324 memset(&ts, 0, sizeof(ts)); ath_tid_drain()
337 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); ath_tid_drain()
407 struct ath_tx_status *ts, int txok, ath_tx_count_frames()
421 seq_st = ts->ts_seqnum; ath_tx_count_frames()
422 memcpy(ba, &ts->ba_low, WME_BA_BMP_SIZE >> 3); ath_tx_count_frames()
440 struct ath_tx_status *ts, int txok) ath_tx_complete_aggr()
459 bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH); ath_tx_complete_aggr()
470 retries = ts->ts_longretry + 1; ath_tx_complete_aggr()
471 for (i = 0; i < ts->ts_rateindex; i++) ath_tx_complete_aggr()
487 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, 0); ath_tx_complete_aggr()
497 isba = ts->ts_flags & ATH9K_TX_BA; ath_tx_complete_aggr()
507 if (isba && tid->tidno != ts->tid) ath_tx_complete_aggr()
514 if (ts->ts_flags & ATH9K_TX_BA) { ath_tx_complete_aggr()
515 seq_st = ts->ts_seqnum; ath_tx_complete_aggr()
516 memcpy(ba, &ts->ba_low, WME_BA_BMP_SIZE >> 3); ath_tx_complete_aggr()
532 ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad); ath_tx_complete_aggr()
589 ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok); ath_tx_complete_aggr()
594 ts); ath_tx_complete_aggr()
597 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, ath_tx_complete_aggr()
618 &bf_head, ts, 0); ath_tx_complete_aggr()
646 if (ts->ts_status & (ATH9K_TXERR_FILT | ATH9K_TXERR_XRETRY)) ath_tx_complete_aggr()
675 struct ath_tx_status *ts, struct ath_buf *bf, ath_tx_process_buffer()
681 txok = !(ts->ts_status & ATH9K_TXERR_MASK); ath_tx_process_buffer()
682 flush = !!(ts->ts_status & ATH9K_TX_FLUSH); ath_tx_process_buffer()
689 ts->duration = ath9k_hw_get_duration(sc->sc_ah, bf->bf_desc, ath_tx_process_buffer()
690 ts->ts_rateindex); ath_tx_process_buffer()
696 ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok); ath_tx_process_buffer()
697 ath_dynack_sample_tx_ts(sc->sc_ah, bf->bf_mpdu, ts); ath_tx_process_buffer()
699 ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok); ath_tx_process_buffer()
701 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok); ath_tx_process_buffer()
930 struct ath_tx_status ts = {}; ath_tx_get_tid_subframe() local
937 ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0); ath_tx_get_tid_subframe()
1811 struct ath_tx_status ts; ath_drain_txq_list() local
1813 memset(&ts, 0, sizeof(ts)); ath_drain_txq_list()
1814 ts.ts_status = ATH9K_TX_FLUSH; ath_drain_txq_list()
1829 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); ath_drain_txq_list()
2540 struct ath_tx_status *ts, int txok) ath_tx_complete_buf()
2550 if (ts->ts_status & ATH9K_TXERR_FILT) ath_tx_complete_buf()
2566 ath_debug_stat_tx(sc, bf, ts, txq, tx_flags); ath_tx_complete_buf()
2584 struct ath_tx_status *ts, int nframes, int nbad, ath_tx_rc_status()
2595 tx_info->status.ack_signal = ts->ts_rssi; ath_tx_rc_status()
2597 tx_rateindex = ts->ts_rateindex; ath_tx_rc_status()
2608 if ((ts->ts_status & ATH9K_TXERR_FILT) == 0 && ath_tx_rc_status()
2622 if (unlikely(ts->ts_flags & (ATH9K_TX_DATA_UNDERRUN | ath_tx_rc_status()
2635 tx_info->status.rates[tx_rateindex].count = ts->ts_longretry + 1; ath_tx_rc_status()
2645 struct ath_tx_status ts; ath_tx_processq() local
2685 memset(&ts, 0, sizeof(ts)); ath_tx_processq()
2686 status = ath9k_hw_txprocdesc(ah, ds, &ts); ath_tx_processq()
2708 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); ath_tx_processq()
2727 struct ath_tx_status ts; ath_tx_edma_tasklet() local
2740 status = ath9k_hw_txprocdesc(ah, NULL, (void *)&ts); ath_tx_edma_tasklet()
2749 if (ts.qid == sc->beacon.beaconq) { ath_tx_edma_tasklet()
2751 sc->beacon.tx_last = !(ts.ts_status & ATH9K_TXERR_MASK); ath_tx_edma_tasklet()
2762 txq = &sc->tx.txq[ts.qid]; ath_tx_edma_tasklet()
2803 ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head); ath_tx_edma_tasklet()
406 ath_tx_count_frames(struct ath_softc *sc, struct ath_buf *bf, struct ath_tx_status *ts, int txok, int *nframes, int *nbad) ath_tx_count_frames() argument
438 ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf, struct list_head *bf_q, struct ath_tx_status *ts, int txok) ath_tx_complete_aggr() argument
674 ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq, struct ath_tx_status *ts, struct ath_buf *bf, struct list_head *bf_head) ath_tx_process_buffer() argument
2538 ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf, struct ath_txq *txq, struct list_head *bf_q, struct ath_tx_status *ts, int txok) ath_tx_complete_buf() argument
2583 ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf, struct ath_tx_status *ts, int nframes, int nbad, int txok) ath_tx_rc_status() argument
/linux-4.1.27/arch/arm/kernel/
H A Dtime.c79 static void dummy_clock_access(struct timespec64 *ts) dummy_clock_access() argument
81 ts->tv_sec = 0; dummy_clock_access()
82 ts->tv_nsec = 0; dummy_clock_access()
88 void read_persistent_clock64(struct timespec64 *ts) read_persistent_clock64() argument
90 __read_persistent_clock(ts); read_persistent_clock64()
93 void read_boot_clock64(struct timespec64 *ts) read_boot_clock64() argument
95 __read_boot_clock(ts); read_boot_clock64()
/linux-4.1.27/drivers/staging/skein/
H A Dskein_block.c33 #define ts (kw + KW_TWK_BASE) macro
38 ctx->h.tweak[0] = ts[0]; \
39 ctx->h.tweak[1] = ts[1]; \
77 X1 += ks[((R) + 2) % 5] + ts[((R) + 1) % 3]; \
78 X2 += ks[((R) + 3) % 5] + ts[((R) + 2) % 3]; \
89 X1 += ks[r + (R) + 1] + ts[r + (R) + 0]; \
90 X2 += ks[r + (R) + 2] + ts[r + (R) + 1]; \
94 ts[r + (R) + 2] = ts[r + (R) - 1]; \
163 X5 += ks[((R) + 6) % 9] + ts[((R) + 1) % 3]; \
164 X6 += ks[((R) + 7) % 9] + ts[((R) + 2) % 3]; \
180 X5 += ks[r + (R) + 5] + ts[r + (R) + 0]; \
181 X6 += ks[r + (R) + 6] + ts[r + (R) + 1]; \
185 ts[r + (R) + 2] = ts[r + (R) - 1]; \
276 X13 += ks[((R) + 14) % 17] + ts[((R) + 1) % 3]; \
277 X14 += ks[((R) + 15) % 17] + ts[((R) + 2) % 3]; \
302 X13 += ks[r + (R) + 13] + ts[r + (R) + 0]; \
303 X14 += ks[r + (R) + 14] + ts[r + (R) + 1]; \
307 ts[r + (R) + 2] = ts[r + (R) - 1]; \
370 ts[0] = ctx->h.tweak[0]; skein_256_process_block()
371 ts[1] = ctx->h.tweak[1]; skein_256_process_block()
377 ts[0] += byte_cnt_add; /* update processed length */ skein_256_process_block()
386 ts[2] = ts[0] ^ ts[1]; skein_256_process_block()
394 X1 = w[1] + ks[1] + ts[0]; skein_256_process_block()
395 X2 = w[2] + ks[2] + ts[1]; skein_256_process_block()
454 ts[1] &= ~SKEIN_T1_FLAG_FIRST; skein_256_process_block()
456 ctx->h.tweak[0] = ts[0]; skein_256_process_block()
457 ctx->h.tweak[1] = ts[1]; skein_256_process_block()
503 ts[0] = ctx->h.tweak[0]; skein_512_process_block()
504 ts[1] = ctx->h.tweak[1]; skein_512_process_block()
510 ts[0] += byte_cnt_add; /* update processed length */ skein_512_process_block()
524 ts[2] = ts[0] ^ ts[1]; skein_512_process_block()
536 X5 = w[5] + ks[5] + ts[0]; skein_512_process_block()
537 X6 = w[6] + ks[6] + ts[1]; skein_512_process_block()
603 ts[1] &= ~SKEIN_T1_FLAG_FIRST; skein_512_process_block()
605 ctx->h.tweak[0] = ts[0]; skein_512_process_block()
606 ctx->h.tweak[1] = ts[1]; skein_512_process_block()
643 ts[0] = ctx->h.tweak[0]; skein_1024_process_block()
644 ts[1] = ctx->h.tweak[1]; skein_1024_process_block()
650 ts[0] += byte_cnt_add; /* update processed length */ skein_1024_process_block()
674 ts[2] = ts[0] ^ ts[1]; skein_1024_process_block()
694 X13 = w[13] + ks[13] + ts[0]; skein_1024_process_block()
695 X14 = w[14] + ks[14] + ts[1]; skein_1024_process_block()
764 ts[1] &= ~SKEIN_T1_FLAG_FIRST; skein_1024_process_block()
767 ctx->h.tweak[0] = ts[0]; skein_1024_process_block()
768 ctx->h.tweak[1] = ts[1]; skein_1024_process_block()
/linux-4.1.27/drivers/scsi/pm8001/
H A Dpm8001_hwi.c1521 struct task_status_struct *ts; pm8001_work_fn() local
1547 ts = &t->task_status; pm8001_work_fn()
1548 ts->resp = SAS_TASK_COMPLETE; pm8001_work_fn()
1550 ts->stat = SAS_QUEUE_FULL; pm8001_work_fn()
1563 t, pw->handler, ts->resp, ts->stat)); pm8001_work_fn()
1855 struct task_status_struct *ts; mpi_ssp_completion() local
1877 ts = &t->task_status; mpi_ssp_completion()
1890 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1891 ts->stat = SAM_STAT_GOOD; mpi_ssp_completion()
1893 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1894 ts->stat = SAS_PROTO_RESPONSE; mpi_ssp_completion()
1895 ts->residual = param; mpi_ssp_completion()
1905 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1906 ts->stat = SAS_ABORTED_TASK; mpi_ssp_completion()
1912 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1913 ts->stat = SAS_DATA_UNDERRUN; mpi_ssp_completion()
1914 ts->residual = param; mpi_ssp_completion()
1921 ts->resp = SAS_TASK_UNDELIVERED; mpi_ssp_completion()
1922 ts->stat = SAS_PHY_DOWN; mpi_ssp_completion()
1927 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1928 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1930 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
1935 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1936 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1937 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
1942 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1943 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1944 ts->open_rej_reason = SAS_OREJ_EPROTO; mpi_ssp_completion()
1949 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1950 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1951 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_ssp_completion()
1956 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1957 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1958 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
1963 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1964 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1965 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_ssp_completion()
1974 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1975 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1976 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_ssp_completion()
1982 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1983 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1984 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_ssp_completion()
1989 ts->resp = SAS_TASK_UNDELIVERED; mpi_ssp_completion()
1990 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1991 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_ssp_completion()
1996 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1997 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1998 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
2003 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2004 ts->stat = SAS_NAK_R_ERR; mpi_ssp_completion()
2009 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2010 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2015 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2016 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2017 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
2022 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2023 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2028 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2029 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2034 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2035 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2044 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2045 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2050 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2051 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2056 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2057 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2062 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2063 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2064 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
2070 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
2071 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
2086 t, status, ts->resp, ts->stat)); mpi_ssp_completion()
2101 struct task_status_struct *ts; mpi_ssp_event() local
2119 ts = &t->task_status; mpi_ssp_event()
2126 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2127 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
2128 ts->residual = 0; mpi_ssp_event()
2140 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2141 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
2142 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_event()
2148 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2149 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
2150 ts->open_rej_reason = SAS_OREJ_EPROTO; mpi_ssp_event()
2155 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2156 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
2157 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_ssp_event()
2162 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2163 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
2164 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_event()
2169 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2170 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
2171 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_ssp_event()
2180 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2181 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
2182 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_ssp_event()
2188 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2189 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
2190 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_ssp_event()
2195 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2196 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
2197 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_ssp_event()
2202 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2203 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
2204 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_event()
2209 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2210 ts->stat = SAS_NAK_R_ERR; mpi_ssp_event()
2220 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2221 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
2226 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2227 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
2232 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2233 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
2238 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2239 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
2244 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2245 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
2250 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2251 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
2261 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
2262 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
2274 t, event, ts->resp, ts->stat)); mpi_ssp_event()
2299 struct task_status_struct *ts; mpi_sata_completion() local
2341 ts = &t->task_status; mpi_sata_completion()
2342 if (!ts) { mpi_sata_completion()
2344 pm8001_printk("ts null\n")); mpi_sata_completion()
2391 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2392 ts->stat = SAM_STAT_GOOD; mpi_sata_completion()
2408 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2409 ts->stat = SAS_PROTO_RESPONSE; mpi_sata_completion()
2410 ts->residual = param; mpi_sata_completion()
2415 resp = (struct ata_task_resp *)ts->buf; mpi_sata_completion()
2433 ts->buf_valid_size = sizeof(*resp); mpi_sata_completion()
2444 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2445 ts->stat = SAS_ABORTED_TASK; mpi_sata_completion()
2454 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2455 ts->stat = SAS_DATA_UNDERRUN; mpi_sata_completion()
2456 ts->residual = param; mpi_sata_completion()
2463 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2464 ts->stat = SAS_PHY_DOWN; mpi_sata_completion()
2469 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2470 ts->stat = SAS_INTERRUPTED; mpi_sata_completion()
2475 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2476 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2477 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_sata_completion()
2483 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2484 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2485 ts->open_rej_reason = SAS_OREJ_EPROTO; mpi_sata_completion()
2490 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2491 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2492 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_sata_completion()
2497 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2498 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2499 ts->open_rej_reason = SAS_OREJ_RSVD_CONT0; mpi_sata_completion()
2504 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2505 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2510 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2511 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2519 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2520 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2521 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_sata_completion()
2526 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2527 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2536 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2537 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2538 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_sata_completion()
2544 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2545 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2550 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2551 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2559 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2560 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2561 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_sata_completion()
2566 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2567 ts->stat = SAS_NAK_R_ERR; mpi_sata_completion()
2572 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2573 ts->stat = SAS_NAK_R_ERR; mpi_sata_completion()
2578 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2579 ts->stat = SAS_ABORTED_TASK; mpi_sata_completion()
2584 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2585 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2590 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2591 ts->stat = SAS_DATA_UNDERRUN; mpi_sata_completion()
2596 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2597 ts->stat = SAS_OPEN_TO; mpi_sata_completion()
2602 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2603 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2608 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2609 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2613 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2614 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2622 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2623 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2628 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2629 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2633 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2634 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2642 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2643 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2644 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_sata_completion()
2649 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2650 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2662 t, status, ts->resp, ts->stat)); mpi_sata_completion()
2674 struct task_status_struct *ts; mpi_sata_event() local
2716 ts = &t->task_status; mpi_sata_event()
2723 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2724 ts->stat = SAS_DATA_OVERRUN; mpi_sata_event()
2725 ts->residual = 0; mpi_sata_event()
2732 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2733 ts->stat = SAS_INTERRUPTED; mpi_sata_event()
2738 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2739 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2740 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_sata_event()
2746 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2747 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2748 ts->open_rej_reason = SAS_OREJ_EPROTO; mpi_sata_event()
2753 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2754 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2755 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_sata_event()
2760 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2761 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2762 ts->open_rej_reason = SAS_OREJ_RSVD_CONT0; mpi_sata_event()
2767 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_event()
2768 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_event()
2773 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2774 ts->stat = SAS_QUEUE_FULL; mpi_sata_event()
2782 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_event()
2783 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2784 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_sata_event()
2790 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2791 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2792 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_sata_event()
2797 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2798 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2799 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_sata_event()
2804 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2805 ts->stat = SAS_NAK_R_ERR; mpi_sata_event()
2810 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2811 ts->stat = SAS_NAK_R_ERR; mpi_sata_event()
2816 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2817 ts->stat = SAS_DATA_UNDERRUN; mpi_sata_event()
2822 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2823 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2828 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2829 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2834 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2835 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2840 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2841 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2846 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2847 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2852 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2853 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2862 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2863 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2869 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2870 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2882 t, event, ts->resp, ts->stat)); mpi_sata_event()
2901 struct task_status_struct *ts; mpi_smp_completion() local
2911 ts = &t->task_status; mpi_smp_completion()
2922 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2923 ts->stat = SAM_STAT_GOOD; mpi_smp_completion()
2930 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2931 ts->stat = SAS_ABORTED_TASK; mpi_smp_completion()
2937 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2938 ts->stat = SAS_DATA_OVERRUN; mpi_smp_completion()
2939 ts->residual = 0; mpi_smp_completion()
2945 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2946 ts->stat = SAS_PHY_DOWN; mpi_smp_completion()
2951 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2952 ts->stat = SAM_STAT_BUSY; mpi_smp_completion()
2957 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2958 ts->stat = SAM_STAT_BUSY; mpi_smp_completion()
2963 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2964 ts->stat = SAM_STAT_BUSY; mpi_smp_completion()
2969 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2970 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2971 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_smp_completion()
2976 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2977 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2978 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_smp_completion()
2983 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2984 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2985 ts->open_rej_reason = SAS_OREJ_RSVD_CONT0; mpi_smp_completion()
2990 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2991 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2992 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_smp_completion()
3000 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3001 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
3002 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_smp_completion()
3008 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3009 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
3010 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_smp_completion()
3015 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3016 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
3017 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_smp_completion()
3022 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3023 ts->stat = SAS_DEV_NO_RESPONSE; mpi_smp_completion()
3028 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3029 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
3030 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_smp_completion()
3035 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3036 ts->stat = SAS_QUEUE_FULL; mpi_smp_completion()
3041 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3042 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
3043 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_smp_completion()
3048 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3049 ts->stat = SAS_DEV_NO_RESPONSE; mpi_smp_completion()
3054 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3055 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
3056 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_smp_completion()
3061 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3062 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
3063 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_smp_completion()
3068 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
3069 ts->stat = SAS_DEV_NO_RESPONSE; mpi_smp_completion()
3082 t, status, ts->resp, ts->stat)); mpi_smp_completion()
3709 struct task_status_struct *ts; pm8001_mpi_task_abort_resp() local
3733 ts = &t->task_status; pm8001_mpi_task_abort_resp()
3741 ts->resp = SAS_TASK_COMPLETE; pm8001_mpi_task_abort_resp()
3742 ts->stat = SAM_STAT_GOOD; pm8001_mpi_task_abort_resp()
3746 ts->resp = TMF_RESP_FUNC_FAILED; pm8001_mpi_task_abort_resp()
4415 struct task_status_struct *ts; pm8001_chip_sata_req() local
4418 ts = &task->task_status; pm8001_chip_sata_req()
4421 ts->resp = SAS_TASK_COMPLETE; pm8001_chip_sata_req()
4422 ts->stat = SAM_STAT_GOOD; pm8001_chip_sata_req()
4433 "\n", task, ts->resp, ts->stat)); pm8001_chip_sata_req()
H A Dpm80xx_hwi.c1511 struct task_status_struct *ts; mpi_ssp_completion() local
1532 ts = &t->task_status; mpi_ssp_completion()
1546 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1547 ts->stat = SAM_STAT_GOOD; mpi_ssp_completion()
1549 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1550 ts->stat = SAS_PROTO_RESPONSE; mpi_ssp_completion()
1551 ts->residual = param; mpi_ssp_completion()
1561 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1562 ts->stat = SAS_ABORTED_TASK; mpi_ssp_completion()
1569 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1570 ts->stat = SAS_DATA_UNDERRUN; mpi_ssp_completion()
1571 ts->residual = param; mpi_ssp_completion()
1578 ts->resp = SAS_TASK_UNDELIVERED; mpi_ssp_completion()
1579 ts->stat = SAS_PHY_DOWN; mpi_ssp_completion()
1584 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1585 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1587 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
1592 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1593 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1594 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
1599 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1600 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1601 ts->open_rej_reason = SAS_OREJ_EPROTO; mpi_ssp_completion()
1606 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1607 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1608 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_ssp_completion()
1613 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1614 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1615 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
1625 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1626 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1627 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_ssp_completion()
1636 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1637 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1638 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_ssp_completion()
1643 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1644 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1645 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_ssp_completion()
1650 ts->resp = SAS_TASK_UNDELIVERED; mpi_ssp_completion()
1651 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1652 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_ssp_completion()
1657 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1658 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1659 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
1664 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1665 ts->stat = SAS_NAK_R_ERR; mpi_ssp_completion()
1670 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1671 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1676 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1677 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1678 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
1683 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1684 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1689 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1690 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1695 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1696 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1705 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1706 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1711 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1712 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1717 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1718 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1723 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1724 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1725 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_completion()
1731 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_completion()
1732 ts->stat = SAS_OPEN_REJECT; mpi_ssp_completion()
1747 t, status, ts->resp, ts->stat)); mpi_ssp_completion()
1762 struct task_status_struct *ts; mpi_ssp_event() local
1779 ts = &t->task_status; mpi_ssp_event()
1786 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1787 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
1788 ts->residual = 0; mpi_ssp_event()
1800 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1801 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
1802 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_event()
1807 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1808 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
1809 ts->open_rej_reason = SAS_OREJ_EPROTO; mpi_ssp_event()
1814 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1815 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
1816 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_ssp_event()
1821 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1822 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
1823 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_event()
1833 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1834 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
1835 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_ssp_event()
1844 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1845 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
1846 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_ssp_event()
1851 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1852 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
1853 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_ssp_event()
1858 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1859 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
1860 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_ssp_event()
1865 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1866 ts->stat = SAS_OPEN_REJECT; mpi_ssp_event()
1867 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_ssp_event()
1872 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1873 ts->stat = SAS_NAK_R_ERR; mpi_ssp_event()
1883 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1884 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
1889 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1890 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
1895 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1896 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
1901 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1902 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
1907 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1908 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
1913 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1914 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
1920 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1921 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
1931 ts->resp = SAS_TASK_COMPLETE; mpi_ssp_event()
1932 ts->stat = SAS_DATA_OVERRUN; mpi_ssp_event()
1944 t, event, ts->resp, ts->stat)); mpi_ssp_event()
1968 struct task_status_struct *ts; mpi_sata_completion() local
2010 ts = &t->task_status; mpi_sata_completion()
2011 if (!ts) { mpi_sata_completion()
2013 pm8001_printk("ts null\n")); mpi_sata_completion()
2061 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2062 ts->stat = SAM_STAT_GOOD; mpi_sata_completion()
2078 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2079 ts->stat = SAS_PROTO_RESPONSE; mpi_sata_completion()
2080 ts->residual = param; mpi_sata_completion()
2085 resp = (struct ata_task_resp *)ts->buf; mpi_sata_completion()
2103 ts->buf_valid_size = sizeof(*resp); mpi_sata_completion()
2114 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2115 ts->stat = SAS_ABORTED_TASK; mpi_sata_completion()
2124 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2125 ts->stat = SAS_DATA_UNDERRUN; mpi_sata_completion()
2126 ts->residual = param; mpi_sata_completion()
2133 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2134 ts->stat = SAS_PHY_DOWN; mpi_sata_completion()
2139 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2140 ts->stat = SAS_INTERRUPTED; mpi_sata_completion()
2145 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2146 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2147 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_sata_completion()
2152 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2153 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2154 ts->open_rej_reason = SAS_OREJ_EPROTO; mpi_sata_completion()
2159 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2160 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2161 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_sata_completion()
2166 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2167 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2168 ts->open_rej_reason = SAS_OREJ_RSVD_CONT0; mpi_sata_completion()
2178 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2179 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2184 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2185 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2193 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2194 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2195 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_sata_completion()
2200 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2201 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2209 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2210 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2211 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_sata_completion()
2216 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2217 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2222 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2223 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2231 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2232 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2233 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_sata_completion()
2238 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2239 ts->stat = SAS_NAK_R_ERR; mpi_sata_completion()
2244 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2245 ts->stat = SAS_NAK_R_ERR; mpi_sata_completion()
2250 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2251 ts->stat = SAS_ABORTED_TASK; mpi_sata_completion()
2256 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2257 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2262 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2263 ts->stat = SAS_DATA_UNDERRUN; mpi_sata_completion()
2268 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2269 ts->stat = SAS_OPEN_TO; mpi_sata_completion()
2274 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2275 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2280 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2281 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2285 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2286 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2294 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2295 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2300 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2301 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2305 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_completion()
2306 ts->stat = SAS_QUEUE_FULL; mpi_sata_completion()
2314 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2315 ts->stat = SAS_OPEN_REJECT; mpi_sata_completion()
2316 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_sata_completion()
2321 ts->resp = SAS_TASK_COMPLETE; mpi_sata_completion()
2322 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_completion()
2334 t, status, ts->resp, ts->stat)); mpi_sata_completion()
2346 struct task_status_struct *ts; mpi_sata_event() local
2387 ts = &t->task_status; mpi_sata_event()
2394 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2395 ts->stat = SAS_DATA_OVERRUN; mpi_sata_event()
2396 ts->residual = 0; mpi_sata_event()
2403 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2404 ts->stat = SAS_INTERRUPTED; mpi_sata_event()
2409 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2410 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2411 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_sata_event()
2416 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2417 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2418 ts->open_rej_reason = SAS_OREJ_EPROTO; mpi_sata_event()
2423 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2424 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2425 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_sata_event()
2430 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2431 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2432 ts->open_rej_reason = SAS_OREJ_RSVD_CONT0; mpi_sata_event()
2442 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_event()
2443 ts->stat = SAS_DEV_NO_RESPONSE; mpi_sata_event()
2448 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2449 ts->stat = SAS_QUEUE_FULL; mpi_sata_event()
2457 ts->resp = SAS_TASK_UNDELIVERED; mpi_sata_event()
2458 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2459 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_sata_event()
2464 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2465 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2466 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_sata_event()
2471 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2472 ts->stat = SAS_OPEN_REJECT; mpi_sata_event()
2473 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_sata_event()
2478 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2479 ts->stat = SAS_NAK_R_ERR; mpi_sata_event()
2484 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2485 ts->stat = SAS_NAK_R_ERR; mpi_sata_event()
2490 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2491 ts->stat = SAS_DATA_UNDERRUN; mpi_sata_event()
2496 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2497 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2502 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2503 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2508 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2509 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2514 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2515 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2520 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2521 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2526 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2527 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2536 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2537 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2543 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2544 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2550 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2551 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2557 ts->resp = SAS_TASK_COMPLETE; mpi_sata_event()
2558 ts->stat = SAS_OPEN_TO; mpi_sata_event()
2570 t, event, ts->resp, ts->stat)); mpi_sata_event()
2589 struct task_status_struct *ts; mpi_smp_completion() local
2600 ts = &t->task_status; mpi_smp_completion()
2612 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2613 ts->stat = SAM_STAT_GOOD; mpi_smp_completion()
2635 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2636 ts->stat = SAS_ABORTED_TASK; mpi_smp_completion()
2642 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2643 ts->stat = SAS_DATA_OVERRUN; mpi_smp_completion()
2644 ts->residual = 0; mpi_smp_completion()
2650 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2651 ts->stat = SAS_PHY_DOWN; mpi_smp_completion()
2656 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2657 ts->stat = SAM_STAT_BUSY; mpi_smp_completion()
2662 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2663 ts->stat = SAM_STAT_BUSY; mpi_smp_completion()
2668 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2669 ts->stat = SAM_STAT_BUSY; mpi_smp_completion()
2674 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2675 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2676 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_smp_completion()
2681 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2682 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2683 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_smp_completion()
2688 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2689 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2690 ts->open_rej_reason = SAS_OREJ_RSVD_CONT0; mpi_smp_completion()
2700 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2701 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2702 ts->open_rej_reason = SAS_OREJ_UNKNOWN; mpi_smp_completion()
2710 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2711 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2712 ts->open_rej_reason = SAS_OREJ_BAD_DEST; mpi_smp_completion()
2717 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2718 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2719 ts->open_rej_reason = SAS_OREJ_CONN_RATE; mpi_smp_completion()
2724 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2725 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2726 ts->open_rej_reason = SAS_OREJ_WRONG_DEST; mpi_smp_completion()
2731 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2732 ts->stat = SAS_DEV_NO_RESPONSE; mpi_smp_completion()
2737 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2738 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2739 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_smp_completion()
2744 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2745 ts->stat = SAS_QUEUE_FULL; mpi_smp_completion()
2750 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2751 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2752 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_smp_completion()
2757 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2758 ts->stat = SAS_DEV_NO_RESPONSE; mpi_smp_completion()
2763 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2764 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2765 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_smp_completion()
2770 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2771 ts->stat = SAS_OPEN_REJECT; mpi_smp_completion()
2772 ts->open_rej_reason = SAS_OREJ_RSVD_RETRY; mpi_smp_completion()
2777 ts->resp = SAS_TASK_COMPLETE; mpi_smp_completion()
2778 ts->stat = SAS_DEV_NO_RESPONSE; mpi_smp_completion()
2791 t, status, ts->resp, ts->stat)); mpi_smp_completion()
4251 struct task_status_struct *ts; pm80xx_chip_sata_req() local
4254 ts = &task->task_status; pm80xx_chip_sata_req()
4257 ts->resp = SAS_TASK_COMPLETE; pm80xx_chip_sata_req()
4258 ts->stat = SAM_STAT_GOOD; pm80xx_chip_sata_req()
4269 "\n", task, ts->resp, ts->stat)); pm80xx_chip_sata_req()
/linux-4.1.27/drivers/misc/
H A Dkgdbts.c187 static struct test_state ts; variable in typeref:struct:test_state
368 ts.idx -= 2; check_single_step()
373 ts.idx -= 4; check_single_step()
402 ts.idx++; skip_back_repeat_test()
404 ts.idx -= go_back; skip_back_repeat_test()
405 fill_get_buf(ts.tst[ts.idx].get); skip_back_repeat_test()
429 ts.idx--; put_cont_catch()
439 ts.idx = -1; emul_reset()
527 ts.idx--; emul_sstep_put()
713 v2printk("get%i: %s\n", ts.idx, get_buf); fill_get_buf()
720 if (ts.tst[ts.idx].put_handler) validate_simple_test()
721 return ts.tst[ts.idx].put_handler(put_str, validate_simple_test()
722 ts.tst[ts.idx].put); validate_simple_test()
724 chk_str = ts.tst[ts.idx].put; validate_simple_test()
761 if (ts.tst[ts.idx].get_handler) run_simple_test()
762 ts.tst[ts.idx].get_handler(ts.tst[ts.idx].get); run_simple_test()
764 fill_get_buf(ts.tst[ts.idx].get); run_simple_test()
769 ts.name, ts.idx); run_simple_test()
781 if (ts.tst[ts.idx].get[0] == '\0' && ts.tst[ts.idx].put[0] == '\0' && run_simple_test()
782 !ts.tst[ts.idx].get_handler) { run_simple_test()
784 " '%s' line %i\n", ts.name, ts.idx); run_simple_test()
790 " '%s' line %i\n", ts.name, ts.idx); run_simple_test()
805 " '%s' line %i\n", ts.name, ts.idx); run_simple_test()
810 v2printk("put%i: %s\n", ts.idx, put_buf); run_simple_test()
812 if (ts.validate_put && ts.validate_put(put_buf)) { run_simple_test()
815 ts.name, ts.idx, ts.tst[ts.idx].put, put_buf); run_simple_test()
817 ts.idx++; run_simple_test()
827 memset(&ts, 0, sizeof(ts)); init_simple_test()
828 ts.run_test = run_simple_test; init_simple_test()
829 ts.validate_put = validate_simple_test; init_simple_test()
840 ts.tst = plant_and_detach_test; run_plant_and_detach_test()
841 ts.name = "plant_and_detach_test"; run_plant_and_detach_test()
862 ts.tst = hw_breakpoint_test; run_breakpoint_test()
863 ts.name = "hw_breakpoint_test"; run_breakpoint_test()
865 ts.tst = sw_breakpoint_test; run_breakpoint_test()
866 ts.name = "sw_breakpoint_test"; run_breakpoint_test()
877 eprintk("kgdbts: ERROR %s test failed\n", ts.name); run_breakpoint_test()
887 ts.tst = hw_write_break_test; run_hw_break_test()
888 ts.name = "hw_write_break_test"; run_hw_break_test()
890 ts.tst = hw_access_break_test; run_hw_break_test()
891 ts.name = "hw_access_break_test"; run_hw_break_test()
899 ts.name); run_hw_break_test()
909 eprintk("kgdbts: ERROR %s test failed\n", ts.name); run_hw_break_test()
918 ts.tst = nmi_sleep_test; run_nmi_sleep_test()
919 ts.name = "nmi_sleep_test"; run_nmi_sleep_test()
932 eprintk("kgdbts: ERROR %s test failed\n", ts.name); run_nmi_sleep_test()
938 ts.tst = bad_read_test; run_bad_read_test()
939 ts.name = "bad_read_test"; run_bad_read_test()
947 ts.tst = do_fork_test; run_do_fork_test()
948 ts.name = "do_fork_test"; run_do_fork_test()
956 ts.tst = sys_open_test; run_sys_open_test()
957 ts.name = "sys_open_test"; run_sys_open_test()
965 ts.tst = singlestep_break_test; run_singlestep_break_test()
966 ts.name = "singlestep_breakpoint_test"; run_singlestep_break_test()
1120 if (ts.run_test) kgdbts_get_char()
1121 val = ts.run_test(1, 0); kgdbts_get_char()
1128 if (ts.run_test) kgdbts_put_char()
1129 ts.run_test(0, chr); kgdbts_put_char()
/linux-4.1.27/drivers/net/wireless/ath/ath5k/
H A Dtrace.h66 struct ath5k_txq *q, struct ath5k_tx_status *ts),
68 TP_ARGS(priv, skb, q, ts),
83 __entry->ts_status = ts->ts_status;
84 __entry->ts_rssi = ts->ts_rssi;
85 __entry->ts_antenna = ts->ts_antenna;
H A Ddesc.c439 * @ts: The &struct ath5k_tx_status
444 struct ath5k_tx_status *ts) ath5k_hw_proc_2word_tx_status()
457 ts->ts_tstamp = AR5K_REG_MS(tx_status->tx_status_0, ath5k_hw_proc_2word_tx_status()
459 ts->ts_shortretry = AR5K_REG_MS(tx_status->tx_status_0, ath5k_hw_proc_2word_tx_status()
461 ts->ts_final_retry = AR5K_REG_MS(tx_status->tx_status_0, ath5k_hw_proc_2word_tx_status()
463 /*TODO: ts->ts_virtcol + test*/ ath5k_hw_proc_2word_tx_status()
464 ts->ts_seqnum = AR5K_REG_MS(tx_status->tx_status_1, ath5k_hw_proc_2word_tx_status()
466 ts->ts_rssi = AR5K_REG_MS(tx_status->tx_status_1, ath5k_hw_proc_2word_tx_status()
468 ts->ts_antenna = 1; ath5k_hw_proc_2word_tx_status()
469 ts->ts_status = 0; ath5k_hw_proc_2word_tx_status()
470 ts->ts_final_idx = 0; ath5k_hw_proc_2word_tx_status()
475 ts->ts_status |= AR5K_TXERR_XRETRY; ath5k_hw_proc_2word_tx_status()
478 ts->ts_status |= AR5K_TXERR_FIFO; ath5k_hw_proc_2word_tx_status()
481 ts->ts_status |= AR5K_TXERR_FILT; ath5k_hw_proc_2word_tx_status()
491 * @ts: The &struct ath5k_tx_status
496 struct ath5k_tx_status *ts) ath5k_hw_proc_4word_tx_status()
514 ts->ts_tstamp = AR5K_REG_MS(txstat0, ath5k_hw_proc_4word_tx_status()
516 ts->ts_shortretry = AR5K_REG_MS(txstat0, ath5k_hw_proc_4word_tx_status()
518 ts->ts_final_retry = AR5K_REG_MS(txstat0, ath5k_hw_proc_4word_tx_status()
520 ts->ts_seqnum = AR5K_REG_MS(txstat1, ath5k_hw_proc_4word_tx_status()
522 ts->ts_rssi = AR5K_REG_MS(txstat1, ath5k_hw_proc_4word_tx_status()
524 ts->ts_antenna = (txstat1 & ath5k_hw_proc_4word_tx_status()
526 ts->ts_status = 0; ath5k_hw_proc_4word_tx_status()
528 ts->ts_final_idx = AR5K_REG_MS(txstat1, ath5k_hw_proc_4word_tx_status()
534 ts->ts_status |= AR5K_TXERR_XRETRY; ath5k_hw_proc_4word_tx_status()
537 ts->ts_status |= AR5K_TXERR_FIFO; ath5k_hw_proc_4word_tx_status()
540 ts->ts_status |= AR5K_TXERR_FILT; ath5k_hw_proc_4word_tx_status()
442 ath5k_hw_proc_2word_tx_status(struct ath5k_hw *ah, struct ath5k_desc *desc, struct ath5k_tx_status *ts) ath5k_hw_proc_2word_tx_status() argument
494 ath5k_hw_proc_4word_tx_status(struct ath5k_hw *ah, struct ath5k_desc *desc, struct ath5k_tx_status *ts) ath5k_hw_proc_4word_tx_status() argument
/linux-4.1.27/kernel/trace/
H A Dtrace_stat.c33 struct tracer_stat *ts; member in struct:stat_session
51 if (session->ts->stat_release) __reset_stat_session()
52 session->ts->stat_release(snode->stat); __reset_stat_session()
126 struct tracer_stat *ts = session->ts; stat_seq_init() local
135 if (!ts->stat_cmp) stat_seq_init()
136 ts->stat_cmp = dummy_cmp; stat_seq_init()
138 stat = ts->stat_start(ts); stat_seq_init()
142 ret = insert_stat(root, stat, ts->stat_cmp); stat_seq_init()
150 stat = ts->stat_next(stat, i); stat_seq_init()
156 ret = insert_stat(root, stat, ts->stat_cmp); stat_seq_init()
183 if (session->ts->stat_headers) { stat_seq_start()
221 return session->ts->stat_headers(s); stat_seq_show()
223 return session->ts->stat_show(s, l->stat); stat_seq_show()
294 session->file = tracefs_create_file(session->ts->name, 0644, init_stat_file()
316 if (node->ts == trace) { register_stat_tracer()
328 session->ts = trace; register_stat_tracer()
352 if (node->ts == trace) { unregister_stat_tracer()
/linux-4.1.27/arch/um/os-Linux/
H A Dtime.c44 * @ts: pointer to the timeval variable to be converted
83 static int after_sleep_interval(struct timespec *ts) after_sleep_interval() argument
129 static inline long long timespec_to_us(const struct timespec *ts) timespec_to_us() argument
131 return ((long long) ts->tv_sec * UM_USEC_PER_SEC) + timespec_to_us()
132 ts->tv_nsec / UM_NSEC_PER_USEC; timespec_to_us()
135 static int after_sleep_interval(struct timespec *ts) after_sleep_interval() argument
138 long long start_usecs = timespec_to_us(ts); after_sleep_interval()
169 struct timespec ts; idle_sleep() local
180 ts = ((struct timespec) { .tv_sec = nsecs / UM_NSEC_PER_SEC, idle_sleep()
183 if (nanosleep(&ts, &ts) == 0) idle_sleep()
185 after_sleep_interval(&ts); idle_sleep()
/linux-4.1.27/tools/perf/scripts/python/
H A Dsched-migration.py230 def get_time_slice(self, ts):
232 slice = TimeSlice(ts, TimeSlice(-1, None))
234 slice = self.data[-1].next(ts)
237 def find_time_slice(self, ts):
247 if self.data[i].start <= ts and self.data[i].end >= ts:
252 if self.data[i].end < ts:
255 elif self.data[i].start > ts:
268 ts = self[idx]
269 rq = ts.rqs[cpu]
272 raw += "Timestamp : %d.%06d\n" % (ts.start / (10 ** 9), (ts.start % (10 ** 9)) / 1000)
273 raw += "Duration : %6d us\n" % ((ts.end - ts.start) / (10 ** 6))
339 print "Sched switch event rejected ts: %s cpu: %d prev: %s(%d) next: %s(%d)" % \
346 ts = self.timeslices.get_time_slice(headers.ts())
347 ts.sched_switch(self.timeslices, prev_pid, prev_state, next_pid, headers.cpu)
350 ts = self.timeslices.get_time_slice(headers.ts())
351 ts.migrate(self.timeslices, pid, orig_cpu, dest_cpu)
356 ts = self.timeslices.get_time_slice(headers.ts())
357 ts.wake_up(self.timeslices, pid, target_cpu, fork)
/linux-4.1.27/tools/testing/selftests/timers/
H A Dmqueue-lat.c59 struct timespec timespec_add(struct timespec ts, unsigned long long ns) timespec_add() argument
61 ts.tv_nsec += ns; timespec_add()
62 while (ts.tv_nsec >= NSEC_PER_SEC) { timespec_add()
63 ts.tv_nsec -= NSEC_PER_SEC; timespec_add()
64 ts.tv_sec++; timespec_add()
66 return ts; timespec_add()
H A Dleap-a-day.c78 struct timespec timespec_add(struct timespec ts, unsigned long long ns) timespec_add() argument
80 ts.tv_nsec += ns; timespec_add()
81 while (ts.tv_nsec >= NSEC_PER_SEC) { timespec_add()
82 ts.tv_nsec -= NSEC_PER_SEC; timespec_add()
83 ts.tv_sec++; timespec_add()
85 return ts; timespec_add()
183 struct timespec ts; main() local
185 if (clock_gettime(CLOCK_TAI, &ts)) { main()
202 struct timespec ts; main() local
207 clock_gettime(CLOCK_REALTIME, &ts); main()
210 next_leap = ts.tv_sec; main()
255 ts.tv_sec = next_leap - 3; main()
256 ts.tv_nsec = 0; main()
258 while (clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, &ts, NULL)) main()
301 ts.tv_sec = 0; main()
302 ts.tv_nsec = NSEC_PER_SEC / 2; main()
303 clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL); main()
H A Draw_skew.c58 unsigned long long ts_to_nsec(struct timespec ts) ts_to_nsec() argument
60 return ts.tv_sec * NSEC_PER_SEC + ts.tv_nsec; ts_to_nsec()
65 struct timespec ts; nsec_to_ts() local
67 ts.tv_sec = ns/NSEC_PER_SEC; nsec_to_ts()
68 ts.tv_nsec = ns%NSEC_PER_SEC; nsec_to_ts()
69 return ts; nsec_to_ts()
H A Dnanosleep.c101 struct timespec timespec_add(struct timespec ts, unsigned long long ns) timespec_add() argument
103 ts.tv_nsec += ns; timespec_add()
104 while (ts.tv_nsec >= NSEC_PER_SEC) { timespec_add()
105 ts.tv_nsec -= NSEC_PER_SEC; timespec_add()
106 ts.tv_sec++; timespec_add()
108 return ts; timespec_add()
H A Dnsleep-lat.c90 struct timespec timespec_add(struct timespec ts, unsigned long long ns) timespec_add() argument
92 ts.tv_nsec += ns; timespec_add()
93 while (ts.tv_nsec >= NSEC_PER_SEC) { timespec_add()
94 ts.tv_nsec -= NSEC_PER_SEC; timespec_add()
95 ts.tv_sec++; timespec_add()
97 return ts; timespec_add()
H A Dalarmtimer-suspend.c111 struct timespec ts; sigalarm() local
113 clock_gettime(alarm_clock_id, &ts); sigalarm()
116 delta_ns = timespec_sub(start_time, ts); sigalarm()
119 printf("ALARM(%i): %ld:%ld latency: %lld ns ", alarmcount, ts.tv_sec, sigalarm()
120 ts.tv_nsec, delta_ns); sigalarm()
H A Dleapcrash.c74 struct timespec ts; main() local
88 clock_gettime(CLOCK_REALTIME, &ts); main()
91 next_leap = ts.tv_sec; main()
H A Dset-timer-lat.c109 struct timespec ts; sigalarm() local
111 clock_gettime(clock_id, &ts); sigalarm()
114 delta_ns = timespec_sub(start_time, ts); sigalarm()
/linux-4.1.27/drivers/media/pci/saa7134/
H A Dsaa7134-ts.c36 MODULE_PARM_DESC(ts_debug,"enable debug messages [ts]");
39 printk(KERN_DEBUG "%s/ts: " fmt, dev->name , ## arg)
101 lines = dev->ts.nr_packets; saa7134_ts_buffer_prepare()
121 int size = TS_PACKET_SIZE * dev->ts.nr_packets; saa7134_ts_queue_setup()
124 *nbuffers = dev->ts.nr_bufs; saa7134_ts_queue_setup()
188 MODULE_PARM_DESC(tsbufs, "number of ts buffers for read/write IO, range 2-32");
192 MODULE_PARM_DESC(ts_nr_packets,"size of a ts buffers (in ts packets)");
201 saa_writeb(SAA7134_TS_DMA0, ((dev->ts.nr_packets-1)&0xff)); saa7134_ts_init_hw()
202 saa_writeb(SAA7134_TS_DMA1, (((dev->ts.nr_packets-1)>>8)&0xff)); saa7134_ts_init_hw()
205 ((((dev->ts.nr_packets-1)>>16)&0x3f) | 0x00)); saa7134_ts_init_hw()
221 dev->ts.nr_bufs = tsbufs; saa7134_ts_init1()
222 dev->ts.nr_packets = ts_nr_packets; saa7134_ts_init1()
270 saa_writeb(SAA7134_TS_DMA0, (dev->ts.nr_packets - 1) & 0xff); saa7134_ts_start()
272 ((dev->ts.nr_packets - 1) >> 8) & 0xff); saa7134_ts_start()
275 (((dev->ts.nr_packets - 1) >> 16) & 0x3f) | 0x00); saa7134_ts_start()
H A Dsaa7134-empress.c40 MODULE_PARM_DESC(empress_nr,"ts device number");
130 f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets; empress_g_fmt_vid_cap()
147 f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets; empress_s_fmt_vid_cap()
164 f->fmt.pix.sizeimage = TS_PACKET_SIZE * dev->ts.nr_packets; empress_try_fmt_vid_cap()
/linux-4.1.27/arch/sh/boards/mach-dreamcast/
H A Drtc.c29 * @ts: pointer to resulting timespec
33 static void aica_rtc_gettimeofday(struct timespec *ts) aica_rtc_gettimeofday() argument
45 ts->tv_sec = val1 - TWENTY_YEARS; aica_rtc_gettimeofday()
48 ts->tv_nsec = 0; aica_rtc_gettimeofday()
/linux-4.1.27/include/linux/input/
H A Dtps6507x-ts.h1 /* linux/i2c/tps6507x-ts.h
/linux-4.1.27/tools/virtio/virtio-trace/
H A Dtrace-agent-rw.c110 struct rw_thread_info *ts = (struct rw_thread_info *)thread_info; rw_thread_main() local
112 bind_cpu(ts->cpu_num); rw_thread_main()
129 rlen = splice(ts->in_fd, NULL, ts->read_pipe, NULL, rw_thread_main()
130 ts->pipe_size, SPLICE_F_MOVE | SPLICE_F_MORE); rw_thread_main()
133 pr_err("Splice_read in rw-thread(%d)\n", ts->cpu_num); rw_thread_main()
143 pr_debug("Read retry(cpu:%d)\n", ts->cpu_num); rw_thread_main()
150 ret = splice(ts->write_pipe, NULL, ts->out_fd, NULL, rw_thread_main()
156 ts->cpu_num); rw_thread_main()
/linux-4.1.27/drivers/pinctrl/mvebu/
H A Dpinctrl-kirkwood.c172 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 1, 1, 1, 0)),
181 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 1, 1, 1, 0)),
190 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 1, 1, 1, 0)),
199 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 1, 1, 1, 0)),
208 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 1, 1, 1, 0)),
216 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 1, 1, 1, 0)),
224 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 1, 1, 1, 0)),
232 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 1, 1, 1, 0)),
240 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 1, 1, 1, 0)),
248 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 1, 1, 1, 0)),
255 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 1, 1, 1, 0)),
261 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 1, 1, 1, 0)),
267 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 1, 1, 1, 0)),
291 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 0, 1, 1, 0)),
297 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 0, 1, 1, 0)),
303 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 0, 1, 1, 0)),
309 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 0, 1, 1, 0)),
315 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 0, 1, 1, 0)),
321 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 0, 1, 1, 0)),
327 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 0, 1, 1, 0)),
333 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 0, 1, 1, 0)),
339 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 0, 1, 1, 0)),
345 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 1, 0)),
350 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 0, 1, 1, 0)),
355 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 0, 1, 1, 0)),
360 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 0, 1, 1, 0)),
366 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 0, 0)),
/linux-4.1.27/drivers/pps/
H A Dkapi.c41 static void pps_add_offset(struct pps_ktime *ts, struct pps_ktime *offset) pps_add_offset() argument
43 ts->nsec += offset->nsec; pps_add_offset()
44 while (ts->nsec >= NSEC_PER_SEC) { pps_add_offset()
45 ts->nsec -= NSEC_PER_SEC; pps_add_offset()
46 ts->sec++; pps_add_offset()
48 while (ts->nsec < 0) { pps_add_offset()
49 ts->nsec += NSEC_PER_SEC; pps_add_offset()
50 ts->sec--; pps_add_offset()
52 ts->sec += offset->sec; pps_add_offset()
161 * @ts: the event timestamp
172 void pps_event(struct pps_device *pps, struct pps_event_time *ts, int event, pps_event() argument
183 ts->ts_real.tv_sec, ts->ts_real.tv_nsec); pps_event()
185 timespec_to_pps_ktime(&ts_real, ts->ts_real); pps_event()
224 pps_kc_event(pps, ts, event); pps_event()
H A Dkc.c107 * @ts: PPS event timestamp
112 void pps_kc_event(struct pps_device *pps, struct pps_event_time *ts, pps_kc_event() argument
120 hardpps(&ts->ts_real, &ts->ts_raw); pps_kc_event()
H A Dkc.h33 struct pps_event_time *ts, int event);
42 struct pps_event_time *ts, int event) {}
41 pps_kc_event(struct pps_device *pps, struct pps_event_time *ts, int event) pps_kc_event() argument
/linux-4.1.27/fs/ntfs/
H A Dtime.h34 * @ts: Linux UTC time to convert to NTFS time
36 * Convert the Linux UTC time @ts to its corresponding NTFS time and return
48 static inline sle64 utc2ntfs(const struct timespec ts) utc2ntfs() argument
54 return cpu_to_sle64((s64)ts.tv_sec * 10000000 + ts.tv_nsec / 100 + utc2ntfs()
87 struct timespec ts; ntfs2utc() local
95 ts.tv_nsec = do_div(t, 10000000) * 100; ntfs2utc()
96 ts.tv_sec = t; ntfs2utc()
97 return ts; ntfs2utc()
/linux-4.1.27/net/netfilter/
H A Dnf_conntrack_amanda.c62 struct ts_config *ts; member in struct:__anon14169
116 search[SEARCH_CONNECT].ts); amanda_help()
122 search[SEARCH_NEWLINE].ts); amanda_help()
128 off = skb_find_text(skb, start, stop, search[i].ts); amanda_help()
203 textsearch_destroy(search[i].ts); nf_conntrack_amanda_fini()
211 search[i].ts = textsearch_prepare(ts_algo, search[i].string, nf_conntrack_amanda_init()
214 if (IS_ERR(search[i].ts)) { nf_conntrack_amanda_init()
215 ret = PTR_ERR(search[i].ts); nf_conntrack_amanda_init()
231 textsearch_destroy(search[i].ts); nf_conntrack_amanda_init()
/linux-4.1.27/drivers/net/ethernet/stmicro/stmmac/
H A Dstmmac_ptp.c103 * @ts: pointer to hold time/result
106 * hardware clock and store it in @ts.
108 static int stmmac_get_time(struct ptp_clock_info *ptp, struct timespec64 *ts) stmmac_get_time() argument
121 *ts = ns_to_timespec64(ns); stmmac_get_time()
130 * @ts: time value to set
136 const struct timespec64 *ts) stmmac_set_time()
144 priv->hw->ptp->init_systime(priv->ioaddr, ts->tv_sec, ts->tv_nsec); stmmac_set_time()
135 stmmac_set_time(struct ptp_clock_info *ptp, const struct timespec64 *ts) stmmac_set_time() argument
/linux-4.1.27/arch/x86/kernel/cpu/
H A Dpowerflags.c10 "ts", /* temperature sensor */
/linux-4.1.27/arch/m68k/kernel/
H A Dtime.c73 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
76 ts->tv_sec = 0; read_persistent_clock()
77 ts->tv_nsec = 0; read_persistent_clock()
84 ts->tv_sec = mktime(time.tm_year, time.tm_mon, time.tm_mday, read_persistent_clock()
/linux-4.1.27/arch/mips/mti-sead3/
H A Dsead3-time.c66 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
68 ts->tv_sec = 0; read_persistent_clock()
69 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/arch/cris/kernel/
H A Dtime.c60 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
62 ts->tv_sec = 0; read_persistent_clock()
63 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/net/9p/
H A Dtrans_fd.c235 struct p9_trans_fd *ts = NULL; p9_fd_poll() local
238 ts = client->trans; p9_fd_poll()
240 if (!ts) p9_fd_poll()
243 if (!ts->rd->f_op->poll) p9_fd_poll()
246 if (!ts->wr->f_op->poll) p9_fd_poll()
249 ret = ts->rd->f_op->poll(ts->rd, pt); p9_fd_poll()
253 if (ts->rd != ts->wr) { p9_fd_poll()
254 n = ts->wr->f_op->poll(ts->wr, pt); p9_fd_poll()
274 struct p9_trans_fd *ts = NULL; p9_fd_read() local
277 ts = client->trans; p9_fd_read()
279 if (!ts) p9_fd_read()
282 if (!(ts->rd->f_flags & O_NONBLOCK)) p9_fd_read()
285 ret = kernel_read(ts->rd, ts->rd->f_pos, v, len); p9_fd_read()
417 struct p9_trans_fd *ts = NULL; p9_fd_write() local
420 ts = client->trans; p9_fd_write()
422 if (!ts) p9_fd_write()
425 if (!(ts->wr->f_flags & O_NONBLOCK)) p9_fd_write()
431 ret = vfs_write(ts->wr, (__force void __user *)v, len, &ts->wr->f_pos); p9_fd_write()
581 struct p9_trans_fd *ts = client->trans; p9_conn_create() local
582 struct p9_conn *m = &ts->conn; p9_conn_create()
663 struct p9_trans_fd *ts = client->trans; p9_fd_request() local
664 struct p9_conn *m = &ts->conn; p9_fd_request()
788 struct p9_trans_fd *ts = kzalloc(sizeof(struct p9_trans_fd), p9_fd_open() local
790 if (!ts) p9_fd_open()
793 ts->rd = fget(rfd); p9_fd_open()
794 ts->wr = fget(wfd); p9_fd_open()
795 if (!ts->rd || !ts->wr) { p9_fd_open()
796 if (ts->rd) p9_fd_open()
797 fput(ts->rd); p9_fd_open()
798 if (ts->wr) p9_fd_open()
799 fput(ts->wr); p9_fd_open()
800 kfree(ts); p9_fd_open()
804 client->trans = ts; p9_fd_open()
868 struct p9_trans_fd *ts; p9_fd_close() local
873 ts = client->trans; p9_fd_close()
874 if (!ts) p9_fd_close()
879 p9_conn_destroy(&ts->conn); p9_fd_close()
881 if (ts->rd) p9_fd_close()
882 fput(ts->rd); p9_fd_close()
883 if (ts->wr) p9_fd_close()
884 fput(ts->wr); p9_fd_close()
886 kfree(ts); p9_fd_close()
/linux-4.1.27/tools/lib/traceevent/
H A Dkbuffer.h49 void *kbuffer_read_event(struct kbuffer *kbuf, unsigned long long *ts);
50 void *kbuffer_next_event(struct kbuffer *kbuf, unsigned long long *ts);
55 void *kbuffer_read_at_offset(struct kbuffer *kbuf, int offset, unsigned long long *ts);
H A Dkbuffer-parse.c484 * @ts: Address to store the next record's timestamp (may be NULL to ignore)
493 void *kbuffer_next_event(struct kbuffer *kbuf, unsigned long long *ts) kbuffer_next_event() argument
504 if (ts) kbuffer_next_event()
505 *ts = kbuf->timestamp; kbuffer_next_event()
566 * @ts: The address to store the timestamp of the event (may be NULL to ignore)
571 void *kbuffer_read_event(struct kbuffer *kbuf, unsigned long long *ts) kbuffer_read_event() argument
579 if (ts) kbuffer_read_event()
580 *ts = kbuf->timestamp; kbuffer_read_event()
599 * @ts: The address to store the timestamp of the event (may be NULL to ignore)
614 unsigned long long *ts) kbuffer_read_at_offset()
627 data = kbuffer_next_event(kbuf, ts); kbuffer_read_at_offset()
613 kbuffer_read_at_offset(struct kbuffer *kbuf, int offset, unsigned long long *ts) kbuffer_read_at_offset() argument
/linux-4.1.27/tools/perf/scripts/perl/
H A Dwakeup-latency.pl35 my $wakeup_ts = $last_wakeup{$common_cpu}{ts};
48 $last_wakeup{$common_cpu}{ts} = 0;
57 $last_wakeup{$target_cpu}{ts} = nsecs($common_secs, $common_nsecs);
/linux-4.1.27/Documentation/ptp/
H A Dtestptp.c150 struct timespec ts; main() local
313 if (clock_gettime(clkid, &ts)) { main()
317 ts.tv_sec, ts.tv_nsec, ctime(&ts.tv_sec)); main()
322 clock_gettime(CLOCK_REALTIME, &ts); main()
323 if (clock_settime(clkid, &ts)) { main()
331 clock_gettime(clkid, &ts); main()
332 if (clock_settime(CLOCK_REALTIME, &ts)) { main()
340 ts.tv_sec = seconds; main()
341 ts.tv_nsec = 0; main()
342 if (clock_settime(clkid, &ts)) { main()
438 if (clock_gettime(clkid, &ts)) { main()
444 perout_request.start.sec = ts.tv_sec + 2; main()
495 pct = &sysoff->ts[0]; main()
/linux-4.1.27/drivers/rtc/
H A Drtc-lib.c140 struct timespec64 ts; rtc_ktime_to_tm() local
143 ts = ktime_to_timespec64(kt); rtc_ktime_to_tm()
145 if (ts.tv_nsec) rtc_ktime_to_tm()
146 ts.tv_sec++; rtc_ktime_to_tm()
147 rtc_time64_to_tm(ts.tv_sec, &ret); rtc_ktime_to_tm()
/linux-4.1.27/drivers/ptp/
H A Dptp_chardev.c127 struct timespec64 ts; ptp_ioctl() local
198 pct = &sysoff->ts[0]; ptp_ioctl()
200 getnstimeofday64(&ts); ptp_ioctl()
201 pct->sec = ts.tv_sec; ptp_ioctl()
202 pct->nsec = ts.tv_nsec; ptp_ioctl()
204 ptp->info->gettime64(ptp->info, &ts); ptp_ioctl()
205 pct->sec = ts.tv_sec; ptp_ioctl()
206 pct->nsec = ts.tv_nsec; ptp_ioctl()
209 getnstimeofday64(&ts); ptp_ioctl()
210 pct->sec = ts.tv_sec; ptp_ioctl()
211 pct->nsec = ts.tv_nsec; ptp_ioctl()
H A Dptp_clock.c110 struct timespec64 ts = timespec_to_timespec64(*tp); ptp_clock_settime() local
112 return ptp->info->settime64(ptp->info, &ts); ptp_clock_settime()
118 struct timespec64 ts; ptp_clock_gettime() local
121 err = ptp->info->gettime64(ptp->info, &ts); ptp_clock_gettime()
123 *tp = timespec64_to_timespec(ts); ptp_clock_gettime()
136 struct timespec ts; ptp_clock_adjtime() local
140 ts.tv_sec = tx->time.tv_sec; ptp_clock_adjtime()
141 ts.tv_nsec = tx->time.tv_usec; ptp_clock_adjtime()
144 ts.tv_nsec *= 1000; ptp_clock_adjtime()
146 if ((unsigned long) ts.tv_nsec >= NSEC_PER_SEC) ptp_clock_adjtime()
149 kt = timespec_to_ktime(ts); ptp_clock_adjtime()
H A Dptp_ixp46x.c178 static int ptp_ixp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) ptp_ixp_gettime() argument
192 ts->tv_sec = div_u64_rem(ns, 1000000000, &remainder); ptp_ixp_gettime()
193 ts->tv_nsec = remainder; ptp_ixp_gettime()
198 const struct timespec64 *ts) ptp_ixp_settime()
205 ns = ts->tv_sec * 1000000000ULL; ptp_ixp_settime()
206 ns += ts->tv_nsec; ptp_ixp_settime()
197 ptp_ixp_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts) ptp_ixp_settime() argument
H A Dptp_pch.c452 static int ptp_pch_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) ptp_pch_gettime() argument
464 ts->tv_sec = div_u64_rem(ns, 1000000000, &remainder); ptp_pch_gettime()
465 ts->tv_nsec = remainder; ptp_pch_gettime()
470 const struct timespec64 *ts) ptp_pch_settime()
477 ns = ts->tv_sec * 1000000000ULL; ptp_pch_settime()
478 ns += ts->tv_nsec; ptp_pch_settime()
469 ptp_pch_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts) ptp_pch_settime() argument
/linux-4.1.27/fs/udf/
H A Dudftime.c120 udf_time_to_disk_stamp(struct timestamp *dest, struct timespec ts) udf_time_to_disk_stamp() argument
133 ts.tv_sec += offset * 60; udf_time_to_disk_stamp()
134 days = ts.tv_sec / SECS_PER_DAY; udf_time_to_disk_stamp()
135 rem = ts.tv_sec % SECS_PER_DAY; udf_time_to_disk_stamp()
162 dest->centiseconds = ts.tv_nsec / 10000000; udf_time_to_disk_stamp()
163 dest->hundredsOfMicroseconds = (ts.tv_nsec / 1000 - udf_time_to_disk_stamp()
165 dest->microseconds = (ts.tv_nsec / 1000 - dest->centiseconds * 10000 - udf_time_to_disk_stamp()
/linux-4.1.27/net/ipv4/
H A Dip_options.c59 ip_rt_get_source(iph+opt->ts+iph[opt->ts+2]-9, skb, rt); ip_options_build()
65 memcpy(iph+opt->ts+iph[opt->ts+2]-5, &midtime, 4); ip_options_build()
74 if (opt->ts) { ip_options_build()
75 memset(iph+opt->ts, IPOPT_NOP, iph[opt->ts+1]); ip_options_build()
76 opt->ts = 0; ip_options_build()
119 if (sopt->ts) { __ip_options_echo()
120 optlen = sptr[sopt->ts+1]; __ip_options_echo()
121 soffset = sptr[sopt->ts+2]; __ip_options_echo()
122 dopt->ts = dopt->optlen + sizeof(struct iphdr); __ip_options_echo()
123 memcpy(dptr, sptr+sopt->ts, optlen); __ip_options_echo()
235 opt->ts = 0; ip_options_fragment()
355 if (opt->ts) { ip_options_compile()
436 opt->ts = optptr - iph; ip_options_compile()
498 if (opt->ts) { ip_options_undo()
499 unsigned char *optptr = opt->__data+opt->ts-sizeof(struct iphdr); ip_options_undo()
596 optptr = raw + opt->ts; ip_forward_options()
H A Dsyncookies.c85 u32 ts, ts_now = tcp_time_stamp; cookie_init_timestamp() local
96 ts = ts_now & ~TSMASK; cookie_init_timestamp()
97 ts |= options; cookie_init_timestamp()
98 if (ts > ts_now) { cookie_init_timestamp()
99 ts >>= TSBITS; cookie_init_timestamp()
100 ts--; cookie_init_timestamp()
101 ts <<= TSBITS; cookie_init_timestamp()
102 ts |= options; cookie_init_timestamp()
104 return ts; cookie_init_timestamp()
/linux-4.1.27/drivers/misc/sgi-gru/
H A Dgruprocfs.c177 struct gru_thread_state *ts; cch_seq_show() local
185 ts = gru->gs_gts[i]; cch_seq_show()
186 if (!ts) cch_seq_show()
190 is_kernel_context(ts) ? 0 : ts->ts_gms->ms_asids[gid].mt_asid, cch_seq_show()
191 is_kernel_context(ts) ? 0 : ts->ts_tgid_owner, cch_seq_show()
192 ts->ts_cbr_au_count * GRU_CBR_AU_SIZE, cch_seq_show()
193 ts->ts_cbr_au_count * GRU_DSR_AU_BYTES, cch_seq_show()
194 mode[ts->ts_user_options & cch_seq_show()
/linux-4.1.27/drivers/net/ethernet/intel/e1000e/
H A Dptp.c104 * @ts: timespec structure to hold the current time value
109 static int e1000e_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) e1000e_phc_gettime() argument
120 *ts = ns_to_timespec64(ns); e1000e_phc_gettime()
128 * @ts: timespec containing the new time for the cycle counter
134 const struct timespec64 *ts) e1000e_phc_settime()
141 ns = timespec64_to_ns(ts); e1000e_phc_settime()
172 struct timespec64 ts; e1000e_systim_overflow_work() local
174 adapter->ptp_clock_info.gettime64(&adapter->ptp_clock_info, &ts); e1000e_systim_overflow_work()
177 (long long) ts.tv_sec, ts.tv_nsec); e1000e_systim_overflow_work()
133 e1000e_phc_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts) e1000e_phc_settime() argument
/linux-4.1.27/drivers/media/platform/vivid/
H A Dvivid-radio-tx.c39 struct timespec ts; vivid_radio_tx_write() local
60 ktime_get_ts(&ts); vivid_radio_tx_write()
61 ts = timespec_sub(ts, dev->radio_rds_init_ts); vivid_radio_tx_write()
62 blk = ts.tv_sec * 100 + ts.tv_nsec / 10000000; vivid_radio_tx_write()
H A Dvivid-radio-rx.c39 struct timespec ts; vivid_radio_rx_read() local
65 ktime_get_ts(&ts); vivid_radio_rx_read()
66 use_alternates = ts.tv_sec % 10 >= 5; vivid_radio_rx_read()
73 ts = timespec_sub(ts, dev->radio_rds_init_ts); vivid_radio_rx_read()
74 blk = ts.tv_sec * 100 + ts.tv_nsec / 10000000; vivid_radio_rx_read()
/linux-4.1.27/include/linux/ceph/
H A Ddecode.h137 static inline void ceph_decode_timespec(struct timespec *ts, ceph_decode_timespec() argument
140 ts->tv_sec = (__kernel_time_t)le32_to_cpu(tv->tv_sec); ceph_decode_timespec()
141 ts->tv_nsec = (long)le32_to_cpu(tv->tv_nsec); ceph_decode_timespec()
144 const struct timespec *ts) ceph_encode_timespec()
146 tv->tv_sec = cpu_to_le32((u32)ts->tv_sec); ceph_encode_timespec()
147 tv->tv_nsec = cpu_to_le32((u32)ts->tv_nsec); ceph_encode_timespec()
143 ceph_encode_timespec(struct ceph_timespec *tv, const struct timespec *ts) ceph_encode_timespec() argument
/linux-4.1.27/drivers/pps/clients/
H A Dpps-ktimer.c44 struct pps_event_time ts; pps_ktimer_event() local
47 pps_get_ts(&ts); pps_ktimer_event()
49 pps_event(pps, &ts, PPS_CAPTUREASSERT, NULL); pps_ktimer_event()
H A Dpps-gpio.c56 struct pps_event_time ts; pps_gpio_irq_handler() local
60 pps_get_ts(&ts); pps_gpio_irq_handler()
67 pps_event(info->pps, &ts, PPS_CAPTUREASSERT, NULL); pps_gpio_irq_handler()
71 pps_event(info->pps, &ts, PPS_CAPTURECLEAR, NULL); pps_gpio_irq_handler()
H A Dpps-ldisc.c35 struct pps_event_time ts; pps_tty_dcd_change() local
37 pps_get_ts(&ts); pps_tty_dcd_change()
48 pps_event(pps, &ts, status ? PPS_CAPTUREASSERT : pps_tty_dcd_change()
/linux-4.1.27/arch/mips/lasat/
H A Dds1603.c138 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
150 ts->tv_sec = word; read_persistent_clock()
151 ts->tv_nsec = 0; read_persistent_clock()
H A Dsysctl.c63 struct timespec64 ts; proc_dolasatrtc() local
67 read_persistent_clock64(&ts); proc_dolasatrtc()
68 rtctmp = ts.tv_sec; proc_dolasatrtc()
/linux-4.1.27/fs/ocfs2/
H A Dmove_extents.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Docfs2_lockingver.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dacl.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dexport.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dlocks.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dresize.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dsymlink.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dsysfile.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Ddcache.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dheartbeat.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dlocalalloc.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dnamei.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dslot_map.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dsuper.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
/linux-4.1.27/include/linux/spi/
H A Dmax7301.h34 extern int __max730x_probe(struct max7301 *ts);
/linux-4.1.27/Documentation/laptops/
H A Ddslm.c60 char *ts = ctime(&time); myctime() local
61 ts[strlen(ts) - 1] = 0; myctime()
63 return ts; myctime()
/linux-4.1.27/fs/afs/
H A Dmain.c40 struct timespec ts; afs_get_client_UUID() local
51 getnstimeofday(&ts); afs_get_client_UUID()
52 uuidtime = (u64) ts.tv_sec * 1000 * 1000 * 10; afs_get_client_UUID()
53 uuidtime += ts.tv_nsec / 100; afs_get_client_UUID()
/linux-4.1.27/fs/fat/
H A Dmisc.c189 void fat_time_fat2unix(struct msdos_sb_info *sbi, struct timespec *ts, fat_time_fat2unix() argument
218 ts->tv_sec = second + (time_cs / 100); fat_time_fat2unix()
219 ts->tv_nsec = (time_cs % 100) * 10000000; fat_time_fat2unix()
221 ts->tv_sec = second; fat_time_fat2unix()
222 ts->tv_nsec = 0; fat_time_fat2unix()
227 void fat_time_unix2fat(struct msdos_sb_info *sbi, struct timespec *ts, fat_time_unix2fat() argument
231 time_to_tm(ts->tv_sec, fat_time_unix2fat()
261 *time_cs = (ts->tv_sec & 1) * 100 + ts->tv_nsec / 10000000; fat_time_unix2fat()
H A Dnamei_msdos.c227 struct timespec *ts, struct fat_slot_info *sinfo) msdos_add_entry()
239 fat_time_unix2fat(sbi, ts, &time, &date, NULL); msdos_add_entry()
252 dir->i_ctime = dir->i_mtime = *ts; msdos_add_entry()
268 struct timespec ts; msdos_create() local
286 ts = CURRENT_TIME_SEC; msdos_create()
287 err = msdos_add_entry(dir, msdos_name, 0, is_hid, 0, &ts, &sinfo); msdos_create()
296 inode->i_mtime = inode->i_atime = inode->i_ctime = ts; msdos_create()
350 struct timespec ts; msdos_mkdir() local
367 ts = CURRENT_TIME_SEC; msdos_mkdir()
368 cluster = fat_alloc_new_dir(dir, &ts); msdos_mkdir()
373 err = msdos_add_entry(dir, msdos_name, 1, is_hid, cluster, &ts, &sinfo); msdos_mkdir()
386 inode->i_mtime = inode->i_atime = inode->i_ctime = ts; msdos_mkdir()
438 struct timespec ts; do_msdos_rename() local
493 ts = CURRENT_TIME_SEC; do_msdos_rename()
506 &ts, &sinfo); do_msdos_rename()
544 old_dir->i_ctime = old_dir->i_mtime = ts; do_msdos_rename()
554 new_inode->i_ctime = ts; do_msdos_rename()
225 msdos_add_entry(struct inode *dir, const unsigned char *name, int is_dir, int is_hid, int cluster, struct timespec *ts, struct fat_slot_info *sinfo) msdos_add_entry() argument
H A Dnamei_vfat.c580 struct timespec *ts, vfat_build_slots()
644 fat_time_unix2fat(sbi, ts, &time, &date, &time_cs); vfat_build_slots()
656 int cluster, struct timespec *ts, vfat_add_entry()
671 err = vfat_build_slots(dir, qname->name, len, is_dir, cluster, ts, vfat_add_entry()
681 dir->i_ctime = dir->i_mtime = dir->i_atime = *ts; vfat_add_entry()
775 struct timespec ts; vfat_create() local
780 ts = CURRENT_TIME_SEC; vfat_create()
781 err = vfat_add_entry(dir, &dentry->d_name, 0, 0, &ts, &sinfo); vfat_create()
793 inode->i_mtime = inode->i_atime = inode->i_ctime = ts; vfat_create()
864 struct timespec ts; vfat_mkdir() local
869 ts = CURRENT_TIME_SEC; vfat_mkdir()
870 cluster = fat_alloc_new_dir(dir, &ts); vfat_mkdir()
875 err = vfat_add_entry(dir, &dentry->d_name, 1, cluster, &ts, &sinfo); vfat_mkdir()
890 inode->i_mtime = inode->i_atime = inode->i_ctime = ts; vfat_mkdir()
912 struct timespec ts; vfat_rename() local
934 ts = CURRENT_TIME_SEC; vfat_rename()
945 &ts, &sinfo); vfat_rename()
979 old_dir->i_ctime = old_dir->i_mtime = ts; vfat_rename()
989 new_inode->i_ctime = ts; vfat_rename()
578 vfat_build_slots(struct inode *dir, const unsigned char *name, int len, int is_dir, int cluster, struct timespec *ts, struct msdos_dir_slot *slots, int *nr_slots) vfat_build_slots() argument
655 vfat_add_entry(struct inode *dir, struct qstr *qname, int is_dir, int cluster, struct timespec *ts, struct fat_slot_info *sinfo) vfat_add_entry() argument
/linux-4.1.27/arch/x86/um/vdso/
H A Dum_vdso.c19 int __vdso_clock_gettime(clockid_t clock, struct timespec *ts) __vdso_clock_gettime() argument
24 "0" (__NR_clock_gettime), "D" (clock), "S" (ts) : "memory"); __vdso_clock_gettime()
/linux-4.1.27/arch/um/kernel/
H A Dtime.c103 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
107 set_normalized_timespec(ts, nsecs / NSEC_PER_SEC, read_persistent_clock()
/linux-4.1.27/arch/mn10300/kernel/
H A Drtc.c26 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
32 ts->tv_nsec = 0; read_persistent_clock()
33 ts->tv_sec = mktime(tm.tm_year, tm.tm_mon, tm.tm_mday, read_persistent_clock()
37 if (ts->tv_sec < 0) read_persistent_clock()
38 ts->tv_sec = mktime(2009, 1, 1, 12, 0, 0); read_persistent_clock()
/linux-4.1.27/kernel/
H A Dcompat.c143 static int __compat_get_timespec(struct timespec *ts, const struct compat_timespec __user *cts) __compat_get_timespec() argument
146 __get_user(ts->tv_sec, &cts->tv_sec) || __compat_get_timespec()
147 __get_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0; __compat_get_timespec()
150 static int __compat_put_timespec(const struct timespec *ts, struct compat_timespec __user *cts) __compat_put_timespec() argument
153 __put_user(ts->tv_sec, &cts->tv_sec) || __compat_put_timespec()
154 __put_user(ts->tv_nsec, &cts->tv_nsec)) ? -EFAULT : 0; __compat_put_timespec()
175 int compat_get_timespec(struct timespec *ts, const void __user *uts) compat_get_timespec() argument
178 return copy_from_user(ts, uts, sizeof(*ts)) ? -EFAULT : 0; compat_get_timespec()
180 return __compat_get_timespec(ts, uts); compat_get_timespec()
184 int compat_put_timespec(const struct timespec *ts, void __user *uts) compat_put_timespec() argument
187 return copy_to_user(uts, ts, sizeof(*ts)) ? -EFAULT : 0; compat_put_timespec()
189 return __compat_put_timespec(ts, uts); compat_put_timespec()
196 struct timespec ts; compat_convert_timespec() local
204 uts = compat_alloc_user_space(sizeof(ts)); compat_convert_timespec()
207 if (compat_get_timespec(&ts, cts)) compat_convert_timespec()
209 if (copy_to_user(uts, &ts, sizeof(ts))) compat_convert_timespec()
728 struct itimerspec ts; COMPAT_SYSCALL_DEFINE2() local
733 (struct itimerspec __user *) &ts); COMPAT_SYSCALL_DEFINE2()
735 if (!err && put_compat_itimerspec(setting, &ts)) COMPAT_SYSCALL_DEFINE2()
745 struct timespec ts; COMPAT_SYSCALL_DEFINE2() local
747 if (compat_get_timespec(&ts, tp)) COMPAT_SYSCALL_DEFINE2()
752 (struct timespec __user *) &ts); COMPAT_SYSCALL_DEFINE2()
762 struct timespec ts; COMPAT_SYSCALL_DEFINE2() local
767 (struct timespec __user *) &ts); COMPAT_SYSCALL_DEFINE2()
769 if (!err && compat_put_timespec(&ts, tp)) COMPAT_SYSCALL_DEFINE2()
802 struct timespec ts; COMPAT_SYSCALL_DEFINE2() local
807 (struct timespec __user *) &ts); COMPAT_SYSCALL_DEFINE2()
809 if (!err && tp && compat_put_timespec(&ts, tp)) COMPAT_SYSCALL_DEFINE2()
H A Dfutex_compat.c178 struct timespec ts; COMPAT_SYSCALL_DEFINE6() local
186 if (compat_get_timespec(&ts, utime)) COMPAT_SYSCALL_DEFINE6()
188 if (!timespec_valid(&ts)) COMPAT_SYSCALL_DEFINE6()
191 t = timespec_to_ktime(ts); COMPAT_SYSCALL_DEFINE6()
/linux-4.1.27/drivers/media/dvb-core/
H A Ddvb_net.c124 unsigned long ts_count; /* Current ts cell counter. */
316 const u8 *ts, *ts_end, *from_where = NULL; dvb_net_ule() local
330 for (ts = buf, ts_end = buf + buf_len; ts < ts_end; /* no default incr. */ ) { dvb_net_ule()
337 memcpy( ule_where, ts, TS_SZ ); dvb_net_ule()
346 if ((ts[0] != TS_SYNC) || (ts[1] & TS_TEI) || ((ts[3] & TS_SC) != 0)) { dvb_net_ule()
348 priv->ts_count, ts[0], dvb_net_ule()
349 (ts[1] & TS_TEI) >> 7, dvb_net_ule()
350 (ts[3] & TS_SC) >> 6); dvb_net_ule()
363 ts += TS_SZ; dvb_net_ule()
369 from_where = ts + 4; dvb_net_ule()
373 if (ts[1] & TS_PUSI) { dvb_net_ule()
376 priv->tscc = ts[3] & 0x0F; dvb_net_ule()
378 if (ts[4] > ts_remain) { dvb_net_ule()
380 "(pointer field %d)\n", priv->ts_count, ts[4]); dvb_net_ule()
381 ts += TS_SZ; dvb_net_ule()
386 from_where = &ts[5] + ts[4]; dvb_net_ule()
387 ts_remain -= 1 + ts[4]; dvb_net_ule()
391 ts += TS_SZ; dvb_net_ule()
399 if ((ts[3] & 0x0F) == priv->tscc) dvb_net_ule()
404 "expected %#x.\n", priv->ts_count, ts[3] & 0x0F, priv->tscc); dvb_net_ule()
422 if (ts[1] & TS_PUSI) { dvb_net_ule()
459 priv->ts_count, priv->ule_sndu_remain, ts[4], ts_remain); dvb_net_ule()
464 from_where += ts[4]; dvb_net_ule()
465 ts_remain -= ts[4]; dvb_net_ule()
482 ts += TS_SZ; dvb_net_ule()
504 ts += TS_SZ; dvb_net_ule()
529 ts += TS_SZ; dvb_net_ule()
747 // printk(KERN_WARNING "ts @ %p, stopped @ %p:\n", ts, from_where + 0); dvb_net_ule()
748 // hexdump(ts, 188); dvb_net_ule()
751 ts += TS_SZ; dvb_net_ule()
1007 printk("%s: could not allocate ts feed\n", dev->name); dvb_net_feed_start()
1011 /* Set netdevice pointer for ts decaps callback. */ dvb_net_feed_start()
1022 printk("%s: could not set ts feed\n", dev->name); dvb_net_feed_start()
1082 printk("%s: no ts feed to stop\n", dev->name); dvb_net_feed_stop()
H A Ddmxdev.h60 struct dmx_ts_feed *ts; member in struct:dmxdev_feed
71 struct list_head ts; member in union:dmxdev_filter::__anon5516
H A Ddmxdev.c435 list_for_each_entry(feed, &dmxdevfilter->feed.ts, next) dvb_dmxdev_feed_stop()
436 feed->ts->stop_filtering(feed->ts); dvb_dmxdev_feed_stop()
456 list_for_each_entry(feed, &filter->feed.ts, next) { dvb_dmxdev_feed_start()
457 ret = feed->ts->start_filtering(feed->ts); dvb_dmxdev_feed_start()
516 list_for_each_entry(feed, &dmxdevfilter->feed.ts, next) { dvb_dmxdev_filter_stop()
517 demux->release_ts_feed(demux, feed->ts); dvb_dmxdev_filter_stop()
518 feed->ts = NULL; dvb_dmxdev_filter_stop()
536 list_for_each_entry_safe(feed, tmp, &dmxdevfilter->feed.ts, next) { dvb_dmxdev_delete_pids()
541 BUG_ON(!list_empty(&dmxdevfilter->feed.ts)); dvb_dmxdev_delete_pids()
569 feed->ts = NULL; dvb_dmxdev_start_feed()
586 ret = dmxdev->demux->allocate_ts_feed(dmxdev->demux, &feed->ts, dvb_dmxdev_start_feed()
591 tsfeed = feed->ts; dvb_dmxdev_start_feed()
710 list_for_each_entry(feed, &filter->feed.ts, next) { dvb_dmxdev_filter_start()
807 (!list_empty(&filter->feed.ts))) dvb_dmxdev_add_pid()
815 list_add(&feed->next, &filter->feed.ts); dvb_dmxdev_add_pid()
832 list_for_each_entry_safe(feed, tmp, &filter->feed.ts, next) { dvb_dmxdev_remove_pid()
833 if ((feed->pid == pid) && (feed->ts != NULL)) { dvb_dmxdev_remove_pid()
834 feed->ts->stop_filtering(feed->ts); dvb_dmxdev_remove_pid()
836 feed->ts); dvb_dmxdev_remove_pid()
881 INIT_LIST_HEAD(&dmxdevfilter->feed.ts); dvb_dmxdev_pes_filter_set()
H A Ddvb_demux.h69 struct dmx_ts_feed ts; member in union:dvb_demux_feed::__anon5518
74 dmx_ts_cb ts; member in union:dvb_demux_feed::__anon5519
H A Ddvb_demux.c133 return feed->cb.ts(&buf[p], count, NULL, 0, &feed->feed.ts, DMX_OK); dvb_dmx_swfilter_payload()
202 printk("dvb_demux.c section ts padding loss: %d/%d\n", dvb_dmx_swfilter_section_new()
364 if (!feed->feed.ts.is_filtering) dvb_dmx_swfilter_packet_type()
370 feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, dvb_dmx_swfilter_packet_type()
392 ((f)->feed.ts.is_filtering) && \
472 feed->cb.ts(buf, 188, NULL, 0, &feed->feed.ts, DMX_OK); dvb_dmx_swfilter_packet()
591 demux->feed->cb.ts(buf, count, NULL, 0, &demux->feed->feed.ts, DMX_OK); dvb_dmx_swfilter_raw()
801 feed->cb.ts = callback; dvbdmx_allocate_ts_feed()
807 (*ts_feed) = &feed->feed.ts; dvbdmx_allocate_ts_feed()
/linux-4.1.27/drivers/net/ethernet/intel/igb/
H A Digb_ptp.c120 struct timespec64 *ts) igb_ptp_read_i210()
133 ts->tv_sec = sec; igb_ptp_read_i210()
134 ts->tv_nsec = nsec; igb_ptp_read_i210()
138 const struct timespec64 *ts) igb_ptp_write_i210()
145 wr32(E1000_SYSTIML, ts->tv_nsec); igb_ptp_write_i210()
146 wr32(E1000_SYSTIMH, ts->tv_sec); igb_ptp_write_i210()
287 struct timespec64 *ts) igb_ptp_gettime_82576()
300 *ts = ns_to_timespec64(ns); igb_ptp_gettime_82576()
306 struct timespec64 *ts) igb_ptp_gettime_i210()
314 igb_ptp_read_i210(igb, ts); igb_ptp_gettime_i210()
322 const struct timespec64 *ts) igb_ptp_settime_82576()
329 ns = timespec64_to_ns(ts); igb_ptp_settime_82576()
341 const struct timespec64 *ts) igb_ptp_settime_i210()
349 igb_ptp_write_i210(igb, ts); igb_ptp_settime_i210()
468 struct timespec ts; igb_ptp_feature_enable_i210() local
510 ts.tv_sec = rq->perout.period.sec; igb_ptp_feature_enable_i210()
511 ts.tv_nsec = rq->perout.period.nsec; igb_ptp_feature_enable_i210()
512 ns = timespec_to_ns(&ts); igb_ptp_feature_enable_i210()
518 ts = ns_to_timespec(ns); igb_ptp_feature_enable_i210()
539 igb->perout[i].period.tv_sec = ts.tv_sec; igb_ptp_feature_enable_i210()
540 igb->perout[i].period.tv_nsec = ts.tv_nsec; igb_ptp_feature_enable_i210()
628 struct timespec64 ts; igb_ptp_overflow_check() local
630 igb->ptp_caps.gettime64(&igb->ptp_caps, &ts); igb_ptp_overflow_check()
633 (long long) ts.tv_sec, ts.tv_nsec); igb_ptp_overflow_check()
1059 struct timespec64 ts = ktime_to_timespec64(ktime_get_real()); igb_ptp_init() local
1061 igb_ptp_settime_i210(&adapter->ptp_caps, &ts); igb_ptp_init()
1173 struct timespec64 ts = ktime_to_timespec64(ktime_get_real()); igb_ptp_reset() local
1175 igb_ptp_write_i210(adapter, &ts); igb_ptp_reset()
119 igb_ptp_read_i210(struct igb_adapter *adapter, struct timespec64 *ts) igb_ptp_read_i210() argument
137 igb_ptp_write_i210(struct igb_adapter *adapter, const struct timespec64 *ts) igb_ptp_write_i210() argument
286 igb_ptp_gettime_82576(struct ptp_clock_info *ptp, struct timespec64 *ts) igb_ptp_gettime_82576() argument
305 igb_ptp_gettime_i210(struct ptp_clock_info *ptp, struct timespec64 *ts) igb_ptp_gettime_i210() argument
321 igb_ptp_settime_82576(struct ptp_clock_info *ptp, const struct timespec64 *ts) igb_ptp_settime_82576() argument
340 igb_ptp_settime_i210(struct ptp_clock_info *ptp, const struct timespec64 *ts) igb_ptp_settime_i210() argument
/linux-4.1.27/arch/mips/sibyte/swarm/
H A Dsetup.c90 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
108 ts->tv_sec = sec; read_persistent_clock()
109 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/arch/avr32/kernel/
H A Dtime.c124 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
126 ts->tv_sec = mktime(2007, 1, 1, 0, 0, 0); read_persistent_clock()
127 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/arch/blackfin/kernel/
H A Dtime.c135 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
138 ts->tv_sec = secs_since_1970; read_persistent_clock()
139 ts->tv_nsec = 0; read_persistent_clock()
H A DMakefile14 obj-y += time-ts.o
/linux-4.1.27/arch/frv/kernel/
H A Dtime.c88 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
104 ts->tv_sec = mktime(year, mon, day, hour, min, sec); read_persistent_clock()
105 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/tools/thermal/tmon/
H A Dpid.c71 p_param.ts = ticktime; init_thermal_controller()
113 i_term = p_param.kp * p_param.ki * p_param.ts * ek; controller_handler()
114 d_term = -p_param.kp * p_param.kd * (xk - 2 * xk_1 + xk_2) / p_param.ts; controller_handler()
/linux-4.1.27/drivers/staging/rtl8188eu/include/
H A Drtw_qos.h27 * s-apsd, ts, block ack... */
/linux-4.1.27/fs/ocfs2/cluster/
H A Docfs2_heartbeat.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dquorum.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dsys.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Docfs2_nodemanager.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Dsys.c2 * vim: noexpandtab sw=8 ts=8 sts=0:
/linux-4.1.27/fs/ocfs2/dlm/
H A Ddlmconvert.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Ddlmdomain.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
H A Ddlmdebug.h2 * vim: noexpandtab sw=8 ts=8 sts=0:
/linux-4.1.27/arch/arm/mach-s3c24xx/
H A Dsetup-ts.c1 /* linux/arch/arm/plat-s3c24xx/setup-ts.c
/linux-4.1.27/drivers/net/ethernet/ti/
H A Dcpts.c170 static int cpts_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) cpts_ptp_gettime() argument
180 *ts = ns_to_timespec64(ns); cpts_ptp_gettime()
186 const struct timespec64 *ts) cpts_ptp_settime()
192 ns = timespec64_to_ns(ts); cpts_ptp_settime()
223 struct timespec64 ts; cpts_overflow_check() local
228 cpts_ptp_gettime(&cpts->info, &ts); cpts_overflow_check()
229 pr_debug("cpts overflow check at %lld.%09lu\n", ts.tv_sec, ts.tv_nsec); cpts_overflow_check()
185 cpts_ptp_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts) cpts_ptp_settime() argument
/linux-4.1.27/arch/sh/kernel/
H A Dtime.c41 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
43 rtc_sh_get_time(ts); read_persistent_clock()
/linux-4.1.27/drivers/iio/humidity/
H A Ddht11.c73 struct {s64 ts; int value; } edges[DHT11_EDGES_PER_READ]; member in struct:dht11::__anon4785
98 t = dht11->edges[i].ts - dht11->edges[i-1].ts; dht11_decode()
113 t = dht11->edges[offset + 2*i + 2].ts - dht11_decode()
114 dht11->edges[offset + 2*i + 1].ts; dht11_decode()
157 dht11->edges[dht11->num_edges].ts = iio_get_time_ns(); dht11_handle_irq()
/linux-4.1.27/drivers/net/ethernet/mellanox/mlx4/
H A Den_clock.c162 * @ts: timespec structure to hold the current time value
168 struct timespec64 *ts) mlx4_en_phc_gettime()
179 *ts = ns_to_timespec64(ns); mlx4_en_phc_gettime()
187 * @ts: timespec containing the new time for the cycle counter
193 const struct timespec64 *ts) mlx4_en_phc_settime()
197 u64 ns = timespec64_to_ns(ts); mlx4_en_phc_settime()
167 mlx4_en_phc_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) mlx4_en_phc_gettime() argument
192 mlx4_en_phc_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts) mlx4_en_phc_settime() argument
/linux-4.1.27/arch/tile/gxio/
H A Dmpipe.c459 const struct timespec64 *ts) gxio_mpipe_set_timestamp()
462 return gxio_mpipe_set_timestamp_aux(context, (uint64_t)ts->tv_sec, gxio_mpipe_set_timestamp()
463 (uint64_t)ts->tv_nsec, gxio_mpipe_set_timestamp()
469 struct timespec64 *ts) gxio_mpipe_get_timestamp()
474 ret = gxio_mpipe_get_timestamp_aux(context, (uint64_t *)&ts->tv_sec, gxio_mpipe_get_timestamp()
475 (uint64_t *)&ts->tv_nsec, gxio_mpipe_get_timestamp()
482 ts->tv_nsec -= (cycles_now - cycles_prev) * 1000000000LL / clock_rate; gxio_mpipe_get_timestamp()
483 if (ts->tv_nsec < 0) { gxio_mpipe_get_timestamp()
484 ts->tv_nsec += 1000000000LL; gxio_mpipe_get_timestamp()
485 ts->tv_sec -= 1; gxio_mpipe_get_timestamp()
458 gxio_mpipe_set_timestamp(gxio_mpipe_context_t *context, const struct timespec64 *ts) gxio_mpipe_set_timestamp() argument
468 gxio_mpipe_get_timestamp(gxio_mpipe_context_t *context, struct timespec64 *ts) gxio_mpipe_get_timestamp() argument
/linux-4.1.27/drivers/net/ethernet/freescale/
H A Dfec_ptp.c115 struct timespec ts; fec_ptp_enable_pps() local
156 * NSEC_PER_SEC - ts.tv_nsec. Add the remaining nanoseconds fec_ptp_enable_pps()
166 ts.tv_sec = div_u64_rem(ns, 1000000000ULL, &remainder); fec_ptp_enable_pps()
167 ts.tv_nsec = remainder; fec_ptp_enable_pps()
172 val = NSEC_PER_SEC - (u32)ts.tv_nsec + tempval; fec_ptp_enable_pps()
176 * - ts.tv_nsec is close to be zero(For example 20ns); Since the timer fec_ptp_enable_pps()
187 /* We add (2 * NSEC_PER_SEC - (u32)ts.tv_nsec) to current fec_ptp_enable_pps()
189 * (NSEC_PER_SEC - (u32)ts.tv_nsec) is less than 2 second. fec_ptp_enable_pps()
388 * @ts: timespec structure to hold the current time value
393 static int fec_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) fec_ptp_gettime() argument
404 *ts = ns_to_timespec64(ns); fec_ptp_gettime()
412 * @ts: the timespec containing the new time for the cycle counter
418 const struct timespec64 *ts) fec_ptp_settime()
434 ns = timespec64_to_ns(ts); fec_ptp_settime()
417 fec_ptp_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts) fec_ptp_settime() argument
/linux-4.1.27/arch/parisc/kernel/
H A Dtime.c249 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
253 ts->tv_sec = tod_data.tod_sec; read_persistent_clock()
254 ts->tv_nsec = tod_data.tod_usec * 1000; read_persistent_clock()
257 ts->tv_sec = 0; read_persistent_clock()
258 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/arch/mips/dec/
H A Dtime.c21 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
56 ts->tv_sec = mktime(year, mon, day, hour, min, sec); read_persistent_clock()
57 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/drivers/pinctrl/sunxi/
H A Dpinctrl-sun6i-a31s.c477 SUNXI_FUNCTION(0x3, "ts"), /* CLK */
483 SUNXI_FUNCTION(0x3, "ts"), /* ERR */
489 SUNXI_FUNCTION(0x3, "ts"), /* SYNC */
495 SUNXI_FUNCTION(0x3, "ts"), /* DVLD */
525 SUNXI_FUNCTION(0x3, "ts"), /* D0 */
531 SUNXI_FUNCTION(0x3, "ts"), /* D1 */
537 SUNXI_FUNCTION(0x3, "ts"), /* D2 */
543 SUNXI_FUNCTION(0x3, "ts"), /* D3 */
549 SUNXI_FUNCTION(0x3, "ts"), /* D4 */
555 SUNXI_FUNCTION(0x3, "ts"), /* D5 */
561 SUNXI_FUNCTION(0x3, "ts"), /* D6 */
567 SUNXI_FUNCTION(0x3, "ts"), /* D7 */
H A Dpinctrl-sun9i-a80.c399 SUNXI_FUNCTION(0x3, "ts"), /* CLK */
405 SUNXI_FUNCTION(0x3, "ts"), /* ERR */
411 SUNXI_FUNCTION(0x3, "ts"), /* SYNC */
417 SUNXI_FUNCTION(0x3, "ts"), /* DVLD */
451 SUNXI_FUNCTION(0x3, "ts"), /* D0 */
457 SUNXI_FUNCTION(0x3, "ts"), /* D1 */
463 SUNXI_FUNCTION(0x3, "ts"), /* D2 */
469 SUNXI_FUNCTION(0x3, "ts"), /* D3 */
475 SUNXI_FUNCTION(0x3, "ts"), /* D4 */
481 SUNXI_FUNCTION(0x3, "ts"), /* D5 */
487 SUNXI_FUNCTION(0x3, "ts"), /* D6 */
493 SUNXI_FUNCTION(0x3, "ts"), /* D7 */
/linux-4.1.27/arch/mips/mti-malta/
H A Dmalta-time.c114 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
116 ts->tv_sec = mc146818_get_cmos_time(); read_persistent_clock()
117 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/arch/mips/sni/
H A Dtime.c186 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
188 ts->tv_sec = -1; read_persistent_clock()
189 ts->tv_nsec = 0; read_persistent_clock()
/linux-4.1.27/arch/m32r/kernel/
H A Dtime.c140 void read_persistent_clock(struct timespec *ts) read_persistent_clock() argument
160 ts->tv_sec = mktime(year, mon, day, hour, min, sec); read_persistent_clock()
161 ts->tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); read_persistent_clock()
/linux-4.1.27/drivers/media/usb/uvc/
H A Duvc_video.c364 static inline void uvc_video_get_ts(struct timespec *ts) uvc_video_get_ts() argument
367 ktime_get_ts(ts); uvc_video_get_ts()
369 ktime_get_real_ts(ts); uvc_video_get_ts()
381 struct timespec ts; uvc_video_clock_decode() local
431 uvc_video_get_ts(&ts); uvc_video_clock_decode()
468 sample->host_ts = ts; uvc_video_clock_decode()
608 struct timespec ts; uvc_video_clock_update() local
659 ts = timespec_sub(last->host_ts, first->host_ts); uvc_video_clock_update()
661 y2 = (ts.tv_sec + 1) * NSEC_PER_SEC + ts.tv_nsec; uvc_video_clock_update()
679 ts.tv_sec = first->host_ts.tv_sec - 1 + div; uvc_video_clock_update()
680 ts.tv_nsec = first->host_ts.tv_nsec + rem; uvc_video_clock_update()
681 if (ts.tv_nsec >= NSEC_PER_SEC) { uvc_video_clock_update()
682 ts.tv_sec++; uvc_video_clock_update()
683 ts.tv_nsec -= NSEC_PER_SEC; uvc_video_clock_update()
686 uvc_trace(UVC_TRACE_CLOCK, "%s: SOF %u.%06llu y %llu ts %lu.%06lu " uvc_video_clock_update()
687 "buf ts %lu.%06lu (x1 %u/%u/%u x2 %u/%u/%u y1 %u y2 %u)\n", uvc_video_clock_update()
690 y, ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC, uvc_video_clock_update()
697 v4l2_buf->timestamp.tv_sec = ts.tv_sec; uvc_video_clock_update()
698 v4l2_buf->timestamp.tv_usec = ts.tv_nsec / NSEC_PER_USEC; uvc_video_clock_update()
860 struct timespec ts; uvc_video_stats_dump() local
863 ts.tv_sec = stream->stats.stream.stop_ts.tv_sec uvc_video_stats_dump()
865 ts.tv_nsec = stream->stats.stream.stop_ts.tv_nsec uvc_video_stats_dump()
867 if (ts.tv_nsec < 0) { uvc_video_stats_dump()
868 ts.tv_sec--; uvc_video_stats_dump()
869 ts.tv_nsec += 1000000000; uvc_video_stats_dump()
875 duration = ts.tv_sec * 1000 + ts.tv_nsec / 1000000; uvc_video_stats_dump()
1011 struct timespec ts; uvc_video_decode_start() local
1022 uvc_video_get_ts(&ts); uvc_video_decode_start()
1026 buf->buf.v4l2_buf.timestamp.tv_sec = ts.tv_sec; uvc_video_decode_start()
1028 ts.tv_nsec / NSEC_PER_USEC; uvc_video_decode_start()
/linux-4.1.27/drivers/media/pci/solo6x10/
H A Dsolo6x10-core.c50 struct timespec ts; solo_set_time() local
52 ktime_get_ts(&ts); solo_set_time()
54 solo_reg_write(solo_dev, SOLO_TIMER_SEC, ts.tv_sec); solo_set_time()
55 solo_reg_write(solo_dev, SOLO_TIMER_USEC, ts.tv_nsec / NSEC_PER_USEC); solo_set_time()
61 struct timespec ts; solo_timer_sync() local
75 ktime_get_ts(&ts); solo_timer_sync()
77 diff = (long)ts.tv_sec - (long)sec; solo_timer_sync()
79 + ((long)(ts.tv_nsec / NSEC_PER_USEC) - (long)usec); solo_timer_sync()
/linux-4.1.27/arch/s390/include/asm/
H A Dtimex.h114 void stck_to_timespec(unsigned long long stck, struct timespec *ts) stck_to_timespec() argument
116 tod_to_timeval(stck - TOD_UNIX_EPOCH, ts); stck_to_timespec()
/linux-4.1.27/arch/arm/plat-omap/
H A Dcounter_32k.c57 static void omap_read_persistent_clock64(struct timespec64 *ts) omap_read_persistent_clock64() argument
70 *ts = persistent_ts; omap_read_persistent_clock64()
/linux-4.1.27/include/linux/mfd/
H A Dipaq-micro.h105 * @ts: callback for asynchronous touchscreen events
120 void (*ts) (void *data, int len, unsigned char *rxdata); member in struct:ipaq_micro
/linux-4.1.27/fs/
H A Dcompat.c1109 struct timespec ts; poll_select_copy_remaining() local
1121 ktime_get_ts(&ts); poll_select_copy_remaining()
1122 ts = timespec_sub(*end_time, ts); poll_select_copy_remaining()
1123 if (ts.tv_sec < 0) poll_select_copy_remaining()
1124 ts.tv_sec = ts.tv_nsec = 0; poll_select_copy_remaining()
1129 rtv.tv_sec = ts.tv_sec; poll_select_copy_remaining()
1130 rtv.tv_usec = ts.tv_nsec / NSEC_PER_USEC; poll_select_copy_remaining()
1137 rts.tv_sec = ts.tv_sec; poll_select_copy_remaining()
1138 rts.tv_nsec = ts.tv_nsec; poll_select_copy_remaining()
1355 struct compat_timespec ts; do_compat_pselect() local
1360 if (copy_from_user(&ts, tsp, sizeof(ts))) do_compat_pselect()
1364 if (poll_select_set_timeout(to, ts.tv_sec, ts.tv_nsec)) do_compat_pselect()
1424 struct compat_timespec ts; COMPAT_SYSCALL_DEFINE5() local
1429 if (copy_from_user(&ts, tsp, sizeof(ts))) COMPAT_SYSCALL_DEFINE5()
1433 if (poll_select_set_timeout(to, ts.tv_sec, ts.tv_nsec)) COMPAT_SYSCALL_DEFINE5()
H A Dselect.c274 struct timespec ts = {.tv_sec = sec, .tv_nsec = nsec}; poll_select_set_timeout() local
276 if (!timespec_valid(&ts)) poll_select_set_timeout()
284 *to = timespec_add_safe(*to, ts); poll_select_set_timeout()
651 struct timespec ts, end_time, *to = NULL; do_pselect() local
655 if (copy_from_user(&ts, tsp, sizeof(ts))) do_pselect()
659 if (poll_select_set_timeout(to, ts.tv_sec, ts.tv_nsec)) do_pselect()
996 struct timespec ts, end_time, *to = NULL; SYSCALL_DEFINE5() local
1000 if (copy_from_user(&ts, tsp, sizeof(ts))) SYSCALL_DEFINE5()
1004 if (poll_select_set_timeout(to, ts.tv_sec, ts.tv_nsec)) SYSCALL_DEFINE5()
/linux-4.1.27/drivers/net/phy/
H A Ddp83640.c260 const struct timespec64 *ts, u16 cmd) tdr_write()
262 ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_nsec & 0xffff);/* ns[15:0] */ tdr_write()
263 ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_nsec >> 16); /* ns[31:16] */ tdr_write()
264 ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_sec & 0xffff); /* sec[15:0] */ tdr_write()
265 ext_write(bc, dev, PAGE4, PTP_TDR, ts->tv_sec >> 16); /* sec[31:16]*/ tdr_write()
414 struct timespec64 ts; ptp_dp83640_adjtime() local
419 ts = ns_to_timespec64(delta); ptp_dp83640_adjtime()
423 err = tdr_write(1, phydev, &ts, PTP_STEP_CLK); ptp_dp83640_adjtime()
431 struct timespec64 *ts) ptp_dp83640_gettime()
449 ts->tv_nsec = val[0] | (val[1] << 16); ptp_dp83640_gettime()
450 ts->tv_sec = val[2] | (val[3] << 16); ptp_dp83640_gettime()
456 const struct timespec64 *ts) ptp_dp83640_settime()
465 err = tdr_write(1, phydev, ts, PTP_LOAD_CLK); ptp_dp83640_settime()
617 struct timespec64 ts; recalibrate() local
709 ts = ns_to_timespec64(diff); recalibrate()
710 tdr_write(0, tmp->phydev, &ts, PTP_STEP_CLK); recalibrate()
259 tdr_write(int bc, struct phy_device *dev, const struct timespec64 *ts, u16 cmd) tdr_write() argument
430 ptp_dp83640_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) ptp_dp83640_gettime() argument
455 ptp_dp83640_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts) ptp_dp83640_settime() argument
/linux-4.1.27/drivers/media/usb/as102/
H A Das102_drv.h70 /* timer handle to trig ts stream download */
/linux-4.1.27/drivers/media/usb/dvb-usb/
H A Dttusb2.h49 /* out data: <index> <type: ts=1/sec=2> <pid msb> <pid lsb> */
/linux-4.1.27/drivers/scsi/megaraid/
H A Dmegaraid_mm.h101 // vi: set ts=8 sw=8 tw=78:
/linux-4.1.27/drivers/media/dvb-frontends/
H A Dzl10353.h39 /* set if parallel ts output is required */
/linux-4.1.27/drivers/pps/generators/
H A Dpps_gen_parport.c183 struct timespec ts; next_intr_time() local
185 getnstimeofday(&ts); next_intr_time()
187 return ktime_set(ts.tv_sec + next_intr_time()
188 ((ts.tv_nsec > 990 * NSEC_PER_MSEC) ? 1 : 0), next_intr_time()
/linux-4.1.27/net/
H A Dcompat.c227 struct timespec *ts = (struct timespec *)data; put_cmsg_compat() local
229 cts[i].tv_sec = ts[i].tv_sec; put_cmsg_compat()
230 cts[i].tv_nsec = ts[i].tv_nsec; put_cmsg_compat()
462 struct timespec ts; compat_sock_get_timestampns() local
471 ts = ktime_to_timespec(sk->sk_stamp); compat_sock_get_timestampns()
472 if (ts.tv_sec == -1) compat_sock_get_timestampns()
474 if (ts.tv_sec == 0) { compat_sock_get_timestampns()
476 ts = ktime_to_timespec(sk->sk_stamp); compat_sock_get_timestampns()
479 if (put_user(ts.tv_sec, &ctv->tv_sec) || compat_sock_get_timestampns()
480 put_user(ts.tv_nsec, &ctv->tv_nsec)) compat_sock_get_timestampns()
/linux-4.1.27/drivers/mmc/card/
H A Dmmc_test.c92 * @ts: time values of transfer
100 struct timespec ts; member in struct:mmc_test_transfer_result
496 static unsigned int mmc_test_rate(uint64_t bytes, struct timespec *ts) mmc_test_rate() argument
500 ns = ts->tv_sec; mmc_test_rate()
502 ns += ts->tv_nsec; mmc_test_rate()
523 unsigned int count, unsigned int sectors, struct timespec ts, mmc_test_save_transfer_result()
537 tr->ts = ts; mmc_test_save_transfer_result()
551 struct timespec ts; mmc_test_print_rate() local
553 ts = timespec_sub(*ts2, *ts1); mmc_test_print_rate()
555 rate = mmc_test_rate(bytes, &ts); mmc_test_print_rate()
556 iops = mmc_test_rate(100, &ts); /* I/O ops per sec x 100 */ mmc_test_print_rate()
561 (sectors & 1 ? ".5" : ""), (unsigned long)ts.tv_sec, mmc_test_print_rate()
562 (unsigned long)ts.tv_nsec, rate / 1000, rate / 1024, mmc_test_print_rate()
565 mmc_test_save_transfer_result(test, 1, sectors, ts, rate, iops); mmc_test_print_rate()
577 struct timespec ts; mmc_test_print_avg_rate() local
579 ts = timespec_sub(*ts2, *ts1); mmc_test_print_avg_rate()
581 rate = mmc_test_rate(tot, &ts); mmc_test_print_avg_rate()
582 iops = mmc_test_rate(count * 100, &ts); /* I/O ops per sec x 100 */ mmc_test_print_avg_rate()
589 (unsigned long)ts.tv_sec, (unsigned long)ts.tv_nsec, mmc_test_print_avg_rate()
593 mmc_test_save_transfer_result(test, count, sectors, ts, rate, iops); mmc_test_print_avg_rate()
1929 struct timespec ts1, ts2, ts; mmc_test_rnd_perf() local
1941 ts = timespec_sub(ts2, ts1); mmc_test_rnd_perf()
1942 if (ts.tv_sec >= 10) mmc_test_rnd_perf()
2828 (unsigned long)tr->ts.tv_sec, mtf_test_show()
2829 (unsigned long)tr->ts.tv_nsec, mtf_test_show()
522 mmc_test_save_transfer_result(struct mmc_test_card *test, unsigned int count, unsigned int sectors, struct timespec ts, unsigned int rate, unsigned int iops) mmc_test_save_transfer_result() argument
/linux-4.1.27/drivers/net/ethernet/intel/i40e/
H A Di40e_ptp.c54 * @ts: timespec structure to hold the current time value
60 static void i40e_ptp_read(struct i40e_pf *pf, struct timespec64 *ts) i40e_ptp_read() argument
72 *ts = ns_to_timespec64(ns); i40e_ptp_read()
78 * @ts: timespec structure that holds the new time value
84 static void i40e_ptp_write(struct i40e_pf *pf, const struct timespec64 *ts) i40e_ptp_write() argument
87 u64 ns = timespec64_to_ns(ts); i40e_ptp_write()
179 * @ts: timespec structure to hold the current time value
184 static int i40e_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts) i40e_ptp_gettime() argument
190 i40e_ptp_read(pf, ts); i40e_ptp_gettime()
199 * @ts: timespec structure that holds the new time value
205 const struct timespec64 *ts) i40e_ptp_settime()
211 i40e_ptp_write(pf, ts); i40e_ptp_settime()
676 struct timespec64 ts; i40e_ptp_init() local
698 ts = ktime_to_timespec64(ktime_get_real()); i40e_ptp_init()
699 i40e_ptp_settime(&pf->ptp_caps, &ts); i40e_ptp_init()
204 i40e_ptp_settime(struct ptp_clock_info *ptp, const struct timespec64 *ts) i40e_ptp_settime() argument
/linux-4.1.27/drivers/platform/chrome/
H A Dchromeos_laptop.c44 static struct i2c_client *ts; variable in typeref:struct:i2c_client
311 if (ts) setup_atmel_1664s_ts()
315 ts = add_probed_i2c_device("touchscreen", type, setup_atmel_1664s_ts()
317 return (!ts) ? -EAGAIN : 0; setup_atmel_1664s_ts()
633 if (ts) chromeos_laptop_exit()
634 i2c_unregister_device(ts); chromeos_laptop_exit()
/linux-4.1.27/arch/powerpc/platforms/52xx/
H A Dmpc52xx_lpbfifo.c228 u32 ts; mpc52xx_lpbfifo_irq() local
233 ts = get_tbl(); mpc52xx_lpbfifo_irq()
311 req->irq_ticks += get_tbl() - ts; mpc52xx_lpbfifo_irq()
331 u32 ts; mpc52xx_lpbfifo_bcom_irq() local
334 ts = get_tbl(); mpc52xx_lpbfifo_bcom_irq()
365 req->irq_ticks += get_tbl() - ts; mpc52xx_lpbfifo_bcom_irq()
/linux-4.1.27/drivers/net/slip/
H A Dslhc.c95 register struct cstate *ts; slhc_init() local
133 ts = comp->tstate; slhc_init()
135 ts[i].cs_this = i; slhc_init()
136 ts[i].next = &(ts[i - 1]); slhc_init()
138 ts[0].next = &(ts[comp->tslot_limit]); slhc_init()
139 ts[0].cs_this = 0; slhc_init()
/linux-4.1.27/arch/x86/kernel/
H A Dpvclock.c120 struct timespec *ts) pvclock_read_wallclock()
141 set_normalized_timespec(ts, now.tv_sec, now.tv_nsec); pvclock_read_wallclock()
118 pvclock_read_wallclock(struct pvclock_wall_clock *wall_clock, struct pvclock_vcpu_time_info *vcpu_time, struct timespec *ts) pvclock_read_wallclock() argument

Completed in 6130 milliseconds

123