All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: unlisted-recipients:; (no To-header on input)@bombadil.infradead.org
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
	Udi Atar <udia@siano-ms.com>
Subject: [PATCH 5/6] V4L/DVB: sms: properly initialize IR phys and IR name
Date: Sun, 1 Aug 2010 17:21:22 -0300	[thread overview]
Message-ID: <20100801172122.01dfc9ec@pedra> (raw)
In-Reply-To: <cover.1280693675.git.mchehab@redhat.com>

sms were using a non-compliant nomenclature for the USB devices. Fix it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

diff --git a/drivers/media/dvb/siano/smsir.c b/drivers/media/dvb/siano/smsir.c
index a56eac7..f8a4fd6 100644
--- a/drivers/media/dvb/siano/smsir.c
+++ b/drivers/media/dvb/siano/smsir.c
@@ -22,6 +22,7 @@
 
 #include <linux/types.h>
 #include <linux/input.h>
+#include <media/ir-core.h>
 
 #include "smscoreapi.h"
 #include "smsir.h"
@@ -247,6 +248,7 @@ void sms_ir_event(struct smscore_device_t *coredev, const char *buf, int len)
 int sms_ir_init(struct smscore_device_t *coredev)
 {
 	struct input_dev *input_dev;
+	int board_id = smscore_get_board_id(coredev);
 
 	sms_log("Allocating input device");
 	input_dev = input_allocate_device();
@@ -256,8 +258,7 @@ int sms_ir_init(struct smscore_device_t *coredev)
 	}
 
 	coredev->ir.input_dev = input_dev;
-	coredev->ir.ir_kb_type =
-		sms_get_board(smscore_get_board_id(coredev))->ir_kb_type;
+	coredev->ir.ir_kb_type = sms_get_board(board_id)->ir_kb_type;
 	coredev->ir.keyboard_layout_map =
 		keyboard_layout_maps[coredev->ir.ir_kb_type].
 				keyboard_layout_map;
@@ -269,11 +270,15 @@ int sms_ir_init(struct smscore_device_t *coredev)
 			coredev->ir.controller, coredev->ir.timeout);
 
 	snprintf(coredev->ir.name,
-				IR_DEV_NAME_MAX_LEN,
-				"SMS IR w/kbd type %d",
-				coredev->ir.ir_kb_type);
+				sizeof(coredev->ir.name),
+				"SMS IR (%s)",
+				sms_get_board(board_id)->name);
+
+	strlcpy(coredev->ir.phys, coredev->devpath, sizeof(coredev->ir.phys));
+	strlcat(coredev->ir.phys, "/ir0", sizeof(coredev->ir.phys));
+
 	input_dev->name = coredev->ir.name;
-	input_dev->phys = coredev->ir.name;
+	input_dev->phys = coredev->ir.phys;
 	input_dev->dev.parent = coredev->device;
 
 	/* Key press events only */
diff --git a/drivers/media/dvb/siano/smsir.h b/drivers/media/dvb/siano/smsir.h
index b7d703e..77e6505 100644
--- a/drivers/media/dvb/siano/smsir.h
+++ b/drivers/media/dvb/siano/smsir.h
@@ -24,7 +24,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <linux/input.h>
 
-#define IR_DEV_NAME_MAX_LEN		23 /* "SMS IR kbd type nn\0" */
+#define IR_DEV_NAME_MAX_LEN		40
 #define IR_KEYBOARD_LAYOUT_SIZE	64
 #define IR_DEFAULT_TIMEOUT		100
 
@@ -78,7 +78,8 @@ struct smscore_device_t;
 struct ir_t {
 	struct input_dev *input_dev;
 	enum ir_kb_type ir_kb_type;
-	char name[IR_DEV_NAME_MAX_LEN+1];
+	char name[IR_DEV_NAME_MAX_LEN + 1];
+	char phys[32];
 	u16 *keyboard_layout_map;
 	u32 timeout;
 	u32 controller;
diff --git a/drivers/media/dvb/siano/smsusb.c b/drivers/media/dvb/siano/smsusb.c
index a9c27fb..50d4338 100644
--- a/drivers/media/dvb/siano/smsusb.c
+++ b/drivers/media/dvb/siano/smsusb.c
@@ -352,8 +352,7 @@ static int smsusb_init_device(struct usb_interface *intf, int board_id)
 	params.num_buffers = MAX_BUFFERS;
 	params.sendrequest_handler = smsusb_sendrequest;
 	params.context = dev;
-	snprintf(params.devpath, sizeof(params.devpath),
-		 "usb\\%d-%s", dev->udev->bus->busnum, dev->udev->devpath);
+	usb_make_path(dev->udev, params.devpath, sizeof(params.devpath));
 
 	/* register in smscore */
 	rc = smscore_register_device(&params, &dev->coredev);
-- 
1.7.1



  parent reply	other threads:[~2010-08-01 20:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1280693675.git.mchehab@redhat.com>
2010-08-01 20:17 ` [PATCH 1/6] V4L/DVB: dib0700: properly implement IR change_protocol Mauro Carvalho Chehab
2010-08-01 20:17 ` [PATCH 2/6] V4L/DVB: dib0700: Fix RC protocol logic to properly handle NEC/NECx and RC-5 Mauro Carvalho Chehab
2010-08-01 20:17 ` [PATCH 3/6] V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick Mauro Carvalho Chehab
2010-08-02  7:27   ` Richard Zidlicky
2010-08-03  2:01     ` Mauro Carvalho Chehab
2010-08-03 13:05       ` Richard Zidlicky
2010-08-03 13:32         ` Mauro Carvalho Chehab
2010-08-03 14:21           ` Jarod Wilson
2010-08-03 14:46           ` Richard Zidlicky
2010-08-03 15:23             ` Mauro Carvalho Chehab
2010-08-04  7:30           ` Richard Zidlicky
2010-08-01 20:21 ` [PATCH 4/6] V4L/DVB: standardize names at rc-dib0700 tables Mauro Carvalho Chehab
2010-08-01 20:21 ` Mauro Carvalho Chehab [this message]
2010-08-01 20:21 ` [PATCH 6/6] V4L/DVB: sms: Convert IR support to use the Remote Controller core Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100801172122.01dfc9ec@pedra \
    --to=mchehab@redhat.com \
    --cc=linux-media@vger.kernel.org \
    --cc=udia@siano-ms.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.