diff options
author | Jean Delvare <khali@linux-fr.org> | 2009-05-13 15:49:32 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:21:11 -0400 |
commit | 4d7a2d6721a6380d4ffc26d81d2c8232fd0d2dfc (patch) | |
tree | 5ccac1dc6084363abdea5a63fe5d305421bd894c /drivers/media/video/cx231xx/cx231xx-i2c.c | |
parent | c668f32dca105d876e51862a003a302fa61e4ae4 (diff) |
V4L/DVB (11845): ir-kbd-i2c: Use initialization data
For specific boards, pass initialization data to ir-kbd-i2c instead
of modifying the settings after the device is initialized. This is
more efficient and easier to read.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx231xx/cx231xx-i2c.c')
-rw-r--r-- | drivers/media/video/cx231xx/cx231xx-i2c.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/drivers/media/video/cx231xx/cx231xx-i2c.c b/drivers/media/video/cx231xx/cx231xx-i2c.c index ac4099a49da0..33219dc4d649 100644 --- a/drivers/media/video/cx231xx/cx231xx-i2c.c +++ b/drivers/media/video/cx231xx/cx231xx-i2c.c | |||
@@ -424,34 +424,6 @@ static u32 functionality(struct i2c_adapter *adap) | |||
424 | return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C; | 424 | return I2C_FUNC_SMBUS_EMUL | I2C_FUNC_I2C; |
425 | } | 425 | } |
426 | 426 | ||
427 | /* | ||
428 | * attach_inform() | ||
429 | * gets called when a device attaches to the i2c bus | ||
430 | * does some basic configuration | ||
431 | */ | ||
432 | static int attach_inform(struct i2c_client *client) | ||
433 | { | ||
434 | struct cx231xx_i2c *bus = i2c_get_adapdata(client->adapter); | ||
435 | struct cx231xx *dev = bus->dev; | ||
436 | |||
437 | switch (client->addr << 1) { | ||
438 | case 0x8e: | ||
439 | { | ||
440 | struct IR_i2c *ir = i2c_get_clientdata(client); | ||
441 | dprintk1(1, "attach_inform: IR detected (%s).\n", | ||
442 | ir->phys); | ||
443 | cx231xx_set_ir(dev, ir); | ||
444 | break; | ||
445 | } | ||
446 | break; | ||
447 | |||
448 | default: | ||
449 | break; | ||
450 | } | ||
451 | |||
452 | return 0; | ||
453 | } | ||
454 | |||
455 | static struct i2c_algorithm cx231xx_algo = { | 427 | static struct i2c_algorithm cx231xx_algo = { |
456 | .master_xfer = cx231xx_i2c_xfer, | 428 | .master_xfer = cx231xx_i2c_xfer, |
457 | .functionality = functionality, | 429 | .functionality = functionality, |
@@ -462,7 +434,6 @@ static struct i2c_adapter cx231xx_adap_template = { | |||
462 | .name = "cx231xx", | 434 | .name = "cx231xx", |
463 | .id = I2C_HW_B_CX231XX, | 435 | .id = I2C_HW_B_CX231XX, |
464 | .algo = &cx231xx_algo, | 436 | .algo = &cx231xx_algo, |
465 | .client_register = attach_inform, | ||
466 | }; | 437 | }; |
467 | 438 | ||
468 | static struct i2c_client cx231xx_client_template = { | 439 | static struct i2c_client cx231xx_client_template = { |