From patchwork Tue Aug 24 08:28:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Henrik Rydberg X-Patchwork-Id: 62557 X-Patchwork-Delegate: leann.ogasawara@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 1E951B70D0 for ; Tue, 24 Aug 2010 18:28:49 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1Onos3-0006pd-8y; Tue, 24 Aug 2010 09:28:39 +0100 Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1Onos0-0006pI-4e for kernel-team@lists.ubuntu.com; Tue, 24 Aug 2010 09:28:36 +0100 Received: from c83-248-196-134.bredband.comhem.se ([83.248.196.134]:60623 helo=alnilam) by ch-smtp02.sth.basefarm.net with smtp (Exim 4.68) (envelope-from ) id 1OnorX-0003o6-8G; Tue, 24 Aug 2010 10:28:10 +0200 Received: by alnilam (sSMTP sendmail emulation); Tue, 24 Aug 2010 10:28:05 +0200 From: "Henrik Rydberg" To: kernel-team@lists.ubuntu.com Subject: [PATCH] input: mt: Initialize slots to unused Date: Tue, 24 Aug 2010 10:28:04 +0200 Message-Id: <1282638484-16236-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 1OnorX-0003o6-8G. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1OnorX-0003o6-8G e8915aded9ff87f86d5147635912d5ac X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com For MT slots, the ABS_MT_TRACKING_ID determines whether a slot is in use, but currently leaves initialization up to the drivers. This patch sets the slot state to unused upon creation. Suggested for Maverick. Signed-off-by: Henrik Rydberg Acked-by: Chase Douglas --- drivers/input/input.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 085ea38..be58b63 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -1750,8 +1750,9 @@ EXPORT_SYMBOL(input_free_device); * @dev: input device supporting MT events and finger tracking * @num_slots: number of slots used by the device * - * This function allocates all necessary memory for MT slot handling - * in the input device, and adds ABS_MT_SLOT to the device capabilities. + * This function allocates all necessary memory for MT slot handling in the + * input device, and adds ABS_MT_SLOT to the device capabilities. All slots + * are initially unused with ABS_MT_TRACKING_ID == -1. */ int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) { @@ -1764,6 +1765,8 @@ int input_mt_create_slots(struct input_dev *dev, unsigned int num_slots) dev->mtsize = num_slots; input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0); + while (num_slots--) + dev->mt[num_slots].abs[ABS_MT_TRACKING_ID - ABS_MT_FIRST] = -1; return 0; }