Lines Matching refs:effect

12  * Set the magnitude of a constant force effect
45 * Upload the component of an effect dealing with the period, phase and magnitude
83 * Uploads the part of an effect setting the envelope of the force
178 * Analyse the changes in an effect, and tell if we need to send an condition
189 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
206 * Analyse the changes in an effect, and tell if we need to send a magnitude
211 struct ff_effect *effect)
213 if (effect->type != FF_CONSTANT) {
214 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
219 return old->u.constant.level != effect->u.constant.level;
223 * Analyse the changes in an effect, and tell if we need to send an envelope
227 struct ff_effect *effect)
229 switch (effect->type) {
231 if (old->u.constant.envelope.attack_length != effect->u.constant.envelope.attack_length
232 || old->u.constant.envelope.attack_level != effect->u.constant.envelope.attack_level
233 || old->u.constant.envelope.fade_length != effect->u.constant.envelope.fade_length
234 || old->u.constant.envelope.fade_level != effect->u.constant.envelope.fade_level)
239 if (old->u.periodic.envelope.attack_length != effect->u.periodic.envelope.attack_length
240 || old->u.periodic.envelope.attack_level != effect->u.periodic.envelope.attack_level
241 || old->u.periodic.envelope.fade_length != effect->u.periodic.envelope.fade_length
242 || old->u.periodic.envelope.fade_level != effect->u.periodic.envelope.fade_level)
247 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
255 * Analyse the changes in an effect, and tell if we need to send a periodic
256 * parameter effect
262 dev_warn(&iforce->dev->dev, "bad effect type in %s\n",
273 * Analyse the changes in an effect, and tell if we need to send an effect
320 /* Stop effect */
325 /* If needed, restart effect */
335 * Upload a periodic effect to the device
338 int iforce_upload_periodic(struct iforce *iforce, struct ff_effect *effect, struct ff_effect *old)
341 int core_id = effect->id;
349 if (!old || need_period_modifier(iforce, old, effect)) {
352 effect->u.periodic.magnitude, effect->u.periodic.offset,
353 effect->u.periodic.period, effect->u.periodic.phase);
359 if (!old || need_envelope_modifier(iforce, old, effect)) {
362 effect->u.periodic.envelope.attack_length,
363 effect->u.periodic.envelope.attack_level,
364 effect->u.periodic.envelope.fade_length,
365 effect->u.periodic.envelope.fade_level);
371 switch (effect->u.periodic.waveform) {
380 if (!old || need_core(old, effect)) {
381 core_err = make_core(iforce, effect->id,
386 effect->replay.length,
387 effect->replay.delay,
388 effect->trigger.button,
389 effect->trigger.interval,
390 effect->direction);
403 * Upload a constant force effect
406 * 0 Ok, effect created or updated
407 * 1 effect did not change since last upload, and no packet was therefore sent
409 int iforce_upload_constant(struct iforce *iforce, struct ff_effect *effect, struct ff_effect *old)
411 int core_id = effect->id;
419 if (!old || need_magnitude_modifier(iforce, old, effect)) {
422 effect->u.constant.level);
428 if (!old || need_envelope_modifier(iforce, old, effect)) {
431 effect->u.constant.envelope.attack_length,
432 effect->u.constant.envelope.attack_level,
433 effect->u.constant.envelope.fade_length,
434 effect->u.constant.envelope.fade_level);
440 if (!old || need_core(old, effect)) {
441 core_err = make_core(iforce, effect->id,
446 effect->replay.length,
447 effect->replay.delay,
448 effect->trigger.button,
449 effect->trigger.interval,
450 effect->direction);
463 * Upload an condition effect. Those are for example friction, inertia, springs...
465 int iforce_upload_condition(struct iforce *iforce, struct ff_effect *effect, struct ff_effect *old)
467 int core_id = effect->id;
475 switch (effect->type) {
481 if (!old || need_condition_modifier(iforce, old, effect)) {
484 effect->u.condition[0].right_saturation,
485 effect->u.condition[0].left_saturation,
486 effect->u.condition[0].right_coeff,
487 effect->u.condition[0].left_coeff,
488 effect->u.condition[0].deadband,
489 effect->u.condition[0].center);
496 effect->u.condition[1].right_saturation,
497 effect->u.condition[1].left_saturation,
498 effect->u.condition[1].right_coeff,
499 effect->u.condition[1].left_coeff,
500 effect->u.condition[1].deadband,
501 effect->u.condition[1].center);
508 if (!old || need_core(old, effect)) {
509 core_err = make_core(iforce, effect->id,
512 effect->replay.length, effect->replay.delay,
513 effect->trigger.button, effect->trigger.interval,
514 effect->direction);