From patchwork Wed Dec 23 13:31:14 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jari Vanhala X-Patchwork-Id: 69548 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id nBNDWKqR028756 for ; Wed, 23 Dec 2009 13:32:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755933AbZLWNcT (ORCPT ); Wed, 23 Dec 2009 08:32:19 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755958AbZLWNcT (ORCPT ); Wed, 23 Dec 2009 08:32:19 -0500 Received: from smtp.nokia.com ([192.100.122.230]:39634 "EHLO mgw-mx03.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755933AbZLWNcS (ORCPT ); Wed, 23 Dec 2009 08:32:18 -0500 Received: from vaebh106.NOE.Nokia.com (vaebh106.europe.nokia.com [10.160.244.32]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nBNDVucP003313; Wed, 23 Dec 2009 15:32:08 +0200 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh106.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 23 Dec 2009 15:31:23 +0200 Received: from mgw-sa01.ext.nokia.com ([147.243.1.47]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 23 Dec 2009 15:31:16 +0200 Received: from [172.22.215.138] (trdhcp215138.nmp.nokia.com [172.22.215.138]) by mgw-sa01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nBNDVESC006171; Wed, 23 Dec 2009 15:31:15 +0200 Subject: [RFC] ff-memless instant starting From: Jari Vanhala Reply-To: ext-jari.vanhala@nokia.com To: Linux Input Cc: Dmitry Torokhov , Anssi Hannula Organization: Nokia/Ixonos Date: Wed, 23 Dec 2009 15:31:14 +0200 Message-ID: <1261575074.24604.31.camel@tema> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 X-OriginalArrivalTime: 23 Dec 2009 13:31:16.0446 (UTC) FILETIME=[342277E0:01CA83D4] X-Nokia-AV: Clean Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From d3b6fa1eaac42f878f7c9b89b22ddfa85d900f38 Mon Sep 17 00:00:00 2001 From: Jari Vanhala Date: Tue, 22 Dec 2009 16:49:29 +0200 Subject: [PATCH] Input: Add instant option to ff-memless Allows Force Feedback effect to be started immediately and not to wait for timer. Useful in low HZ systems. Signed-off-by: Jari Vanhala --- drivers/input/ff-memless.c | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index b483b29..dfd5830 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c @@ -67,6 +67,10 @@ struct ml_device { struct ff_effect *effect); }; +static int instant; +module_param(instant, int, 0); +MODULE_PARM_DESC(instant, "Start new effect instantly"); + static const struct ff_envelope *get_envelope(const struct ff_effect *effect) { static const struct ff_envelope empty_envelope; @@ -411,7 +415,10 @@ static int ml_ff_playback(struct input_dev *dev, int effect_id, int value) msecs_to_jiffies(state->effect->replay.length); state->adj_at = state->play_at; - ml_schedule_timer(ml); + if (instant && !state->effect->replay.delay) + ml_play_effects(ml); + else + ml_schedule_timer(ml); } else { debug("initiated stop"); -- 1.6.3.3