Lines Matching full:effect
90 struct ff_effect *effect; member
130 struct cs40l50_effect *effect; in cs40l50_find_effect() local
132 list_for_each_entry(effect, effect_head, list) in cs40l50_find_effect()
133 if (effect->id == id) in cs40l50_find_effect()
134 return effect; in cs40l50_find_effect()
140 struct cs40l50_effect *effect) in cs40l50_effect_bank_set() argument
150 effect->type = CS40L50_WVFRM_BANK_OWT; in cs40l50_effect_bank_set()
152 effect->type = bank_type; in cs40l50_effect_bank_set()
158 struct cs40l50_effect *effect) in cs40l50_effect_index_set() argument
164 base_index = vib->dsp.banks[effect->type].base_index; in cs40l50_effect_index_set()
165 max_index = vib->dsp.banks[effect->type].max_index; in cs40l50_effect_index_set()
167 effect->index = base_index; in cs40l50_effect_index_set()
169 switch (effect->type) { in cs40l50_effect_index_set()
173 effect->index++; in cs40l50_effect_index_set()
177 effect->index += work_data->custom_data[1] & CS40L50_CUSTOM_DATA_MASK; in cs40l50_effect_index_set()
180 dev_err(vib->dev, "Bank type %d not supported\n", effect->type); in cs40l50_effect_index_set()
184 if (effect->index > max_index || effect->index < base_index) { in cs40l50_effect_index_set()
185 dev_err(vib->dev, "Index out of bounds: %u\n", effect->index); in cs40l50_effect_index_set()
193 struct cs40l50_effect *effect) in cs40l50_effect_gpio_mapping_set() argument
195 u16 gpio_edge, gpio_num, button = work_data->effect->trigger.button; in cs40l50_effect_gpio_mapping_set()
201 effect->gpio_reg = vib->dsp.gpio_base_reg + (gpio_num * 8) - gpio_edge; in cs40l50_effect_gpio_mapping_set()
203 return regmap_write(vib->regmap, effect->gpio_reg, button); in cs40l50_effect_gpio_mapping_set()
206 effect->gpio_reg = CS40L50_GPIO_MAPPING_NONE; in cs40l50_effect_gpio_mapping_set()
231 dev_err(vib->dev, "No space in open wavetable for effect\n"); in cs40l50_upload_owt()
266 struct cs40l50_effect *effect; in cs40l50_add_worker() local
274 /* Update effect if already uploaded, otherwise create new effect */ in cs40l50_add_worker()
275 effect = cs40l50_find_effect(work_data->effect->id, &vib->effect_head); in cs40l50_add_worker()
276 if (!effect) { in cs40l50_add_worker()
277 effect = kzalloc(sizeof(*effect), GFP_KERNEL); in cs40l50_add_worker()
278 if (!effect) { in cs40l50_add_worker()
283 effect->id = work_data->effect->id; in cs40l50_add_worker()
287 error = cs40l50_effect_bank_set(work_data, effect); in cs40l50_add_worker()
291 error = cs40l50_effect_index_set(work_data, effect); in cs40l50_add_worker()
295 error = cs40l50_effect_gpio_mapping_set(work_data, effect); in cs40l50_add_worker()
299 if (effect->type == CS40L50_WVFRM_BANK_OWT) in cs40l50_add_worker()
304 kfree(effect); in cs40l50_add_worker()
306 list_add(&effect->list, &vib->effect_head); in cs40l50_add_worker()
315 static int cs40l50_add(struct input_dev *dev, struct ff_effect *effect, in cs40l50_add() argument
318 struct ff_periodic_effect *periodic = &effect->u.periodic; in cs40l50_add()
322 if (effect->type != FF_PERIODIC || periodic->waveform != FF_CUSTOM) { in cs40l50_add()
324 effect->type, periodic->waveform); in cs40l50_add()
328 work_data.custom_data = memdup_array_user(effect->u.periodic.custom_data, in cs40l50_add()
329 effect->u.periodic.custom_len, in cs40l50_add()
334 work_data.custom_len = effect->u.periodic.custom_len; in cs40l50_add()
336 work_data.effect = effect; in cs40l50_add()
357 start_effect = cs40l50_find_effect(work_data->effect->id, &vib->effect_head); in cs40l50_start_worker()
361 usleep_range(work_data->effect->replay.length, in cs40l50_start_worker()
362 work_data->effect->replay.length + 100); in cs40l50_start_worker()
365 dev_err(vib->dev, "Effect to play not found\n"); in cs40l50_start_worker()
402 work_data->effect = &dev->ff->effects[effect_id]; in cs40l50_playback()
406 /* Stop the amplifier as device drives only one effect */ in cs40l50_playback()
426 erase_effect = cs40l50_find_effect(work_data->effect->id, &vib->effect_head); in cs40l50_erase_worker()
428 dev_err(vib->dev, "Effect to erase not found\n"); in cs40l50_erase_worker()
468 work_data.effect = &dev->ff->effects[effect_id]; in cs40l50_erase()