Lines Matching refs:effect
148 struct ff_haptic_effect *effect, in fill_effect_buf() argument
171 if (effect->intensity > 100) { in fill_effect_buf()
175 effect->intensity * in fill_effect_buf()
181 value = effect->repeat_count; in fill_effect_buf()
184 value = effect->retrigger_period; in fill_effect_buf()
233 static int hid_haptic_upload_effect(struct input_dev *dev, struct ff_effect *effect, in hid_haptic_upload_effect() argument
243 if (effect->u.haptic.hid_usage >= (HID_HP_VENDORWAVEFORMMIN & HID_USAGE) && in hid_haptic_upload_effect()
244 effect->u.haptic.hid_usage <= (HID_HP_VENDORWAVEFORMMAX & HID_USAGE) && in hid_haptic_upload_effect()
245 (effect->u.haptic.vendor_id != haptic->vendor_id || in hid_haptic_upload_effect()
246 effect->u.haptic.vendor_waveform_page != haptic->vendor_page)) in hid_haptic_upload_effect()
251 if (haptic->hid_usage_map[i] == effect->u.haptic.hid_usage) { in hid_haptic_upload_effect()
260 fill_effect_buf(haptic, &effect->u.haptic, &haptic->effect[effect->id], in hid_haptic_upload_effect()
263 if (effect->u.haptic.hid_usage == (HID_HP_WAVEFORMPRESS & HID_USAGE) || in hid_haptic_upload_effect()
264 effect->u.haptic.hid_usage == (HID_HP_WAVEFORMRELEASE & HID_USAGE)) in hid_haptic_upload_effect()
277 struct hid_haptic_effect *effect) in play_effect() argument
281 ret = hid_hw_output_report(hdev, effect->report_buf, in play_effect()
286 effect->report_buf, in play_effect()
297 struct hid_haptic_effect *effect = container_of(work, in haptic_work_handler() local
300 struct input_dev *dev = effect->input_dev; in haptic_work_handler()
305 if (effect != &haptic->stop_effect) in haptic_work_handler()
308 play_effect(hdev, haptic, effect); in haptic_work_handler()
318 queue_work(haptic->wq, &haptic->effect[effect_id].work); in hid_haptic_playback()
325 static void effect_set_default(struct ff_effect *effect) in effect_set_default() argument
327 effect->type = FF_HAPTIC; in effect_set_default()
328 effect->id = -1; in effect_set_default()
329 effect->u.haptic.hid_usage = HID_HP_WAVEFORMNONE & HID_USAGE; in effect_set_default()
330 effect->u.haptic.intensity = 100; in effect_set_default()
331 effect->u.haptic.retrigger_period = 0; in effect_set_default()
332 effect->u.haptic.repeat_count = 0; in effect_set_default()
339 struct ff_effect effect; in hid_haptic_erase() local
342 effect_set_default(&effect); in hid_haptic_erase()
344 if (effect.u.haptic.hid_usage == (HID_HP_WAVEFORMRELEASE & HID_USAGE)) { in hid_haptic_erase()
351 effect.u.haptic.hid_usage = HID_HP_WAVEFORMRELEASE & HID_USAGE; in hid_haptic_erase()
353 fill_effect_buf(haptic, &effect.u.haptic, &haptic->effect[effect_id], in hid_haptic_erase()
355 } else if (effect.u.haptic.hid_usage == (HID_HP_WAVEFORMPRESS & HID_USAGE)) { in hid_haptic_erase()
363 effect.u.haptic.hid_usage = HID_HP_WAVEFORMPRESS & HID_USAGE; in hid_haptic_erase()
365 fill_effect_buf(haptic, &effect.u.haptic, &haptic->effect[effect_id], in hid_haptic_erase()
384 if (haptic->effect) { in hid_haptic_destroy()
386 kfree(haptic->effect[r].report_buf); in hid_haptic_destroy()
387 kfree(haptic->effect); in hid_haptic_destroy()
389 haptic->effect = NULL; in hid_haptic_destroy()
477 haptic->effect = kzalloc_objs(struct hid_haptic_effect, FF_MAX_EFFECTS); in hid_haptic_init()
478 if (!haptic->effect) { in hid_haptic_init()
483 haptic->effect[r].report_buf = in hid_haptic_init()
486 if (!haptic->effect[r].report_buf) { in hid_haptic_init()
492 haptic->effect[r].input_dev = dev; in hid_haptic_init()
493 INIT_WORK(&haptic->effect[r].work, haptic_work_handler); in hid_haptic_init()
551 kfree(haptic->effect[r].report_buf); in hid_haptic_init()
552 kfree(haptic->effect); in hid_haptic_init()
553 haptic->effect = NULL; in hid_haptic_init()