diff options
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/bttvp.h | 2 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 58 | ||||
-rw-r--r-- | drivers/media/video/ir-kbd-gpio.c | 52 | ||||
-rw-r--r-- | drivers/media/video/ir-kbd-i2c.c | 33 | ||||
-rw-r--r-- | drivers/media/video/msp3400.c | 8 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-input.c | 39 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134.h | 2 | ||||
-rw-r--r-- | drivers/media/video/tda9887.c | 4 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 4 |
9 files changed, 110 insertions, 92 deletions
diff --git a/drivers/media/video/bttvp.h b/drivers/media/video/bttvp.h index 7a312f79340a..e0e7c7a84bc5 100644 --- a/drivers/media/video/bttvp.h +++ b/drivers/media/video/bttvp.h | |||
@@ -240,7 +240,7 @@ struct bttv_pll_info { | |||
240 | 240 | ||
241 | /* for gpio-connected remote control */ | 241 | /* for gpio-connected remote control */ |
242 | struct bttv_input { | 242 | struct bttv_input { |
243 | struct input_dev dev; | 243 | struct input_dev *dev; |
244 | struct ir_input_state ir; | 244 | struct ir_input_state ir; |
245 | char name[32]; | 245 | char name[32]; |
246 | char phys[32]; | 246 | char phys[32]; |
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index d81b21d6e05d..c27fe4c36f69 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -260,7 +260,7 @@ static IR_KEYTAB_TYPE ir_codes_cinergy_1400[IR_KEYTAB_SIZE] = { | |||
260 | 260 | ||
261 | struct cx88_IR { | 261 | struct cx88_IR { |
262 | struct cx88_core *core; | 262 | struct cx88_core *core; |
263 | struct input_dev input; | 263 | struct input_dev *input; |
264 | struct ir_input_state ir; | 264 | struct ir_input_state ir; |
265 | char name[32]; | 265 | char name[32]; |
266 | char phys[32]; | 266 | char phys[32]; |
@@ -315,23 +315,23 @@ static void cx88_ir_handle_key(struct cx88_IR *ir) | |||
315 | if (ir->mask_keydown) { | 315 | if (ir->mask_keydown) { |
316 | /* bit set on keydown */ | 316 | /* bit set on keydown */ |
317 | if (gpio & ir->mask_keydown) { | 317 | if (gpio & ir->mask_keydown) { |
318 | ir_input_keydown(&ir->input, &ir->ir, data, data); | 318 | ir_input_keydown(ir->input, &ir->ir, data, data); |
319 | } else { | 319 | } else { |
320 | ir_input_nokey(&ir->input, &ir->ir); | 320 | ir_input_nokey(ir->input, &ir->ir); |
321 | } | 321 | } |
322 | 322 | ||
323 | } else if (ir->mask_keyup) { | 323 | } else if (ir->mask_keyup) { |
324 | /* bit cleared on keydown */ | 324 | /* bit cleared on keydown */ |
325 | if (0 == (gpio & ir->mask_keyup)) { | 325 | if (0 == (gpio & ir->mask_keyup)) { |
326 | ir_input_keydown(&ir->input, &ir->ir, data, data); | 326 | ir_input_keydown(ir->input, &ir->ir, data, data); |
327 | } else { | 327 | } else { |
328 | ir_input_nokey(&ir->input, &ir->ir); | 328 | ir_input_nokey(ir->input, &ir->ir); |
329 | } | 329 | } |
330 | 330 | ||
331 | } else { | 331 | } else { |
332 | /* can't distinguish keydown/up :-/ */ | 332 | /* can't distinguish keydown/up :-/ */ |
333 | ir_input_keydown(&ir->input, &ir->ir, data, data); | 333 | ir_input_keydown(ir->input, &ir->ir, data, data); |
334 | ir_input_nokey(&ir->input, &ir->ir); | 334 | ir_input_nokey(ir->input, &ir->ir); |
335 | } | 335 | } |
336 | } | 336 | } |
337 | 337 | ||
@@ -357,13 +357,19 @@ static void cx88_ir_work(void *data) | |||
357 | int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | 357 | int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) |
358 | { | 358 | { |
359 | struct cx88_IR *ir; | 359 | struct cx88_IR *ir; |
360 | struct input_dev *input_dev; | ||
360 | IR_KEYTAB_TYPE *ir_codes = NULL; | 361 | IR_KEYTAB_TYPE *ir_codes = NULL; |
361 | int ir_type = IR_TYPE_OTHER; | 362 | int ir_type = IR_TYPE_OTHER; |
362 | 363 | ||
363 | ir = kmalloc(sizeof(*ir), GFP_KERNEL); | 364 | ir = kzalloc(sizeof(*ir), GFP_KERNEL); |
364 | if (NULL == ir) | 365 | input_dev = input_allocate_device(); |
366 | if (!ir || !input_dev) { | ||
367 | kfree(ir); | ||
368 | input_free_device(input_dev); | ||
365 | return -ENOMEM; | 369 | return -ENOMEM; |
366 | memset(ir, 0, sizeof(*ir)); | 370 | } |
371 | |||
372 | ir->input = input_dev; | ||
367 | 373 | ||
368 | /* detect & configure */ | 374 | /* detect & configure */ |
369 | switch (core->board) { | 375 | switch (core->board) { |
@@ -425,6 +431,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
425 | 431 | ||
426 | if (NULL == ir_codes) { | 432 | if (NULL == ir_codes) { |
427 | kfree(ir); | 433 | kfree(ir); |
434 | input_free_device(input_dev); | ||
428 | return -ENODEV; | 435 | return -ENODEV; |
429 | } | 436 | } |
430 | 437 | ||
@@ -433,19 +440,19 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
433 | cx88_boards[core->board].name); | 440 | cx88_boards[core->board].name); |
434 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci)); | 441 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", pci_name(pci)); |
435 | 442 | ||
436 | ir_input_init(&ir->input, &ir->ir, ir_type, ir_codes); | 443 | ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); |
437 | ir->input.name = ir->name; | 444 | input_dev->name = ir->name; |
438 | ir->input.phys = ir->phys; | 445 | input_dev->phys = ir->phys; |
439 | ir->input.id.bustype = BUS_PCI; | 446 | input_dev->id.bustype = BUS_PCI; |
440 | ir->input.id.version = 1; | 447 | input_dev->id.version = 1; |
441 | if (pci->subsystem_vendor) { | 448 | if (pci->subsystem_vendor) { |
442 | ir->input.id.vendor = pci->subsystem_vendor; | 449 | input_dev->id.vendor = pci->subsystem_vendor; |
443 | ir->input.id.product = pci->subsystem_device; | 450 | input_dev->id.product = pci->subsystem_device; |
444 | } else { | 451 | } else { |
445 | ir->input.id.vendor = pci->vendor; | 452 | input_dev->id.vendor = pci->vendor; |
446 | ir->input.id.product = pci->device; | 453 | input_dev->id.product = pci->device; |
447 | } | 454 | } |
448 | ir->input.dev = &pci->dev; | 455 | input_dev->cdev.dev = &pci->dev; |
449 | 456 | ||
450 | /* record handles to ourself */ | 457 | /* record handles to ourself */ |
451 | ir->core = core; | 458 | ir->core = core; |
@@ -465,8 +472,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci) | |||
465 | } | 472 | } |
466 | 473 | ||
467 | /* all done */ | 474 | /* all done */ |
468 | input_register_device(&ir->input); | 475 | input_register_device(ir->input); |
469 | printk("%s: registered IR remote control\n", core->name); | ||
470 | 476 | ||
471 | return 0; | 477 | return 0; |
472 | } | 478 | } |
@@ -484,7 +490,7 @@ int cx88_ir_fini(struct cx88_core *core) | |||
484 | flush_scheduled_work(); | 490 | flush_scheduled_work(); |
485 | } | 491 | } |
486 | 492 | ||
487 | input_unregister_device(&ir->input); | 493 | input_unregister_device(ir->input); |
488 | kfree(ir); | 494 | kfree(ir); |
489 | 495 | ||
490 | /* done */ | 496 | /* done */ |
@@ -515,7 +521,7 @@ void cx88_ir_irq(struct cx88_core *core) | |||
515 | if (!ir->scount) { | 521 | if (!ir->scount) { |
516 | /* nothing to sample */ | 522 | /* nothing to sample */ |
517 | if (ir->ir.keypressed && time_after(jiffies, ir->release)) | 523 | if (ir->ir.keypressed && time_after(jiffies, ir->release)) |
518 | ir_input_nokey(&ir->input, &ir->ir); | 524 | ir_input_nokey(ir->input, &ir->ir); |
519 | return; | 525 | return; |
520 | } | 526 | } |
521 | 527 | ||
@@ -557,7 +563,7 @@ void cx88_ir_irq(struct cx88_core *core) | |||
557 | 563 | ||
558 | ir_dprintk("Key Code: %x\n", (ircode >> 16) & 0x7f); | 564 | ir_dprintk("Key Code: %x\n", (ircode >> 16) & 0x7f); |
559 | 565 | ||
560 | ir_input_keydown(&ir->input, &ir->ir, (ircode >> 16) & 0x7f, (ircode >> 16) & 0xff); | 566 | ir_input_keydown(ir->input, &ir->ir, (ircode >> 16) & 0x7f, (ircode >> 16) & 0xff); |
561 | ir->release = jiffies + msecs_to_jiffies(120); | 567 | ir->release = jiffies + msecs_to_jiffies(120); |
562 | break; | 568 | break; |
563 | case CX88_BOARD_HAUPPAUGE: | 569 | case CX88_BOARD_HAUPPAUGE: |
@@ -566,7 +572,7 @@ void cx88_ir_irq(struct cx88_core *core) | |||
566 | ir_dprintk("biphase decoded: %x\n", ircode); | 572 | ir_dprintk("biphase decoded: %x\n", ircode); |
567 | if ((ircode & 0xfffff000) != 0x3000) | 573 | if ((ircode & 0xfffff000) != 0x3000) |
568 | break; | 574 | break; |
569 | ir_input_keydown(&ir->input, &ir->ir, ircode & 0x3f, ircode); | 575 | ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f, ircode); |
570 | ir->release = jiffies + msecs_to_jiffies(120); | 576 | ir->release = jiffies + msecs_to_jiffies(120); |
571 | break; | 577 | break; |
572 | } | 578 | } |
diff --git a/drivers/media/video/ir-kbd-gpio.c b/drivers/media/video/ir-kbd-gpio.c index cf292da8fdd5..234151e48edc 100644 --- a/drivers/media/video/ir-kbd-gpio.c +++ b/drivers/media/video/ir-kbd-gpio.c | |||
@@ -158,7 +158,7 @@ static IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE] = { | |||
158 | 158 | ||
159 | struct IR { | 159 | struct IR { |
160 | struct bttv_sub_device *sub; | 160 | struct bttv_sub_device *sub; |
161 | struct input_dev input; | 161 | struct input_dev *input; |
162 | struct ir_input_state ir; | 162 | struct ir_input_state ir; |
163 | char name[32]; | 163 | char name[32]; |
164 | char phys[32]; | 164 | char phys[32]; |
@@ -217,23 +217,23 @@ static void ir_handle_key(struct IR *ir) | |||
217 | if (ir->mask_keydown) { | 217 | if (ir->mask_keydown) { |
218 | /* bit set on keydown */ | 218 | /* bit set on keydown */ |
219 | if (gpio & ir->mask_keydown) { | 219 | if (gpio & ir->mask_keydown) { |
220 | ir_input_keydown(&ir->input,&ir->ir,data,data); | 220 | ir_input_keydown(ir->input, &ir->ir, data, data); |
221 | } else { | 221 | } else { |
222 | ir_input_nokey(&ir->input,&ir->ir); | 222 | ir_input_nokey(ir->input, &ir->ir); |
223 | } | 223 | } |
224 | 224 | ||
225 | } else if (ir->mask_keyup) { | 225 | } else if (ir->mask_keyup) { |
226 | /* bit cleared on keydown */ | 226 | /* bit cleared on keydown */ |
227 | if (0 == (gpio & ir->mask_keyup)) { | 227 | if (0 == (gpio & ir->mask_keyup)) { |
228 | ir_input_keydown(&ir->input,&ir->ir,data,data); | 228 | ir_input_keydown(ir->input, &ir->ir, data, data); |
229 | } else { | 229 | } else { |
230 | ir_input_nokey(&ir->input,&ir->ir); | 230 | ir_input_nokey(ir->input, &ir->ir); |
231 | } | 231 | } |
232 | 232 | ||
233 | } else { | 233 | } else { |
234 | /* can't disturgissh keydown/up :-/ */ | 234 | /* can't disturgissh keydown/up :-/ */ |
235 | ir_input_keydown(&ir->input,&ir->ir,data,data); | 235 | ir_input_keydown(ir->input, &ir->ir, data, data); |
236 | ir_input_nokey(&ir->input,&ir->ir); | 236 | ir_input_nokey(ir->input, &ir->ir); |
237 | } | 237 | } |
238 | } | 238 | } |
239 | 239 | ||
@@ -268,13 +268,17 @@ static int ir_probe(struct device *dev) | |||
268 | { | 268 | { |
269 | struct bttv_sub_device *sub = to_bttv_sub_dev(dev); | 269 | struct bttv_sub_device *sub = to_bttv_sub_dev(dev); |
270 | struct IR *ir; | 270 | struct IR *ir; |
271 | struct input_dev *input_dev; | ||
271 | IR_KEYTAB_TYPE *ir_codes = NULL; | 272 | IR_KEYTAB_TYPE *ir_codes = NULL; |
272 | int ir_type = IR_TYPE_OTHER; | 273 | int ir_type = IR_TYPE_OTHER; |
273 | 274 | ||
274 | ir = kmalloc(sizeof(*ir),GFP_KERNEL); | 275 | ir = kzalloc(sizeof(*ir), GFP_KERNEL); |
275 | if (NULL == ir) | 276 | input_dev = input_allocate_device(); |
277 | if (!ir || !input_dev) { | ||
278 | kfree(ir); | ||
279 | input_free_device(input_dev); | ||
276 | return -ENOMEM; | 280 | return -ENOMEM; |
277 | memset(ir,0,sizeof(*ir)); | 281 | } |
278 | 282 | ||
279 | /* detect & configure */ | 283 | /* detect & configure */ |
280 | switch (sub->core->type) { | 284 | switch (sub->core->type) { |
@@ -328,6 +332,7 @@ static int ir_probe(struct device *dev) | |||
328 | } | 332 | } |
329 | if (NULL == ir_codes) { | 333 | if (NULL == ir_codes) { |
330 | kfree(ir); | 334 | kfree(ir); |
335 | input_free_device(input_dev); | ||
331 | return -ENODEV; | 336 | return -ENODEV; |
332 | } | 337 | } |
333 | 338 | ||
@@ -341,19 +346,19 @@ static int ir_probe(struct device *dev) | |||
341 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", | 346 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", |
342 | pci_name(sub->core->pci)); | 347 | pci_name(sub->core->pci)); |
343 | 348 | ||
344 | ir_input_init(&ir->input, &ir->ir, ir_type, ir_codes); | 349 | ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); |
345 | ir->input.name = ir->name; | 350 | input_dev->name = ir->name; |
346 | ir->input.phys = ir->phys; | 351 | input_dev->phys = ir->phys; |
347 | ir->input.id.bustype = BUS_PCI; | 352 | input_dev->id.bustype = BUS_PCI; |
348 | ir->input.id.version = 1; | 353 | input_dev->id.version = 1; |
349 | if (sub->core->pci->subsystem_vendor) { | 354 | if (sub->core->pci->subsystem_vendor) { |
350 | ir->input.id.vendor = sub->core->pci->subsystem_vendor; | 355 | input_dev->id.vendor = sub->core->pci->subsystem_vendor; |
351 | ir->input.id.product = sub->core->pci->subsystem_device; | 356 | input_dev->id.product = sub->core->pci->subsystem_device; |
352 | } else { | 357 | } else { |
353 | ir->input.id.vendor = sub->core->pci->vendor; | 358 | input_dev->id.vendor = sub->core->pci->vendor; |
354 | ir->input.id.product = sub->core->pci->device; | 359 | input_dev->id.product = sub->core->pci->device; |
355 | } | 360 | } |
356 | ir->input.dev = &sub->core->pci->dev; | 361 | input_dev->cdev.dev = &sub->core->pci->dev; |
357 | 362 | ||
358 | if (ir->polling) { | 363 | if (ir->polling) { |
359 | INIT_WORK(&ir->work, ir_work, ir); | 364 | INIT_WORK(&ir->work, ir_work, ir); |
@@ -364,9 +369,8 @@ static int ir_probe(struct device *dev) | |||
364 | } | 369 | } |
365 | 370 | ||
366 | /* all done */ | 371 | /* all done */ |
367 | dev_set_drvdata(dev,ir); | 372 | dev_set_drvdata(dev, ir); |
368 | input_register_device(&ir->input); | 373 | input_register_device(ir->input); |
369 | printk(DEVNAME ": %s detected at %s\n",ir->input.name,ir->input.phys); | ||
370 | 374 | ||
371 | return 0; | 375 | return 0; |
372 | } | 376 | } |
@@ -380,7 +384,7 @@ static int ir_remove(struct device *dev) | |||
380 | flush_scheduled_work(); | 384 | flush_scheduled_work(); |
381 | } | 385 | } |
382 | 386 | ||
383 | input_unregister_device(&ir->input); | 387 | input_unregister_device(ir->input); |
384 | kfree(ir); | 388 | kfree(ir); |
385 | return 0; | 389 | return 0; |
386 | } | 390 | } |
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c index 67105b9804a2..9703d3d351f9 100644 --- a/drivers/media/video/ir-kbd-i2c.c +++ b/drivers/media/video/ir-kbd-i2c.c | |||
@@ -121,10 +121,9 @@ static IR_KEYTAB_TYPE ir_codes_purpletv[IR_KEYTAB_SIZE] = { | |||
121 | 121 | ||
122 | }; | 122 | }; |
123 | 123 | ||
124 | struct IR; | ||
125 | struct IR { | 124 | struct IR { |
126 | struct i2c_client c; | 125 | struct i2c_client c; |
127 | struct input_dev input; | 126 | struct input_dev *input; |
128 | struct ir_input_state ir; | 127 | struct ir_input_state ir; |
129 | 128 | ||
130 | struct work_struct work; | 129 | struct work_struct work; |
@@ -271,9 +270,9 @@ static void ir_key_poll(struct IR *ir) | |||
271 | } | 270 | } |
272 | 271 | ||
273 | if (0 == rc) { | 272 | if (0 == rc) { |
274 | ir_input_nokey(&ir->input,&ir->ir); | 273 | ir_input_nokey(ir->input, &ir->ir); |
275 | } else { | 274 | } else { |
276 | ir_input_keydown(&ir->input,&ir->ir, ir_key, ir_raw); | 275 | ir_input_keydown(ir->input, &ir->ir, ir_key, ir_raw); |
277 | } | 276 | } |
278 | } | 277 | } |
279 | 278 | ||
@@ -318,11 +317,18 @@ static int ir_attach(struct i2c_adapter *adap, int addr, | |||
318 | char *name; | 317 | char *name; |
319 | int ir_type; | 318 | int ir_type; |
320 | struct IR *ir; | 319 | struct IR *ir; |
320 | struct input_dev *input_dev; | ||
321 | 321 | ||
322 | if (NULL == (ir = kmalloc(sizeof(struct IR),GFP_KERNEL))) | 322 | ir = kzalloc(sizeof(struct IR), GFP_KERNEL); |
323 | input_dev = input_allocate_device(); | ||
324 | if (!ir || !input_dev) { | ||
325 | kfree(ir); | ||
326 | input_free_device(input_dev); | ||
323 | return -ENOMEM; | 327 | return -ENOMEM; |
324 | memset(ir,0,sizeof(*ir)); | 328 | } |
329 | |||
325 | ir->c = client_template; | 330 | ir->c = client_template; |
331 | ir->input = input_dev; | ||
326 | 332 | ||
327 | i2c_set_clientdata(&ir->c, ir); | 333 | i2c_set_clientdata(&ir->c, ir); |
328 | ir->c.adapter = adap; | 334 | ir->c.adapter = adap; |
@@ -375,13 +381,12 @@ static int ir_attach(struct i2c_adapter *adap, int addr, | |||
375 | ir->c.dev.bus_id); | 381 | ir->c.dev.bus_id); |
376 | 382 | ||
377 | /* init + register input device */ | 383 | /* init + register input device */ |
378 | ir_input_init(&ir->input,&ir->ir,ir_type,ir_codes); | 384 | ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); |
379 | ir->input.id.bustype = BUS_I2C; | 385 | input_dev->id.bustype = BUS_I2C; |
380 | ir->input.name = ir->c.name; | 386 | input_dev->name = ir->c.name; |
381 | ir->input.phys = ir->phys; | 387 | input_dev->phys = ir->phys; |
382 | input_register_device(&ir->input); | 388 | |
383 | printk(DEVNAME ": %s detected at %s [%s]\n", | 389 | input_register_device(ir->input); |
384 | ir->input.name,ir->input.phys,adap->name); | ||
385 | 390 | ||
386 | /* start polling via eventd */ | 391 | /* start polling via eventd */ |
387 | INIT_WORK(&ir->work, ir_work, ir); | 392 | INIT_WORK(&ir->work, ir_work, ir); |
@@ -402,7 +407,7 @@ static int ir_detach(struct i2c_client *client) | |||
402 | flush_scheduled_work(); | 407 | flush_scheduled_work(); |
403 | 408 | ||
404 | /* unregister devices */ | 409 | /* unregister devices */ |
405 | input_unregister_device(&ir->input); | 410 | input_unregister_device(ir->input); |
406 | i2c_detach_client(&ir->c); | 411 | i2c_detach_client(&ir->c); |
407 | 412 | ||
408 | /* free memory */ | 413 | /* free memory */ |
diff --git a/drivers/media/video/msp3400.c b/drivers/media/video/msp3400.c index f0d43fc2632f..262890cb20a7 100644 --- a/drivers/media/video/msp3400.c +++ b/drivers/media/video/msp3400.c | |||
@@ -1420,8 +1420,8 @@ static int msp_detach(struct i2c_client *client); | |||
1420 | static int msp_probe(struct i2c_adapter *adap); | 1420 | static int msp_probe(struct i2c_adapter *adap); |
1421 | static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); | 1421 | static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg); |
1422 | 1422 | ||
1423 | static int msp_suspend(struct device * dev, pm_message_t state, u32 level); | 1423 | static int msp_suspend(struct device * dev, pm_message_t state); |
1424 | static int msp_resume(struct device * dev, u32 level); | 1424 | static int msp_resume(struct device * dev); |
1425 | 1425 | ||
1426 | static void msp_wake_thread(struct i2c_client *client); | 1426 | static void msp_wake_thread(struct i2c_client *client); |
1427 | 1427 | ||
@@ -1821,7 +1821,7 @@ static int msp_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
1821 | return 0; | 1821 | return 0; |
1822 | } | 1822 | } |
1823 | 1823 | ||
1824 | static int msp_suspend(struct device * dev, pm_message_t state, u32 level) | 1824 | static int msp_suspend(struct device * dev, pm_message_t state) |
1825 | { | 1825 | { |
1826 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); | 1826 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); |
1827 | 1827 | ||
@@ -1830,7 +1830,7 @@ static int msp_suspend(struct device * dev, pm_message_t state, u32 level) | |||
1830 | return 0; | 1830 | return 0; |
1831 | } | 1831 | } |
1832 | 1832 | ||
1833 | static int msp_resume(struct device * dev, u32 level) | 1833 | static int msp_resume(struct device * dev) |
1834 | { | 1834 | { |
1835 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); | 1835 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); |
1836 | 1836 | ||
diff --git a/drivers/media/video/saa7134/saa7134-input.c b/drivers/media/video/saa7134/saa7134-input.c index 1f456c4d76f2..242cb235cf92 100644 --- a/drivers/media/video/saa7134/saa7134-input.c +++ b/drivers/media/video/saa7134/saa7134-input.c | |||
@@ -425,9 +425,9 @@ static int build_key(struct saa7134_dev *dev) | |||
425 | 425 | ||
426 | if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || | 426 | if ((ir->mask_keydown && (0 != (gpio & ir->mask_keydown))) || |
427 | (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { | 427 | (ir->mask_keyup && (0 == (gpio & ir->mask_keyup)))) { |
428 | ir_input_keydown(&ir->dev,&ir->ir,data,data); | 428 | ir_input_keydown(ir->dev, &ir->ir, data, data); |
429 | } else { | 429 | } else { |
430 | ir_input_nokey(&ir->dev,&ir->ir); | 430 | ir_input_nokey(ir->dev, &ir->ir); |
431 | } | 431 | } |
432 | return 0; | 432 | return 0; |
433 | } | 433 | } |
@@ -456,6 +456,7 @@ static void saa7134_input_timer(unsigned long data) | |||
456 | int saa7134_input_init1(struct saa7134_dev *dev) | 456 | int saa7134_input_init1(struct saa7134_dev *dev) |
457 | { | 457 | { |
458 | struct saa7134_ir *ir; | 458 | struct saa7134_ir *ir; |
459 | struct input_dev *input_dev; | ||
459 | IR_KEYTAB_TYPE *ir_codes = NULL; | 460 | IR_KEYTAB_TYPE *ir_codes = NULL; |
460 | u32 mask_keycode = 0; | 461 | u32 mask_keycode = 0; |
461 | u32 mask_keydown = 0; | 462 | u32 mask_keydown = 0; |
@@ -535,10 +536,13 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
535 | return -ENODEV; | 536 | return -ENODEV; |
536 | } | 537 | } |
537 | 538 | ||
538 | ir = kmalloc(sizeof(*ir),GFP_KERNEL); | 539 | ir = kzalloc(sizeof(*ir), GFP_KERNEL); |
539 | if (NULL == ir) | 540 | input_dev = input_allocate_device(); |
541 | if (!ir || !input_dev) { | ||
542 | kfree(ir); | ||
543 | input_free_device(input_dev); | ||
540 | return -ENOMEM; | 544 | return -ENOMEM; |
541 | memset(ir,0,sizeof(*ir)); | 545 | } |
542 | 546 | ||
543 | /* init hardware-specific stuff */ | 547 | /* init hardware-specific stuff */ |
544 | ir->mask_keycode = mask_keycode; | 548 | ir->mask_keycode = mask_keycode; |
@@ -552,19 +556,19 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
552 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", | 556 | snprintf(ir->phys, sizeof(ir->phys), "pci-%s/ir0", |
553 | pci_name(dev->pci)); | 557 | pci_name(dev->pci)); |
554 | 558 | ||
555 | ir_input_init(&ir->dev, &ir->ir, ir_type, ir_codes); | 559 | ir_input_init(input_dev, &ir->ir, ir_type, ir_codes); |
556 | ir->dev.name = ir->name; | 560 | input_dev->name = ir->name; |
557 | ir->dev.phys = ir->phys; | 561 | input_dev->phys = ir->phys; |
558 | ir->dev.id.bustype = BUS_PCI; | 562 | input_dev->id.bustype = BUS_PCI; |
559 | ir->dev.id.version = 1; | 563 | input_dev->id.version = 1; |
560 | if (dev->pci->subsystem_vendor) { | 564 | if (dev->pci->subsystem_vendor) { |
561 | ir->dev.id.vendor = dev->pci->subsystem_vendor; | 565 | input_dev->id.vendor = dev->pci->subsystem_vendor; |
562 | ir->dev.id.product = dev->pci->subsystem_device; | 566 | input_dev->id.product = dev->pci->subsystem_device; |
563 | } else { | 567 | } else { |
564 | ir->dev.id.vendor = dev->pci->vendor; | 568 | input_dev->id.vendor = dev->pci->vendor; |
565 | ir->dev.id.product = dev->pci->device; | 569 | input_dev->id.product = dev->pci->device; |
566 | } | 570 | } |
567 | ir->dev.dev = &dev->pci->dev; | 571 | input_dev->cdev.dev = &dev->pci->dev; |
568 | 572 | ||
569 | /* all done */ | 573 | /* all done */ |
570 | dev->remote = ir; | 574 | dev->remote = ir; |
@@ -576,8 +580,7 @@ int saa7134_input_init1(struct saa7134_dev *dev) | |||
576 | add_timer(&ir->timer); | 580 | add_timer(&ir->timer); |
577 | } | 581 | } |
578 | 582 | ||
579 | input_register_device(&dev->remote->dev); | 583 | input_register_device(ir->dev); |
580 | printk("%s: registered input device for IR\n",dev->name); | ||
581 | return 0; | 584 | return 0; |
582 | } | 585 | } |
583 | 586 | ||
@@ -586,9 +589,9 @@ void saa7134_input_fini(struct saa7134_dev *dev) | |||
586 | if (NULL == dev->remote) | 589 | if (NULL == dev->remote) |
587 | return; | 590 | return; |
588 | 591 | ||
589 | input_unregister_device(&dev->remote->dev); | ||
590 | if (dev->remote->polling) | 592 | if (dev->remote->polling) |
591 | del_timer_sync(&dev->remote->timer); | 593 | del_timer_sync(&dev->remote->timer); |
594 | input_unregister_device(dev->remote->dev); | ||
592 | kfree(dev->remote); | 595 | kfree(dev->remote); |
593 | dev->remote = NULL; | 596 | dev->remote = NULL; |
594 | } | 597 | } |
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h index 3ea09142ec9c..860b89530e2a 100644 --- a/drivers/media/video/saa7134/saa7134.h +++ b/drivers/media/video/saa7134/saa7134.h | |||
@@ -351,7 +351,7 @@ struct saa7134_oss { | |||
351 | 351 | ||
352 | /* IR input */ | 352 | /* IR input */ |
353 | struct saa7134_ir { | 353 | struct saa7134_ir { |
354 | struct input_dev dev; | 354 | struct input_dev *dev; |
355 | struct ir_input_state ir; | 355 | struct ir_input_state ir; |
356 | char name[32]; | 356 | char name[32]; |
357 | char phys[32]; | 357 | char phys[32]; |
diff --git a/drivers/media/video/tda9887.c b/drivers/media/video/tda9887.c index 0456dda2624d..94053f149ddf 100644 --- a/drivers/media/video/tda9887.c +++ b/drivers/media/video/tda9887.c | |||
@@ -784,13 +784,13 @@ tda9887_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
784 | return 0; | 784 | return 0; |
785 | } | 785 | } |
786 | 786 | ||
787 | static int tda9887_suspend(struct device * dev, pm_message_t state, u32 level) | 787 | static int tda9887_suspend(struct device * dev, pm_message_t state) |
788 | { | 788 | { |
789 | dprintk("tda9887: suspend\n"); | 789 | dprintk("tda9887: suspend\n"); |
790 | return 0; | 790 | return 0; |
791 | } | 791 | } |
792 | 792 | ||
793 | static int tda9887_resume(struct device * dev, u32 level) | 793 | static int tda9887_resume(struct device * dev) |
794 | { | 794 | { |
795 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); | 795 | struct i2c_client *c = container_of(dev, struct i2c_client, dev); |
796 | struct tda9887 *t = i2c_get_clientdata(c); | 796 | struct tda9887 *t = i2c_get_clientdata(c); |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index 05572020af4d..ad85bef1c3d5 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -697,7 +697,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) | |||
697 | return 0; | 697 | return 0; |
698 | } | 698 | } |
699 | 699 | ||
700 | static int tuner_suspend(struct device *dev, pm_message_t state, u32 level) | 700 | static int tuner_suspend(struct device *dev, pm_message_t state) |
701 | { | 701 | { |
702 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); | 702 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); |
703 | struct tuner *t = i2c_get_clientdata (c); | 703 | struct tuner *t = i2c_get_clientdata (c); |
@@ -707,7 +707,7 @@ static int tuner_suspend(struct device *dev, pm_message_t state, u32 level) | |||
707 | return 0; | 707 | return 0; |
708 | } | 708 | } |
709 | 709 | ||
710 | static int tuner_resume(struct device *dev, u32 level) | 710 | static int tuner_resume(struct device *dev) |
711 | { | 711 | { |
712 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); | 712 | struct i2c_client *c = container_of (dev, struct i2c_client, dev); |
713 | struct tuner *t = i2c_get_clientdata (c); | 713 | struct tuner *t = i2c_get_clientdata (c); |