From patchwork Fri Oct 22 13:25:28 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: 274171 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 o9MDSA38029068 for ; Fri, 22 Oct 2010 13:28:10 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756740Ab0JVN1u (ORCPT ); Fri, 22 Oct 2010 09:27:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6320 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756632Ab0JVN1t (ORCPT ); Fri, 22 Oct 2010 09:27:49 -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 o9MDRnOS027668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 22 Oct 2010 09:27:49 -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 o9MDPfvg018126 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Fri, 22 Oct 2010 09:27:48 -0400 Date: Fri, 22 Oct 2010 11:25:28 -0200 From: Mauro Carvalho Chehab To: jarod@redhat.com Cc: Linux Media Mailing List Subject: [PATCH 3/3] mceusb: Allow a per-model device name Message-ID: <20101022112528.6c2e4131@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:28:10 +0000 (UTC) diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c index e72bfa1..35425ee 100644 --- a/drivers/media/IR/mceusb.c +++ b/drivers/media/IR/mceusb.c @@ -126,6 +126,7 @@ struct mceusb_model { u32 is_polaris:1; const char *rc_map; /* Allow specify a per-board map */ + const char *name; /* per-board name */ }; static const struct mceusb_model mceusb_model[] = { @@ -155,6 +156,7 @@ static const struct mceusb_model mceusb_model[] = { * to allow testing it */ .rc_map = RC_MAP_RC5_HAUPPAUGE_NEW, + .name = "cx231xx MCE IR", }, }; @@ -960,6 +962,7 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir) struct ir_dev_props *props; struct device *dev = ir->dev; const char *rc_map = RC_MAP_RC6_MCE; + const char *name = "Media Center Ed. eHome Infrared Remote Transceiver"; int ret = -ENODEV; idev = input_allocate_device(); @@ -975,8 +978,11 @@ static struct input_dev *mceusb_init_input_dev(struct mceusb_dev *ir) goto props_alloc_failed; } - snprintf(ir->name, sizeof(ir->name), "Media Center Ed. eHome " - "Infrared Remote Transceiver (%04x:%04x)", + if (mceusb_model[ir->model].name) + name = mceusb_model[ir->model].name; + + snprintf(ir->name, sizeof(ir->name), "%s (%04x:%04x)", + name, le16_to_cpu(ir->usbdev->descriptor.idVendor), le16_to_cpu(ir->usbdev->descriptor.idProduct));