Proposed ir-core (rc-core) changes
cover Proposed ir-core (rc-core) changes
The following series merges the different files that currently make up the ir-core module into a single-file rc-core module.
In addition, the ir_input_dev and ir_dev_props structs are replaced by a single rc_dev struct with an API similar to that of the input subsystem.
This allows the removal of all knowledge of any input devices from the rc drivers and paves the way for allowing multiple input devices per rc device in the future. The namespace conversion from ir_* to rc_* should mostly be done for the drivers with this patchset.
I have intentionally not signed off on the patches yet since they haven't been tested. I'd like your feedback on the general approach before I spend the time to properly test the result.
Also, the imon driver is not converted (and will thus break with this patchset). The reason is that the imon driver wants to generate mouse events on the input dev under the control of rc-core. I was hoping that Jarod would be willing to convert the imon driver to create a separate input device for sending mouse events to userspace :)
Comments please...
---
David Härdeman (3):
merge rc-core
remove remaining users of the ir-functions keyhandlers make rc_dev the primary interface for remote control drivers
drivers/media/IR/Makefile | 3 drivers/media/IR/ir-core-priv.h | 26 - drivers/media/IR/ir-functions.c | 96 -- drivers/media/IR/ir-jvc-decoder.c | 13 drivers/media/IR/ir-keytable.c | 552 ------------ drivers/media/IR/ir-lirc-codec.c | 75 +- drivers/media/IR/ir-nec-decoder.c | 13 drivers/media/IR/ir-raw-event.c | 270 ------ drivers/media/IR/ir-rc5-decoder.c | 13 drivers/media/IR/ir-rc6-decoder.c | 17 drivers/media/IR/ir-sony-decoder.c | 11 drivers/media/IR/ir-sysfs.c | 354 -------- drivers/media/IR/mceusb.c | 99 +- drivers/media/IR/rc-core.c | 1206 +++++++++++++++++++++++++++ drivers/media/IR/rc-map.c | 84 -- drivers/media/dvb/dm1105/dm1105.c | 45 + drivers/media/dvb/mantis/mantis_common.h | 4 drivers/media/dvb/mantis/mantis_input.c | 61 + drivers/media/dvb/ttpci/budget-ci.c | 49 - drivers/media/video/bt8xx/bttv-input.c | 67 +- drivers/media/video/bt8xx/bttvp.h | 1 drivers/media/video/cx18/cx18-i2c.c | 1 drivers/media/video/cx23885/cx23885-input.c | 93 -- drivers/media/video/cx88/cx88-input.c | 86 +- drivers/media/video/em28xx/em28xx-input.c | 71 +- drivers/media/video/ir-kbd-i2c.c | 41 - drivers/media/video/ivtv/ivtv-i2c.c | 3 drivers/media/video/saa7134/saa7134-input.c | 121 +-- include/media/ir-common.h | 32 - include/media/ir-core.h | 155 ++- include/media/ir-kbd-i2c.h | 5 31 files changed, 1655 insertions(+), 2012 deletions(-) delete mode 100644 drivers/media/IR/ir-keytable.c delete mode 100644 drivers/media/IR/ir-raw-event.c delete mode 100644 drivers/media/IR/ir-sysfs.c create mode 100644 drivers/media/IR/rc-core.c delete mode 100644 drivers/media/IR/rc-map.c
PATCH 1/3 merge rc-core
This patch merges the files which makes up ir-core and renames the resulting module to rc-core. IMHO this makes it much easier to hack on the core module since all code is in one file.
This also allows some simplification of ir-core-priv.h as less internal functions need to be exposed.
--- drivers/media/IR/Makefile | 3 drivers/media/IR/ir-core-priv.h | 16 - drivers/media/IR/ir-keytable.c | 552 ------------------ drivers/media/IR/ir-raw-event.c | 270 --------- drivers/media/IR/ir-sysfs.c | 354 ----------- drivers/media/IR/rc-core.c | 1206 +++++++++++++++++++++++++++++++++++++++ drivers/media/IR/rc-map.c | 84 --- include/media/ir-core.h | 3 8 files changed, 1207 insertions(+), 1281 deletions(-) delete mode 100644 drivers/media/IR/ir-keytable.c delete mode 100644 drivers/media/IR/ir-raw-event.c delete mode 100644 drivers/media/IR/ir-sysfs.c create mode 100644 drivers/media/IR/rc-core.c delete mode 100644 drivers/media/IR/rc-map.c
drivers/media/IR/Makefile +1 -2
@@ -1,9 +1,8 @@ ir-common-objs := ir-functions.o -ir-core-objs := ir-keytable.o ir-sysfs.o ir-raw-event.o rc-map.o obj-y += keymaps/ -obj-$(CONFIG_IR_CORE) += ir-core.o +obj-$(CONFIG_IR_CORE) += rc-core.o obj-$(CONFIG_VIDEO_IR) += ir-common.o obj-$(CONFIG_LIRC) += lirc_dev.o obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o
drivers/media/IR/ir-core-priv.h +0 -16
@@ -108,24 +108,8 @@ static inline void decrease_duration(struct ir_raw_event *ev, unsigned duration)#define TO_STR (is_pulse) ((is_pulse) ? "pulse" : "space")#define IS_RESET (ev) (ev.duration == 0) -/* -* Routines from ir-sysfs.c - Meant to be called only internally inside -* ir-core -*/ - -int ir_register_class (struct input_dev *input_dev); -void ir_unregister_class (struct input_dev *input_dev); - -/* -* Routines from ir-raw-event.c to be used internally and by decoders -*/ -u64 ir_raw_get_allowed_protocols (void ); -int ir_raw_event_register (struct input_dev *input_dev); -void ir_raw_event_unregister (struct input_dev *input_dev);int ir_raw_handler_register (struct ir_raw_handler *ir_raw_handler);void ir_raw_handler_unregister (struct ir_raw_handler *ir_raw_handler); -void ir_raw_init (void ); -/* * Decoder initialization code
drivers/media/IR/ir-keytable.c deleted +0 -552
552 lines not on this page · raw message
drivers/media/IR/ir-raw-event.c deleted +0 -270
270 lines not on this page · raw message
drivers/media/IR/ir-sysfs.c deleted +0 -354
354 lines not on this page · raw message
drivers/media/IR/rc-core.c new file +1206 -0
1,206 lines not on this page · raw message
drivers/media/IR/rc-map.c deleted +0 -84
84 lines not on this page · raw message
include/media/ir-core.h +0 -3
@@ -92,7 +92,6 @@ enum raw_event_type {#define to_ir_input_dev (_attr) container_of(_attr, struct ir_input_dev, attr) -/* From ir-keytable.c */ int __ir_input_register(struct input_dev *dev, const struct ir_scancode_table *ir_codes, const struct ir_dev_props *props,
@@ -132,8 +131,6 @@ void ir_repeat(struct input_dev *dev);void ir_keydown (struct input_dev *dev,int scancode,u8 toggle);u32 ir_g_keycode_from_table (struct input_dev *input_dev,u32 scancode); -/* From ir-raw-event.c */ -struct ir_raw_event {unsigned pulse:1 ;unsigned duration:31 ;
PATCH 2/3 remove remaining users of the ir-functions keyhandlers
In reply to David HärdemanThis patch removes the remaining usages of the ir_input_nokey() and ir_input_keydown() functions provided by drivers/media/IR/ir-functions.c by using the corresponding functionality in rc-core directly instead.
--- drivers/media/IR/ir-functions.c | 96 ++--------------------- drivers/media/IR/rc-core.c | 114 +++++++++++++++++++++------ drivers/media/video/bt8xx/bttv-input.c | 26 ++---- drivers/media/video/bt8xx/bttvp.h | 1 drivers/media/video/cx18/cx18-i2c.c | 1 drivers/media/video/cx23885/cx23885-input.c | 59 +------------- drivers/media/video/cx88/cx88-input.c | 24 ++---- drivers/media/video/ir-kbd-i2c.c | 14 --- drivers/media/video/ivtv/ivtv-i2c.c | 3 - drivers/media/video/saa7134/saa7134-input.c | 50 ++---------- include/media/ir-common.h | 29 +------ include/media/ir-core.h | 2 include/media/ir-kbd-i2c.h | 3 - 13 files changed, 131 insertions(+), 291 deletions(-)
drivers/media/IR/ir-functions.c +8 -88
@@ -1,7 +1,8 @@/* * -* some common structs and functions to handle infrared remotes via -* input layer ... +* some common functions to handle infrared remote protocol decoding for +* drivers which have not yet been (or can't be) converted to use the +* regular protocol decoders... * * (c) 2003 Gerd Knorr <[email protected]> [SuSE Labs] *
@@ -31,67 +32,6 @@MODULE_AUTHOR ("Gerd Knorr <[email protected]> [SuSE Labs]" );MODULE_LICENSE ("GPL" ); -static int repeat =1 ; -module_param (repeat, int,0444 ); -MODULE_PARM_DESC (repeat,"auto-repeat for IR keys (default: on)" ); - -/* -------------------------------------------------------------------------- */ - -static void ir_input_key_event (struct input_dev *dev,struct ir_input_state *ir) -{ -if (KEY_RESERVED == ir->keycode) { -printk (KERN_INFO "%s: unknown key: key=0x%02x down=%d\n" , - dev->name, ir->ir_key, ir->keypressed); -return ; - } -IR_dprintk (1 ,"%s: key event code=%d down=%d\n" , - dev->name,ir->keycode,ir->keypressed); -input_report_key (dev,ir->keycode,ir->keypressed); -input_sync (dev); -} - -/* -------------------------------------------------------------------------- */ - -int ir_input_init (struct input_dev *dev,struct ir_input_state *ir, -const u64 ir_type) -{ - ir->ir_type = ir_type; - -if (repeat) -set_bit (EV_REP , dev->evbit); - -return 0 ; -} -EXPORT_SYMBOL_GPL (ir_input_init); - - -void ir_input_nokey (struct input_dev *dev,struct ir_input_state *ir) -{ -if (ir->keypressed) { - ir->keypressed =0 ; -ir_input_key_event (dev,ir); - } -} -EXPORT_SYMBOL_GPL (ir_input_nokey); - -void ir_input_keydown (struct input_dev *dev,struct ir_input_state *ir, -u32 ir_key) -{ -u32 keycode =ir_g_keycode_from_table (dev, ir_key); - -if (ir->keypressed && ir->keycode != keycode) { - ir->keypressed =0 ; -ir_input_key_event (dev,ir); - } -if (!ir->keypressed) { - ir->ir_key = ir_key; - ir->keycode = keycode; - ir->keypressed =1 ; -ir_input_key_event (dev,ir); - } -} -EXPORT_SYMBOL_GPL (ir_input_keydown); -/* -------------------------------------------------------------------------- */ /* extract mask bits out of data and pack them into the result */ u32 ir_extract_bits (u32 data,u32 mask)
@@ -284,7 +224,7 @@ void ir_rc5_timer_end(unsigned long data) {struct card_ir *ir = (struct card_ir *)data;struct timeval tv; -unsigned long current_jiffies, timeout; +unsigned long current_jiffies;u32 gap;u32 rc5 =0 ;
@@ -325,32 +265,12 @@ void ir_rc5_timer_end(unsigned long data)u32 toggle =RC5_TOGGLE (rc5);u32 instr =RC5_INSTR (rc5); -/* Good code, decide if repeat/repress */ -if (toggle !=RC5_TOGGLE (ir->last_rc5) || - instr !=RC5_INSTR (ir->last_rc5)) { -IR_dprintk (1 ,"ir-common: instruction %x, toggle %x\n" , instr, - toggle); -ir_input_nokey (ir->dev, &ir->ir); -ir_input_keydown (ir->dev, &ir->ir, instr); - } - -/* Set/reset key-up timer */ - timeout = current_jiffies + -msecs_to_jiffies (ir->rc5_key_timeout); -mod_timer (&ir->timer_keyup, timeout); - -/* Save code for repeat test */ - ir->last_rc5 = rc5; +/* Good code */ +ir_keydown (ir->dev, instr, toggle); +IR_dprintk (1 ,"ir-common: instruction %x, toggle %x\n" , instr, + toggle); } } }EXPORT_SYMBOL_GPL (ir_rc5_timer_end); -void ir_rc5_timer_keyup (unsigned long data) -{ -struct card_ir *ir = (struct card_ir *)data; - -IR_dprintk (1 ,"ir-common: key released\n" ); -ir_input_nokey (ir->dev, &ir->ir); -} -EXPORT_SYMBOL_GPL (ir_rc5_timer_keyup);
drivers/media/IR/rc-core.c +87 -27
168 lines not on this page · raw message
drivers/media/video/bt8xx/bttv-input.c +7 -19
@@ -38,8 +38,6 @@ module_param(repeat_period, int, 0644);static int ir_rc5_remote_gap =885 ;module_param (ir_rc5_remote_gap, int,0644 ); -static int ir_rc5_key_timeout =200 ; -module_param (ir_rc5_key_timeout, int,0644 );#undef dprintk #define dprintk(arg...) do { \
@@ -76,14 +74,14 @@ static void ir_handle_key(struct bttv *btv)if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { -ir_input_keydown (ir->dev, &ir->ir, data); +ir_keydown_notimeout (ir->dev, data,0 ); }else {/* HACK: Probably, ir->mask_keydown is missing for this board */ if (btv->c.type ==BTTV_BOARD_WINFAST2000 ) -ir_input_keydown (ir->dev, &ir->ir, data); +ir_keydown (ir->dev, data,0 ); -ir_input_nokey (ir->dev,&ir->ir); +ir_keyup (ir->dev); } }
@@ -107,9 +105,9 @@ static void ir_enltv_handle_key(struct bttv *btv) gpio, data, (gpio & ir->mask_keyup) ? " up" : "up/down"); -ir_input_keydown (ir->dev, &ir->ir, data); +ir_keydown_notimeout (ir->dev, data,0 );if (keyup) -ir_input_nokey (ir->dev, &ir->ir); +ir_keyup (ir->dev); }else {if ((ir->last_gpio &1 <<31 ) == keyup)return ;
@@ -119,9 +117,9 @@ static void ir_enltv_handle_key(struct bttv *btv) (gpio & ir->mask_keyup) ? " up" : "down");if (keyup) -ir_input_nokey (ir->dev, &ir->ir); +ir_keyup (ir->dev);else -ir_input_keydown (ir->dev, &ir->ir, data); +ir_keydown_notimeout (ir->dev, data,0 ); } ir->last_gpio = data | keyup;
@@ -215,14 +213,9 @@ static void bttv_ir_start(struct bttv *btv, struct card_ir *ir)init_timer (&ir->timer_end); ir->timer_end.function = ir_rc5_timer_end; ir->timer_end.data = (unsigned long )ir; - -init_timer (&ir->timer_keyup); - ir->timer_keyup.function = ir_rc5_timer_keyup; - ir->timer_keyup.data = (unsigned long )ir; ir->shift_by =1 ; ir->start =3 ; ir->addr =0x0 ; - ir->rc5_key_timeout = ir_rc5_key_timeout; ir->rc5_remote_gap = ir_rc5_remote_gap; } }
@@ -250,7 +243,6 @@ int bttv_input_init(struct bttv *btv)struct card_ir *ir;char *ir_codes =NULL ;struct input_dev *input_dev; -u64 ir_type =IR_TYPE_OTHER ;int err = -ENOMEM ;if (!btv->has_remote)
@@ -371,10 +363,6 @@ int bttv_input_init(struct bttv *btv)snprintf (ir->phys,sizeof (ir->phys),"pci-%s/ir0" ,pci_name (btv->c.pci)); - err =ir_input_init (input_dev, &ir->ir, ir_type); -if (err <0 ) - goto err_out_free; - input_dev->name = ir->name; input_dev->phys = ir->phys; input_dev->id.bustype =BUS_PCI ;
drivers/media/video/bt8xx/bttvp.h +0 -1
@@ -301,7 +301,6 @@ struct bttv_pll_info {/* for gpio-connected remote control */ struct bttv_input {struct input_dev *dev; -struct ir_input_state ir;char name[32 ];char phys[32 ];u32 mask_keycode;
drivers/media/video/cx18/cx18-i2c.c +0 -1
@@ -111,7 +111,6 @@ static int cx18_i2c_new_ir(struct cx18 *cx, struct i2c_adapter *adap, u32 hw,case CX18_HW_Z8F0811_IR_RX_HAUP : init_data->ir_codes =RC_MAP_HAUPPAUGE_NEW ; init_data->internal_get_key_func =IR_KBD_GET_KEY_HAUP_XVR ; - init_data->type =IR_TYPE_RC5 ; init_data->name = cx->card_name; info.platform_data = init_data;break ;
drivers/media/video/cx23885/cx23885-input.c +3 -56
125 lines not on this page · raw message
drivers/media/video/cx88/cx88-input.c +10 -14
@@ -41,7 +41,6 @@ struct cx88_IR {struct cx88_core *core;struct input_dev *input;struct ir_dev_props props; -u64 ir_type;int users;
@@ -125,21 +124,27 @@ static void cx88_ir_handle_key(struct cx88_IR *ir) data = (data <<4 ) | ((gpio_key &0xf0 ) >>4 ); -ir_keydown (ir->input, data,0 ); +ir_keydown_notimeout (ir->input, data,0 ); +ir_keyup (ir->input); }else if (ir->mask_keydown) {/* bit set on keydown */ if (gpio & ir->mask_keydown) -ir_keydown (ir->input, data,0 ); +ir_keydown_notimeout (ir->input, data,0 ); +else +ir_keyup (ir->input); }else if (ir->mask_keyup) {/* bit cleared on keydown */ if (0 == (gpio & ir->mask_keyup)) -ir_keydown (ir->input, data,0 ); +ir_keydown_notimeout (ir->input, data,0 ); +else +ir_keyup (ir->input); }else {/* can't distinguish keydown/up :-/ */ -ir_keydown (ir->input, data,0 ); +ir_keydown_notimeout (ir->input, data,0 ); +ir_keyup (ir->input); } }
@@ -238,7 +243,6 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)struct cx88_IR *ir;struct input_dev *input_dev;char *ir_codes =NULL ; -u64 ir_type =IR_TYPE_OTHER ;int err = -ENOMEM ;u32 hardware_mask =0 ;/* For devices with a hardware mask, when * used with a full-code IR table
@@ -264,7 +268,6 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)break ;case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1 : ir_codes =RC_MAP_CINERGY_1400 ; - ir_type =IR_TYPE_NEC ; ir->sampling =0xeb04 ;/* address */ break ;case CX88_BOARD_HAUPPAUGE :
@@ -279,7 +282,6 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)case CX88_BOARD_PCHDTV_HD5500 :case CX88_BOARD_HAUPPAUGE_IRONLY : ir_codes =RC_MAP_HAUPPAUGE_NEW ; - ir_type =IR_TYPE_RC5 ; ir->sampling =1 ;break ;case CX88_BOARD_WINFAST_DTV2000H :
@@ -367,18 +369,15 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)case CX88_BOARD_PROF_7301 :case CX88_BOARD_PROF_6200 : ir_codes =RC_MAP_TBS_NEC ; - ir_type =IR_TYPE_NEC ; ir->sampling =0xff00 ;/* address */ break ;case CX88_BOARD_TEVII_S460 :case CX88_BOARD_TEVII_S420 : ir_codes =RC_MAP_TEVII_NEC ; - ir_type =IR_TYPE_NEC ; ir->sampling =0xff00 ;/* address */ break ;case CX88_BOARD_DNTV_LIVE_DVB_T_PRO : ir_codes =RC_MAP_DNTV_LIVE_DVBT_PRO ; - ir_type =IR_TYPE_NEC ; ir->sampling =0xff00 ;/* address */ break ;case CX88_BOARD_NORWOOD_MICRO :
@@ -396,7 +395,6 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)break ;case CX88_BOARD_PINNACLE_PCTV_HD_800i: ir_codes =RC_MAP_PINNACLE_PCTV_HD ; - ir_type =IR_TYPE_RC5 ; ir->sampling =1 ;break ;case CX88_BOARD_POWERCOLOR_REAL_ANGEL :
@@ -431,8 +429,6 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)snprintf (ir->name,sizeof (ir->name),"cx88 IR (%s)" , core->board.name);snprintf (ir->phys,sizeof (ir->phys),"pci-%s/ir0" ,pci_name (pci)); - ir->ir_type = ir_type; - input_dev->name = ir->name; input_dev->phys = ir->phys; input_dev->id.bustype =BUS_PCI ;
drivers/media/video/ir-kbd-i2c.c +1 -13
@@ -296,7 +296,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) {char *ir_codes =NULL ;const char *name =NULL ; -u64 ir_type =0 ;struct IR_i2c *ir;struct input_dev *input_dev;struct i2c_adapter *adap = client->adapter;
@@ -318,13 +317,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)case 0x64 : name ="Pixelview" ; ir->get_key = get_key_pixelview; - ir_type =IR_TYPE_OTHER ; ir_codes =RC_MAP_EMPTY ;break ;case 0x4b : name ="PV951" ; ir->get_key = get_key_pv951; - ir_type =IR_TYPE_OTHER ; ir_codes =RC_MAP_PV951 ;break ;case 0x18 :
@@ -332,7 +329,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)case 0x1a : name ="Hauppauge" ; ir->get_key = get_key_haup; - ir_type =IR_TYPE_RC5 ;if (hauppauge ==1 ) { ir_codes =RC_MAP_HAUPPAUGE_NEW ; }else {
@@ -342,13 +338,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)case 0x30 : name ="KNC One" ; ir->get_key = get_key_knc1; - ir_type =IR_TYPE_OTHER ; ir_codes =RC_MAP_EMPTY ;break ;case 0x6b : name ="FusionHDTV" ; ir->get_key = get_key_fusionhdtv; - ir_type =IR_TYPE_RC5 ; ir_codes =RC_MAP_FUSIONHDTV_MCE ;break ;case 0x0b :
@@ -359,7 +353,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)/* Handled by cx88-input */ name = adap->id ==I2C_HW_B_CX2341X ?"CX2341x remote" :"CX2388x remote" ; - ir_type =IR_TYPE_RC5 ; ir->get_key = get_key_haup_xvr;if (hauppauge ==1 ) { ir_codes =RC_MAP_HAUPPAUGE_NEW ;
@@ -369,13 +362,11 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) }else {/* Handled by saa7134-input */ name ="SAA713x remote" ; - ir_type =IR_TYPE_OTHER ; }break ;case 0x40 : name ="AVerMedia Cardbus remote" ; ir->get_key = get_key_avermedia_cardbus; - ir_type =IR_TYPE_OTHER ; ir_codes =RC_MAP_AVERMEDIA_CARDBUS ;break ; }
@@ -387,8 +378,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) ir_codes = init_data->ir_codes; name = init_data->name; -if (init_data->type) - ir_type = init_data->type;switch (init_data->internal_get_key_func) {case IR_KBD_GET_KEY_CUSTOM :
@@ -420,7 +409,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) }/* Make sure we are all setup before going on */ -if (!name || !ir->get_key || !ir_type || !ir_codes) { +if (!name || !ir->get_key || !ir_codes) {dprintk (1 ,": Unsupported device at address 0x%02x\n" , addr); err = -ENODEV ;
@@ -436,7 +425,6 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) dev_name(&client->dev));/* init + register input device */ - ir->ir_type = ir_type; input_dev->id.bustype =BUS_I2C ; input_dev->name = ir->name; input_dev->phys = ir->phys;
drivers/media/video/ivtv/ivtv-i2c.c +0 -3
@@ -196,7 +196,6 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr) init_data->ir_codes =RC_MAP_AVERMEDIA_CARDBUS ; init_data->internal_get_key_func =IR_KBD_GET_KEY_AVERMEDIA_CARDBUS ; - init_data->type =IR_TYPE_OTHER ; init_data->name ="AVerMedia AVerTV card" ;break ;case IVTV_HW_I2C_IR_RX_HAUP_EXT :
@@ -204,14 +203,12 @@ static int ivtv_i2c_new_ir(struct ivtv *itv, u32 hw, const char *type, u8 addr)/* Default to old black remote */ init_data->ir_codes =RC_MAP_RC5_TV ; init_data->internal_get_key_func =IR_KBD_GET_KEY_HAUP ; - init_data->type =IR_TYPE_RC5 ; init_data->name = itv->card_name;break ;case IVTV_HW_Z8F0811_IR_RX_HAUP :/* Default to grey remote */ init_data->ir_codes =RC_MAP_HAUPPAUGE_NEW ; init_data->internal_get_key_func =IR_KBD_GET_KEY_HAUP_XVR ; - init_data->type =IR_TYPE_RC5 ; init_data->name = itv->card_name;break ; }
drivers/media/video/saa7134/saa7134-input.c +10 -40
123 lines not on this page · raw message
include/media/ir-common.h +3 -26
@@ -1,7 +1,8 @@/* * -* some common structs and functions to handle infrared remotes via -* input layer ... +* some common functions to handle infrared remote protocol decoding for +* drivers which have not yet been (or can't be) converted to use the +* regular protocol decoders... * * (c) 2003 Gerd Knorr <[email protected]> [SuSE Labs] *
@@ -33,30 +34,17 @@#define RC5_ADDR (x) (((x)>>6)&31)#define RC5_INSTR (x) ((x)&63) -struct ir_input_state { -/* configuration */ -u64 ir_type; - -/* key info */ -u32 ir_key;/* ir scancode */ -u32 keycode;/* linux key code */ -int keypressed;/* current state */ -}; -/* this was saa7134_ir and bttv_ir, moved here for * rc5 decoding. */ struct card_ir {struct input_dev *dev; -struct ir_input_state ir;char name[32 ];char phys[32 ];int users; -u32 running:1 ;struct ir_dev_props props;/* Usual gpio signalling */ -u32 mask_keycode;u32 mask_keydown;u32 mask_keyup;
@@ -65,7 +53,6 @@ struct card_ir {int shift_by;int start;// What should RC5_START() be int addr;// What RC5_ADDR() should be. -int rc5_key_timeout;int rc5_remote_gap;struct work_struct work;struct timer_list timer;
@@ -73,8 +60,6 @@ struct card_ir {/* RC5 gpio */ u32 rc5_gpio;struct timer_list timer_end;/* timer_end for code completion */ -struct timer_list timer_keyup;/* timer_end for key release */ -u32 last_rc5;/* last good rc5 code */ u32 last_bit;/* last raw bit seen */ u32 code;/* raw code under construction */ struct timeval base_time;/* time of last seen code */
@@ -89,19 +74,11 @@ struct card_ir { };/* Routines from ir-functions.c */ - -int ir_input_init (struct input_dev *dev,struct ir_input_state *ir, -const u64 ir_type); -void ir_input_nokey (struct input_dev *dev,struct ir_input_state *ir); -void ir_input_keydown (struct input_dev *dev,struct ir_input_state *ir, -u32 ir_key);u32 ir_extract_bits (u32 data,u32 mask);int ir_dump_samples (u32 *samples,int count);int ir_decode_biphase (u32 *samples,int count,int low,int high);int ir_decode_pulsedistance (u32 *samples,int count,int low,int high);u32 ir_rc5_decode (unsigned int code); -void ir_rc5_timer_end (unsigned long data); -void ir_rc5_timer_keyup (unsigned long data);#endif
include/media/ir-core.h +2 -0
@@ -128,7 +128,9 @@ static inline int ir_input_register(struct input_dev *dev,void ir_input_unregister (struct input_dev *input_dev);void ir_repeat (struct input_dev *dev); +void ir_keyup (struct input_dev *dev);void ir_keydown (struct input_dev *dev,int scancode,u8 toggle); +void ir_keydown_notimeout (struct input_dev *dev,int scancode,u8 toggle);u32 ir_g_keycode_from_table (struct input_dev *input_dev,u32 scancode);struct ir_raw_event {
include/media/ir-kbd-i2c.h +0 -3
@@ -10,8 +10,6 @@ struct IR_i2c {struct i2c_client *c;struct input_dev *input; -struct ir_input_state ir; -u64 ir_type;/* Used to avoid fast repeating */ unsigned char old;
@@ -36,7 +34,6 @@ enum ir_kbd_get_key_fn {struct IR_i2c_init_data {char *ir_codes;const char *name; -u64 type;/* IR_TYPE_RC5, etc */ /* * Specify either a function pointer or a value indicating one of * ir_kbd_i2c's internal get_key functions
PATCH 3/3 make rc_dev the primary interface for remote control drivers
In reply to David HärdemanThis patch merges the ir_input_dev and ir_dev_props structs into a single struct called rc_dev. The drivers and various functions in rc-core used by the drivers are also changed to use rc_dev as the primary interface when dealing with rc-core.
This means that the input_dev is abstracted away from the drivers which is necessary if we ever want to support multiple input devs per rc device.
The new API is similar to what the input subsystem uses, i.e:rc_device_alloc()rc_device_free()rc_device_register()rc_device_unregister()
Note that this patch (in its current state) has not been tested and will break the imon driver since it hasn't been converted yet.
--- drivers/media/IR/ir-core-priv.h | 10 drivers/media/IR/ir-jvc-decoder.c | 13 - drivers/media/IR/ir-lirc-codec.c | 75 +-- drivers/media/IR/ir-nec-decoder.c | 13 - drivers/media/IR/ir-rc5-decoder.c | 13 - drivers/media/IR/ir-rc6-decoder.c | 17 - drivers/media/IR/ir-sony-decoder.c | 11 drivers/media/IR/mceusb.c | 99 ++-- drivers/media/IR/rc-core.c | 630 ++++++++++++--------------- drivers/media/dvb/dm1105/dm1105.c | 45 +- drivers/media/dvb/mantis/mantis_common.h | 4 drivers/media/dvb/mantis/mantis_input.c | 61 +-- drivers/media/dvb/ttpci/budget-ci.c | 49 +- drivers/media/video/bt8xx/bttv-input.c | 41 +- drivers/media/video/cx23885/cx23885-input.c | 34 + drivers/media/video/cx88/cx88-input.c | 78 ++- drivers/media/video/em28xx/em28xx-input.c | 71 +-- drivers/media/video/ir-kbd-i2c.c | 27 + drivers/media/video/saa7134/saa7134-input.c | 71 +-- include/media/ir-common.h | 3 include/media/ir-core.h | 154 +++---- include/media/ir-kbd-i2c.h | 2 22 files changed, 699 insertions(+), 822 deletions(-)
drivers/media/IR/ir-core-priv.h +5 -5
@@ -23,11 +23,11 @@ struct ir_raw_handler {struct list_head list;u64 protocols;/* which are handled by this handler */ -int (*decode)(struct input_dev *input_dev,struct ir_raw_event event); +int (*decode)(struct rc_dev *dev,struct ir_raw_event event);/* These two should only be used by the lirc decoder */ -int (*raw_register)(struct input_dev *input_dev); -int (*raw_unregister)(struct input_dev *input_dev); +int (*raw_register)(struct rc_dev *dev); +int (*raw_unregister)(struct rc_dev *dev); };struct ir_raw_event_ctrl {
@@ -36,7 +36,7 @@ struct ir_raw_event_ctrl {struct kfifo kfifo;/* fifo for the pulse/space durations */ ktime_t last_event;/* when last event occurred */ enum raw_event_type last_type;/* last event type */ -struct input_dev *input_dev;/* pointer to the parent input_dev */ +struct rc_dev *dev;/* pointer to the parent rc_dev */ u64 enabled_protocols;/* enabled raw protocol decoders */ /* raw decoder state follows */
@@ -74,7 +74,7 @@ struct ir_raw_event_ctrl {bool toggle; } jvc;struct lirc_codec { -struct ir_input_dev *ir_dev; +struct rc_dev *dev;struct lirc_driver *drv;int lircdata; } lirc;
drivers/media/IR/ir-jvc-decoder.c +6 -7
@@ -36,17 +36,16 @@ enum jvc_state {/** * ir_jvc_decode() - Decode one JVC pulse or space -* @input_dev: the struct input_dev descriptor of the device +* @dev: the struct rc_dev descriptor of the device * @duration: the struct ir_raw_event descriptor of the pulse/space * * This function returns -EINVAL if the pulse violates the state machine */ -static int ir_jvc_decode (struct input_dev *input_dev,struct ir_raw_event ev) +static int ir_jvc_decode (struct rc_dev *dev,struct ir_raw_event ev) { -struct ir_input_dev *ir_dev =input_get_drvdata (input_dev); -struct jvc_dec *data = &ir_dev->raw->jvc; +struct jvc_dec *data = &dev->raw->jvc; -if (!(ir_dev->raw->enabled_protocols &IR_TYPE_JVC )) +if (!(dev->raw->enabled_protocols &IR_TYPE_JVC ))return 0 ;if (IS_RESET (ev)) {
@@ -137,12 +136,12 @@ static int ir_jvc_decode(struct input_dev *input_dev, struct ir_raw_event ev) scancode = (bitrev8 ((data->bits >>8 ) &0xff ) <<8 ) | (bitrev8 ((data->bits >>0 ) &0xff ) <<0 );IR_dprintk (1 ,"JVC scancode 0x%04x\n" , scancode); -ir_keydown (input_dev, scancode, data->toggle); +ir_keydown (dev, scancode, data->toggle); data->first = false; data->old_bits = data->bits; }else if (data->bits == data->old_bits) {IR_dprintk (1 ,"JVC repeat\n" ); -ir_repeat (input_dev); +ir_repeat (dev); }else {IR_dprintk (1 ,"JVC invalid repeat msg\n" );break ;
drivers/media/IR/ir-lirc-codec.c +34 -41
178 lines not on this page · raw message
drivers/media/IR/ir-nec-decoder.c +6 -7
@@ -38,19 +38,18 @@ enum nec_state {/** * ir_nec_decode() - Decode one NEC pulse or space -* @input_dev: the struct input_dev descriptor of the device +* @dev: the struct rc_dev descriptor of the device * @duration: the struct ir_raw_event descriptor of the pulse/space * * This function returns -EINVAL if the pulse violates the state machine */ -static int ir_nec_decode (struct input_dev *input_dev,struct ir_raw_event ev) +static int ir_nec_decode (struct rc_dev *dev,struct ir_raw_event ev) { -struct ir_input_dev *ir_dev =input_get_drvdata (input_dev); -struct nec_dec *data = &ir_dev->raw->nec; +struct nec_dec *data = &dev->raw->nec;u32 scancode;u8 address, not_address, command, not_command; -if (!(ir_dev->raw->enabled_protocols &IR_TYPE_NEC )) +if (!(dev->raw->enabled_protocols &IR_TYPE_NEC ))return 0 ;if (IS_RESET (ev)) {
@@ -83,7 +82,7 @@ static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev) data->state =STATE_BIT_PULSE ;return 0 ; }else if (eq_margin (ev.duration,NEC_REPEAT_SPACE ,NEC_UNIT /2 )) { -ir_repeat (input_dev); +ir_repeat (dev);IR_dprintk (1 ,"Repeat last key\n" ); data->state =STATE_TRAILER_PULSE ;return 0 ;
@@ -159,7 +158,7 @@ static int ir_nec_decode(struct input_dev *input_dev, struct ir_raw_event ev)IR_dprintk (1 ,"NEC scancode 0x%04x\n" , scancode); } -ir_keydown (input_dev, scancode,0 ); +ir_keydown (dev, scancode,0 ); data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/IR/ir-rc5-decoder.c +6 -7
@@ -40,19 +40,18 @@ enum rc5_state {/** * ir_rc5_decode() - Decode one RC-5 pulse or space -* @input_dev: the struct input_dev descriptor of the device +* @dev: the struct rc_dev descriptor of the device * @ev: the struct ir_raw_event descriptor of the pulse/space * * This function returns -EINVAL if the pulse violates the state machine */ -static int ir_rc5_decode (struct input_dev *input_dev,struct ir_raw_event ev) +static int ir_rc5_decode (struct rc_dev *dev,struct ir_raw_event ev) { -struct ir_input_dev *ir_dev =input_get_drvdata (input_dev); -struct rc5_dec *data = &ir_dev->raw->rc5; +struct rc5_dec *data = &dev->raw->rc5;u8 toggle;u32 scancode; -if (!(ir_dev->raw->enabled_protocols &IR_TYPE_RC5 )) +if (!(dev->raw->enabled_protocols &IR_TYPE_RC5 ))return 0 ;if (IS_RESET (ev)) {
@@ -95,7 +94,7 @@ again:return 0 ;case STATE_BIT_END : -if (!is_transition (&ev, &ir_dev->raw->prev_ev)) +if (!is_transition (&ev, &dev->raw->prev_ev))break ;if (data->count == data->wanted_bits)
@@ -150,7 +149,7 @@ again: scancode, toggle); } -ir_keydown (input_dev, scancode, toggle); +ir_keydown (dev, scancode, toggle); data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/IR/ir-rc6-decoder.c +8 -9
@@ -70,19 +70,18 @@ static enum rc6_mode rc6_mode(struct rc6_dec *data)/** * ir_rc6_decode() - Decode one RC6 pulse or space -* @input_dev: the struct input_dev descriptor of the device +* @dev: the struct rc_dev descriptor of the device * @ev: the struct ir_raw_event descriptor of the pulse/space * * This function returns -EINVAL if the pulse violates the state machine */ -static int ir_rc6_decode (struct input_dev *input_dev,struct ir_raw_event ev) +static int ir_rc6_decode (struct rc_dev *dev,struct ir_raw_event ev) { -struct ir_input_dev *ir_dev =input_get_drvdata (input_dev); -struct rc6_dec *data = &ir_dev->raw->rc6; +struct rc6_dec *data = &dev->raw->rc6;u32 scancode;u8 toggle; -if (!(ir_dev->raw->enabled_protocols &IR_TYPE_RC6 )) +if (!(dev->raw->enabled_protocols &IR_TYPE_RC6 ))return 0 ;if (IS_RESET (ev)) {
@@ -138,7 +137,7 @@ again:return 0 ;case STATE_HEADER_BIT_END : -if (!is_transition (&ev, &ir_dev->raw->prev_ev)) +if (!is_transition (&ev, &dev->raw->prev_ev))break ;if (data->count ==RC6_HEADER_NBITS )
@@ -158,7 +157,7 @@ again:return 0 ;case STATE_TOGGLE_END : -if (!is_transition (&ev, &ir_dev->raw->prev_ev) || +if (!is_transition (&ev, &dev->raw->prev_ev) || !geq_margin (ev.duration,RC6_TOGGLE_END ,RC6_UNIT /2 ))break ;
@@ -203,7 +202,7 @@ again:return 0 ;case STATE_BODY_BIT_END : -if (!is_transition (&ev, &ir_dev->raw->prev_ev)) +if (!is_transition (&ev, &dev->raw->prev_ev))break ;if (data->count == data->wanted_bits)
@@ -242,7 +241,7 @@ again: goto out; } -ir_keydown (input_dev, scancode, toggle); +ir_keydown (dev, scancode, toggle); data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/IR/ir-sony-decoder.c +5 -6
@@ -33,19 +33,18 @@ enum sony_state {/** * ir_sony_decode() - Decode one Sony pulse or space -* @input_dev: the struct input_dev descriptor of the device +* @dev: the struct rc_dev descriptor of the device * @ev: the struct ir_raw_event descriptor of the pulse/space * * This function returns -EINVAL if the pulse violates the state machine */ -static int ir_sony_decode (struct input_dev *input_dev,struct ir_raw_event ev) +static int ir_sony_decode (struct rc_dev *dev,struct ir_raw_event ev) { -struct ir_input_dev *ir_dev =input_get_drvdata (input_dev); -struct sony_dec *data = &ir_dev->raw->sony; +struct sony_dec *data = &dev->raw->sony;u32 scancode;u8 device, subdevice, function; -if (!(ir_dev->raw->enabled_protocols &IR_TYPE_SONY )) +if (!(dev->raw->enabled_protocols &IR_TYPE_SONY ))return 0 ;if (IS_RESET (ev)) {
@@ -143,7 +142,7 @@ static int ir_sony_decode(struct input_dev *input_dev, struct ir_raw_event ev) scancode = device <<16 | subdevice <<8 | function;IR_dprintk (1 ,"Sony(%u) scancode 0x%05x\n" , data->count, scancode); -ir_keydown (input_dev, scancode,0 ); +ir_keydown (dev, scancode,0 ); data->state =STATE_INACTIVE ;return 0 ; }
drivers/media/IR/mceusb.c +36 -63
196 lines not on this page · raw message
drivers/media/IR/rc-core.c +285 -345
1,070 lines not on this page · raw message
drivers/media/dvb/dm1105/dm1105.c +23 -22
91 lines not on this page · raw message
drivers/media/dvb/mantis/mantis_common.h +3 -1
@@ -171,7 +171,9 @@ struct mantis_pci {struct work_struct uart_work;spinlock_t uart_lock; -struct input_dev *rc; +struct rc_dev *rc; +char input_name[80 ]; +char input_phys[80 ]; };#define MANTIS_HIF_STATUS (mantis->gpio_status)
drivers/media/dvb/mantis/mantis_input.c +34 -27
100 lines not on this page · raw message
drivers/media/dvb/ttpci/budget-ci.c +22 -27
118 lines not on this page · raw message
drivers/media/video/bt8xx/bttv-input.c +18 -23
94 lines not on this page · raw message
drivers/media/video/cx23885/cx23885-input.c +18 -16
@@ -35,7 +35,6 @@* 02110-1301, USA. */ -#include <linux/input.h> #include <linux/slab.h> #include <media/ir-common.h> #include <media/v4l2-subdev.h>
@@ -291,7 +290,7 @@ static void cx23885_input_ir_stop(struct cx23885_dev *dev)int cx23885_input_init (struct cx23885_dev *dev) {struct card_ir *ir; -struct input_dev *input_dev; +struct rc_dev *rc;char *ir_codes =NULL ;int ir_addr, ir_start;int ret;
@@ -316,13 +315,13 @@ int cx23885_input_init(struct cx23885_dev *dev)return -ENODEV ; ir =kzalloc (sizeof (*ir),GFP_KERNEL ); - input_dev =input_allocate_device (); -if (!ir || !input_dev) { + rc =rc_allocate_device (); +if (!ir || !rc) { ret = -ENOMEM ; goto err_out_free; } - ir->dev = input_dev; + ir->dev = rc; ir->addr = ir_addr; ir->start = ir_start;
@@ -331,23 +330,25 @@ int cx23885_input_init(struct cx23885_dev *dev) cx23885_boards[dev->board].name);snprintf (ir->phys,sizeof (ir->phys),"pci-%s/ir0" ,pci_name (dev->pci)); - input_dev->name = ir->name; - input_dev->phys = ir->phys; - input_dev->id.bustype =BUS_PCI ; - input_dev->id.version =1 ; + rc->input_name = ir->name; + rc->input_phys = ir->phys; + rc->map_name = ir_codes; + rc->driver_name =MODULE_NAME ; + rc->input_id.bustype =BUS_PCI ; + rc->input_id.version =1 ;if (dev->pci->subsystem_vendor) { - input_dev->id.vendor = dev->pci->subsystem_vendor; - input_dev->id.product = dev->pci->subsystem_device; + rc->input_id.vendor = dev->pci->subsystem_vendor; + rc->input_id.product = dev->pci->subsystem_device; }else { - input_dev->id.vendor = dev->pci->vendor; - input_dev->id.product = dev->pci->device; + rc->input_id.vendor = dev->pci->vendor; + rc->input_id.product = dev->pci->device; } - input_dev->dev.parent = &dev->pci->dev; + rc->dev.parent = &dev->pci->dev; dev->ir_input = ir;cx23885_input_ir_start (dev); - ret =ir_input_register (ir->dev, ir_codes,NULL ,MODULE_NAME ); + ret =rc_register_device (rc);if (ret) goto err_out_stop;
@@ -357,6 +358,7 @@ err_out_stop:cx23885_input_ir_stop (dev); dev->ir_input =NULL ; err_out_free: +rc_free_device (rc);kfree (ir);return ret; }
@@ -368,7 +370,7 @@ void cx23885_input_fini(struct cx23885_dev *dev)if (dev->ir_input ==NULL )return ; -ir_input_unregister (dev->ir_input->dev); +rc_unregister_device (dev->ir_input->dev);kfree (dev->ir_input); dev->ir_input =NULL ; }
drivers/media/video/cx88/cx88-input.c +40 -38
187 lines not on this page · raw message
drivers/media/video/em28xx/em28xx-input.c +33 -38
165 lines not on this page · raw message
drivers/media/video/ir-kbd-i2c.c +16 -11
@@ -273,7 +273,7 @@ static void ir_key_poll(struct IR_i2c *ir) }if (rc) -ir_keydown (ir->input, ir_key,0 ); +ir_keydown (ir->rc, ir_key,0 ); }static void ir_work (struct work_struct *work)
@@ -297,20 +297,20 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)char *ir_codes =NULL ;const char *name =NULL ;struct IR_i2c *ir; -struct input_dev *input_dev; +struct rc_dev *rc;struct i2c_adapter *adap = client->adapter;unsigned short addr = client->addr;int err; ir =kzalloc (sizeof (struct IR_i2c ),GFP_KERNEL ); - input_dev =input_allocate_device (); -if (!ir || !input_dev) { + rc =rc_allocate_device (); +if (!ir || !rc) { err = -ENOMEM ; goto err_out_free; } ir->c = client; - ir->input = input_dev; + ir->rc = rc;i2c_set_clientdata (client, ir);switch (addr) {
@@ -425,16 +425,20 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id) dev_name(&client->dev));/* init + register input device */ - input_dev->id.bustype =BUS_I2C ; - input_dev->name = ir->name; - input_dev->phys = ir->phys; + rc->input_id.bustype =BUS_I2C ; + rc->input_name = ir->name; + rc->input_phys = ir->phys; + rc->map_name = ir->ir_codes; + rc->driver_name =MODULE_NAME ; - err =ir_input_register (ir->input, ir->ir_codes,NULL ,MODULE_NAME ); + err =rc_register_device (rc);if (err) goto err_out_free; + ir->rc = rc; +printk (MODULE_NAME ": %s detected at %s [%s]\n" , - ir->input->name, ir->input->phys, adap->name); + ir->name, ir->phys, adap->name);/* start polling via eventd */ INIT_DELAYED_WORK (&ir->work, ir_work);
@@ -443,6 +447,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)return 0 ; err_out_free: +rc_free_device (rc);kfree (ir);return err; }
@@ -455,7 +460,7 @@ static int ir_remove(struct i2c_client *client)cancel_delayed_work_sync (&ir->work);/* unregister device */ -ir_input_unregister (ir->input); +rc_unregister_device (ir->rc);/* free memory */ kfree (ir);
drivers/media/video/saa7134/saa7134-input.c +30 -41
147 lines not on this page · raw message
include/media/ir-common.h +1 -2
@@ -37,12 +37,11 @@/* this was saa7134_ir and bttv_ir, moved here for * rc5 decoding. */ struct card_ir { -struct input_dev *dev; +struct rc_dev *dev;char name[32 ];char phys[32 ];int users;u32 running:1 ; -struct ir_dev_props props;/* Usual gpio signalling */ u32 mask_keycode;
include/media/ir-core.h +69 -85
186 lines not on this page · raw message
include/media/ir-kbd-i2c.h +1 -1
@@ -9,7 +9,7 @@ struct IR_i2c {char *ir_codes;struct i2c_client *c; -struct input_dev *input; +struct rc_dev *rc;/* Used to avoid fast repeating */ unsigned char old;
Quoted 16 lines · David Härdeman
The following series merges the different files that currently make up the ir-core module into a single-file rc-core module.
In addition, the
ir_input_devandir_dev_propsstructs are replaced by a singlerc_devstruct with an API similar to that of the input subsystem.This allows the removal of all knowledge of any input devices from the rc drivers and paves the way for allowing multiple input devices per rc device in the future. The namespace conversion from ir_* to rc_* should mostly be done for the drivers with this patchset.
I have intentionally not signed off on the patches yet since they haven't been tested. I'd like your feedback on the general approach before I spend the time to properly test the result.
Quoted 5 lines
Also, the imon driver is not converted (and will thus break with this patchset). The reason is that the imon driver wants to generate mouse events on the input dev under the control of rc-core. I was hoping that Jarod would be willing to convert the imon driver to create a separate input device for sending mouse events to userspace :)
Yeah, I could be persuaded to do that. Means that the imon driver, when driving one of the touchscreen devices, will bring up 3 separate input devices, but oh well. (I'd actually considered doing that when porting to ir-core in the first place, but went the lazy route. ;)
Quoted 1 line
Comments please...
Haven't tried it out at all yet or done more than a quick skim through the patches, but at first glance, I do like the idea of further abstracting away the input layer. I know I tanked a few things the first go 'round, thinking I needed to do both some rc-layer and input-layer setup and/or teardown. It becomes more cut and dry if you don't see anything input-related anywhere at all.
One thing I did note with the patches is that a lot of bits were altered from ir-foo to rc-foo, but not all of them... If we're going to make the change, why no go whole hog? (Or was it only things relevant to ir specifically right now that didn't get renamed?)
Signature · 2 lines
Jarod Wilson [email protected]
Quoted 25 lines · Jarod Wilson
Quoted 18 lines · David Härdeman
The following series merges the different files that currently make up the ir-core module into a single-file rc-core module.
In addition, the
ir_input_devandir_dev_propsstructs are replaced by a singlerc_devstruct with an API similar to that of the input subsystem.This allows the removal of all knowledge of any input devices from the rc drivers and paves the way for allowing multiple input devices per rc device in the future. The namespace conversion from ir_* to rc_* should mostly be done for the drivers with this patchset.
I have intentionally not signed off on the patches yet since they haven't
been tested. I'd like your feedback on the general approach before I spend
the time to properly test the result.Quoted 5 lines
Also, the imon driver is not converted (and will thus break with this patchset). The reason is that the imon driver wants to generate mouse events on the input dev under the control of rc-core. I was hoping that Jarod would be willing to convert the imon driver to create a separate input device for sending mouse events to userspace :)
Quoted 4 lines
Yeah, I could be persuaded to do that. Means that the imon driver, when driving one of the touchscreen devices, will bring up 3 separate input devices, but oh well. (I'd actually considered doing that when porting to ir-core in the first place, but went the lazy route. ;)
That would be good. I'm pretty certain that the split will be necessary sooner or later.
Quoted 8 lines
Quoted 1 line
Comments please...
Haven't tried it out at all yet or done more than a quick skim through the patches, but at first glance, I do like the idea of further abstracting away the input layer. I know I tanked a few things the first go 'round, thinking I needed to do both some rc-layer and input-layer setup and/or teardown. It becomes more cut and dry if you don't see anything input-related anywhere at all.
Not to mention we will have a more consistent user experience. For
example: some of the current hardware drivers are fiddling with the repeat values of the input dev...something which should be the same across the entire subsystem (you wouldn't expect the repetition rate for the exact same remote control to change just because you change the receiver).
Also, it's necessary for any future support of multiple input devices (one per physical remote control being one example)...and it gives us more flexibility to make changes in rc-core when drivers do not muck around in subdevices (input devices that is).
Quoted 4 lines
One thing I did note with the patches is that a lot of bits were altered from ir-foo to rc-foo, but not all of them... If we're going to make the change, why no go whole hog? (Or was it only things relevant to ir specifically right now that didn't get renamed?)
The rule of thumb I followed was to rename stuff that I touched but leave unchanged code alone. Renaming the remaining functions can be done in later, separate, patches (some of them will be more invasive as file names need changing as well).
On a related note, I'm getting confused wrt git the v4l-dvb git branches. The current patches are against staging/rc which hasn't seen much activity in a month or two but staging/other seems to carry some more recent rc-related patches...which one am I supposed to base my work on?
Signature · 1 line
David Härdeman