From patchwork Fri Oct 22 13:25:27 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: 274161 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9MDQoek028369 for ; Fri, 22 Oct 2010 13:26:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756634Ab0JVN0s (ORCPT ); Fri, 22 Oct 2010 09:26:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756424Ab0JVN0s (ORCPT ); Fri, 22 Oct 2010 09:26:48 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o9MDQlcA005812 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Oct 2010 09:26:48 -0400 Received: from pedra (vpn-225-240.phx2.redhat.com [10.3.225.240]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o9MDPfvf018126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 22 Oct 2010 09:26:46 -0400 Date: Fri, 22 Oct 2010 11:25:27 -0200 From: Mauro Carvalho Chehab To: jarod@redhat.com Cc: Linux Media Mailing List Subject: [PATCH 2/3] mceusb: allow a per-model RC map Message-ID: <20101022112527.7104b849@pedra> In-Reply-To: References: Mime-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 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 (demeter1.kernel.org [140.211.167.41]); Fri, 22 Oct 2010 13:26:50 +0000 (UTC) diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c index 9143ab6..e72bfa1 100644 --- a/drivers/media/IR/mceusb.c +++ b/drivers/media/IR/mceusb.c @@ -125,10 +125,7 @@ struct mceusb_model { u32 tx_mask_inverted:1; u32 is_polaris:1; - /* - * Allow specify a per-board extra data, like - * device names, and per-device rc_maps - */ + const char *rc_map; /* Allow specify a per-board map */ }; static const struct mceusb_model mceusb_model[] = { @@ -152,6 +149,12 @@ static const struct mceusb_model mceusb_model[] = { }, [POLARIS_EVK] = { .is_polaris = 1, + /* + * In fact, the EVK is shipped without + * remotes, but we should have something handy, + * to allow testing it + */ + .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW, }, }; @@ -956,6 +959,7 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir) struct input_dev *idev; struct ir_dev_props *props; struct device *dev = ir->dev; + const char *rc_map = RC_MAP_RC6_MCE; int ret = -ENODEV; idev = input_allocate_device(); @@ -990,7 +994,10 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir) ir->props = props; - ret = ir_input_register(idev, RC_MAP_RC6_MCE, props, DRIVER_NAME); + if (mceusb_model[ir->model].rc_map) + rc_map = mceusb_model[ir->model].rc_map; + + ret = ir_input_register(idev, rc_map, props, DRIVER_NAME); if (ret < 0) { dev_err(dev, "remote input device register failed\n"); goto irdev_failed;