diff --git a/hid-ftec.c b/hid-ftec.c index 6f66153..65f9d08 100644 --- a/hid-ftec.c +++ b/hid-ftec.c @@ -522,26 +522,25 @@ static int ftec_client_ll_raw_request(struct hid_device *hdev, effect->id = 0; // FIXME: also unload? break; - } - - if (params->op == 0x2) { - // stop all other effects - struct ff_effect *other_effect; - for (size_t i = 0; i < ARRAY_SIZE(drv_data->client.effects); ++i) { - other_effect = &drv_data->client.effects[i]; - if (other_effect->id > 0 && other_effect != effect) { - (void)ff->playback(inputdev, other_effect->id, 0); - other_effect->id = 0; - // FIXME: also unload? + } else { + if (params->op == 0x2) { + // stop all other effects + struct ff_effect *other_effect; + for (size_t i = 0; i < ARRAY_SIZE(drv_data->client.effects); ++i) { + other_effect = &drv_data->client.effects[i]; + if (other_effect->id > 0 && other_effect != effect) { + (void)ff->playback(inputdev, other_effect->id, 0); + other_effect->id = 0; + // FIXME: also unload? + } } - } - } - - if (params->op == 0x1) { - if (!effect->id) { - effect->id = params->id; - (void)ff->upload(inputdev, effect, NULL); + } + if (params->op == 0x1 || params->op == 0x2) { + if (!effect->id) { + effect->id = params->id; + (void)ff->upload(inputdev, effect, NULL); + } } }