linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] [media] Add a keymap for FireDTV board
@ 2012-05-28 13:14 Mauro Carvalho Chehab
  2012-05-28 13:14 ` [PATCH 2/2] [media] firedtv: Port it to use rc_core Mauro Carvalho Chehab
  2012-05-28 13:29 ` [PATCH 1/2] [media] Add a keymap for FireDTV board Stefan Richter
  0 siblings, 2 replies; 9+ messages in thread
From: Mauro Carvalho Chehab @ 2012-05-28 13:14 UTC (permalink / raw)
  To: stefanr; +Cc: Mauro Carvalho Chehab, Linux Media Mailing List

Table imported from the FireDTV driver.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/rc/keymaps/Makefile     |    1 +
 drivers/media/rc/keymaps/rc-firedtv.c |  132 +++++++++++++++++++++++++++++++++
 include/media/rc-map.h                |    1 +
 3 files changed, 134 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/rc/keymaps/rc-firedtv.c

diff --git a/drivers/media/rc/keymaps/Makefile b/drivers/media/rc/keymaps/Makefile
index ab84d66..6c32562 100644
--- a/drivers/media/rc/keymaps/Makefile
+++ b/drivers/media/rc/keymaps/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \
 			rc-encore-enltv-fm53.o \
 			rc-evga-indtube.o \
 			rc-eztv.o \
+			rc-firedtv.o \
 			rc-flydvb.o \
 			rc-flyvideo.o \
 			rc-fusionhdtv-mce.o \
