Lines Matching full:effect

20  * Check that the effect_id is a valid effect and whether the user
48 * Convert an effect into compatible one
50 static int compat_effect(struct ff_device *ff, struct ff_effect *effect) in compat_effect() argument
54 switch (effect->type) { in compat_effect()
63 magnitude = effect->u.rumble.strong_magnitude / 3 + in compat_effect()
64 effect->u.rumble.weak_magnitude / 6; in compat_effect()
66 effect->type = FF_PERIODIC; in compat_effect()
67 effect->u.periodic.waveform = FF_SINE; in compat_effect()
68 effect->u.periodic.period = 50; in compat_effect()
69 effect->u.periodic.magnitude = magnitude; in compat_effect()
70 effect->u.periodic.offset = 0; in compat_effect()
71 effect->u.periodic.phase = 0; in compat_effect()
72 effect->u.periodic.envelope.attack_length = 0; in compat_effect()
73 effect->u.periodic.envelope.attack_level = 0; in compat_effect()
74 effect->u.periodic.envelope.fade_length = 0; in compat_effect()
75 effect->u.periodic.envelope.fade_level = 0; in compat_effect()
86 * input_ff_upload() - upload effect into force-feedback device
88 * @effect: effect to be uploaded
89 * @file: owner of the effect
91 int input_ff_upload(struct input_dev *dev, struct ff_effect *effect, in input_ff_upload() argument
102 if (effect->type < FF_EFFECT_MIN || effect->type > FF_EFFECT_MAX || in input_ff_upload()
103 !test_bit(effect->type, dev->ffbit)) { in input_ff_upload()
104 dev_dbg(&dev->dev, "invalid or not supported effect type in upload\n"); in input_ff_upload()
108 if (effect->type == FF_PERIODIC && in input_ff_upload()
109 (effect->u.periodic.waveform < FF_WAVEFORM_MIN || in input_ff_upload()
110 effect->u.periodic.waveform > FF_WAVEFORM_MAX || in input_ff_upload()
111 !test_bit(effect->u.periodic.waveform, dev->ffbit))) { in input_ff_upload()
116 if (!test_bit(effect->type, ff->ffbit)) { in input_ff_upload()
117 ret = compat_effect(ff, effect); in input_ff_upload()
124 if (effect->id == -1) { in input_ff_upload()
134 effect->id = id; in input_ff_upload()
138 id = effect->id; in input_ff_upload()
146 if (!check_effects_compatible(effect, old)) { in input_ff_upload()
152 ret = ff->upload(dev, effect, old); in input_ff_upload()
157 ff->effects[id] = *effect; in input_ff_upload()
168 * Erases the effect if the requester is also the effect owner. The mutex
201 * input_ff_erase - erase a force-feedback effect from device
202 * @dev: input device to erase effect from
203 * @effect_id: id of the effect to be erased
206 * This function erases a force-feedback effect from specified device.
207 * The effect will only be erased if it was uploaded through the same
228 * @dev: input device to erase effect from
255 * @dev: input device to send the effect to