From patchwork Fri Jun 24 05:39:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9196659 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 4C8A66088F for ; Fri, 24 Jun 2016 05:40:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3EA2828491 for ; Fri, 24 Jun 2016 05:40:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30A3B28497; Fri, 24 Jun 2016 05:40:56 +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 A50D628491 for ; Fri, 24 Jun 2016 05:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751298AbcFXFkg (ORCPT ); Fri, 24 Jun 2016 01:40:36 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33947 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbcFXFkZ (ORCPT ); Fri, 24 Jun 2016 01:40:25 -0400 Received: by mail-wm0-f65.google.com with SMTP id 187so2192884wmz.1 for ; Thu, 23 Jun 2016 22:40:24 -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=/c8KBZKCDR9Hr9MV0LAuVUwDum+rPfmK+kIS3rtEYIg=; b=ky9V5PVgdIrhfNQ0/TzV6wAasu3I/CQXgJQTVrp4P3LewAYBfusg7FkfvIoasZeyx1 z0EFNRnG402e2LCbY6CZLoIDUDWHxwWhXVpO1rn37fCQgOMrff5MSj4g2PY3m14fRVSK x5LGa41OWhje2166WyrM/BUsuaM+eHusBAMM2OudxMFeknud7HeKgfw8t67BQIBMkDSO KUbtMewJTqxLmnaJIQzrNwdKaz4gTIJSUlAVdSDnz48m+a74EViIyhkeFV5WuzZdt57S v+WQ8EsxMnoYGz3aGPLvSI4oU+97pfLOToPnw3RGoEd+zLMhDH72OxUc20abFVQgEiq/ z9RQ== 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=/c8KBZKCDR9Hr9MV0LAuVUwDum+rPfmK+kIS3rtEYIg=; b=HP8/wtWvhiguG1oMsEZuoT25TI2ZZX87p5z/y0uYuRM+33vINb42LKTcaNxf1q5UCO MCgDmyBaUR6mzJloHKT9VSeX59ZImwIt2uh55r4tf7Zp8t5v/K9lk8XGUpUKXAjmc61e NuLkLUuLU9NdSIDt++ELOyF/X2XdN2jeHBwLUPQeOuNe3UokMZ1/YnBIJtThnnhRK4BR ks6SxCY0hwyfVQ+y46uDO18fKTplkHVC9Xx3ZwSyF5kRTaC/GnAowJpbmz24dvOwfVLt eNyb3moNgX/pp5sUBVD2iXb3wYDsk4jKaiNuAr/SAlL77F8+T5SkS1HkyVS/thqctbu5 JfjQ== X-Gm-Message-State: ALyK8tJd8Z0z3Sl0+D0KqLEwb6njq3UC/VRBwX85IeOlwKsGWQe+z2i11VV4GhPhgkfI8A== X-Received: by 10.194.5.166 with SMTP id t6mr1846604wjt.58.1466746823660; Thu, 23 Jun 2016 22:40:23 -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 a198sm1312504wme.16.2016.06.23.22.40.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Jun 2016 22:40:23 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 6/9] media: rc: nuvoton: remove study states To: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org Message-ID: <8f71f415-d36e-b138-35f8-3b2a135194dd@gmail.com> Date: Fri, 24 Jun 2016 07:39:45 +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 Study states have never been used and are not needed. Remove them. Signed-off-by: Heiner Kallweit --- drivers/media/rc/nuvoton-cir.c | 11 +---------- drivers/media/rc/nuvoton-cir.h | 13 ------------- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 9d9717d..5ce0238 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c @@ -865,7 +865,7 @@ static bool nvt_cir_tx_inactive(struct nvt_dev *nvt) static irqreturn_t nvt_cir_isr(int irq, void *data) { struct nvt_dev *nvt = data; - u8 status, iren, cur_state; + u8 status, iren; unsigned long flags; nvt_dbg_verbose("%s firing", __func__); @@ -907,7 +907,6 @@ static irqreturn_t nvt_cir_isr(int irq, void *data) nvt_handle_rx_fifo_overrun(nvt); if (status & CIR_IRSTS_RTR) { - /* FIXME: add code for study/learn mode */ /* We only do rx if not tx'ing */ if (nvt_cir_tx_inactive(nvt)) nvt_get_rx_ir_data(nvt); @@ -916,11 +915,6 @@ static irqreturn_t nvt_cir_isr(int irq, void *data) if (status & CIR_IRSTS_PE) { if (nvt_cir_tx_inactive(nvt)) nvt_get_rx_ir_data(nvt); - - cur_state = nvt->study_state; - - if (cur_state == ST_STUDY_NONE) - nvt_clear_cir_fifo(nvt); } spin_unlock_irqrestore(&nvt->nvt_lock, flags); @@ -1193,9 +1187,6 @@ static int nvt_suspend(struct pnp_dev *pdev, pm_message_t state) spin_lock_irqsave(&nvt->nvt_lock, flags); - /* zero out misc state tracking */ - nvt->study_state = ST_STUDY_NONE; - /* disable all CIR interrupts */ nvt_cir_reg_write(nvt, 0, CIR_IREN); diff --git a/drivers/media/rc/nuvoton-cir.h b/drivers/media/rc/nuvoton-cir.h index 8bd35bd..65324ef 100644 --- a/drivers/media/rc/nuvoton-cir.h +++ b/drivers/media/rc/nuvoton-cir.h @@ -117,23 +117,10 @@ struct nvt_dev { /* rx settings */ bool learning_enabled; - /* for study */ - u8 study_state; /* carrier period = 1 / frequency */ u32 carrier; }; -/* study states */ -#define ST_STUDY_NONE 0x0 -#define ST_STUDY_START 0x1 -#define ST_STUDY_CARRIER 0x2 -#define ST_STUDY_ALL_RECV 0x4 - -/* receive states */ -#define ST_RX_WAIT_7F 0x1 -#define ST_RX_WAIT_HEAD 0x2 -#define ST_RX_WAIT_SILENT_END 0x4 - /* send states */ #define ST_TX_NONE 0x0 #define ST_TX_REQUEST 0x2