From patchwork Thu Mar 26 02:34:53 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Udo Steinberg X-Patchwork-Id: 14464 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n2Q2ZJg8027076 for ; Thu, 26 Mar 2009 02:35:19 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751992AbZCZCfR (ORCPT ); Wed, 25 Mar 2009 22:35:17 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752401AbZCZCfR (ORCPT ); Wed, 25 Mar 2009 22:35:17 -0400 Received: from os.inf.tu-dresden.de ([141.76.48.99]:51827 "EHLO os.inf.tu-dresden.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751992AbZCZCfQ (ORCPT ); Wed, 25 Mar 2009 22:35:16 -0400 Received: from [77.179.92.62] (helo=laptop.hypervisor.org) by os.inf.tu-dresden.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) id 1LmfQz-0003k0-Nj; Thu, 26 Mar 2009 03:35:09 +0100 Date: Thu, 26 Mar 2009 03:34:53 +0100 From: "Udo A. Steinberg" To: mchehab@redhat.com, Darron Broad Cc: v4l-dvb-maintainer@linuxtv.org, linux-media@vger.kernel.org Subject: [PATCH] Allow the user to restrict the RC5 address Message-ID: <20090326033453.7d90236d@laptop.hypervisor.org> X-Mailer: X-Mailer 5.0 Gold Mime-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Mauro, This patch allows users with multiple remotes to specify an RC5 address for a remote from which key codes will be accepted. If no address is specified, the default value of 0 accepts key codes from any remote. This replaces the current hard-coded address checks, which are too restrictive. Signed-off-by: Udo Steinberg --- linux-2.6.29/drivers/media/video/ir-kbd-i2c.c 2009-03-24 00:12:14.000000000 +0100 +++ linux-2.6.29/drivers/media/video/ir-kbd-i2c.new 2009-03-26 03:12:11.000000000 +0100 @@ -58,6 +58,9 @@ module_param(hauppauge, int, 0644); /* Choose Hauppauge remote */ MODULE_PARM_DESC(hauppauge, "Specify Hauppauge remote: 0=black, 1=grey (defaults to 0)"); +static unsigned int device; +module_param(device, uint, 0644); /* RC5 device address */ +MODULE_PARM_DESC(device, "Specify device address: 0=any (defaults to 0)"); #define DEVNAME "ir-kbd-i2c" #define dprintk(level, fmt, arg...) if (debug >= level) \ @@ -104,8 +107,8 @@ /* invalid key press */ return 0; - if (dev!=0x1e && dev!=0x1f) - /* not a hauppauge remote */ + if (device && device != dev) + /* not an acceptable remote */ return 0; if (!range)