summaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorDevin Heitmueller2012-08-07 03:47:04 +0200
committerMauro Carvalho Chehab2012-08-10 01:39:36 +0200
commitfaaf01b2f6be0378c0c6084f0257b150dc014152 (patch)
tree1efc492512b5e405737df9a4917641a3fefc514b /drivers/media/video
parent[media] au0828: fix case where STREAMOFF being called on stopped stream cause... (diff)
downloadkernel-qcow2-linux-faaf01b2f6be0378c0c6084f0257b150dc014152.tar.gz
kernel-qcow2-linux-faaf01b2f6be0378c0c6084f0257b150dc014152.tar.xz
kernel-qcow2-linux-faaf01b2f6be0378c0c6084f0257b150dc014152.zip
[media] au0828: speed up i2c clock when doing xc5000 firmware load
Put a hack in place to speed up the firmware load in the case that the xc5000 has just been reset. The chip can safely do 400 KHz in this mode, while in normal operation it can only do 100 KHz. This reduces the firmware load time from 6.9 seconds to 4.2. Signed-off-by: Devin Heitmueller <dheitmueller@kernellabs.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-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 @@
#include <linux/io.h>
#include "au0828.h"
-
+#include "media/tuner.h"
#include <media/v4l2-common.h>
static int i2c_scan;
@@ -147,8 +147,18 @@ static int i2c_sendbytes(struct i2c_adapter *i2c_adap,
au0828_write(dev, AU0828_I2C_MULTIBYTE_MODE_2FF, 0x01);
/* Set the I2C clock */
- au0828_write(dev, AU0828_I2C_CLK_DIVIDER_202,
- dev->board.i2c_clk_divider);
+ if ((dev->board.tuner_type == TUNER_XC5000) &&
+ (dev->board.tuner_addr == msg->addr) &&
+ (msg->len == 64)) {
+ /* Hack to speed up firmware load. The xc5000 lets us do up
+ to 400 KHz when in firmware download mode */
+ au0828_write(dev, AU0828_I2C_CLK_DIVIDER_202,
+ AU0828_I2C_CLK_250KHZ);
+ } else {
+ /* Use the i2c clock speed in the board configuration */
+ au0828_write(dev, AU0828_I2C_CLK_DIVIDER_202,
+ dev->board.i2c_clk_divider);
+ }
/* Hardware needs 8 bit addresses */
au0828_write(dev, AU0828_I2C_DEST_ADDR_203, msg->addr << 1);