From patchwork Fri Jun 24 05:38:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9196649 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 E7D1360754 for ; Fri, 24 Jun 2016 05:40:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D8C0C2845B for ; Fri, 24 Jun 2016 05:40:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD01128482; Fri, 24 Jun 2016 05:40:39 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 E0EF928488 for ; Fri, 24 Jun 2016 05:40:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751295AbcFXFka (ORCPT ); Fri, 24 Jun 2016 01:40:30 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:33709 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751143AbcFXFkT (ORCPT ); Fri, 24 Jun 2016 01:40:19 -0400 Received: by mail-wm0-f66.google.com with SMTP id r201so2202557wme.0 for ; Thu, 23 Jun 2016 22:40:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=k8Q+adhPISwD9f4c9bHpjhMLKardHjbPCX50R11CsW0=; b=bTHwRs+f0eXcpurZej5TsJpjEjN6EPyejQa1FaTeU/9r2l613MHxVgAHXJEMKinORr OZDLf5OZr1LFx7wRzsfYjjBUiWJWdU/etOt9NOATSl9cKXDnuIQSMEi+vEO1ZbO11pCa CU3klGxtCzEYgjgOopET4EQyaby++oDdskHaHDFetIcyUOd6s+ncO+oybaZV2SxBJ420 BqxPgYhjYBI3C/LwtraVYCqLvdQWj4rahzU5WO1rj8OTKUZzR7VV1fWGBTb/ZQljPzmV EFHHtpnZpYEL9WyQ0rFLHkWY/i3BMsyf2hzHsroS6RRMb3w+7KFZkxRqpn0DBBlSi30Z wh1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=k8Q+adhPISwD9f4c9bHpjhMLKardHjbPCX50R11CsW0=; b=FVu+WRz4T1kp0et5t+L9hH7O6XDn8GgbMAfmcdYX5iWUfbrjO6My0x5gnphWAcnj/G KejbEotDjaZbqqk50gLxzeO4WX3oL+uol9pOZ69LcGAbbpCGeK/vhgT4UDZbXLOpP9BZ N9j0vtiW6rdV4ovGdOlV3xr1kxeK2IHcXLfWpURmygoMa8us6heGGrcEbYt8RSInFi7e qMfDhEv/xMOqKCrU1H2PE48olCM9T/oK21pqE91voT3iBOd8thZzmiw12V5o3aFey6AC MkhVg4a1IwgYvMZtL6CbUhrUgz+5LcXI30xs4wra1RZ2HyZAlM6ZUf369wrB99UzJZ1I 1RfA== X-Gm-Message-State: ALyK8tL27CPWjwlb/X69TsYGtUSMmBGFaAxk0/nhu1E0CSe21RW0TgXmQwXR/hGspClE2w== X-Received: by 10.194.200.164 with SMTP id jt4mr1873841wjc.18.1466746817654; Thu, 23 Jun 2016 22:40:17 -0700 (PDT) Received: from ?IPv6:2003:62:5f01:4400:1482:e189:e8da:8d18? (p200300625F0144001482E189E8DA8D18.dip0.t-ipconnect.de. [2003:62:5f01:4400:1482:e189:e8da:8d18]) by smtp.googlemail.com with ESMTPSA id yr4sm3345454wjc.18.2016.06.23.22.40.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jun 2016 22:40:17 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 1/9] media: rc: nuvoton: remove interrupt handling for wakeup To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Message-ID: Date: Fri, 24 Jun 2016 07:38:54 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is a rudimentary ISR for handling interrupts generated by the wakeup part of the chip. Interrupts however have never been enabled in the wakeup part. Also, now that we can set the wakeup sequence via sysfs, there's in general no need to enable interrupts in the wakeup part. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 58 ++---------------------------------------- drivers/media/rc/nuvoton-cir.h | 1 - 2 files changed, 2 insertions(+), 57 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 4a8f79c..b32f3bf 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c @@ -480,10 +480,8 @@ static void nvt_cir_wake_ldev_init(struct nvt_dev *nvt) nvt_set_ioaddr(nvt, &nvt->cir_wake_addr); - nvt_cr_write(nvt, nvt->cir_wake_irq, CR_CIR_IRQ_RSRC); - - nvt_dbg("CIR Wake initialized, base io port address: 0x%lx, irq: %d", - nvt->cir_wake_addr, nvt->cir_wake_irq); + nvt_dbg("CIR Wake initialized, base io port address: 0x%lx", + nvt->cir_wake_addr); } /* clear out the hardware's cir rx fifo */ @@ -997,51 +995,6 @@ static irqreturn_t nvt_cir_isr(int irq, void *data) return IRQ_HANDLED; } -/* Interrupt service routine for CIR Wake */ -static irqreturn_t nvt_cir_wake_isr(int irq, void *data) -{ - u8 status, iren, val; - struct nvt_dev *nvt = data; - unsigned long flags; - - nvt_dbg_wake("%s firing", __func__); - - spin_lock_irqsave(&nvt->nvt_lock, flags); - - status = nvt_cir_wake_reg_read(nvt, CIR_WAKE_IRSTS); - iren = nvt_cir_wake_reg_read(nvt, CIR_WAKE_IREN); - - /* IRQ may be shared with CIR, therefore check for each - * status bit whether the related interrupt source is enabled - */ - if (!(status & iren)) { - spin_unlock_irqrestore(&nvt->nvt_lock, flags); - return IRQ_NONE; - } - - if (status & CIR_WAKE_IRSTS_IR_PENDING) - nvt_clear_cir_wake_fifo(nvt); - - nvt_cir_wake_reg_write(nvt, status, CIR_WAKE_IRSTS); - nvt_cir_wake_reg_write(nvt, 0, CIR_WAKE_IRSTS); - - if ((status & CIR_WAKE_IRSTS_PE) && - (nvt->wake_state == ST_WAKE_START)) { - while (nvt_cir_wake_reg_read(nvt, CIR_WAKE_RD_FIFO_ONLY_IDX)) { - val = nvt_cir_wake_reg_read(nvt, CIR_WAKE_RD_FIFO_ONLY); - nvt_dbg("setting wake up key: 0x%x", val); - } - - nvt_cir_wake_reg_write(nvt, 0, CIR_WAKE_IREN); - nvt->wake_state = ST_WAKE_FINISH; - } - - spin_unlock_irqrestore(&nvt->nvt_lock, flags); - - nvt_dbg_wake("%s done", __func__); - return IRQ_HANDLED; -} - static void nvt_disable_cir(struct nvt_dev *nvt) { unsigned long flags; @@ -1145,8 +1098,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) nvt->cir_irq = pnp_irq(pdev, 0); nvt->cir_wake_addr = pnp_port_start(pdev, 1); - /* irq is always shared between cir and cir wake */ - nvt->cir_wake_irq = nvt->cir_irq; nvt->cr_efir = CR_EFIR; nvt->cr_efdr = CR_EFDR; @@ -1223,11 +1174,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) CIR_IOREG_LENGTH, NVT_DRIVER_NAME "-wake")) goto exit_unregister_device; - if (devm_request_irq(&pdev->dev, nvt->cir_wake_irq, - nvt_cir_wake_isr, IRQF_SHARED, - NVT_DRIVER_NAME "-wake", (void *)nvt)) - goto exit_unregister_device; - ret = device_create_file(&rdev->dev, &dev_attr_wakeup_data); if (ret) goto exit_unregister_device; diff --git a/drivers/media/rc/nuvoton-cir.h b/drivers/media/rc/nuvoton-cir.h index c9c98eb..68431f0 100644 --- a/drivers/media/rc/nuvoton-cir.h +++ b/drivers/media/rc/nuvoton-cir.h @@ -104,7 +104,6 @@ struct nvt_dev { unsigned long cir_addr; unsigned long cir_wake_addr; int cir_irq; - int cir_wake_irq; enum nvt_chip_ver chip_ver; /* hardware id */