Lines Matching defs:effect

21  * Check that the effect_id is a valid effect and whether the user
49 * Convert an effect into compatible one
51 static int compat_effect(struct ff_device *ff, struct ff_effect *effect)
55 switch (effect->type) {
64 magnitude = effect->u.rumble.strong_magnitude / 3 +
65 effect->u.rumble.weak_magnitude / 6;
67 effect->type = FF_PERIODIC;
68 effect->u.periodic.waveform = FF_SINE;
69 effect->u.periodic.period = 50;
70 effect->u.periodic.magnitude = max(magnitude, 0x7fff);
71 effect->u.periodic.offset = 0;
72 effect->u.periodic.phase = 0;
73 effect->u.periodic.envelope.attack_length = 0;
74 effect->u.periodic.envelope.attack_level = 0;
75 effect->u.periodic.envelope.fade_length = 0;
76 effect->u.periodic.envelope.fade_level = 0;
87 * input_ff_upload() - upload effect into force-feedback device
89 * @effect: effect to be uploaded
90 * @file: owner of the effect
92 int input_ff_upload(struct input_dev *dev, struct ff_effect *effect,
103 if (effect->type < FF_EFFECT_MIN || effect->type > FF_EFFECT_MAX ||
104 !test_bit(effect->type, dev->ffbit)) {
105 dev_dbg(&dev->dev, "invalid or not supported effect type in upload\n");
109 if (effect->type == FF_PERIODIC &&
110 (effect->u.periodic.waveform < FF_WAVEFORM_MIN ||
111 effect->u.periodic.waveform > FF_WAVEFORM_MAX ||
112 !test_bit(effect->u.periodic.waveform, dev->ffbit))) {
117 if (!test_bit(effect->type, ff->ffbit)) {
118 ret = compat_effect(ff, effect);
125 if (effect->id == -1) {
135 effect->id = id;
139 id = effect->id;
147 if (!check_effects_compatible(effect, old)) {
153 ret = ff->upload(dev, effect, old);
158 ff->effects[id] = *effect;
169 * Erases the effect if the requester is also the effect owner. The mutex
202 * input_ff_erase - erase a force-feedback effect from device
203 * @dev: input device to erase effect from
204 * @effect_id: id of the effect to be erased
207 * This function erases a force-feedback effect from specified device.
208 * The effect will only be erased if it was uploaded through the same
229 * @dev: input device to erase effect from
256 * @dev: input device to send the effect to