From patchwork Tue Nov 9 02:15:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jooaun X-Patchwork-Id: 309942 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 oA92G8VB031966 for ; Tue, 9 Nov 2010 02:16:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753772Ab0KICPu (ORCPT ); Mon, 8 Nov 2010 21:15:50 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:49374 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752222Ab0KICPs (ORCPT ); Mon, 8 Nov 2010 21:15:48 -0500 Received: by gyh4 with SMTP id 4so3965040gyh.19 for ; Mon, 08 Nov 2010 18:15:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=BYYEBBdMhdgFlEB3RAeUbUZdZn1Hj4OcITXgH2hlzhw=; b=FpwybVYeVEEWn7Nr+S66lytk/MDu04JgzgbmbzJ8WrAX7BvIOzq5yUJRLg/v8d8G/Q utqO7FTUfamrSHUoq/9ETAMcpTSHJrNXbFcruFnVVTDAAv75bcTkY6SrL2tgOsg/MMxa 9ngkG2YoRhzqjKRaKpOZWpuBFGNE0d32JhiSU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=L0Y2ReN9T7bXWHjZOa2cm4PLV/N8b2OU99rHp08Eu05/d3YoQU19+AHk26umWm7RpZ yGXPUQ1zl/YmXwlcgI3O9rEElWwveqOJW0ui6t+u0LDLGvs9Rny28xzFQ7LT4Hil5/pv 3no9vrxDZaLSw+i9EaWwZzn4KS/rY6FIRiHWU= Received: by 10.150.206.1 with SMTP id d1mr9739361ybg.113.1289268948144; Mon, 08 Nov 2010 18:15:48 -0800 (PST) Received: from localhost.localdomain (203-206-227-95.perm.iinet.net.au [203.206.227.95]) by mx.google.com with ESMTPS id j27sm449455yha.30.2010.11.08.18.15.45 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Nov 2010 18:15:47 -0800 (PST) From: jooaun To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, raphaelpereira@gmail.com, jooaun Subject: [PATCH 2/8] qt2160: configurable key sensitivity Date: Tue, 9 Nov 2010 13:15:05 +1100 Message-Id: <1289268911-32322-2-git-send-email-jasaw81@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1289268911-32322-1-git-send-email-jasaw81@gmail.com> References: <1289268911-32322-1-git-send-email-jasaw81@gmail.com> 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]); Tue, 09 Nov 2010 02:16:08 +0000 (UTC) diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c index 7ec256c..dcd05cd 100755 --- a/drivers/input/keyboard/qt2160.c +++ b/drivers/input/keyboard/qt2160.c @@ -43,9 +43,26 @@ #define QT2160_CMD_SUBVER 7 #define QT2160_CMD_CALIBRATE 10 #define QT2160_CMD_RESET 11 +#define QT2160_CMD_BURST_REP 13 +#define QT2160_CMD_NEG_DRIFT 15 +#define QT2160_CMD_POS_DRIFT 16 +#define QT2160_CMD_DI_LIMIT 17 +#define QT2160_CMD_NEG_RECAL 18 +#define QT2160_CMD_DHTA 19 #define QT2160_CMD_SLIDE_CTRL 20 #define QT2160_CMD_SLIDE_OPT 21 #define QT2160_CMD_KEY0_AKS 22 +#define QT2160_CMD_KEY0_NEGT 38 +#define QT2160_CMD_KEY0_BURST 54 +#define QT2160_CMD_GPIO_DRV1 70 +#define QT2160_CMD_GPIO_DRV2 71 +#define QT2160_CMD_GPIO_DIR 73 +#define QT2160_CMD_GPIO_PWM1 74 +#define QT2160_CMD_GPIO_PWM2 75 +#define QT2160_CMD_PWM_LEVEL 76 +#define QT2160_CMD_GPIO_WAKE 77 +#define QT2160_CMD_CC_KEYS1 78 +#define QT2160_CMD_CC_KEYS2 79 #define QT2160_CYCLE_INTERVAL (2*HZ) @@ -297,6 +314,27 @@ static int __devinit qt2160_configure_device(struct i2c_client *client, } for (i = 0; i < QT2160_MAXKEYS; i++) { + /* setup burst length and disable unused keys */ + if (i < pdata->slider_length) { + if (pdata->key_burst_length[i]) + error |= i2c_smbus_write_byte_data( + client, + QT2160_CMD_KEY0_BURST + i, + pdata->key_burst_length[i]); + } else { + if (pdata->keycodes[i]) { + if (pdata->key_burst_length[i]) + error |= i2c_smbus_write_byte_data( + client, + QT2160_CMD_KEY0_BURST + i, + pdata->key_burst_length[i]); + } else { + error |= i2c_smbus_write_byte_data( + client, + QT2160_CMD_KEY0_BURST + i, + 0); + } + } /* set AKS */ error |= i2c_smbus_write_byte_data(client, QT2160_CMD_KEY0_AKS + i, diff --git a/include/linux/input/qt2160.h b/include/linux/input/qt2160.h index 9d1252e..748c86e 100755 --- a/include/linux/input/qt2160.h +++ b/include/linux/input/qt2160.h @@ -15,12 +15,14 @@ * @key_aks: adjacent key suppression; keys that form a slider must be in the * same aks group; keys in the same aks group will only report 1 active key at * any time; value 0 disables aks group; valid aks groups are 1, 2, 3 + * @key_burst_length: key sensitivity; 0 use default */ struct qt2160_info { unsigned char slider_length; unsigned int slider_axis; unsigned short keycodes[QT2160_MAXKEYS]; unsigned char key_aks[QT2160_MAXKEYS]; + unsigned char key_burst_length[QT2160_MAXKEYS]; }; #endif /* __QT2160_H__ */