Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762193AbXFAQpo (ORCPT ); Fri, 1 Jun 2007 12:45:44 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760788AbXFAQpf (ORCPT ); Fri, 1 Jun 2007 12:45:35 -0400 Received: from wa-out-1112.google.com ([209.85.146.180]:31799 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760732AbXFAQpd (ORCPT ); Fri, 1 Jun 2007 12:45:33 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=BcaOnmgIWCELfyq3qnANX92drIYhQ+OLyUVr+mhayY4pRZUgNiexvx+LrR7BqZLhYIWMi+PMFZGQG8MPbleqyifyT7LnYgranhALQJruKkvAeizkFcBsNI2Ux+ARRuKw5le6bQtn4ld1vV9YtSIt9HNz73fA2aQ4dZJ6+FviOHI= Message-ID: Date: Fri, 1 Jun 2007 12:45:31 -0400 From: "Dmitry Torokhov" To: "Richard Hughes" Subject: Re: Add INPUT support to toshiba_acpi Cc: "Bastien Nocera" , "John Belmonte" , linux-kernel , linux-acpi In-Reply-To: <1180626416.3469.7.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_8055_27478124.1180716331887" References: <1180614979.2693.26.camel@localhost.localdomain> <1180615994.3030.166.camel@cookie.hadess.net> <1180619002.2693.35.camel@localhost.localdomain> <1180626416.3469.7.camel@localhost.localdomain> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 21412 Lines: 307 ------=_Part_8055_27478124.1180716331887 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Richard, On 5/31/07, Richard Hughes wrote: > On Thu, 2007-05-31 at 14:44 +0100, Richard Hughes wrote: > > Nope, impossible AFAICS. The hardware is just broken. Windows XP has an > > toshiba supplied daemon that polls, so I think we have to just bite the > > bullet. > > ... adding in reply in different thread... > > On Thu, 2007-05-31 at 10:37 -0400, Dmitry Torokhov wrote: > > Please use input-polldev to set up polled devices. It > > will create work queue for you and will make sure that polling is > > stopped when device is closed. > > Okay, I had never heard of this. I've done the suggested changes in the > attached patch. Please can you have a look and make sure I'm being sane. > The patch was pretty good, I did not quite like the driver registration code so I tried to clean it up. What do you think about the attached patch (not tested due to the lack of hardware). If you are OK with it please add your signed-off-by because version of the patch I grabbed did not have it. > > Also I don't think you want to use > > KEY_BREAK. What is the expected function of that key? > > It's a "lock" key, I really want KEY_LOCK added to input.h, but that > might prove difficult. For now I've used KEY_CLEAR, yell if you think > there's a better one to substitute or if you guys want me to add get a > constant added to input.h. Iam still struggling with the purpose of the key. What would you extect to happen when youser presses this key? Screen gets locked? KEY_SCREENLOCK? KEY_SCREENSAVER? -- Dmitry ------=_Part_8055_27478124.1180716331887 Content-Type: text/plain; name=toshiba_acpi_add_buttons.patch; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: base64 X-Attachment-Id: f_f2evzdud Content-Disposition: attachment; filename="toshiba_acpi_add_buttons.patch" RnJvbTogUmljaGFyZCBIdWdoZXMgPGh1Z2hzaWVudEBnbWFpbC5jb20+ClN1YmplY3Q6IHRvc2hp YmFfYWNwaTogaW50ZWdyYXRlIHdpdGggSU5QVVQgbGF5ZXIKClRvc2hpYmEgaGFyZHdhcmUgaXMg YSBsaXR0bGUgb2RkYmFsbCwgYW5kIGRvZXMgbm90IHByb3ZpZGUgQUNQSSBldmVudHMKb24gc29t ZSBrZXkgcHJlc3NlcywgdHlwaWNhbGx5IEZuIGhvdGtleSBidXR0b25zLiBUaGUga2V5IGludGVy ZmFjZSBpcwpub3cgcG9sbGVkLCBhbmQgZXZlbnRzIG5vdyBtYXRjaGVkIHRvIGEgbGlzdCBvZiB0 b3NoaWJhIHNwZWNpZmljCnNjYW5jb2RlcywgYW5kIGFyZ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d2hlbiBob3RrZXlzIGFyZSBkZWxpdmVyZWQgdmlhIGlu cHV0CisJCQlsYXllci4gRGVmYXVsdCBpcyA1MDAgbXNlY3MuCisKIAl0cDcyMD0JCVtIVyxQUzJd CiAKIAl0cml4PQkJW0hXLE9TU10gTWVkaWFUcml4IEF1ZGlvVHJpeCBQcm8K ------=_Part_8055_27478124.1180716331887-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/