V4L/DVB: dib0700: properly implement IR change_protocol
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/6 V4L/DVB: dib0700: properly implement IR change_protocol
This patch implements change_protocol callback. With this change, there's no need for an extra modprobe parameter to specify the protocol. When a table is loaded (either from in-kernel rc-map tables or via ir-keytable program), the driver will automatically change the protocol, in order to work with the given table.
drivers/media/dvb/dvb-usb/dib0700.h +1 -0
@@ -60,6 +60,7 @@ extern int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff);extern struct i2c_algorithm dib0700_i2c_algo;extern int dib0700_identify_state (struct usb_device *udev,struct dvb_usb_device_properties *props,struct dvb_usb_device_description **desc,int *cold); +extern int dib0700_change_protocol (void *priv,u64 ir_type);extern int dib0700_device_count;extern int dvb_usb_dib0700_ir_proto;
drivers/media/dvb/dvb-usb/dib0700_core.c +37 -16
86 lines not on this page · raw message
drivers/media/dvb/dvb-usb/dib0700_devices.c +100 -18
214 lines not on this page · raw message
drivers/media/dvb/dvb-usb/dvb-usb.h +2 -0
@@ -179,6 +179,7 @@ struct dvb_rc_legacy {/** * struct dvb_rc properties of remote controller, using rc-core * @rc_codes: name of rc codes table +* @protocol: type of protocol(s) currently used by the driver * @rc_query: called to query an event event. * @rc_interval: time in ms between two queries. * @rc_props: remote controller properties
@@ -186,6 +187,7 @@ struct dvb_rc_legacy {*/ struct dvb_rc {char *rc_codes; +u64 protocol;char *module_name;int (*rc_query) (struct dvb_usb_device *d);int rc_interval;
Signature · 1 line
1.7.1
PATCH 2/6 V4L/DVB: dib0700: Fix RC protocol logic to properly handle NEC/NECx and RC-5
In reply to a message not in the archiveSimplifies the logic for handling firmware 1.20 RC messages, fixing the logic.
While here, I tried to use a RC-6 remote controller from my TV set, but it didn't work with dib0700. Not sure why, but maybe this never worked.
drivers/media/dvb/dvb-usb/dib0700_core.c +35 -31
@@ -499,7 +499,7 @@ int dib0700_change_protocol(void *priv, u64 ir_type)return ret; } - d->props.rc.core.protocol = new_proto; + d->props.rc.core.protocol = ir_type;return ret; }
@@ -511,7 +511,13 @@ int dib0700_change_protocol(void *priv, u64 ir_type)struct dib0700_rc_response {u8 report_id;u8 data_state; -u16 system; +union { +u16 system16; +struct { +u8 system; +u8 not_system; + }; + };u8 data;u8 not_data; };
@@ -521,9 +527,8 @@ static void dib0700_rc_urb_completion(struct urb *purb) {struct dvb_usb_device *d = purb->context;struct dib0700_state *st; -struct dib0700_rc_response poll_reply; -u8 *buf; -u32 keycode; +struct dib0700_rc_response *poll_reply; +u32 uninitialized_var (keycode );u8 toggle;deb_info ("%s()\n" , __func__);
@@ -537,7 +542,7 @@ static void dib0700_rc_urb_completion(struct urb *purb) } st = d->priv; - buf = (u8 *)purb->transfer_buffer; + poll_reply = purb->transfer_buffer;if (purb->status <0 ) {deb_info ("discontinuing polling\n" );
@@ -550,52 +555,51 @@ static void dib0700_rc_urb_completion(struct urb *purb) goto resubmit; } -deb_data ("IR raw %02X %02X %02X %02X %02X %02X (len %d)\n" , buf[0 ], - buf[1 ], buf[2 ], buf[3 ], buf[4 ], buf[5 ], purb->actual_length); +deb_data ("IR ID = %02X state = %02X System = %02X %02X Cmd = %02X %02X (len %d)\n" , + poll_reply->report_id, poll_reply->data_state, + poll_reply->system, poll_reply->not_system, + poll_reply->data, poll_reply->not_data, + purb->actual_length);switch (d->props.rc.core.protocol) {case IR_TYPE_NEC : - poll_reply.data_state =0 ; - poll_reply.system = buf[2 ]; - poll_reply.data = buf[4 ]; - poll_reply.not_data = buf[5 ]; toggle =0 ;/* NEC protocol sends repeat code as 0 0 0 FF */ -if ((poll_reply.system ==0x00 ) && (poll_reply.data ==0x00 ) - && (poll_reply.not_data ==0xff )) { - poll_reply.data_state =2 ; +if ((poll_reply->system ==0x00 ) && (poll_reply->data ==0x00 ) + && (poll_reply->not_data ==0xff )) { + poll_reply->data_state =2 ;break ; } +if ((poll_reply->system ^ poll_reply->not_system) !=0xff ) { +deb_data ("NEC extended protocol\n" ); +/* NEC extended code - 24 bits */ + keycode = poll_reply->system16 <<8 | poll_reply->data; + }else { +deb_data ("NEC normal protocol\n" ); +/* normal NEC code - 16 bits */ + keycode = poll_reply->system <<8 | poll_reply->data; + } +break ;default : +deb_data ("RC5 protocol\n" );/* RC5 Protocol */ -/* TODO: need to check the mapping for RC6 */ - poll_reply.report_id = buf[0 ]; - poll_reply.data_state = buf[1 ]; - poll_reply.system = (buf[2 ] <<8 ) | buf[3 ]; - poll_reply.data = buf[4 ]; - poll_reply.not_data = buf[5 ]; - - toggle = poll_reply.report_id; + toggle = poll_reply->report_id; + keycode = poll_reply->system16 <<8 | poll_reply->data;break ; } -if ((poll_reply.data + poll_reply.not_data) !=0xff ) { +if ((poll_reply->data + poll_reply->not_data) !=0xff ) {/* Key failed integrity check */ err ("key failed integrity check: %04x %02x %02x" , - poll_reply.system, - poll_reply.data, poll_reply.not_data); + poll_reply->system, + poll_reply->data, poll_reply->not_data); goto resubmit; } -deb_data ("rid=%02x ds=%02x sm=%04x d=%02x nd=%02x\n" , - poll_reply.report_id, poll_reply.data_state, - poll_reply.system, poll_reply.data, poll_reply.not_data); - - keycode = poll_reply.system <<8 | poll_reply.data;ir_keydown (d->rc_input_dev, keycode, toggle); resubmit:
Signature · 1 line
1.7.1
PATCH 3/6 V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
In reply to a message not in the archiveAdd the proper gpio port for WinTV MiniStick, with the information provided by Michael.
Thanks-to: Michael Krufky <[email protected]>
drivers/media/dvb/siano/sms-cards.c +1 -0
@@ -67,6 +67,7 @@ static struct sms_board sms_boards[] = { .board_cfg.leds_power = 26, .board_cfg.led0 = 27, .board_cfg.led1 = 28, + .board_cfg.ir = 9, .led_power = 26, .led_lo = 27, .led_hi = 28,
Signature · 1 line
1.7.1
Re: [PATCH 3/6] V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
Quoted 11 lines · Mauro Carvalho Chehab
Add the proper gpio port for WinTV MiniStick, with the information provided by Michael.
Thanks-to: Michael Krufky <[email protected]>
Signed-off-by Mauro Carvalho Chehab <[email protected]>drivers/media/dvb/siano/sms-cards.c +0
-0
drivers/media/dvb/siano/sms-cards.c static struct sms_board sms_boards[] = { · line 70
Quoted 4 lines
drivers/media/dvb/siano/sms-cards.c +1
-0@@ -67,6 +67,7 @@ static struct sms_board sms_boards[] = { .board_cfg.leds_power = 26, .board_cfg.led0 = 27, .board_cfg.led1 = 28, + .board_cfg.ir = 9,
^^^^
are you sure about this?
I am using the value of 4 for the ir port and it definitely works.. confused.
Thanks for looking at it, will test the patches as soon as I can.
Richard
Re: [PATCH 3/6] V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
Hi Richard,
Em 02-08-2010 04:27, Richard Zidlicky escreveu:
Quoted 18 lines · Mauro Carvalho Chehab
Quoted 11 lines
Add the proper gpio port for WinTV MiniStick, with the information provided by Michael.
Thanks-to: Michael Krufky <[email protected]>
Signed-off-by Mauro Carvalho Chehab <[email protected]>drivers/media/dvb/siano/sms-cards.c +0
-0drivers/media/dvb/siano/sms-cards.c static struct sms_board sms_boards[] = { · line 70
Quoted 4 lines
drivers/media/dvb/siano/sms-cards.c +1
-0@@ -67,6 +67,7 @@ static struct sms_board sms_boards[] = { .board_cfg.leds_power = 26, .board_cfg.led0 = 27, .board_cfg.led1 = 28, + .board_cfg.ir = 9,^^^^
Quoted 3 lines
are you sure about this?
I am using the value of 4 for the ir port and it definitely works.. confused.
I got this from a reliable source, and that worked perfectly my with a Model 55009 LF Rev B1F7. What's the model of your device?
Quoted 1 line
Thanks for looking at it, will test the patches as soon as I can.
I'd appreciate if you could test those patches, as the new implementation is feature-rich, as it uses the in-kernel decoders via RC subsystem.
Quoted 6 lines
Richard
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Cheers,
Mauro
Re: [PATCH 3/6] V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
Hi,
Quoted 19 lines
Em 02-08-2010 04:27, Richard Zidlicky escreveu:
Quoted 18 lines · Mauro Carvalho Chehab
Quoted 11 lines
Add the proper gpio port for WinTV MiniStick, with the information provided by Michael.
Thanks-to: Michael Krufky <[email protected]>
Signed-off-by Mauro Carvalho Chehab <[email protected]>drivers/media/dvb/siano/sms-cards.c +0
-0drivers/media/dvb/siano/sms-cards.c static struct sms_board sms_boards[] = { · line 70
Quoted 4 lines
drivers/media/dvb/siano/sms-cards.c +1
-0@@ -67,6 +67,7 @@ static struct sms_board sms_boards[] = { .board_cfg.leds_power = 26, .board_cfg.led0 = 27, .board_cfg.led1 = 28, + .board_cfg.ir = 9,^^^^
Quoted 6 lines
Quoted 3 lines
are you sure about this?
I am using the value of 4 for the ir port and it definitely works.. confused.
I got this from a reliable source, and that worked perfectly my with a Model 55009 LF Rev B1F7. What's the model of your device?
mine says
Aug 3 14:58:10 localhost kernel: [149778.591862] usb 5-5: New USB device found, idVendor=2040, idProduct=5500 Aug 3 14:58:10 localhost kernel: [149778.591865] usb 5-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Aug 3 14:58:10 localhost kernel: [149778.591868] usb 5-5: Product: WinTV MiniStick Aug 3 14:58:10 localhost kernel: [149778.591870] usb 5-5: Manufacturer: Hauppauge Computer Works Aug 3 14:58:10 localhost kernel: [149778.591872] usb 5-5: SerialNumber: f069684c
not sure what else to report.
I will compile and try a new kernel tonight.
Wondering - is this
http://git.sliepen.org/browse?p=inputlirc
usefull to feed the input events to LIRC when trying the new driver with a slightly older LIRC based distro?
Richard
Re: [PATCH 3/6] V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
Em 03-08-2010 10:05, Richard Zidlicky escreveu:
Quoted 30 lines
Hi,
Quoted 19 lines
Em 02-08-2010 04:27, Richard Zidlicky escreveu:
Quoted 18 lines · Mauro Carvalho Chehab
Quoted 11 lines
Add the proper gpio port for WinTV MiniStick, with the information provided by Michael.
Thanks-to: Michael Krufky <[email protected]>
Signed-off-by Mauro Carvalho Chehab <[email protected]>drivers/media/dvb/siano/sms-cards.c +0
-0drivers/media/dvb/siano/sms-cards.c static struct sms_board sms_boards[] = { · line 70
Quoted 4 lines
drivers/media/dvb/siano/sms-cards.c +1
-0@@ -67,6 +67,7 @@ static struct sms_board sms_boards[] = { .board_cfg.leds_power = 26, .board_cfg.led0 = 27, .board_cfg.led1 = 28, + .board_cfg.ir = 9,^^^^Quoted 6 lines
Quoted 3 lines
are you sure about this?
I am using the value of 4 for the ir port and it definitely works.. confused.
I got this from a reliable source, and that worked perfectly my with a Model 55009 LF Rev B1F7. What's the model of your device?
mine says
Quoted 7 lines
Aug 3 14:58:10 localhost kernel: [149778.591862] usb 5-5: New USB device found, idVendor=2040, idProduct=5500 Aug 3 14:58:10 localhost kernel: [149778.591865] usb 5-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Aug 3 14:58:10 localhost kernel: [149778.591868] usb 5-5: Product: WinTV MiniStick Aug 3 14:58:10 localhost kernel: [149778.591870] usb 5-5: Manufacturer: Hauppauge Computer Works Aug 3 14:58:10 localhost kernel: [149778.591872] usb 5-5: SerialNumber: f069684cnot sure what else to report.
The model number is on a label at the back of the stick (at least, mine have it).
Quoted 6 lines
I will compile and try a new kernel tonight.
Wondering - is this
http://git.sliepen.org/browse?p=inputlirc
usefull to feed the input events to LIRC when trying the new driver with a slightly older LIRC based distro?
The in-kernel lirc support need a new version of LIRC since a few ioctls numbers were changed, to avoid needing to write a code in kernel to handle compatibility between 32 and 64 bit kernels. If you're running a 32 bits kernel, it may work.
Btw, you don't need to use lirc if all you want is to replace the IR keycodes. You can use, instead, the ir-keycode program, available at http://git.linuxtv.org/v4l-utils.git. There are several keycode tables already mapped there. Of course, lirc offers some extra features.
Cheers,
Mauro.
Re: [PATCH 3/6] V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
Quoted 43 lines · Mauro Carvalho Chehab
Em 03-08-2010 10:05, Richard Zidlicky escreveu:
Quoted 30 lines
Hi,
Quoted 19 lines
Em 02-08-2010 04:27, Richard Zidlicky escreveu:
Quoted 18 lines · Mauro Carvalho Chehab
Quoted 11 lines
Add the proper gpio port for WinTV MiniStick, with the information provided by Michael.
Thanks-to: Michael Krufky <[email protected]>
Signed-off-by Mauro Carvalho Chehab <[email protected]>drivers/media/dvb/siano/sms-cards.c +0
-0drivers/media/dvb/siano/sms-cards.c static struct sms_board sms_boards[] = { · line 70
Quoted 4 lines
drivers/media/dvb/siano/sms-cards.c +1
-0@@ -67,6 +67,7 @@ static struct sms_board sms_boards[] = { .board_cfg.leds_power = 26, .board_cfg.led0 = 27, .board_cfg.led1 = 28, + .board_cfg.ir = 9,^^^^
Quoted 6 lines
Quoted 3 lines
are you sure about this?
I am using the value of 4 for the ir port and it definitely works.. confused.
I got this from a reliable source, and that worked perfectly my with a Model 55009 LF Rev B1F7. What's the model of your device?
mine says
Quoted 7 lines
Aug 3 14:58:10 localhost kernel: [149778.591862] usb 5-5: New USB device found, idVendor=2040, idProduct=5500 Aug 3 14:58:10 localhost kernel: [149778.591865] usb 5-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Aug 3 14:58:10 localhost kernel: [149778.591868] usb 5-5: Product: WinTV MiniStick
Aug 3 14:58:10 localhost kernel: [149778.591870] usb 5-5: Manufacturer: Hauppauge Computer Works Aug 3 14:58:10 localhost kernel: [149778.591872] usb 5-5: SerialNumber:f069684cnot sure what else to report.
The model number is on a label at the back of the stick (at least, mine have it).
Quoted 2 lines
I will compile and try a new kernel tonight.
Quoted 8 lines
Quoted 4 lines
Wondering - is this
http://git.sliepen.org/browse?p=inputlirc
usefull to feed the input events to LIRC when trying the new driver with a slightly older LIRC based distro?The in-kernel lirc support need a new version of LIRC since a few ioctls numbers were changed, to avoid needing to write a code in kernel to handle compatibility between 32 and 64 bit kernels. If you're running a 32 bits kernel, it may work.
Should also be able to skirt around the issue if you don't use the /dev/lircX interface to get data out of the receiver. For example, one could use the lircd devinput driver, a la "lircd -H devinput -d /dev/input/by-id/<my-remote's-input-device>", and I don't think the ioctl changes should matter.
Signature · 2 lines
Jarod Wilson [email protected]
Re: [PATCH 3/6] V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
In reply to Mauro Carvalho ChehabQuoted 1 line · Mauro Carvalho Chehab
The model number is on a label at the back of the stick (at least, mine have it).
ah.. I was wondering whichever magical tool you are using. So here is my number:
55009 LF Rev A1F7
Quoted 3 lines
Btw, you don't need to use lirc if all you want is to replace the IR keycodes. You can use, instead, the ir-keycode program, available at http://git.linuxtv.org/v4l-utils.git. There are several keycode tables already mapped there. Of course, lirc offers some extra features.
thanks for the tipps.. the userspace configuration seems more confusing than the kernel internals. So far I get keycodes that work nicely in an xterm and for controling firefox but not much else.
Richard
Re: [PATCH 3/6] V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
Em 03-08-2010 11:46, Richard Zidlicky escreveu:
Quoted 6 lines · Mauro Carvalho Chehab
Quoted 2 lines
The model number is on a label at the back of the stick (at least, mine have it).
ah.. I was wondering whichever magical tool you are using. So here is my number:
55009 LF Rev A1F7
Ok, so it is close to mine.
Quoted 7 lines
Quoted 3 lines
Btw, you don't need to use lirc if all you want is to replace the IR keycodes. You can use, instead, the ir-keycode program, available at http://git.linuxtv.org/v4l-utils.git. There are several keycode tables already mapped there. Of course, lirc offers some extra features.
thanks for the tipps.. the userspace configuration seems more confusing than the kernel internals. So far I get keycodes that work nicely in an xterm and for controling firefox but not much else.
Yes, that's the expected results without lirc. It will just use the RC as if it were a keyboard. You can play with the IR, via ir-keycode, to use a different remote controller, or to reassign a different keycode to a key. For example, reassigning the scancode for channel up as KEY_UP.
With lirc, you can also associate a keycode to an specific application, using for example, one key to open your favorite TV application. There are some discussions about having a similar support directly into X window managers, and direct support for RC into media applications, but, there's no current patches for that, afaik.
Cheers,
Mauro.
Re: [PATCH 3/6] V4L/DVB: smsusb: enable IR port for Hauppauge WinTV MiniStick
In reply to Mauro Carvalho ChehabHi,
not much success.. no key events appear in userspace, not sure if the hardware receives anything. Tried both 4 and 9 ports which does not seem to make any difference. lshal does list the IR port, as it did with the siano specific code.
Could be my fault, I have cherrypicked patches and applied them on top of Linus 2.6.35. Is there an easy way to get a diff from your version against Linus 2.6.35? I would rather not fetch the whole repo over my mobile connection;)
Aug 4 09:04:50 localhost kernel: [ 260.142019] usb 5-5: new high speed USB device using ehci_hcd and address 3 Aug 4 09:04:50 localhost kernel: [ 260.256894] usb 5-5: New USB device found, idVendor=2040, idProduct=5500 Aug 4 09:04:50 localhost kernel: [ 260.256896] usb 5-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3 Aug 4 09:04:50 localhost kernel: [ 260.256899] usb 5-5: Product: WinTV MiniStick Aug 4 09:04:50 localhost kernel: [ 260.256901] usb 5-5: Manufacturer: Hauppauge Computer Works Aug 4 09:04:50 localhost kernel: [ 260.256903] usb 5-5: SerialNumber: f069684c Aug 4 09:04:50 localhost kernel: [ 260.308378] IR NEC protocol handler initialized Aug 4 09:04:50 localhost kernel: [ 260.322270] IR RC5(x) protocol handler initialized Aug 4 09:04:50 localhost kernel: [ 260.332901] IR RC6 protocol handler initialized Aug 4 09:04:50 localhost kernel: [ 260.363497] IR JVC protocol handler initialized Aug 4 09:04:50 localhost kernel: [ 260.407230] IR Sony protocol handler initialized Aug 4 09:04:51 localhost kernel: [ 260.958061] smscore_set_device_mode: firmware download success: sms1xxx-hcw-55xxx-dvbt-02.fw Aug 4 09:04:51 localhost kernel: [ 260.958400] sms_ir_init: Allocating input device Aug 4 09:04:51 localhost kernel: [ 260.958416] sms_ir_init: IR port 0, timeout 100 ms Aug 4 09:04:51 localhost kernel: [ 260.958419] sms_ir_init: Input device (IR) SMS IR (Hauppauge WinTV MiniStick) is set for key events Aug 4 09:04:51 localhost kernel: [ 261.010020] Registered IR keymap rc-rc5-hauppauge-new Aug 4 09:04:51 localhost kernel: [ 261.010571] input: SMS IR (Hauppauge WinTV MiniStick) as /devices/pci0000:00/0000:00:1d.7/usb 5/5-5/rc/rc0/input5 Aug 4 09:04:51 localhost kernel: [ 261.010797] rc0: SMS IR (Hauppauge WinTV MiniStick) as /devices/pci0000:00/0000:00:1d.7/usb5/ 5-5/rc/rc0 Aug 4 09:04:51 localhost kernel: [ 261.037230] DVB: registering new adapter (Hauppauge WinTV MiniStick) Aug 4 09:04:51 localhost kernel: [ 261.039296] DVB: registering adapter 0 frontend 0 (Siano Mobile Digital MDTV Receiver)... Aug 4 09:04:51 localhost kernel: [ 261.044846] usbcore: registered new interface driver smsusb
Richard
PATCH 4/6 V4L/DVB: standardize names at rc-dib0700 tables
In reply to a message not in the archiveUse a more standard way to name those tables, as they're currently used by the script that coverts those tables to be loaded via userspace.
drivers/media/IR/keymaps/rc-dib0700-nec.c +6 -6
@@ -17,7 +17,7 @@#include <media/rc-map.h> -static struct ir_scancode dib0700_table[] = { +static struct ir_scancode dib0700_nec_table[] = {/* Key codes for the Pixelview SBTVD remote */ {0x8613 ,KEY_MUTE }, {0x8612 ,KEY_POWER },
@@ -98,10 +98,10 @@ static struct ir_scancode dib0700_table[] = { { 0x4542, KEY_SELECT }, /* Select video input, 'Select' for Teletext */ }; -static struct rc_keymap dib0700_map = { +static struct rc_keymap dib0700_nec_map = { .map = { - .scan = dib0700_table, - .size =ARRAY_SIZE (dib0700_table), + .scan = dib0700_nec_table, + .size =ARRAY_SIZE (dib0700_nec_table), .ir_type =IR_TYPE_NEC , .name =RC_MAP_DIB0700_NEC_TABLE , }
@@ -109,12 +109,12 @@ static struct rc_keymap dib0700_map = {static int __init init_rc_map (void ) { -return ir_register_map (&dib0700_map); +return ir_register_map (&dib0700_nec_map); } static void __exit exit_rc_map(void) { -ir_unregister_map (&dib0700_map); +ir_unregister_map (&dib0700_nec_map); }module_init (init_rc_map)
drivers/media/IR/keymaps/rc-dib0700-rc5.c +6 -6
@@ -17,7 +17,7 @@#include <media/rc-map.h> -static struct ir_scancode dib0700_table[] = { +static struct ir_scancode dib0700_rc5_table[] = {/* Key codes for the tiny Pinnacle remote*/ {0x0700 ,KEY_MUTE }, {0x0701 ,KEY_MENU },/* Pinnacle logo */
@@ -209,10 +209,10 @@ static struct ir_scancode dib0700_table[] = { { 0x1d3d, KEY_POWER }, }; -static struct rc_keymap dib0700_map = { +static struct rc_keymap dib0700_rc5_map = { .map = { - .scan = dib0700_table, - .size =ARRAY_SIZE (dib0700_table), + .scan = dib0700_rc5_table, + .size =ARRAY_SIZE (dib0700_rc5_table), .ir_type =IR_TYPE_RC5 , .name =RC_MAP_DIB0700_RC5_TABLE , }
@@ -220,12 +220,12 @@ static struct rc_keymap dib0700_map = {static int __init init_rc_map (void ) { -return ir_register_map (&dib0700_map); +return ir_register_map (&dib0700_rc5_map); } static void __exit exit_rc_map(void) { -ir_unregister_map (&dib0700_map); +ir_unregister_map (&dib0700_rc5_map); }module_init (init_rc_map)
Signature · 1 line
1.7.1
PATCH 5/6 V4L/DVB: sms: properly initialize IR phys and IR name
In reply to a message not in the archivesms were using a non-compliant nomenclature for the USB devices. Fix it.
drivers/media/dvb/siano/smsir.c +11 -6
@@ -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 */
drivers/media/dvb/siano/smsir.h +3 -2
@@ -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;
drivers/media/dvb/siano/smsusb.c +1 -2
@@ -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 (¶ms, &dev->coredev);
Signature · 1 line
1.7.1
PATCH 6/6 V4L/DVB: sms: Convert IR support to use the Remote Controller core
In reply to a message not in the archiveRewrites the siano IR implementation. The previous implementation were non-standard. As such, it has issues if more than one device registers IR, as there used to have some static constants used during protocol decoding phase. Also, it used to implement its on RAW decoder, and only for RC5.
The new code uses RC core subsystem for handling IR. This brings several new features to the driver, including:
- Allow to dynamically replace the IR keycodes;
- Supports all existing raw decoders (JVC, NEC, RC-5, RC-6, SONY);
- Supports lirc dev;
- Doesn't have race conditions when more than one sms IR is registered;
- The code size for the IR implementation is very small;
- it exports the IR features via /sys/class/rc.
drivers/media/IR/ir-keytable.c +3 -2
@@ -497,8 +497,9 @@ int __ir_input_register(struct input_dev *input_dev, goto out_event; } -IR_dprintk (1 ,"Registered input device on %s for %s remote.\n" , - driver_name, rc_tab->name); +IR_dprintk (1 ,"Registered input device on %s for %s remote%s.\n" , + driver_name, rc_tab->name, + ir_dev->props->driver_type ==RC_DRIVER_IR_RAW ?" in raw mode" :"" );return 0 ;
drivers/media/dvb/siano/sms-cards.c +1 -0
@@ -64,6 +64,7 @@ static struct sms_board sms_boards[] = { .type = SMS_NOVA_B0, .fw[DEVICE_MODE_ISDBT_BDA] = "sms1xxx-hcw-55xxx-isdbt-02.fw", .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", + .rc_codes = RC_MAP_RC5_HAUPPAUGE_NEW, .board_cfg.leds_power = 26, .board_cfg.led0 = 27, .board_cfg.led1 = 28,
drivers/media/dvb/siano/sms-cards.h +1 -1
@@ -75,7 +75,7 @@ struct sms_board {enum sms_device_type_st type;char *name, *fw[DEVICE_MODE_MAX ];struct sms_board_gpio_cfg board_cfg; -enum ir_kb_type ir_kb_type; +char *rc_codes;/* Name of IR codes table */ /* gpios */ int led_power, led_hi, led_lo, lna_ctrl, rf_switch;
drivers/media/dvb/siano/smsir.c +33 -227
309 lines not on this page · raw message
drivers/media/dvb/siano/smsir.h +12 -50
82 lines not on this page · raw message
Signature · 1 line
1.7.1