diff --git a/drivers/media/rc/keymaps/rc-firedtv.c b/drivers/media/rc/keymaps/rc-firedtv.c
new file mode 100644
index 0000000..dfead50
--- /dev/null
+++ b/drivers/media/rc/keymaps/rc-firedtv.c
@@ -0,0 +1,132 @@
+/* rc-firedtv.h - Keytable for FireDTV Remote Controller
+ *
+ * Imported from firedtv-rc.c driver
+ *
+ * Copyright (c) 2012 by Mauro Carvalho Chehab <mchehab@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <media/rc-map.h>
+#include <linux/module.h>
+
+static struct rc_map_table firedtv[] = {
+	/* Older keycodes, geared towards MythTV */
+	{0x4501, KEY_ESC},
+	{0x4502, KEY_F9},
+	{0x4503, KEY_1},
+	{0x4504, KEY_2},
+	{0x4505, KEY_3},
+	{0x4506, KEY_4},
+	{0x4507, KEY_5},
+	{0x4508, KEY_6},
+	{0x4509, KEY_7},
+	{0x450a, KEY_8},
+	{0x450b, KEY_9},
+	{0x450c, KEY_I},
+	{0x450d, KEY_0},
+	{0x450e, KEY_ENTER},
+	{0x450f, KEY_RED},
+	{0x4510, KEY_UP},
+	{0x4511, KEY_GREEN},
+	{0x4512, KEY_F10},
+	{0x4513, KEY_SPACE},
+	{0x4514, KEY_F11},
+	{0x4515, KEY_YELLOW},
+	{0x4516, KEY_DOWN},
+	{0x4517, KEY_BLUE},
+	{0x4518, KEY_Z},
+	{0x4519, KEY_P},
+	{0x451a, KEY_PAGEDOWN},
+	{0x451b, KEY_LEFT},
+	{0x451c, KEY_W},
+	{0x451d, KEY_RIGHT},
+	{0x451e, KEY_P},
+	{0x451f, KEY_M},
+	{0x4540, KEY_R},
+	{0x4541, KEY_V},
+	{0x4542, KEY_C},
+
+	/* For a remote as sold in 2008 */
+	{0x0300, KEY_POWER},
+	{0x0301, KEY_SLEEP},
+	{0x0302, KEY_STOP},
+	{0x0303, KEY_OK},
+	{0x0304, KEY_RIGHT},
+	{0x0305, KEY_1},
+	{0x0306, KEY_2},
+	{0x0307, KEY_3},
+	{0x0308, KEY_LEFT},
+	{0x0309, KEY_4},
+	{0x030a, KEY_5},
+	{0x030b, KEY_6},
+	{0x030c, KEY_UP},
+	{0x030d, KEY_7},
+	{0x030e, KEY_8},
+	{0x030f, KEY_9},
+	{0x0310, KEY_DOWN},
+	{0x0311, KEY_TITLE},	/* "OSD" - fixme */
+	{0x0312, KEY_0},
+	{0x0313, KEY_F20},	/* "16:9" - fixme */
+	{0x0314, KEY_SCREEN},	/* "FULL" - fixme */
+	{0x0315, KEY_MUTE},
+	{0x0316, KEY_SUBTITLE},
+	{0x0317, KEY_RECORD},
+	{0x0318, KEY_TEXT},
+	{0x0319, KEY_AUDIO},
+	{0x031a, KEY_RED},
+	{0x031b, KEY_PREVIOUS},
+	{0x031c, KEY_REWIND},
+	{0x031d, KEY_PLAYPAUSE},
+	{0x031e, KEY_NEXT},
+	{0x031f, KEY_VOLUMEUP},
+	{0x0340, KEY_CHANNELUP},
+	{0x0341, KEY_F21},	/* "4:3" - fixme */
+	{0x0342, KEY_TV},
+	{0x0343, KEY_DVD},
+	{0x0344, KEY_VCR},
+	{0x0345, KEY_AUX},
+	{0x0346, KEY_GREEN},
+	{0x0347, KEY_YELLOW},
+	{0x0348, KEY_BLUE},
+	{0x0349, KEY_CHANNEL},	/* "CH.LIST" */
+	{0x034a, KEY_VENDOR},	/* "CI" - fixme */
+	{0x034b, KEY_VOLUMEDOWN},
+	{0x034c, KEY_CHANNELDOWN},
+	{0x034d, KEY_LAST},
+	{0x034e, KEY_INFO},
+	{0x034f, KEY_FORWARD},
+	{0x0350, KEY_LIST},
+	{0x0351, KEY_FAVORITES},
+	{0x0352, KEY_MENU},
+	{0x0353, KEY_EPG},
+	{0x0354, KEY_EXIT},
+};
+
+static struct rc_map_list firedtv_map = {
+	.map = {
+		.scan    = firedtv,
+		.size    = ARRAY_SIZE(firedtv),
+		.rc_type = RC_TYPE_NEC,
+		.name    = RC_MAP_FIREDTV,
+	}
+};
+
+static int __init init_rc_map_firedtv(void)
+{
+	return rc_map_register(&firedtv_map);
+}
+
+static void __exit exit_rc_map_firedtv(void)
+{
+	rc_map_unregister(&firedtv_map);
+}
+
+module_init(init_rc_map_firedtv)
+module_exit(exit_rc_map_firedtv)
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@redhat.com>");
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index cfd5163..adc6f28 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -158,6 +158,7 @@ void rc_map_init(void);
 #define RC_MAP_VIDEOMATE_TV_PVR          "rc-videomate-tv-pvr"
 #define RC_MAP_WINFAST                   "rc-winfast"
 #define RC_MAP_WINFAST_USBII_DELUXE      "rc-winfast-usbii-deluxe"
