From patchwork Wed Nov 17 22:09:21 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarod Wilson X-Patchwork-Id: 4950 Return-path: Envelope-to: mchehab@pedra Delivery-date: Wed, 17 Nov 2010 20:11:19 -0200 Received: from mchehab by pedra with local (Exim 4.72) (envelope-from ) id 1PIqDn-000406-7O for mchehab@pedra; Wed, 17 Nov 2010 20:11:19 -0200 Received: from casper.infradead.org [85.118.1.10] by pedra with IMAP (fetchmail-6.3.17) for (single-drop); Wed, 17 Nov 2010 20:11:19 -0200 (BRST) Received: from vger.kernel.org ([209.132.180.67]) by casper.infradead.org with esmtp (Exim 4.72 #1 (Red Hat Linux)) id 1PIqBy-0006NF-1T; Wed, 17 Nov 2010 22:09:26 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758895Ab0KQWJY (ORCPT + 1 other); Wed, 17 Nov 2010 17:09:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:34737 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758606Ab0KQWJY (ORCPT ); Wed, 17 Nov 2010 17:09:24 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAHM9MXk022036 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 17 Nov 2010 17:09:22 -0500 Received: from xavier.bos.redhat.com (xavier.bos.redhat.com [10.16.16.50]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAHM9LFe000937; Wed, 17 Nov 2010 17:09:22 -0500 Received: by xavier.bos.redhat.com (Postfix, from userid 500) id B5165817CB; Wed, 17 Nov 2010 17:09:21 -0500 (EST) Date: Wed, 17 Nov 2010 17:09:21 -0500 From: Jarod Wilson To: linux-media@vger.kernel.org Cc: Paul Bender Subject: [PATCH] rc: fix sysfs entry for mceusb and streamzap Message-ID: <20101117220921.GE24814@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Sender: From 4c13334d96e667dfbad90882ffe671d598d30d7f Mon Sep 17 00:00:00 2001 From: Paul Bender Date: Wed, 17 Nov 2010 14:56:17 -0500 Subject: [PATCH] rc: fix sysfs entry for mceusb and streamzap When trying to create persistent device names for mceusb and streamzap devices, I noticed that their respective drivers are not creating the rc device as a child of the USB device. Rather it creates it as virtual device. As a result, udev cannot use the USB device information to create persistent device names for event and lirc devices associated with the rc device. Not having persistent device names makes it more difficult to make use of the devices in userspace as their names can change. Signed-off-by: Paul Bender Forward-ported to media_tree staging/for_v2.6.38 and tested with both streamzap and mceusb devices: $ ll /dev/input/by-id/ ... lrwxrwxrwx. 1 root root 9 Nov 17 17:06 usb-Streamzap__Inc._Streamzap_Remote_Control-event-if00 -> ../event6 lrwxrwxrwx. 1 root root 9 Nov 17 17:05 usb-Topseed_Technology_Corp._eHome_Infrared_Transceiver_TS000BzY-event-if00 -> ../event5 Previously, nada. Tested-by: Jarod Wilson Signed-off-by: Jarod Wilson --- drivers/media/rc/mceusb.c | 5 ++++- drivers/media/rc/streamzap.c | 3 +++ 2 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 968cf1f..2cca983 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #define DRIVER_VERSION "1.91" @@ -1044,7 +1045,7 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir) snprintf(ir->name, sizeof(ir->name), "%s (%04x:%04x)", mceusb_model[ir->model].name ? - mceusb_model[ir->model].name : + mceusb_model[ir->model].name : "Media Center Ed. eHome Infrared Remote Transceiver", le16_to_cpu(ir->usbdev->descriptor.idVendor), le16_to_cpu(ir->usbdev->descriptor.idProduct)); @@ -1053,6 +1054,8 @@ static struct rc_dev *mceusb_init_rc_dev(struct mceusb_dev *ir) rc->input_name = ir->name; rc->input_phys = ir->phys; + usb_to_input_id(ir->usbdev, &rc->input_id); + rc->dev.parent = dev; rc->priv = ir; rc->driver_type = RC_DRIVER_IR_RAW; rc->allowed_protos = IR_TYPE_ALL; diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c index 19652d4..b2eef51 100644 --- a/drivers/media/rc/streamzap.c +++ b/drivers/media/rc/streamzap.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #define DRIVER_VERSION "1.61" @@ -315,6 +316,8 @@ static struct rc_dev *streamzap_init_rc_dev(struct streamzap_ir *sz) rdev->input_name = sz->name; rdev->input_phys = sz->phys; + usb_to_input_id(sz->usbdev, &rdev->input_id); + rdev->dev.parent = dev; rdev->priv = sz; rdev->driver_type = RC_DRIVER_IR_RAW; rdev->allowed_protos = IR_TYPE_ALL;