From patchwork Thu Feb 7 14:17:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Meerwald-Stadler X-Patchwork-Id: 2111161 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id AAF6FDFB7B for ; Thu, 7 Feb 2013 14:18:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758236Ab3BGOSE (ORCPT ); Thu, 7 Feb 2013 09:18:04 -0500 Received: from ns.pmeerw.net ([87.118.82.44]:47054 "EHLO pmeerw.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758631Ab3BGOSB (ORCPT ); Thu, 7 Feb 2013 09:18:01 -0500 Received: from localhost.localdomain (unknown [195.70.114.118]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: pmeerw) by pmeerw.net (Postfix) with ESMTPSA id 5BD74C50284; Thu, 7 Feb 2013 15:18:00 +0100 (CET) From: Peter Meerwald To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, djkurtz@chromium.org, y0922.shim@samsung.com, Peter Meerwald Subject: [PATCH 5/7] input: atmel_mxt_ts: only apply mxt_platform_data blen and threshold on mxt224, not mxt224e Date: Thu, 7 Feb 2013 15:17:46 +0100 Message-Id: <1360246668-2291-6-git-send-email-pmeerw@pmeerw.net> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1360246668-2291-1-git-send-email-pmeerw@pmeerw.net> References: <1360246668-2291-1-git-send-email-pmeerw@pmeerw.net> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From: Peter Meerwald on the mxt224e, the upper 4 bits of blen are gain and the threshold should probably be set in CTECONFIG mxt_handle_pdata() is problematic as there is no way to NOT apply settings Signed-off-by: Peter Meerwald --- drivers/input/touchscreen/atmel_mxt_ts.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 7fdd439..313b201 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -673,14 +673,6 @@ static void mxt_handle_pdata(struct mxt_data *data) mxt_write_object(data, MXT_TOUCH_MULTI_T9, MXT_TOUCH_ORIENT, pdata->orient); - /* Set touchscreen burst length */ - mxt_write_object(data, MXT_TOUCH_MULTI_T9, - MXT_TOUCH_BLEN, pdata->blen); - - /* Set touchscreen threshold */ - mxt_write_object(data, MXT_TOUCH_MULTI_T9, - MXT_TOUCH_TCHTHR, pdata->threshold); - /* Set touchscreen resolution */ mxt_write_object(data, MXT_TOUCH_MULTI_T9, MXT_TOUCH_XRANGE_LSB, (pdata->x_size - 1) & 0xff); @@ -693,6 +685,14 @@ static void mxt_handle_pdata(struct mxt_data *data) /* Set touchscreen voltage */ if (pdata->voltage && data->info.family_id == MXT224_ID) { + /* Set touchscreen burst length */ + mxt_write_object(data, MXT_TOUCH_MULTI_T9, + MXT_TOUCH_BLEN, pdata->blen); + + /* Set touchscreen threshold */ + mxt_write_object(data, MXT_TOUCH_MULTI_T9, + MXT_TOUCH_TCHTHR, pdata->threshold); + if (pdata->voltage < MXT_VOLTAGE_DEFAULT) { voltage = (MXT_VOLTAGE_DEFAULT - pdata->voltage) / MXT_VOLTAGE_STEP;