+#define RC_MAP_FIREDTV			 "rc-firedtv"
 
 /*
  * Please, do not just append newer Remote Controller names at the end.
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] [media] firedtv: Port it to use rc_core
  2012-05-28 13:14 [PATCH 1/2] [media] Add a keymap for FireDTV board Mauro Carvalho Chehab
@ 2012-05-28 13:14 ` Mauro Carvalho Chehab
  2012-05-28 14:01   ` Stefan Richter
  2012-05-28 13:29 ` [PATCH 1/2] [media] Add a keymap for FireDTV board Stefan Richter
  1 sibling, 1 reply; 9+ messages in thread
From: Mauro Carvalho Chehab @ 2012-05-28 13:14 UTC (permalink / raw)
  To: stefanr; +Cc: Mauro Carvalho Chehab, Linux Media Mailing List

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
 drivers/media/dvb/firewire/firedtv-rc.c |  152 ++-----------------------------
 drivers/media/dvb/firewire/firedtv.h    |    2 +-
 2 files changed, 11 insertions(+), 143 deletions(-)

diff --git a/drivers/media/dvb/firewire/firedtv-rc.c b/drivers/media/dvb/firewire/firedtv-rc.c
index f82d4a9..3c2c9b3 100644
--- a/drivers/media/dvb/firewire/firedtv-rc.c
+++ b/drivers/media/dvb/firewire/firedtv-rc.c
@@ -19,138 +19,25 @@
 
 #include "firedtv.h"
 
-/* fixed table with older keycodes, geared towards MythTV */
-static const u16 oldtable[] = {
-
-	/* code from device: 0x4501...0x451f */
-
-	KEY_ESC,
-	KEY_F9,
-	KEY_1,
-	KEY_2,
-	KEY_3,
-	KEY_4,
-	KEY_5,
-	KEY_6,
-	KEY_7,
-	KEY_8,
-	KEY_9,
-	KEY_I,
-	KEY_0,
-	KEY_ENTER,
-	KEY_RED,
-	KEY_UP,
-	KEY_GREEN,
-	KEY_F10,
-	KEY_SPACE,
-	KEY_F11,
-	KEY_YELLOW,
-	KEY_DOWN,
-	KEY_BLUE,
-	KEY_Z,
-	KEY_P,
-	KEY_PAGEDOWN,
-	KEY_LEFT,
-	KEY_W,
-	KEY_RIGHT,
-	KEY_P,
-	KEY_M,
-
-	/* code from device: 0x4540...0x4542 */
-
-	KEY_R,
-	KEY_V,
-	KEY_C,
-};
-
-/* user-modifiable table for a remote as sold in 2008 */
-static const u16 keytable[] = {
-
-	/* code from device: 0x0300...0x031f */
-
-	[0x00] = KEY_POWER,
-	[0x01] = KEY_SLEEP,
-	[0x02] = KEY_STOP,
-	[0x03] = KEY_OK,
-	[0x04] = KEY_RIGHT,
-	[0x05] = KEY_1,
-	[0x06] = KEY_2,
-	[0x07] = KEY_3,
-	[0x08] = KEY_LEFT,
-	[0x09] = KEY_4,
-	[0x0a] = KEY_5,
-	[0x0b] = KEY_6,
-	[0x0c] = KEY_UP,
-	[0x0d] = KEY_7,
-	[0x0e] = KEY_8,
-	[0x0f] = KEY_9,
-	[0x10] = KEY_DOWN,
-	[0x11] = KEY_TITLE,	/* "OSD" - fixme */
-	[0x12] = KEY_0,
-	[0x13] = KEY_F20,	/* "16:9" - fixme */
-	[0x14] = KEY_SCREEN,	/* "FULL" - fixme */
-	[0x15] = KEY_MUTE,
-	[0x16] = KEY_SUBTITLE,
-	[0x17] = KEY_RECORD,
-	[0x18] = KEY_TEXT,
-	[0x19] = KEY_AUDIO,
-	[0x1a] = KEY_RED,
-	[0x1b] = KEY_PREVIOUS,
-	[0x1c] = KEY_REWIND,
-	[0x1d] = KEY_PLAYPAUSE,
-	[0x1e] = KEY_NEXT,
-	[0x1f] = KEY_VOLUMEUP,
-
-	/* code from device: 0x0340...0x0354 */
-
-	[0x20] = KEY_CHANNELUP,
-	[0x21] = KEY_F21,	/* "4:3" - fixme */
-	[0x22] = KEY_TV,
-	[0x23] = KEY_DVD,
-	[0x24] = KEY_VCR,
-	[0x25] = KEY_AUX,
-	[0x26] = KEY_GREEN,
-	[0x27] = KEY_YELLOW,
-	[0x28] = KEY_BLUE,
-	[0x29] = KEY_CHANNEL,	/* "CH.LIST" */
-	[0x2a] = KEY_VENDOR,	/* "CI" - fixme */
-	[0x2b] = KEY_VOLUMEDOWN,
-	[0x2c] = KEY_CHANNELDOWN,
-	[0x2d] = KEY_LAST,
-	[0x2e] = KEY_INFO,
-	[0x2f] = KEY_FORWARD,
-	[0x30] = KEY_LIST,
-	[0x31] = KEY_FAVORITES,
-	[0x32] = KEY_MENU,
-	[0x33] = KEY_EPG,
-	[0x34] = KEY_EXIT,
-};
-
 int fdtv_register_rc(struct firedtv *fdtv, struct device *dev)
 {
-	struct input_dev *idev;
+	struct rc_dev *idev;
 	int i, err;
 
-	idev = input_allocate_device();
+	idev = rc_allocate_device();
 	if (!idev)
 		return -ENOMEM;
 
 	fdtv->remote_ctrl_dev = idev;
 	idev->name = "FireDTV remote control";
+	idev->phys = "/ir0";		/* FIXME */
 	idev->dev.parent = dev;
-	idev->evbit[0] = BIT_MASK(EV_KEY);
-	idev->keycode = kmemdup(keytable, sizeof(keytable), GFP_KERNEL);
-	if (!idev->keycode) {
-		err = -ENOMEM;
-		goto fail;
-	}
-	idev->keycodesize = sizeof(keytable[0]);
-	idev->keycodemax = ARRAY_SIZE(keytable);
-
-	for (i = 0; i < ARRAY_SIZE(keytable); i++)
-		set_bit(keytable[i], idev->keybit);
+	idev->priv = fdtv;
+	idev->allowed_protos = RC_TYPE_NEC;
+	idev->map_name = RC_FIREDTV;
+	idev->driver_name = MODULE_NAME;
 
-	err = input_register_device(idev);
+	err = rc_register_device(idev);
 	if (err)
 		goto fail_free_keymap;
 
@@ -166,31 +53,12 @@ fail:
 void fdtv_unregister_rc(struct firedtv *fdtv)
 {
 	cancel_work_sync(&fdtv->remote_ctrl_work);
-	kfree(fdtv->remote_ctrl_dev->keycode);
-	input_unregister_device(fdtv->remote_ctrl_dev);
+	rc_unregister_device(fdtv->remote_ctrl_dev);
 }
 
 void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code)
 {
 	struct input_dev *idev = fdtv->remote_ctrl_dev;
-	u16 *keycode = idev->keycode;
-
-	if (code >= 0x0300 && code <= 0x031f)
-		code = keycode[code - 0x0300];
-	else if (code >= 0x0340 && code <= 0x0354)
-		code = keycode[code - 0x0320];
-	else if (code >= 0x4501 && code <= 0x451f)
-		code = oldtable[code - 0x4501];
-	else if (code >= 0x4540 && code <= 0x4542)
-		code = oldtable[code - 0x4521];
-	else {
-		printk(KERN_DEBUG "firedtv: invalid key code 0x%04x "
-		       "from remote control\n", code);
-		return;
-	}
 
-	input_report_key(idev, code, 1);
-	input_sync(idev);
-	input_report_key(idev, code, 0);
-	input_sync(idev);
+	rc_keydown(idev, code);
 }
