Lines Matching defs:effect
18 * Check that the effect_id is a valid effect and whether the user
46 * Convert an effect into compatible one
48 static int compat_effect(struct ff_device *ff, struct ff_effect *effect)
52 switch (effect->type) {
61 magnitude = effect->u.rumble.strong_magnitude / 3 +
62 effect->u.rumble.weak_magnitude / 6;
64 effect->type = FF_PERIODIC;
65 effect->u.periodic.waveform = FF_SINE;
66 effect->u.periodic.period = 50;
67 effect->u.periodic.magnitude = magnitude;
68 effect->u.periodic.offset = 0;
69 effect->u.periodic.phase = 0;
70 effect->u.periodic.envelope.attack_length = 0;
71 effect->u.periodic.envelope.attack_level = 0;
72 effect->u.periodic.envelope.fade_length = 0;
73 effect->u.periodic.envelope.fade_level = 0;
84 * input_ff_upload() - upload effect into force-feedback device
86 * @effect: effect to be uploaded
87 * @file: owner of the effect
89 int input_ff_upload(struct input_dev *dev, struct ff_effect *effect,
100 if (effect->type < FF_EFFECT_MIN || effect->type > FF_EFFECT_MAX ||
101 !test_bit(effect->type, dev->ffbit)) {
102 dev_dbg(&dev->dev, "invalid or not supported effect type in upload\n");
106 if (effect->type == FF_PERIODIC &&
107 (effect->u.periodic.waveform < FF_WAVEFORM_MIN ||
108 effect->u.periodic.waveform > FF_WAVEFORM_MAX ||
109 !test_bit(effect->u.periodic.waveform, dev->ffbit))) {
114 if (!test_bit(effect->type, ff->ffbit)) {
115 ret = compat_effect(ff, effect);
122 if (effect->id == -1) {
132 effect->id = id;
136 id = effect->id;
144 if (!check_effects_compatible(effect, old)) {
150 ret = ff->upload(dev, effect, old);
155 ff->effects[id] = *effect;
166 * Erases the effect if the requester is also the effect owner. The mutex
199 * input_ff_erase - erase a force-feedback effect from device
200 * @dev: input device to erase effect from
201 * @effect_id: id of the effect to be erased
204 * This function erases a force-feedback effect from specified device.
205 * The effect will only be erased if it was uploaded through the same
226 * @dev: input device to erase effect from
253 * @dev: input device to send the effect to