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)
54 switch (effect->type) {
63 magnitude = effect->u.rumble.strong_magnitude / 3 +
64 effect->u.rumble.weak_magnitude / 6;
66 effect->type = FF_PERIODIC;
67 effect->u.periodic.waveform = FF_SINE;
68 effect->u.periodic.period = 50;
69 effect->u.periodic.magnitude = magnitude;
70 effect->u.periodic.offset = 0;
71 effect->u.periodic.phase = 0;
72 effect->u.periodic.envelope.attack_length = 0;
73 effect->u.periodic.envelope.attack_level = 0;
74 effect->u.periodic.envelope.fade_length = 0;
75 effect->u.periodic.envelope.fade_level = 0;
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,
102 if (effect->type < FF_EFFECT_MIN || effect->type > FF_EFFECT_MAX ||
103 !test_bit(effect->type, dev->ffbit)) {
104 dev_dbg(&dev->dev, "invalid or not supported effect type in upload\n");
108 if (effect->type == FF_PERIODIC &&
109 (effect->u.periodic.waveform < FF_WAVEFORM_MIN ||
110 effect->u.periodic.waveform > FF_WAVEFORM_MAX ||
111 !test_bit(effect->u.periodic.waveform, dev->ffbit))) {
116 if (!test_bit(effect->type, ff->ffbit)) {
117 error = compat_effect(ff, effect);
124 if (effect->id == -1) {
132 effect->id = id;
136 id = effect->id;
144 if (!check_effects_compatible(effect, old))
148 error = ff->upload(dev, effect, old);
153 ff->effects[id] = *effect;
162 * Erases the effect if the requester is also the effect owner. The mutex
194 * input_ff_erase - erase a force-feedback effect from device
195 * @dev: input device to erase effect from
196 * @effect_id: id of the effect to be erased
199 * This function erases a force-feedback effect from specified device.
200 * The effect will only be erased if it was uploaded through the same
217 * @dev: input device to erase effect from
242 * @dev: input device to send the effect to