From patchwork Tue Nov 9 02:43:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jooaun X-Patchwork-Id: 310042 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 oA92i4Ft002884 for ; Tue, 9 Nov 2010 02:44:05 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754424Ab0KICoD (ORCPT ); Mon, 8 Nov 2010 21:44:03 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:33342 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754415Ab0KICoB (ORCPT ); Mon, 8 Nov 2010 21:44:01 -0500 Received: by gyh4 with SMTP id 4so3975908gyh.19 for ; Mon, 08 Nov 2010 18:44:01 -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=tuNkUqK7vHTlLHsZd52/1/FsaGxfgnxHYE7M3X+QmtU=; b=iN08SjAuen1Xs8hvbKxIjnIpV836taYgn342aJLYa3gd2IHMuoFi7w2C5tVh53yDpR +yqkCPF58D8MRulwnyH7hlaoUqcJP140q+noTmqgxAt+WPtd+UNi+my3oYRusW9DtC3i 94SjafYT1S12Lj+mUHZ2qIaX4PCU+gykbJBMs= 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=pTOZY8eTwnmmeLd5FEcjQPggG9QCdzaoFm1H+gP6rrhHDL8ln2khEZpYoWb7eG4xWH YAa8BIa7cb0KiA4h5w4DqMsexwAptNo5foRMBG9Nom4W+5cKvwlNY/JqhlC71yvkDXPU mwSowJgrojsh2VL8vwHDgKeU5JFWpfxcTFyH4= Received: by 10.150.145.7 with SMTP id s7mr5420616ybd.251.1289270641204; Mon, 08 Nov 2010 18:44:01 -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 g9sm473548yha.6.2010.11.08.18.43.58 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Nov 2010 18:44:00 -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:43:24 +1100 Message-Id: <1289270604-4259-1-git-send-email-jasaw81@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1289268911-32322-2-git-send-email-jasaw81@gmail.com> References: <1289268911-32322-2-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:44:05 +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__ */