aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx25840
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-07-22 11:52:40 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-10-09 21:03:20 -0400
commitc976bc82339437e840f7dbf0b8c89c09d3fcd75e (patch)
treea8e48cead1f061340fe19890fde43d880c26b92a /drivers/media/video/cx25840
parentfa8a7529ba8c3c2f87dec78ad32c388695f4c1b7 (diff)
V4L/DVB (5922): ivtv, cx25840: postpone fw load until first use
The firmware is now loaded when the driver is actually used for the first time. This allows the driver to be compiled in-kernel instead of as a module. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c21
-rw-r--r--drivers/media/video/cx25840/cx25840-core.h1
2 files changed, 17 insertions, 5 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 67bda9f9a44b..9c12bd39cfb5 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -625,6 +625,22 @@ static int cx25840_command(struct i2c_client *client, unsigned int cmd,
625 struct v4l2_tuner *vt = arg; 625 struct v4l2_tuner *vt = arg;
626 struct v4l2_routing *route = arg; 626 struct v4l2_routing *route = arg;
627 627
628 /* ignore these commands */
629 switch (cmd) {
630 case TUNER_SET_TYPE_ADDR:
631 return 0;
632 }
633
634 if (!state->is_initialized) {
635 v4l_dbg(1, cx25840_debug, client, "cmd %08x triggered fw load\n", cmd);
636 /* initialize on first use */
637 state->is_initialized = 1;
638 if (state->is_cx25836)
639 cx25836_initialize(client);
640 else
641 cx25840_initialize(client, 1);
642 }
643
628 switch (cmd) { 644 switch (cmd) {
629#ifdef CONFIG_VIDEO_ADV_DEBUG 645#ifdef CONFIG_VIDEO_ADV_DEBUG
630 /* ioctls to allow direct access to the 646 /* ioctls to allow direct access to the
@@ -906,11 +922,6 @@ static int cx25840_detect_client(struct i2c_adapter *adapter, int address,
906 922
907 i2c_attach_client(client); 923 i2c_attach_client(client);
908 924
909 if (state->is_cx25836)
910 cx25836_initialize(client);
911 else
912 cx25840_initialize(client, 1);
913
914 return 0; 925 return 0;
915} 926}
916 927
diff --git a/drivers/media/video/cx25840/cx25840-core.h b/drivers/media/video/cx25840/cx25840-core.h
index f4b56d2fd6b6..8c1fbd9b87c1 100644
--- a/drivers/media/video/cx25840/cx25840-core.h
+++ b/drivers/media/video/cx25840/cx25840-core.h
@@ -46,6 +46,7 @@ struct cx25840_state {
46 u32 id; 46 u32 id;
47 u32 rev; 47 u32 rev;
48 int is_cx25836; 48 int is_cx25836;
49 int is_initialized;
49}; 50};
50 51
51/* ----------------------------------------------------------------------- */ 52/* ----------------------------------------------------------------------- */