From patchwork Tue Nov 9 02:47:37 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jooaun X-Patchwork-Id: 310072 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 oA92luTU003597 for ; Tue, 9 Nov 2010 02:47:56 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754982Ab0KICrz (ORCPT ); Mon, 8 Nov 2010 21:47:55 -0500 Received: from mail-gw0-f46.google.com ([74.125.83.46]:38531 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754970Ab0KICrz (ORCPT ); Mon, 8 Nov 2010 21:47:55 -0500 Received: by gwj21 with SMTP id 21so3934010gwj.19 for ; Mon, 08 Nov 2010 18:47:54 -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=GEyPRWqyiVo/aTHZhOlTcx9ZOwakxnbVQ8l9BNiC3qw=; b=pq7B1HmmBAd7KfqUylKmUTzjl1qgr1Bu0/2btzKvxT2EZPQrWp6RoWvKL7aNs6G6Qj GHmP3raRlXkGgRhasROxgYofHYc0pc0PAo21QWdnPIEaxuf8Kqk+/Pp4Us8OR8mU5pPL A+CmHH+/Ugb2XX5GwuElr11lIWnG8UIDVe6hY= 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=aicqLDBpjMDurtO8/Bu2F7Rriv8Ohsw53kjP/0/EuVlrm78eBu2kaPcSmPw/FyvJuN DJRHd0InIJkyrYLG/ecWNxcIjd+dkMx9GIi5PK/TpKeheh1GKhKXJmMpSChDMw++m01z pv2eCFJf65WLgVFS1bWbJ7wO/qLKkel1GHBWQ= Received: by 10.151.157.19 with SMTP id j19mr9057667ybo.256.1289270874585; Mon, 08 Nov 2010 18:47:54 -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 h68sm476236yha.15.2010.11.08.18.47.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 08 Nov 2010 18:47:54 -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:47:37 +1100 Message-Id: <1289270857-4372-1-git-send-email-jasaw81@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1289268911-32322-8-git-send-email-jasaw81@gmail.com> References: <1289268911-32322-8-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:47:56 +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];