diff --git a/drivers/media/dvb/firewire/firedtv.h b/drivers/media/dvb/firewire/firedtv.h
index 4fdcd8c..9a9cc67 100644
--- a/drivers/media/dvb/firewire/firedtv.h
+++ b/drivers/media/dvb/firewire/firedtv.h
@@ -91,7 +91,7 @@ struct firedtv {
 	wait_queue_head_t	avc_wait;
 	bool			avc_reply_received;
 	struct work_struct	remote_ctrl_work;
-	struct input_dev	*remote_ctrl_dev;
+	struct rc_dev		*remote_ctrl_dev;
 
 	enum model_type		type;
 	char			subunit;
-- 
1.7.8


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] [media] Add a keymap for FireDTV board
  2012-05-28 13:14 [PATCH 1/2] [media] Add a keymap for FireDTV board Mauro Carvalho Chehab
  2012-05-28 13:14 ` [PATCH 2/2] [media] firedtv: Port it to use rc_core Mauro Carvalho Chehab
@ 2012-05-28 13:29 ` Stefan Richter
  2012-05-28 13:32   ` Mauro Carvalho Chehab
  1 sibling, 1 reply; 9+ messages in thread
From: Stefan Richter @ 2012-05-28 13:29 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On May 28 Mauro Carvalho Chehab wrote:
> --- a/include/media/rc-map.h
> +++ b/include/media/rc-map.h
> @@ -158,6 +158,7 @@ void rc_map_init(void);
>  #define RC_MAP_VIDEOMATE_TV_PVR          "rc-videomate-tv-pvr"
>  #define RC_MAP_WINFAST                   "rc-winfast"
>  #define RC_MAP_WINFAST_USBII_DELUXE      "rc-winfast-usbii-deluxe"
> +#define RC_MAP_FIREDTV			 "rc-firedtv"
>  
>  /*
>   * Please, do not just append newer Remote Controller names at the end.

The comment says that names should be inserted in alphabetical order. :-)
-- 
Stefan Richter
-=====-===-- -=-= ===--
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] [media] Add a keymap for FireDTV board
  2012-05-28 13:29 ` [PATCH 1/2] [media] Add a keymap for FireDTV board Stefan Richter
