From patchwork Mon Oct 10 16:42:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Tissoires X-Patchwork-Id: 9369733 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 83F606048F for ; Mon, 10 Oct 2016 16:43:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7522E296A3 for ; Mon, 10 Oct 2016 16:43:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69B302972E; Mon, 10 Oct 2016 16:43:36 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 1F9CD296A3 for ; Mon, 10 Oct 2016 16:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752940AbcJJQnR (ORCPT ); Mon, 10 Oct 2016 12:43:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42414 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753329AbcJJQnA (ORCPT ); Mon, 10 Oct 2016 12:43:00 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C255E61E5B; Mon, 10 Oct 2016 16:42:59 +0000 (UTC) Received: from plouf.banquise.eu.com (ovpn-116-101.ams2.redhat.com [10.36.116.101]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u9AGgb2W021567; Mon, 10 Oct 2016 12:42:57 -0400 From: Benjamin Tissoires To: Wolfram Sang , Dmitry Torokhov Cc: Jean Delvare , Jonathan Corbet , KT Liao , linux-i2c@vger.kernel.org, linux-input@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 8/8] Input: elan_i2c - add Host Notify support Date: Mon, 10 Oct 2016 18:42:35 +0200 Message-Id: <1476117755-8113-9-git-send-email-benjamin.tissoires@redhat.com> In-Reply-To: <1476117755-8113-1-git-send-email-benjamin.tissoires@redhat.com> References: <1476117755-8113-1-git-send-email-benjamin.tissoires@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Mon, 10 Oct 2016 16:42:59 +0000 (UTC) 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 The Thinkpad series 13 uses Host Notify to report the interrupt. Add elan_smb_alert() to handle those interrupts and disable the irq handling on this case. Signed-off-by: Benjamin Tissoires --- new in v4 (was submitted on linux-input with the .alert callback) --- drivers/input/mouse/elan_i2c_core.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 6f16eb4..4aaac5d 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c @@ -1040,6 +1040,21 @@ static int elan_probe(struct i2c_client *client, I2C_FUNC_SMBUS_BLOCK_DATA | I2C_FUNC_SMBUS_I2C_BLOCK)) { transport_ops = &elan_smbus_ops; + + if (!irq) { + if (!i2c_check_functionality(client->adapter, + I2C_FUNC_SMBUS_HOST_NOTIFY)) { + dev_err(dev, "no Host Notify support\n"); + return -ENODEV; + } + + irq = i2c_smbus_host_notify_to_irq(client); + if (irq < 0) { + dev_err(dev, + "Unable to request a Host Notify IRQ.\n"); + return irq; + } + } } else { dev_err(dev, "not a supported I2C/SMBus adapter\n"); return -EIO;