aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 11ce63578e9b..c427c0eeba1d 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -1403,6 +1403,17 @@ EXPORT_SYMBOL_GPL(em28xx_tuner_callback);
1403static void inline em28xx_set_model(struct em28xx *dev) 1403static void inline em28xx_set_model(struct em28xx *dev)
1404{ 1404{
1405 memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board)); 1405 memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board));
1406
1407 /* Those are the default values for the majority of boards
1408 Use those values if not specified otherwise at boards entry
1409 */
1410 if (!dev->board.xclk)
1411 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
1412 EM28XX_XCLK_FREQUENCY_12MHZ;
1413
1414 if (!dev->board.i2c_speed)
1415 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1416 EM28XX_I2C_FREQ_100_KHZ;
1406} 1417}
1407 1418
1408/* Since em28xx_pre_card_setup() requires a proper dev->model, 1419/* Since em28xx_pre_card_setup() requires a proper dev->model,
@@ -1464,17 +1475,8 @@ void em28xx_pre_card_setup(struct em28xx *dev)
1464 if (rc >= 0) 1475 if (rc >= 0)
1465 dev->reg_gpo = rc; 1476 dev->reg_gpo = rc;
1466 1477
1467 /* Those are the default values for the majority of boards 1478 /* Set the initial XCLK and I2C clock values based on the board
1468 Use those values if not specified otherwise at boards entry 1479 definition */
1469 */
1470 if (!dev->board.xclk)
1471 dev->board.xclk = EM28XX_XCLK_IR_RC5_MODE |
1472 EM28XX_XCLK_FREQUENCY_12MHZ;
1473
1474 if (!dev->board.i2c_speed)
1475 dev->board.i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE |
1476 EM28XX_I2C_FREQ_100_KHZ;
1477
1478 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f); 1480 em28xx_write_reg(dev, EM28XX_R0F_XCLK, dev->board.xclk & 0x7f);
1479 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed); 1481 em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, dev->board.i2c_speed);
1480 msleep(50); 1482 msleep(50);