@ 2012-05-28 13:32   ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 9+ messages in thread
From: Mauro Carvalho Chehab @ 2012-05-28 13:32 UTC (permalink / raw)
  To: Stefan Richter; +Cc: Linux Media Mailing List

Em 28-05-2012 10:29, Stefan Richter escreveu:
> On May 28 Mauro Carvalho Chehab wrote:
>> --- a/include/media/rc-map.h
>> +++ b/include/media/rc-map.h
>> @@ -158,6 +158,7 @@ void rc_map_init(void);
>>  #define RC_MAP_VIDEOMATE_TV_PVR          "rc-videomate-tv-pvr"
>>  #define RC_MAP_WINFAST                   "rc-winfast"
>>  #define RC_MAP_WINFAST_USBII_DELUXE      "rc-winfast-usbii-deluxe"
>> +#define RC_MAP_FIREDTV			 "rc-firedtv"
>>  
>>  /*
>>   * Please, do not just append newer Remote Controller names at the end.
> 
> The comment says that names should be inserted in alphabetical order. :-)

Gah! you got me ;)

I'll merge the enclosed diff on it, to fix it.

Regards,
Mauro

diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index adc6f28..29a54db 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -93,6 +93,7 @@ void rc_map_init(void);
 #define RC_MAP_ENCORE_ENLTV              "rc-encore-enltv"
 #define RC_MAP_EVGA_INDTUBE              "rc-evga-indtube"
 #define RC_MAP_EZTV                      "rc-eztv"
+#define RC_MAP_FIREDTV			 "rc-firedtv"
 #define RC_MAP_FLYDVB                    "rc-flydvb"
 #define RC_MAP_FLYVIDEO                  "rc-flyvideo"
 #define RC_MAP_FUSIONHDTV_MCE            "rc-fusionhdtv-mce"
@@ -158,7 +159,6 @@ void rc_map_init(void);
 #define RC_MAP_VIDEOMATE_TV_PVR          "rc-videomate-tv-pvr"
 #define RC_MAP_WINFAST                   "rc-winfast"
 #define RC_MAP_WINFAST_USBII_DELUXE      "rc-winfast-usbii-deluxe"
-#define RC_MAP_FIREDTV			 "rc-firedtv"
 
 /*
  * Please, do not just append newer Remote Controller names at the end.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] [media] firedtv: Port it to use rc_core
  2012-05-28 13:14 ` [PATCH 2/2] [media] firedtv: Port it to use rc_core Mauro Carvalho Chehab
@ 2012-05-28 14:01   ` Stefan Richter
  2012-05-28 14:09     ` Mauro Carvalho Chehab
                       ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Stefan Richter @ 2012-05-28 14:01 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On May 28 Mauro Carvalho Chehab wrote:
> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
> ---
>  drivers/media/dvb/firewire/firedtv-rc.c |  152 ++-----------------------------
>  drivers/media/dvb/firewire/firedtv.h    |    2 +-
>  2 files changed, 11 insertions(+), 143 deletions(-)

Also in drivers/media/dvb/firewire/Kconfig, INPUT needs to be replaced by
RC_CORE, right?

> diff --git a/drivers/media/dvb/firewire/firedtv-rc.c b/drivers/media/dvb/firewire/firedtv-rc.c
> index f82d4a9..3c2c9b3 100644
> --- a/drivers/media/dvb/firewire/firedtv-rc.c
> +++ b/drivers/media/dvb/firewire/firedtv-rc.c

-#include <linux/input.h>
+#include <media/rc-core.h>

[...]
>  int fdtv_register_rc(struct firedtv *fdtv, struct device *dev)
>  {
> -	struct input_dev *idev;
> +	struct rc_dev *idev;
>  	int i, err;
>  
> -	idev = input_allocate_device();
> +	idev = rc_allocate_device();
>  	if (!idev)
>  		return -ENOMEM;
>  
>  	fdtv->remote_ctrl_dev = idev;
>  	idev->name = "FireDTV remote control";
> +	idev->phys = "/ir0";		/* FIXME */

