Lines Matching full:effect
148 struct ff_haptic_effect *effect,
171 if (effect->intensity > 100) {
175 effect->intensity *
181 value = effect->repeat_count;
184 value = effect->retrigger_period;
233 static int hid_haptic_upload_effect(struct input_dev *dev, struct ff_effect *effect,
243 if (effect->u.haptic.hid_usage >= (HID_HP_VENDORWAVEFORMMIN & HID_USAGE) &&
244 effect->u.haptic.hid_usage <= (HID_HP_VENDORWAVEFORMMAX & HID_USAGE) &&
245 (effect->u.haptic.vendor_id != haptic->vendor_id ||
246 effect->u.haptic.vendor_waveform_page != haptic->vendor_page))
251 if (haptic->hid_usage_map[i] == effect->u.haptic.hid_usage) {
259 /* Fill the buffer for the effect id */
260 fill_effect_buf(haptic, &effect->u.haptic, &haptic->effect[effect->id],
263 if (effect->u.haptic.hid_usage == (HID_HP_WAVEFORMPRESS & HID_USAGE) ||
264 effect->u.haptic.hid_usage == (HID_HP_WAVEFORMRELEASE & HID_USAGE))
267 /* If device is in autonomous mode, and the uploaded effect signals userspace
277 struct hid_haptic_effect *effect)
281 ret = hid_hw_output_report(hdev, effect->report_buf,
286 effect->report_buf,
297 struct hid_haptic_effect *effect = container_of(work,
300 struct input_dev *dev = effect->input_dev;
305 if (effect != &haptic->stop_effect)
308 play_effect(hdev, haptic, effect);
318 queue_work(haptic->wq, &haptic->effect[effect_id].work);
325 static void effect_set_default(struct ff_effect *effect)
327 effect->type = FF_HAPTIC;
328 effect->id = -1;
329 effect->u.haptic.hid_usage = HID_HP_WAVEFORMNONE & HID_USAGE;
330 effect->u.haptic.intensity = 100;
331 effect->u.haptic.retrigger_period = 0;
332 effect->u.haptic.repeat_count = 0;
339 struct ff_effect effect;
342 effect_set_default(&effect);
344 if (effect.u.haptic.hid_usage == (HID_HP_WAVEFORMRELEASE & HID_USAGE)) {
351 effect.u.haptic.hid_usage = HID_HP_WAVEFORMRELEASE & HID_USAGE;
353 fill_effect_buf(haptic, &effect.u.haptic, &haptic->effect[effect_id],
355 } else if (effect.u.haptic.hid_usage == (HID_HP_WAVEFORMPRESS & HID_USAGE)) {
363 effect.u.haptic.hid_usage = HID_HP_WAVEFORMPRESS & HID_USAGE;
365 fill_effect_buf(haptic, &effect.u.haptic, &haptic->effect[effect_id],
384 if (haptic->effect) {
386 kfree(haptic->effect[r].report_buf);
387 kfree(haptic->effect);
389 haptic->effect = NULL;
477 haptic->effect = kzalloc_objs(struct hid_haptic_effect, FF_MAX_EFFECTS);
478 if (!haptic->effect) {
483 haptic->effect[r].report_buf =
486 if (!haptic->effect[r].report_buf) {
488 "Failed to allocate a buffer for an effect.\n");
492 haptic->effect[r].input_dev = dev;
493 INIT_WORK(&haptic->effect[r].work, haptic_work_handler);
500 "Failed to allocate a buffer for stop effect.\n");
551 kfree(haptic->effect[r].report_buf);
552 kfree(haptic->effect);
553 haptic->effect = NULL;