summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-01-18 22:28:51 -0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-01-18 22:28:51 -0200
commit5ab66038c4316acb1ed807b40a3a035dd481f4fa (patch)
treef7d62fc365ac76bb05d060a17872fece40625ef7 /linux/drivers
parentb3bd2b4c24de403f1baa56ec2ec452e7f8f9b463 (diff)
parent21ddc1581a225df18d39e8742ced6d3d2bd89003 (diff)
downloadmediapointer-dvb-s2-5ab66038c4316acb1ed807b40a3a035dd481f4fa.tar.gz
mediapointer-dvb-s2-5ab66038c4316acb1ed807b40a3a035dd481f4fa.tar.bz2
merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-cx25840
From: Mauro Carvalho Chehab <mchehab@redhat.com> Priority: normal Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/cx25840/cx25840-core.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx25840/cx25840-core.c b/linux/drivers/media/video/cx25840/cx25840-core.c
index 479700c8c..6d324002a 100644
--- a/linux/drivers/media/video/cx25840/cx25840-core.c
+++ b/linux/drivers/media/video/cx25840/cx25840-core.c
@@ -1120,6 +1120,16 @@ static void log_audio_status(struct i2c_client *client)
/* ----------------------------------------------------------------------- */
+/* This init operation must be called to load the driver's firmware.
+ Without this the audio standard detection will fail and you will
+ only get mono.
+
+ Since loading the firmware is often problematic when the driver is
+ compiled into the kernel I recommend postponing calling this function
+ until the first open of the video device. Another reason for
+ postponing it is that loading this firmware takes a long time (seconds)
+ due to the slow i2c bus speed. So it will speed up the boot process if
+ you can avoid loading the fw as long as the video device isn't used. */
static int cx25840_init(struct v4l2_subdev *sd, u32 val)
{
struct cx25840_state *state = to_state(sd);
@@ -1401,6 +1411,14 @@ static int cx25840_log_status(struct v4l2_subdev *sd)
static int cx25840_command(struct i2c_client *client, unsigned cmd, void *arg)
{
+ /* ignore this command */
+ if (cmd == TUNER_SET_TYPE_ADDR)
+ return 0;
+
+ /* Old-style drivers rely on initialization on first use, so
+ call the init whenever a command is issued to this driver.
+ New-style drivers using v4l2_subdev should call init explicitly. */
+ cx25840_init(i2c_get_clientdata(client), 0);
return v4l2_subdev_command(i2c_get_clientdata(client), cmd, arg);
}