Something similar to drivers/media/dvb/dvb-usb/dvb-usb-remote.c::

	usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys));
	strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys));

should be implemented for this, right?

Also, idev->name should be idev->input_name and idev->phys should be
idev->input_phys.

> --- a/drivers/media/dvb/firewire/firedtv.h
> +++ b/drivers/media/dvb/firewire/firedtv.h

-struct input_dev;
+struct struct rc_dev;

> @@ -91,7 +91,7 @@ struct firedtv {
>  	wait_queue_head_t	avc_wait;
>  	bool			avc_reply_received;
>  	struct work_struct	remote_ctrl_work;
> -	struct input_dev	*remote_ctrl_dev;
> +	struct rc_dev		*remote_ctrl_dev;
>  
>  	enum model_type		type;
>  	char			subunit;

(Do you want to reroll it or should I resubmit it myself after actually
trying it?)
-- 
Stefan Richter
-=====-===-- -=-= ===--
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] [media] firedtv: Port it to use rc_core
  2012-05-28 14:01   ` Stefan Richter
@ 2012-05-28 14:09     ` Mauro Carvalho Chehab
  2012-05-28 14:09     ` Mauro Carvalho Chehab
  2012-05-28 14:14     ` Stefan Richter
  2 siblings, 0 replies; 9+ messages in thread
From: Mauro Carvalho Chehab @ 2012-05-28 14:09 UTC (permalink / raw)
  To: Stefan Richter; +Cc: Linux Media Mailing List

