From patchwork Tue Nov 9 02:15:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jooaun X-Patchwork-Id: 310012 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 oA92G8VI031966 for ; Tue, 9 Nov 2010 02:16:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752222Ab0KICQJ (ORCPT ); Mon, 8 Nov 2010 21:16:09 -0500 Received: from mail-gw0-f46.google.com ([74.125.83.46]:43507 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753369Ab0KICQI (ORCPT ); Mon, 8 Nov 2010 21:16:08 -0500 Received: by gwj21 with SMTP id 21so3921893gwj.19 for ; Mon, 08 Nov 2010 18:16:07 -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=Gc95vXkEpYA1NZRorp2LdHysL8ihfDmzkaP5MAKf9ns=; b=e1S90VK15iX24YqAMauKSqajdWU7avfcJTIZ+I8ur5jPBdom2F2CzkaypKK1u1CiTp mmNfmtcwNSN1K3dCj5KuL39b8MMKvs7g7QrFrTlK7DwkcVX26BeL6d2P/L/wYHqycqgu JY+/DDiTqZ6laVY2zc4gmTBcHnXS+J1xPb1uI= 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=g/X0n1a27geh2qGC056PUjWHb/wp2hAm1UOXJb1cCY9ku7Az+2XtvZwwY/5LfwYv6e uZAkVwkDh78dgHVbY7t/qfxORSKdd5cYcncUOpjs1fVSzoXTW1lzjzpw2NKs6VJ81hE7 /A/l9ksLwr0/7uCIdq2tHCNVTAtpFGUvDhiy4= Received: by 10.151.10.11 with SMTP id n11mr9761271ybi.78.1289268966246; Mon, 08 Nov 2010 18:16:06 -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.16.03 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Nov 2010 18:16:05 -0800 (PST) From: jooaun To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, raphaelpereira@gmail.com, jooaun Subject: [PATCH 8/8] qt2160: add hardware reset Date: Tue, 9 Nov 2010 13:15:11 +1100 Message-Id: <1289268911-32322-8-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:10 +0000 (UTC) diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c index d2ce573..d4a8033 100755 --- a/drivers/input/keyboard/qt2160.c +++ b/drivers/input/keyboard/qt2160.c @@ -284,7 +284,13 @@ static int __devinit qt2160_configure_device(struct i2c_client *client, int error = 0; /* perform software reset and wait for at least 32ms */ - i2c_smbus_write_byte_data(client, QT2160_CMD_RESET, 0xFF); + if (pdata->setrst) { + pdata->setrst(pdata->data, 0); + udelay(10); + pdata->setrst(pdata->data, 1); + } else { + i2c_smbus_write_byte_data(client, QT2160_CMD_RESET, 0xFF); + } msleep(200); /* perform dummy write to reset I2C state */ diff --git a/include/linux/input/qt2160.h b/include/linux/input/qt2160.h index dad11bb..1b4b58d 100755 --- a/include/linux/input/qt2160.h +++ b/include/linux/input/qt2160.h @@ -10,6 +10,7 @@ * @data: private data for lowlevel IO abstraction routines * @getchange: return 0 when CHANGE pin is active/low; return 1 when CHANGE pin * is deactivated/high + * @setrst: 0 activates RESET pin; 1 deactivates RESET pin * @slider_length: number of keys to use as slider, max 8 keys, min 2 keys * @slider_axis: absolute axis type, value 0 is ABS_X * @keycodes: key codes for keys that are part of the slider are ignored; slider @@ -26,6 +27,7 @@ struct qt2160_info { void *data; int (*getchange) (void *data); + void (*setrst) (void *data, int state); unsigned char slider_length; unsigned int slider_axis; unsigned short keycodes[QT2160_MAXKEYS];