From patchwork Thu Feb 7 14:17:44 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: 2111141 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 D01E9DFB7B for ; Thu, 7 Feb 2013 14:18:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757499Ab3BGOSD (ORCPT ); Thu, 7 Feb 2013 09:18:03 -0500 Received: from ns.pmeerw.net ([87.118.82.44]:47047 "EHLO pmeerw.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758426Ab3BGOSA (ORCPT ); Thu, 7 Feb 2013 09:18:00 -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 C32F0C50282; Thu, 7 Feb 2013 15:17:59 +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 3/7] input: atmel_mxt_ts: check mxt224 family before writing touchscreen voltage Date: Thu, 7 Feb 2013 15:17:44 +0100 Message-Id: <1360246668-2291-4-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 only the mxt224 has a SPT_CTECONFIG_T28 object, the mxt224e doesn't Signed-off-by: Peter Meerwald --- drivers/input/touchscreen/atmel_mxt_ts.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 63a82bb..17cc15a 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -41,6 +41,10 @@ #define MXT_OBJECT_NUM 0x06 #define MXT_OBJECT_START 0x07 +/* Family IDs */ +#define MXT224_ID 0x80 +#define MXT224E_ID 0x81 + #define MXT_OBJECT_SIZE 6 /* Object types */ @@ -687,7 +691,7 @@ static void mxt_handle_pdata(struct mxt_data *data) MXT_TOUCH_YRANGE_MSB, (pdata->y_size - 1) >> 8); /* Set touchscreen voltage */ - if (pdata->voltage) { + if (pdata->voltage && data->info.family_id == MXT224_ID) { if (pdata->voltage < MXT_VOLTAGE_DEFAULT) { voltage = (MXT_VOLTAGE_DEFAULT - pdata->voltage) / MXT_VOLTAGE_STEP;