From patchwork Fri Mar 10 23:01:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 9618083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2357F604D9 for ; Fri, 10 Mar 2017 23:02:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 163222870D for ; Fri, 10 Mar 2017 23:02:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 097D3287B7; Fri, 10 Mar 2017 23:02:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AFB22870D for ; Fri, 10 Mar 2017 23:02:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755363AbdCJXCY (ORCPT ); Fri, 10 Mar 2017 18:02:24 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:33961 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933434AbdCJXCR (ORCPT ); Fri, 10 Mar 2017 18:02:17 -0500 Received: by mail-pg0-f66.google.com with SMTP id b5so11697225pgg.1; Fri, 10 Mar 2017 15:01:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NSQJF9PQrIaiGvWueOUHl7ne5K4ZscDR0pvCb6/8nko=; b=nYPayRZWdvwElZlMIhjD3KSGorD/Sl/5i967HCRI96JS/+yTAke7e59cHSC64MnNYq OLBbXe5NM8NOZb9fltXo+CqIxLXnxex+d1DAtvD1jkXswMcksUlx87GrHyA/T4siUM6C FDhU1jevint9OFTlPhD+jROwpCC/EmayvIBdgka53NdWxqpAvgmzxPWDIhxfm6ddqtJQ bfswPt+mJqY5dwLA6R1B3EBTcRzs1kAGLo4WoJt6ZwUpk12KcIdQJvEhzMs6MvgUnsHb /Y2uJoiNkBz4lb6eZB6qm1oS9NgCMM8H/fItt0b4nakGtqYkaW+qbc6O9QfqjdiA9iY7 aWxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NSQJF9PQrIaiGvWueOUHl7ne5K4ZscDR0pvCb6/8nko=; b=XP7ns8z+AK3MZKBBMeNnIswqtS6peExH4y58a5cV2zircDUPlqaneMmCBHzWXjbBOp 8WyE51zF4za0kPHk8VsvCwcxWiErA1ZwqEMa/PSAAcKcKLy85u44Molm1p6PPE4ZaoUw 0bI+4TSXWnzJahb04Z8OJO9F3Hg0ZcCgpIHm8cSBBOGAz10kaMbtnpeCvSPCdjd3Z0gw QILj+zJ2jZFjVaGH17eO21yOrSOJcEm7zhcuSbnDZp8wB+D584SdcPLaDWiL1WFRz9DZ M2/rf7KuU7g68T2865WWNURdnu/B6lX/mzXcabb0mRsjj9zK59bnpJ/EQGAvi2OgTEzd d01A== X-Gm-Message-State: AMke39nMVEwv5Wt2WMOFMly9pRbxd2YOi8h4LzoMTiQD4j7VAylnno/g1cGMnsJwkDPszQ== X-Received: by 10.99.36.71 with SMTP id k68mr23446714pgk.68.1489186885263; Fri, 10 Mar 2017 15:01:25 -0800 (PST) Received: from dtor-ws.mtv.corp.google.com ([172.22.152.34]) by smtp.gmail.com with ESMTPSA id z7sm20457800pfz.128.2017.03.10.15.01.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Mar 2017 15:01:24 -0800 (PST) From: Dmitry Torokhov To: Benjamin Tissoires Cc: Andrew Duggan , linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: [PATCH v2 9/9] [NEEDS F21] Input: synaptics - switch forcepad devices over to SMbus access Date: Fri, 10 Mar 2017 15:01:14 -0800 Message-Id: <20170310230114.788-10-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.12.0.246.ga2ecc84866-goog In-Reply-To: <20170310230114.788-1-dmitry.torokhov@gmail.com> References: <20170310230114.788-1-dmitry.torokhov@gmail.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Synaptics "forcedpad" devices use address 0x20 instead of 0x2c. Unfortunately the fact that the device is a forcepad is not exported through PS/2 interface, so we need a bit of DMI magic to switch over to the correct address. Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/synaptics.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 26794f06ad9c..1b9ae3a7f915 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -171,6 +171,13 @@ static const char * const smbus_pnp_ids[] = { NULL }; +/* This list has been kindly provided by Synaptics. */ +static const char * const forcepad_pnp_ids[] = { + "SYN300D", + "SYN3014", + NULL +}; + /* * Send a command to the synpatics touchpad by special commands */ @@ -493,13 +500,6 @@ static const struct min_max_quirk min_max_pnpid_table[] = { { } }; -/* This list has been kindly provided by Synaptics. */ -static const char * const forcepad_pnp_ids[] = { - "SYN300D", - "SYN3014", - NULL -}; - /***************************************************************************** * Synaptics communications functions ****************************************************************************/ @@ -1721,11 +1721,14 @@ static int synaptics_create_intertouch(struct psmouse *psmouse, !!SYN_CAP_EXT_BUTTONS_STICK(info->ext_cap_10), }, }; - const struct i2c_board_info intertouch_board = { + struct i2c_board_info intertouch_board = { I2C_BOARD_INFO("rmi4_smbus", 0x2c), .flags = I2C_CLIENT_HOST_NOTIFY, }; + if (psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids)) + intertouch_board.addr = 0x20; + return psmouse_smbus_init(psmouse, &intertouch_board, &pdata, sizeof(pdata), leave_breadcrumbs); @@ -1746,8 +1749,10 @@ static int synaptics_setup_intertouch(struct psmouse *psmouse, if (synaptics_intertouch == SYNAPTICS_INTERTOUCH_NOT_SET) { if (!psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) && - !psmouse_matches_pnp_id(psmouse, smbus_pnp_ids)) + !psmouse_matches_pnp_id(psmouse, smbus_pnp_ids) && + !psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids)) { return -ENXIO; + } } psmouse_info(psmouse, "Trying to set up SMBus access\n");