From patchwork Sun Sep 19 11:54:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Rydberg X-Patchwork-Id: 193492 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8JBsn9o013008 for ; Sun, 19 Sep 2010 11:54:49 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753262Ab0ISLyt (ORCPT ); Sun, 19 Sep 2010 07:54:49 -0400 Received: from ch-smtp03.sth.basefarm.net ([80.76.149.214]:37377 "EHLO ch-smtp03.sth.basefarm.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753220Ab0ISLys (ORCPT ); Sun, 19 Sep 2010 07:54:48 -0400 Received: from c83-248-196-134.bredband.comhem.se ([83.248.196.134]:53870 helo=alnilam) by ch-smtp03.sth.basefarm.net with smtp (Exim 4.68) (envelope-from ) id 1OxITN-0003Na-AZ; Sun, 19 Sep 2010 13:54:24 +0200 Received: by alnilam (sSMTP sendmail emulation); Sun, 19 Sep 2010 13:54:17 +0200 From: "Henrik Rydberg" To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Henrik Rydberg Subject: [PATCH] input: uinput: Setup MT usage during device creation Date: Sun, 19 Sep 2010 13:54:13 +0200 Message-Id: <1284897253-1634-1-git-send-email-rydberg@euromail.se> X-Mailer: git-send-email 1.7.1 X-Originating-IP: 83.248.196.134 X-Scan-Result: No virus found in message 1OxITN-0003Na-AZ. X-Scan-Signature: ch-smtp03.sth.basefarm.net 1OxITN-0003Na-AZ 0bc08f62031c636280efde9f4b88e078 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sun, 19 Sep 2010 11:54:50 +0000 (UTC) diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c index 0d4266a..3606985 100644 --- a/drivers/input/misc/uinput.c +++ b/drivers/input/misc/uinput.c @@ -404,6 +404,13 @@ static int uinput_setup_device(struct uinput_device *udev, const char __user *bu retval = uinput_validate_absbits(dev); if (retval < 0) goto exit; + if (test_bit(ABS_MT_SLOT, dev->absbit)) { + int nslot = input_abs_get_max(dev, ABS_MT_SLOT) + 1; + input_mt_create_slots(dev, nslot); + input_set_events_per_packet(dev, 6 * nslot); + } else if (test_bit(ABS_MT_POSITION_X, dev->absbit)) { + input_set_events_per_packet(dev, 60); + } } udev->state = UIST_SETUP_COMPLETE;