From patchwork Mon Dec 3 08:27:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Song, Hongyan" X-Patchwork-Id: 10708743 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E171414BD for ; Mon, 3 Dec 2018 08:16:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CD2AE2ABB9 for ; Mon, 3 Dec 2018 08:16:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C132F2ADC2; Mon, 3 Dec 2018 08:16:48 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 678912ABB9 for ; Mon, 3 Dec 2018 08:16:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725842AbeLCIQt (ORCPT ); Mon, 3 Dec 2018 03:16:49 -0500 Received: from mga12.intel.com ([192.55.52.136]:59214 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725837AbeLCIQt (ORCPT ); Mon, 3 Dec 2018 03:16:49 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2018 00:16:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,309,1539673200"; d="scan'208";a="104354231" Received: from shsensorbuild2.sh.intel.com ([10.239.133.143]) by fmsmga007.fm.intel.com with ESMTP; 03 Dec 2018 00:16:46 -0800 From: hongyan.song@intel.com To: linux-input@vger.kernel.org Cc: jikos@kernel.org, jic23@kernel.org, hong.liu@intel.com, hongyan.song@intel.com Subject: [PATCH] hid:intel-ish-hid: add MSI interrupt support Date: Mon, 3 Dec 2018 16:27:22 +0800 Message-Id: <1543825642-31988-1-git-send-email-hongyan.song@intel.com> X-Mailer: git-send-email 2.7.4 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 From: Song Hongyan Add single MSI interrupt support to widely match interrupt types. Signed-off-by: Song Hongyan Reviewed-by: Hong Liu --- drivers/hid/intel-ish-hid/ipc/pci-ish.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/hid/intel-ish-hid/ipc/pci-ish.c b/drivers/hid/intel-ish-hid/ipc/pci-ish.c index 8793cc4..a6e1ee7 100644 --- a/drivers/hid/intel-ish-hid/ipc/pci-ish.c +++ b/drivers/hid/intel-ish-hid/ipc/pci-ish.c @@ -117,6 +117,7 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { int ret; struct ish_hw *hw; + unsigned long irq_flag = 0; struct ishtp_device *ishtp; struct device *dev = &pdev->dev; @@ -156,8 +157,12 @@ static int ish_probe(struct pci_dev *pdev, const struct pci_device_id *ent) pdev->dev_flags |= PCI_DEV_FLAGS_NO_D3; /* request and enable interrupt */ + ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES); + if (!pdev->msi_enabled && !pdev->msix_enabled) + irq_flag = IRQF_SHARED; + ret = devm_request_irq(dev, pdev->irq, ish_irq_handler, - IRQF_SHARED, KBUILD_MODNAME, ishtp); + irq_flag, KBUILD_MODNAME, ishtp); if (ret) { dev_err(dev, "ISH: request IRQ %d failed\n", pdev->irq); return ret;