Em 28-05-2012 11:01, Stefan Richter escreveu:
> On May 28 Mauro Carvalho Chehab wrote:
>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>> ---
>>  drivers/media/dvb/firewire/firedtv-rc.c |  152 ++-----------------------------
>>  drivers/media/dvb/firewire/firedtv.h    |    2 +-
>>  2 files changed, 11 insertions(+), 143 deletions(-)
> 
> Also in drivers/media/dvb/firewire/Kconfig, INPUT needs to be replaced by
> RC_CORE, right?
> 
>> diff --git a/drivers/media/dvb/firewire/firedtv-rc.c b/drivers/media/dvb/firewire/firedtv-rc.c
>> index f82d4a9..3c2c9b3 100644
>> --- a/drivers/media/dvb/firewire/firedtv-rc.c
>> +++ b/drivers/media/dvb/firewire/firedtv-rc.c
> 
> -#include <linux/input.h>
> +#include <media/rc-core.h>

Ok.
> 
> [...]
>>  int fdtv_register_rc(struct firedtv *fdtv, struct device *dev)
>>  {
>> -	struct input_dev *idev;
>> +	struct rc_dev *idev;
>>  	int i, err;
>>  
>> -	idev = input_allocate_device();
>> +	idev = rc_allocate_device();
>>  	if (!idev)
>>  		return -ENOMEM;
>>  
>>  	fdtv->remote_ctrl_dev = idev;
>>  	idev->name = "FireDTV remote control";
>> +	idev->phys = "/ir0";		/* FIXME */
> 
> Something similar to drivers/media/dvb/dvb-usb/dvb-usb-remote.c::
> 
> 	usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys));
> 	strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys));
> 
> should be implemented for this, right?

Yes. I dunno how are the physical descriptions for firewire, but we
generally use the same way as it is there at sysfs. This is not an
absolute requirement for the RC core to work.
> 
> Also, idev->name should be idev->input_name and idev->phys should be
> idev->input_phys.

Yeah, you're right... Weird that I didn't notice any compilation issue here.

>> --- a/drivers/media/dvb/firewire/firedtv.h
>> +++ b/drivers/media/dvb/firewire/firedtv.h
> 
> -struct input_dev;
> +struct struct rc_dev;
> 
>> @@ -91,7 +91,7 @@ struct firedtv {
>>  	wait_queue_head_t	avc_wait;
>>  	bool			avc_reply_received;
>>  	struct work_struct	remote_ctrl_work;
>> -	struct input_dev	*remote_ctrl_dev;
>> +	struct rc_dev		*remote_ctrl_dev;
>>  
>>  	enum model_type		type;
>>  	char			subunit;
> 
> (Do you want to reroll it or should I resubmit it myself after actually
> trying it?)

Feel free to fix and resubmit it after testing.

Regards,
Mauro

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] [media] firedtv: Port it to use rc_core
  2012-05-28 14:01   ` Stefan Richter
  2012-05-28 14:09     ` Mauro Carvalho Chehab
@ 2012-05-28 14:09     ` Mauro Carvalho Chehab
  2012-05-28 14:14     ` Stefan Richter
  2 siblings, 0 replies; 9+ messages in thread
From: Mauro Carvalho Chehab @ 2012-05-28 14:09 UTC (permalink / raw)
  To: Stefan Richter; +Cc: Linux Media Mailing List

Em 28-05-2012 11:01, Stefan Richter escreveu:
> On May 28 Mauro Carvalho Chehab wrote:
>> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
>> ---
>>  drivers/media/dvb/firewire/firedtv-rc.c |  152 ++-----------------------------
>>  drivers/media/dvb/firewire/firedtv.h    |    2 +-
>>  2 files changed, 11 insertions(+), 143 deletions(-)
> 
> Also in drivers/media/dvb/firewire/Kconfig, INPUT needs to be replaced by
> RC_CORE, right?

Yes.

(sorry, I missed that one on the previous email ;) )

