Lines Matching full:effect

274 					    struct ff_effect *effect)  in pidff_set_constant_force_report()  argument
279 effect->u.constant.level); in pidff_set_constant_force_report()
288 static int pidff_needs_set_constant(struct ff_effect *effect, in pidff_needs_set_constant() argument
291 return effect->u.constant.level != old->u.constant.level; in pidff_needs_set_constant()
295 * Send set effect report to the device
298 struct ff_effect *effect) in pidff_set_effect_report() argument
304 pidff->set_effect[PID_DURATION].value[0] = effect->replay.length; in pidff_set_effect_report()
305 pidff->set_effect[PID_TRIGGER_BUTTON].value[0] = effect->trigger.button; in pidff_set_effect_report()
307 effect->trigger.interval; in pidff_set_effect_report()
312 pidff_rescale(effect->direction, 0xffff, in pidff_set_effect_report()
314 pidff->set_effect[PID_START_DELAY].value[0] = effect->replay.delay; in pidff_set_effect_report()
323 static int pidff_needs_set_effect(struct ff_effect *effect, in pidff_needs_set_effect() argument
326 return effect->replay.length != old->replay.length || in pidff_needs_set_effect()
327 effect->trigger.interval != old->trigger.interval || in pidff_needs_set_effect()
328 effect->trigger.button != old->trigger.button || in pidff_needs_set_effect()
329 effect->direction != old->direction || in pidff_needs_set_effect()
330 effect->replay.delay != old->replay.delay; in pidff_needs_set_effect()
334 * Send periodic effect report to the device
337 struct ff_effect *effect) in pidff_set_periodic_report() argument
342 effect->u.periodic.magnitude); in pidff_set_periodic_report()
344 effect->u.periodic.offset); in pidff_set_periodic_report()
345 pidff_set(&pidff->set_periodic[PID_PHASE], effect->u.periodic.phase); in pidff_set_periodic_report()
346 pidff->set_periodic[PID_PERIOD].value[0] = effect->u.periodic.period; in pidff_set_periodic_report()
354 * Test if periodic effect parameters have changed
356 static int pidff_needs_set_periodic(struct ff_effect *effect, in pidff_needs_set_periodic() argument
359 return effect->u.periodic.magnitude != old->u.periodic.magnitude || in pidff_needs_set_periodic()
360 effect->u.periodic.offset != old->u.periodic.offset || in pidff_needs_set_periodic()
361 effect->u.periodic.phase != old->u.periodic.phase || in pidff_needs_set_periodic()
362 effect->u.periodic.period != old->u.periodic.period; in pidff_needs_set_periodic()
366 * Send condition effect reports to the device
369 struct ff_effect *effect) in pidff_set_condition_report() argument
379 effect->u.condition[i].center); in pidff_set_condition_report()
381 effect->u.condition[i].right_coeff); in pidff_set_condition_report()
383 effect->u.condition[i].left_coeff); in pidff_set_condition_report()
385 effect->u.condition[i].right_saturation); in pidff_set_condition_report()
387 effect->u.condition[i].left_saturation); in pidff_set_condition_report()
389 effect->u.condition[i].deadband); in pidff_set_condition_report()
396 * Test if condition effect parameters have changed
398 static int pidff_needs_set_condition(struct ff_effect *effect, in pidff_needs_set_condition() argument
405 struct ff_condition_effect *cond = &effect->u.condition[i]; in pidff_needs_set_condition()
423 struct ff_effect *effect) in pidff_set_ramp_force_report() argument
428 effect->u.ramp.start_level); in pidff_set_ramp_force_report()
430 effect->u.ramp.end_level); in pidff_set_ramp_force_report()
438 static int pidff_needs_set_ramp(struct ff_effect *effect, struct ff_effect *old) in pidff_needs_set_ramp() argument
440 return effect->u.ramp.start_level != old->u.ramp.start_level || in pidff_needs_set_ramp()
441 effect->u.ramp.end_level != old->u.ramp.end_level; in pidff_needs_set_ramp()
445 * Send a request for effect upload to the device
489 * Play the effect with PID id n times
509 * Play the effect with effect id @effect_id for @value times
521 * Erase effect with PID id
531 * Stop and erase effect with effect_id
541 prevent the effect removal. */ in pidff_erase_effect()
550 * Effect upload handler
552 static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect, in pidff_upload_effect() argument
562 pidff->pid_id[effect->id]; in pidff_upload_effect()
565 switch (effect->type) { in pidff_upload_effect()
573 if (!old || pidff_needs_set_effect(effect, old)) in pidff_upload_effect()
574 pidff_set_effect_report(pidff, effect); in pidff_upload_effect()
575 if (!old || pidff_needs_set_constant(effect, old)) in pidff_upload_effect()
576 pidff_set_constant_force_report(pidff, effect); in pidff_upload_effect()
578 pidff_needs_set_envelope(&effect->u.constant.envelope, in pidff_upload_effect()
581 &effect->u.constant.envelope); in pidff_upload_effect()
586 switch (effect->u.periodic.waveform) { in pidff_upload_effect()
612 if (!old || pidff_needs_set_effect(effect, old)) in pidff_upload_effect()
613 pidff_set_effect_report(pidff, effect); in pidff_upload_effect()
614 if (!old || pidff_needs_set_periodic(effect, old)) in pidff_upload_effect()
615 pidff_set_periodic_report(pidff, effect); in pidff_upload_effect()
617 pidff_needs_set_envelope(&effect->u.periodic.envelope, in pidff_upload_effect()
620 &effect->u.periodic.envelope); in pidff_upload_effect()
630 if (!old || pidff_needs_set_effect(effect, old)) in pidff_upload_effect()
631 pidff_set_effect_report(pidff, effect); in pidff_upload_effect()
632 if (!old || pidff_needs_set_ramp(effect, old)) in pidff_upload_effect()
633 pidff_set_ramp_force_report(pidff, effect); in pidff_upload_effect()
635 pidff_needs_set_envelope(&effect->u.ramp.envelope, in pidff_upload_effect()
638 &effect->u.ramp.envelope); in pidff_upload_effect()
648 if (!old || pidff_needs_set_effect(effect, old)) in pidff_upload_effect()
649 pidff_set_effect_report(pidff, effect); in pidff_upload_effect()
650 if (!old || pidff_needs_set_condition(effect, old)) in pidff_upload_effect()
651 pidff_set_condition_report(pidff, effect); in pidff_upload_effect()
661 if (!old || pidff_needs_set_effect(effect, old)) in pidff_upload_effect()
662 pidff_set_effect_report(pidff, effect); in pidff_upload_effect()
663 if (!old || pidff_needs_set_condition(effect, old)) in pidff_upload_effect()
664 pidff_set_condition_report(pidff, effect); in pidff_upload_effect()
674 if (!old || pidff_needs_set_effect(effect, old)) in pidff_upload_effect()
675 pidff_set_effect_report(pidff, effect); in pidff_upload_effect()
676 if (!old || pidff_needs_set_condition(effect, old)) in pidff_upload_effect()
677 pidff_set_condition_report(pidff, effect); in pidff_upload_effect()
687 if (!old || pidff_needs_set_effect(effect, old)) in pidff_upload_effect()
688 pidff_set_effect_report(pidff, effect); in pidff_upload_effect()
689 if (!old || pidff_needs_set_condition(effect, old)) in pidff_upload_effect()
690 pidff_set_condition_report(pidff, effect); in pidff_upload_effect()
699 pidff->pid_id[effect->id] = in pidff_upload_effect()
946 hid_err(pidff->hid, "effect lists not found\n"); in pidff_find_special_fields()
966 hid_err(pidff->hid, "effect operation field not found\n"); in pidff_find_special_fields()
978 hid_err(pidff->hid, "no effect types found\n"); in pidff_find_special_fields()
993 hid_err(pidff->hid, "effect operation identifiers not found\n"); in pidff_find_special_fields()
1001 * Find the implemented effect types
1013 "effect type number %d is invalid\n", i); in pidff_find_effects()
1097 "has constant effect but no envelope\n"); in pidff_init_fields()
1100 "has ramp effect but no envelope\n"); in pidff_init_fields()
1104 "has periodic effect but no envelope\n"); in pidff_init_fields()
1109 hid_warn(pidff->hid, "unknown constant effect layout\n"); in pidff_init_fields()
1115 hid_warn(pidff->hid, "unknown ramp effect layout\n"); in pidff_init_fields()
1124 hid_warn(pidff->hid, "unknown condition effect layout\n"); in pidff_init_fields()
1133 hid_warn(pidff->hid, "unknown periodic effect layout\n"); in pidff_init_fields()
1196 * effect upload and cancel it immediately. If the approved in pidff_check_autocenter()
1197 * effect id was one above the minimum, then we assume the first in pidff_check_autocenter()
1198 * effect id is a built-in spring type effect used for autocenter in pidff_check_autocenter()