From patchwork Tue Nov 16 20:42:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Leech X-Patchwork-Id: 329241 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 oAGKg7fw029763 for ; Tue, 16 Nov 2010 20:42:08 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756872Ab0KPUmH (ORCPT ); Tue, 16 Nov 2010 15:42:07 -0500 Received: from mga02.intel.com ([134.134.136.20]:34775 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756675Ab0KPUmG (ORCPT ); Tue, 16 Nov 2010 15:42:06 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 16 Nov 2010 12:42:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.59,207,1288594800"; d="scan'208";a="678144351" Received: from cleech-lnx (HELO localhost6.localdomain6) ([10.7.197.231]) by orsmga001.jf.intel.com with ESMTP; 16 Nov 2010 12:42:06 -0800 Subject: [PATCH 4/5] qt602240_ts: add optional hooks for board specific reset logic To: linux-input@vger.kernel.org From: Chris Leech Cc: Joonyoung Shim Date: Tue, 16 Nov 2010 12:42:06 -0800 Message-ID: <20101116204206.28796.34520.stgit@localhost6.localdomain6> In-Reply-To: <20101116203914.28796.23141.stgit@localhost6.localdomain6> References: <20101116203914.28796.23141.stgit@localhost6.localdomain6> User-Agent: StGit/0.15 MIME-Version: 1.0 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, 16 Nov 2010 20:42:08 +0000 (UTC) diff --git a/drivers/input/touchscreen/qt602240_ts.c b/drivers/input/touchscreen/qt602240_ts.c index 11055ec..efe975e 100644 --- a/drivers/input/touchscreen/qt602240_ts.c +++ b/drivers/input/touchscreen/qt602240_ts.c @@ -1307,6 +1307,11 @@ static int __devinit qt602240_probe(struct i2c_client *client, i2c_set_clientdata(client, data); + if (data->pdata->hw_setup) { + error = data->pdata->hw_setup(client); + if (error) + goto err_free_object; + } error = qt602240_initialize(data); if (error) goto err_free_object; @@ -1376,6 +1381,8 @@ static int __devexit qt602240_remove(struct i2c_client *client) sysfs_remove_group(&client->dev.kobj, &qt602240_attr_group); free_irq(data->irq, data); input_unregister_device(data->input_dev); + if (data->pdata->hw_teardown) + data->pdata->hw_teardown(client); kfree(data->object_table); kfree(data); diff --git a/include/linux/i2c/qt602240_ts.h b/include/linux/i2c/qt602240_ts.h index d2aa1b6..764dd45 100644 --- a/include/linux/i2c/qt602240_ts.h +++ b/include/linux/i2c/qt602240_ts.h @@ -41,6 +41,10 @@ struct qt602240_platform_data { * platform_data). */ unsigned char trust_nvm; + + /* Board-specific HW hooks; NULL if not needed */ + int (*hw_setup) (struct i2c_client *client); + void (*hw_teardown) (struct i2c_client *client); }; #endif /* __LINUX_QT602240_TS_H */