aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ir-kbd-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/ir-kbd-i2c.c')
-rw-r--r--drivers/media/video/ir-kbd-i2c.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/drivers/media/video/ir-kbd-i2c.c b/drivers/media/video/ir-kbd-i2c.c
index a78883a6e0e..83b59a19523 100644
--- a/drivers/media/video/ir-kbd-i2c.c
+++ b/drivers/media/video/ir-kbd-i2c.c
@@ -252,7 +252,7 @@ static void ir_key_poll(struct IR_i2c *ir)
252 } 252 }
253 253
254 if (rc) 254 if (rc)
255 ir_keydown(ir->input, ir_key, 0); 255 ir_keydown(ir->rc, ir_key, 0);
256} 256}
257 257
258static void ir_work(struct work_struct *work) 258static void ir_work(struct work_struct *work)
@@ -271,20 +271,20 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
271 const char *name = NULL; 271 const char *name = NULL;
272 u64 ir_type = IR_TYPE_UNKNOWN; 272 u64 ir_type = IR_TYPE_UNKNOWN;
273 struct IR_i2c *ir; 273 struct IR_i2c *ir;
274 struct input_dev *input_dev; 274 struct rc_dev *rc;
275 struct i2c_adapter *adap = client->adapter; 275 struct i2c_adapter *adap = client->adapter;
276 unsigned short addr = client->addr; 276 unsigned short addr = client->addr;
277 int err; 277 int err;
278 278
279 ir = kzalloc(sizeof(struct IR_i2c),GFP_KERNEL); 279 ir = kzalloc(sizeof(struct IR_i2c),GFP_KERNEL);
280 input_dev = input_allocate_device(); 280 rc = rc_allocate_device();
281 if (!ir || !input_dev) { 281 if (!ir || !rc) {
282 err = -ENOMEM; 282 err = -ENOMEM;
283 goto err_out_free; 283 goto err_out_free;
284 } 284 }
285 285
286 ir->c = client; 286 ir->c = client;
287 ir->input = input_dev; 287 ir->rc = rc;
288 ir->polling_interval = DEFAULT_POLLING_INTERVAL; 288 ir->polling_interval = DEFAULT_POLLING_INTERVAL;
289 i2c_set_clientdata(client, ir); 289 i2c_set_clientdata(client, ir);
290 290
@@ -383,16 +383,18 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
383 dev_name(&client->dev)); 383 dev_name(&client->dev));
384 384
385 /* init + register input device */ 385 /* init + register input device */
386 input_dev->id.bustype = BUS_I2C; 386 rc->input_id.bustype = BUS_I2C;
387 input_dev->name = ir->name; 387 rc->input_name = ir->name;
388 input_dev->phys = ir->phys; 388 rc->input_phys = ir->phys;
389 rc->map_name = ir->ir_codes;
390 rc->driver_name = MODULE_NAME;
389 391
390 err = ir_input_register(ir->input, ir->ir_codes, NULL, MODULE_NAME); 392 err = rc_register_device(rc);
391 if (err) 393 if (err)
392 goto err_out_free; 394 goto err_out_free;
393 395
394 printk(MODULE_NAME ": %s detected at %s [%s]\n", 396 printk(MODULE_NAME ": %s detected at %s [%s]\n",
395 ir->input->name, ir->input->phys, adap->name); 397 ir->name, ir->phys, adap->name);
396 398
397 /* start polling via eventd */ 399 /* start polling via eventd */
398 INIT_DELAYED_WORK(&ir->work, ir_work); 400 INIT_DELAYED_WORK(&ir->work, ir_work);
@@ -401,6 +403,7 @@ static int ir_probe(struct i2c_client *client, const struct i2c_device_id *id)
401 return 0; 403 return 0;
402 404
403 err_out_free: 405 err_out_free:
406 rc_free_device(rc);
404 kfree(ir); 407 kfree(ir);
405 return err; 408 return err;
406} 409}
@@ -413,7 +416,7 @@ static int ir_remove(struct i2c_client *client)
413 cancel_delayed_work_sync(&ir->work); 416 cancel_delayed_work_sync(&ir->work);
414 417
415 /* unregister device */ 418 /* unregister device */
416 ir_input_unregister(ir->input); 419 rc_unregister_device(ir->rc);
417 420
418 /* free memory */ 421 /* free memory */
419 kfree(ir); 422 kfree(ir);