From patchwork Wed Dec 30 04:12:27 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 70189 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 nBU4CYoI028376 for ; Wed, 30 Dec 2009 04:12:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751159AbZL3EMd (ORCPT ); Tue, 29 Dec 2009 23:12:33 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751515AbZL3EMd (ORCPT ); Tue, 29 Dec 2009 23:12:33 -0500 Received: from mail-pz0-f171.google.com ([209.85.222.171]:46111 "EHLO mail-pz0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbZL3EMd (ORCPT ); Tue, 29 Dec 2009 23:12:33 -0500 Received: by pzk1 with SMTP id 1so3847330pzk.33 for ; Tue, 29 Dec 2009 20:12:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=sgJajBK7XX+xw5HBiQGF3oWdN5irp5mv292WsKNZ/2M=; b=qaAt4ukk0dvRe1wIhRmxMVl7DScMshXqbkraW9hy/+bB21jqhG2YsV3v3gcq68uApp i4e9aGXZE29b1O6QyatPVEk6Q5bwYAkmJs+AE3+h6xa+IS8NsHD7bu8v4LBto2LmZ0Aa hFZKqKW5iJ0tIi+KXFZyuSz9685K2HaXmHjnw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=HiwYo/nLDEz+oSXcb3iDdcwIFsriKrC1Ezin/RRauwTQGOAjSrOtn5lN27Z6Xp4vFQ lAk2fmvc1G/UgmjWSTyBCcapCon0Cw5Db4sU9bmGY2zl+5W0NRPcGOWrgjA9mnViLjJt n8Ve6wwB+Rc+SDFm7TK1BFGR016C6NtsFze9c= Received: by 10.114.18.17 with SMTP id 17mr1082231war.131.1262146352372; Tue, 29 Dec 2009 20:12:32 -0800 (PST) Received: from mailhub.coreip.homeip.net (c-24-6-153-137.hsd1.ca.comcast.net [24.6.153.137]) by mx.google.com with ESMTPS id 23sm13205993pzk.12.2009.12.29.20.12.29 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Dec 2009 20:12:30 -0800 (PST) Date: Tue, 29 Dec 2009 20:12:27 -0800 From: Dmitry Torokhov To: Henrique de Moraes Holschuh Cc: Len Brown , Mattia Dongili , linux-acpi@vger.kernel.org Subject: Re: [PATCH 2/3] sony-laptop - simplify keymap initialization Message-ID: <20091230041227.GB2186@core.coreip.homeip.net> References: <20091224080135.11511.18604.stgit@localhost.localdomain> <20091224080222.11511.79737.stgit@localhost.localdomain> <20091224210146.GA2346@khazad-dum.debian.net> <20091225070138.GB19401@core.coreip.homeip.net> <20091225133812.GB5891@khazad-dum.debian.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20091225133812.GB5891@khazad-dum.debian.net> User-Agent: Mutt/1.5.20 (2009-08-17) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org diff --git a/drivers/input/input.c b/drivers/input/input.c index ab06071..910d7be 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -613,12 +613,12 @@ static int input_default_setkeycode(struct input_dev *dev, } } - clear_bit(old_keycode, dev->keybit); - set_bit(keycode, dev->keybit); + __clear_bit(old_keycode, dev->keybit); + __set_bit(keycode, dev->keybit); for (i = 0; i < dev->keycodemax; i++) { if (input_fetch_keycode(dev, i) == old_keycode) { - set_bit(old_keycode, dev->keybit); + __set_bit(old_keycode, dev->keybit); break; /* Setting the bit twice is useless, so break */ } } @@ -676,6 +676,9 @@ int input_set_keycode(struct input_dev *dev, int scancode, int keycode) if (retval) goto out; + /* Make sure KEY_RESERVED did not get enabled. */ + __clear_bit(KEY_RESERVED, dev->keybit); + /* * Simulate keyup event if keycode is not present * in the keymap anymore @@ -1513,13 +1516,16 @@ int input_register_device(struct input_dev *dev) const char *path; int error; + /* Every input device generates EV_SYN/SYN_REPORT events. */ __set_bit(EV_SYN, dev->evbit); + /* KEY_RESERVED is not supposed to be transmitted to userspace. */ + __clear_bit(KEY_RESERVED, dev->keybit); + /* * If delay and period are pre-set by the driver, then autorepeating * is handled by the driver itself and we don't do it in input.c. */ - init_timer(&dev->timer); if (!dev->rep[REP_DELAY] && !dev->rep[REP_PERIOD]) { dev->timer.data = (long) dev;