From patchwork Thu Jun 27 12:49:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Dyer X-Patchwork-Id: 2792711 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 504E4C0AB1 for ; Thu, 27 Jun 2013 12:53:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 26575202ED for ; Thu, 27 Jun 2013 12:53:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E605202EE for ; Thu, 27 Jun 2013 12:53:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753716Ab3F0Mw6 (ORCPT ); Thu, 27 Jun 2013 08:52:58 -0400 Received: from kdh-gw.itdev.co.uk ([89.21.227.133]:12379 "EHLO hermes.kdh.itdev.co.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753707Ab3F0Muy (ORCPT ); Thu, 27 Jun 2013 08:50:54 -0400 Received: from localhost.localdomain (andromeda.kdh.itdev.co.uk [192.168.1.19]) by hermes.kdh.itdev.co.uk (Postfix) with ESMTP id 2C41A85AF1; Thu, 27 Jun 2013 13:50:53 +0100 (BST) From: Nick Dyer To: Dmitry Torokhov Cc: Daniel Kurtz , Henrik Rydberg , Joonyoung Shim , Alan Bowens , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Meerwald , Benson Leung , Olof Johansson , Nick Dyer Subject: [PATCH 46/51] Input: atmel_mxt_ts - Initialize power config before and after downloading cfg Date: Thu, 27 Jun 2013 13:49:21 +0100 Message-Id: <1372337366-9286-47-git-send-email-nick.dyer@itdev.co.uk> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1372337366-9286-1-git-send-email-nick.dyer@itdev.co.uk> References: <1372337366-9286-1-git-send-email-nick.dyer@itdev.co.uk> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If the power configuration is zero then the configuration download may fail to work properly, so initialize T7 before config download. The downloaded configuration may reset the T7 power configuration so it must be re-initialized afterwards. Signed-off-by: Nick Dyer Acked-by: Benson Leung --- drivers/input/touchscreen/atmel_mxt_ts.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index b4ecd1d..5ab3861 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -1226,6 +1226,8 @@ static int mxt_check_retrigen(struct mxt_data *data) return 0; } +static int mxt_init_t7_power_cfg(struct mxt_data *data); + /* * mxt_check_reg_init - download configuration to chip * @@ -1485,6 +1487,9 @@ static int mxt_check_reg_init(struct mxt_data *data) dev_info(dev, "Config written\n"); + /* T7 config may have changed */ + mxt_init_t7_power_cfg(data); + release_mem: kfree(config_mem); release: @@ -1883,17 +1888,17 @@ retry_bootloader: if (error) goto err_free_object_table; - /* Check register init values */ - error = mxt_check_reg_init(data); + error = mxt_init_t7_power_cfg(data); if (error) { - dev_err(&client->dev, "Error %d initialising configuration\n", - error); + dev_err(&client->dev, "Failed to initialize power cfg\n"); goto err_free_object_table; } - error = mxt_init_t7_power_cfg(data); + /* Check register init values */ + error = mxt_check_reg_init(data); if (error) { - dev_err(&client->dev, "Failed to initialize power cfg\n"); + dev_err(&client->dev, "Error %d initialising configuration\n", + error); goto err_free_object_table; }