From patchwork Tue Apr 6 18:18:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 90828 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o36IITxw008071 for ; Tue, 6 Apr 2010 18:18:29 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757216Ab0DFSS0 (ORCPT ); Tue, 6 Apr 2010 14:18:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:26028 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756888Ab0DFSSX (ORCPT ); Tue, 6 Apr 2010 14:18:23 -0400 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o36IINDc008011 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 6 Apr 2010 14:18:23 -0400 Received: from pedra (vpn-8-182.rdu.redhat.com [10.11.8.182]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o36IIAEf021397 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 6 Apr 2010 14:18:22 -0400 Date: Tue, 6 Apr 2010 15:18:00 -0300 From: Mauro Carvalho Chehab To: linux-media@vger.kernel.org, Linux Media Mailing List Subject: [PATCH 25/26] V4L/DVB: re-add enable/disable check to the IR decoders Message-ID: <20100406151800.7653fe23@pedra> In-Reply-To: References: Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Tue, 06 Apr 2010 18:18:29 +0000 (UTC) diff --git a/drivers/media/IR/ir-nec-decoder.c b/drivers/media/IR/ir-nec-decoder.c index 28d7735..9d1ada9 100644 --- a/drivers/media/IR/ir-nec-decoder.c +++ b/drivers/media/IR/ir-nec-decoder.c @@ -142,6 +142,9 @@ static int ir_nec_decode(struct input_dev *input_dev, if (!data) return -EINVAL; + if (!data->enabled) + return 0; + /* Except for the initial event, what matters is the previous bit */ bit = (ev->type & IR_PULSE) ? 1 : 0; diff --git a/drivers/media/IR/ir-rc5-decoder.c b/drivers/media/IR/ir-rc5-decoder.c index 61b5839..4fb3ce4 100644 --- a/drivers/media/IR/ir-rc5-decoder.c +++ b/drivers/media/IR/ir-rc5-decoder.c @@ -153,6 +153,9 @@ static int ir_rc5_decode(struct input_dev *input_dev, if (!data) return -EINVAL; + if (!data->enabled) + return 0; + /* Except for the initial event, what matters is the previous bit */ bit = (ev->type & IR_PULSE) ? 1 : 0;