aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/au0828/au0828-i2c.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/media/video/au0828/au0828-i2c.c b/drivers/media/video/au0828/au0828-i2c.c
index 05c299fa5d79..d4545550e0dd 100644
--- a/drivers/media/video/au0828/au0828-i2c.c
+++ b/drivers/media/video/au0828/au0828-i2c.c
@@ -26,7 +26,7 @@
26#include <linux/io.h> 26#include <linux/io.h>
27 27
28#include "au0828.h" 28#include "au0828.h"
29 29#include "media/tuner.h"
30#include <media/v4l2-common.h> 30#include <media/v4l2-common.h>
31 31
32static int i2c_scan; 32static int i2c_scan;
@@ -147,8 +147,18 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
147 au0828_write(dev, AU0828_I2C_MULTIBYTE_MODE_2FF, 0x01); 147 au0828_write(dev, AU0828_I2C_MULTIBYTE_MODE_2FF, 0x01);
148 148
149 /* Set the I2C clock */ 149 /* Set the I2C clock */
150 au0828_write(dev, AU0828_I2C_CLK_DIVIDER_202, 150 if ((dev->board.tuner_type == TUNER_XC5000) &&
151 dev->board.i2c_clk_divider); 151 (dev->board.tuner_addr == msg->addr) &&
152 (msg->len == 64)) {
153 /* Hack to speed up firmware load. The xc5000 lets us do up
154 to 400 KHz when in firmware download mode */
155 au0828_write(dev, AU0828_I2C_CLK_DIVIDER_202,
156 AU0828_I2C_CLK_250KHZ);
157 } else {
158 /* Use the i2c clock speed in the board configuration */
159 au0828_write(dev, AU0828_I2C_CLK_DIVIDER_202,
160 dev->board.i2c_clk_divider);
161 }
152 162
153 /* Hardware needs 8 bit addresses */ 163 /* Hardware needs 8 bit addresses */
154 au0828_write(dev, AU0828_I2C_DEST_ADDR_203, msg->addr << 1); 164 au0828_write(dev, AU0828_I2C_DEST_ADDR_203, msg->addr << 1);