Regards,
Mauro

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] [media] firedtv: Port it to use rc_core
  2012-05-28 14:01   ` Stefan Richter
  2012-05-28 14:09     ` Mauro Carvalho Chehab
  2012-05-28 14:09     ` Mauro Carvalho Chehab
@ 2012-05-28 14:14     ` Stefan Richter
  2012-05-28 14:41       ` Mauro Carvalho Chehab
  2 siblings, 1 reply; 9+ messages in thread
From: Stefan Richter @ 2012-05-28 14:14 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Linux Media Mailing List

On May 28 Stefan Richter wrote:
> > +	idev->phys = "/ir0";		/* FIXME */  
> 
> Something similar to drivers/media/dvb/dvb-usb/dvb-usb-remote.c::
> 
> 	usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys));
> 	strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys));
> 
> should be implemented for this, right?

PS:
The current input device looks like this:

/sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0/0000:03:01.0/0000:04:00.0/fw7/fw7.0/input/input8/device -> ../../../fw7.0

"fw7.0" is dev_name(dev) in fdtv_register_rc() or dev_name(fdtv->device)
in general in firedtv.

The last numeric name before fw7, i.e. 0000:04:00.0, is the name of the PCI
device of the FireWire controller.  fw7 is the name of the FireDTV node;
fw7.0 is the name of the (only) unit within the FireDTV node which
implements the DVB receiver and IR receiver.  What would be needed from
this?

FWIW, usb_make_path() results in "usb-%s-%s" % (usb_device.bus.bus_name,
usb_device.devpath).
-- 
Stefan Richter
-=====-===-- -=-= ===--
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] [media] firedtv: Port it to use rc_core
  2012-05-28 14:14     ` Stefan Richter
@ 2012-05-28 14:41       ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 9+ messages in thread
From: Mauro Carvalho Chehab @ 2012-05-28 14:41 UTC (permalink / raw)
  To: Stefan Richter; +Cc: Linux Media Mailing List

Em 28-05-2012 11:14, Stefan Richter escreveu:
> On May 28 Stefan Richter wrote:
>>> +	idev->phys = "/ir0";		/* FIXME */  
>>
>> Something similar to drivers/media/dvb/dvb-usb/dvb-usb-remote.c::
>>
>> 	usb_make_path(d->udev, d->rc_phys, sizeof(d->rc_phys));
>> 	strlcat(d->rc_phys, "/ir0", sizeof(d->rc_phys));
>>
>> should be implemented for this, right?
> 
> PS:
> The current input device looks like this:
> 
> /sys/devices/pci0000:00/0000:00:02.0/0000:02:00.0/0000:03:01.0/0000:04:00.0/fw7/fw7.0/input/input8/device -> ../../../fw7.0
> 
> "fw7.0" is dev_name(dev) in fdtv_register_rc() or dev_name(fdtv->device)
> in general in firedtv.
> 
> The last numeric name before fw7, i.e. 0000:04:00.0, is the name of the PCI
> device of the FireWire controller.  fw7 is the name of the FireDTV node;
> fw7.0 is the name of the (only) unit within the FireDTV node which
> implements the DVB receiver and IR receiver.  What would be needed from
> this?
> 
> FWIW, usb_make_path() results in "usb-%s-%s" % (usb_device.bus.bus_name,
> usb_device.devpath).

IMO, the physical patch is "fw7.0". We add a /ir0 for the first IR device (as a
driver might have more than one IR).

So, the phys should be "fw7.0/ir0".

Regards,
Mauro

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-05-28 14:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-28 13:14 [PATCH 1/2] [media] Add a keymap for FireDTV board Mauro Carvalho Chehab
2012-05-28 13:14 ` [PATCH 2/2] [media] firedtv: Port it to use rc_core Mauro Carvalho Chehab
2012-05-28 14:01   ` Stefan Richter
2012-05-28 14:09     ` Mauro Carvalho Chehab
2012-05-28 14:09     ` Mauro Carvalho Chehab
2012-05-28 14:14     ` Stefan Richter
2012-05-28 14:41       ` Mauro Carvalho Chehab
2012-05-28 13:29 ` [PATCH 1/2] [media] Add a keymap for FireDTV board Stefan Richter
2012-05-28 13:32   ` Mauro Carvalho Chehab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).