Lines Matching full:effect

12  * Set the magnitude of a constant force effect
44 * Upload the component of an effect dealing with the period, phase and magnitude
81 * Uploads the part of an effect setting the envelope of the force
174 * Analyse the changes in an effect, and tell if we need to send an condition
185 dev_warn(&iforce->dev->dev, "bad effect type in %s\n", in need_condition_modifier()
202 * Analyse the changes in an effect, and tell if we need to send a magnitude
207 struct ff_effect *effect) in need_magnitude_modifier() argument
209 if (effect->type != FF_CONSTANT) { in need_magnitude_modifier()
210 dev_warn(&iforce->dev->dev, "bad effect type in %s\n", in need_magnitude_modifier()
215 return old->u.constant.level != effect->u.constant.level; in need_magnitude_modifier()
219 * Analyse the changes in an effect, and tell if we need to send an envelope
223 struct ff_effect *effect) in need_envelope_modifier() argument
225 switch (effect->type) { in need_envelope_modifier()
227 if (old->u.constant.envelope.attack_length != effect->u.constant.envelope.attack_length in need_envelope_modifier()
228 || old->u.constant.envelope.attack_level != effect->u.constant.envelope.attack_level in need_envelope_modifier()
229 || old->u.constant.envelope.fade_length != effect->u.constant.envelope.fade_length in need_envelope_modifier()
230 || old->u.constant.envelope.fade_level != effect->u.constant.envelope.fade_level) in need_envelope_modifier()
235 if (old->u.periodic.envelope.attack_length != effect->u.periodic.envelope.attack_length in need_envelope_modifier()
236 || old->u.periodic.envelope.attack_level != effect->u.periodic.envelope.attack_level in need_envelope_modifier()
237 || old->u.periodic.envelope.fade_length != effect->u.periodic.envelope.fade_length in need_envelope_modifier()
238 || old->u.periodic.envelope.fade_level != effect->u.periodic.envelope.fade_level) in need_envelope_modifier()
243 dev_warn(&iforce->dev->dev, "bad effect type in %s\n", in need_envelope_modifier()
251 * Analyse the changes in an effect, and tell if we need to send a periodic
252 * parameter effect
258 dev_warn(&iforce->dev->dev, "bad effect type in %s\n", in need_period_modifier()
269 * Analyse the changes in an effect, and tell if we need to send an effect
316 /* Stop effect */ in make_core()
321 /* If needed, restart effect */ in make_core()
331 * Upload a periodic effect to the device
334 int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, struct ff_effect *old) in iforce_upload_periodic() argument
337 int core_id = effect->id; in iforce_upload_periodic()
345 if (!old || need_period_modifier(iforce, old, effect)) { in iforce_upload_periodic()
348 effect->u.periodic.magnitude, effect->u.periodic.offset, in iforce_upload_periodic()
349 effect->u.periodic.period, effect->u.periodic.phase); in iforce_upload_periodic()
355 if (!old || need_envelope_modifier(iforce, old, effect)) { in iforce_upload_periodic()
358 effect->u.periodic.envelope.attack_length, in iforce_upload_periodic()
359 effect->u.periodic.envelope.attack_level, in iforce_upload_periodic()
360 effect->u.periodic.envelope.fade_length, in iforce_upload_periodic()
361 effect->u.periodic.envelope.fade_level); in iforce_upload_periodic()
367 switch (effect->u.periodic.waveform) { in iforce_upload_periodic()
376 if (!old || need_core(old, effect)) { in iforce_upload_periodic()
377 core_err = make_core(iforce, effect->id, in iforce_upload_periodic()
382 effect->replay.length, in iforce_upload_periodic()
383 effect->replay.delay, in iforce_upload_periodic()
384 effect->trigger.button, in iforce_upload_periodic()
385 effect->trigger.interval, in iforce_upload_periodic()
386 effect->direction); in iforce_upload_periodic()
399 * Upload a constant force effect
402 * 0 Ok, effect created or updated
403 * 1 effect did not change since last upload, and no packet was therefore sent
405 int iforce_upload_constant(struct iforce *iforce, struct ff_effect *effect, struct ff_effect *old) in iforce_upload_constant() argument
407 int core_id = effect->id; in iforce_upload_constant()
415 if (!old || need_magnitude_modifier(iforce, old, effect)) { in iforce_upload_constant()
418 effect->u.constant.level); in iforce_upload_constant()
424 if (!old || need_envelope_modifier(iforce, old, effect)) { in iforce_upload_constant()
427 effect->u.constant.envelope.attack_length, in iforce_upload_constant()
428 effect->u.constant.envelope.attack_level, in iforce_upload_constant()
429 effect->u.constant.envelope.fade_length, in iforce_upload_constant()
430 effect->u.constant.envelope.fade_level); in iforce_upload_constant()
436 if (!old || need_core(old, effect)) { in iforce_upload_constant()
437 core_err = make_core(iforce, effect->id, in iforce_upload_constant()
442 effect->replay.length, in iforce_upload_constant()
443 effect->replay.delay, in iforce_upload_constant()
444 effect->trigger.button, in iforce_upload_constant()
445 effect->trigger.interval, in iforce_upload_constant()
446 effect->direction); in iforce_upload_constant()
459 * Upload an condition effect. Those are for example friction, inertia, springs...
461 int iforce_upload_condition(struct iforce *iforce, struct ff_effect *effect, struct ff_effect *old) in iforce_upload_condition() argument
463 int core_id = effect->id; in iforce_upload_condition()
471 switch (effect->type) { in iforce_upload_condition()
477 if (!old || need_condition_modifier(iforce, old, effect)) { in iforce_upload_condition()
480 effect->u.condition[0].right_saturation, in iforce_upload_condition()
481 effect->u.condition[0].left_saturation, in iforce_upload_condition()
482 effect->u.condition[0].right_coeff, in iforce_upload_condition()
483 effect->u.condition[0].left_coeff, in iforce_upload_condition()
484 effect->u.condition[0].deadband, in iforce_upload_condition()
485 effect->u.condition[0].center); in iforce_upload_condition()
492 effect->u.condition[1].right_saturation, in iforce_upload_condition()
493 effect->u.condition[1].left_saturation, in iforce_upload_condition()
494 effect->u.condition[1].right_coeff, in iforce_upload_condition()
495 effect->u.condition[1].left_coeff, in iforce_upload_condition()
496 effect->u.condition[1].deadband, in iforce_upload_condition()
497 effect->u.condition[1].center); in iforce_upload_condition()
504 if (!old || need_core(old, effect)) { in iforce_upload_condition()
505 core_err = make_core(iforce, effect->id, in iforce_upload_condition()
508 effect->replay.length, effect->replay.delay, in iforce_upload_condition()
509 effect->trigger.button, effect->trigger.interval, in iforce_upload_condition()
510 effect->direction); in iforce_upload_condition()