diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-03-29 18:20:26 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-06 20:44:21 -0400 |
commit | cc26b076cf8b1040ccc514302ef9a24042272ec3 (patch) | |
tree | 6b41545a2d59f531cffd32d7161dcabc1d40d0e1 /drivers/media/video/cx25840 | |
parent | 7c9fc9d50f97c9a6733ff1a22b6e31bcd91778e2 (diff) |
V4L/DVB (11369): v4l2-subdev: add load_fw and use that instead of abusing core->init.
The init callback was used in several places to load firmware. Make a separate
load_fw callback for that. This makes the code a lot more understandable.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx25840')
-rw-r--r-- | drivers/media/video/cx25840/cx25840-core.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index f8ed3c09b17c..51266812d338 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c | |||
@@ -1182,7 +1182,7 @@ static void log_audio_status(struct i2c_client *client) | |||
1182 | 1182 | ||
1183 | /* ----------------------------------------------------------------------- */ | 1183 | /* ----------------------------------------------------------------------- */ |
1184 | 1184 | ||
1185 | /* This init operation must be called to load the driver's firmware. | 1185 | /* This load_fw operation must be called to load the driver's firmware. |
1186 | Without this the audio standard detection will fail and you will | 1186 | Without this the audio standard detection will fail and you will |
1187 | only get mono. | 1187 | only get mono. |
1188 | 1188 | ||
@@ -1192,13 +1192,13 @@ static void log_audio_status(struct i2c_client *client) | |||
1192 | postponing it is that loading this firmware takes a long time (seconds) | 1192 | postponing it is that loading this firmware takes a long time (seconds) |
1193 | due to the slow i2c bus speed. So it will speed up the boot process if | 1193 | due to the slow i2c bus speed. So it will speed up the boot process if |
1194 | you can avoid loading the fw as long as the video device isn't used. */ | 1194 | you can avoid loading the fw as long as the video device isn't used. */ |
1195 | static int cx25840_init(struct v4l2_subdev *sd, u32 val) | 1195 | static int cx25840_load_fw(struct v4l2_subdev *sd) |
1196 | { | 1196 | { |
1197 | struct cx25840_state *state = to_state(sd); | 1197 | struct cx25840_state *state = to_state(sd); |
1198 | struct i2c_client *client = v4l2_get_subdevdata(sd); | 1198 | struct i2c_client *client = v4l2_get_subdevdata(sd); |
1199 | 1199 | ||
1200 | if (!state->is_initialized) { | 1200 | if (!state->is_initialized) { |
1201 | /* initialize on first use */ | 1201 | /* initialize and load firmware */ |
1202 | state->is_initialized = 1; | 1202 | state->is_initialized = 1; |
1203 | if (state->is_cx25836) | 1203 | if (state->is_cx25836) |
1204 | cx25836_initialize(client); | 1204 | cx25836_initialize(client); |
@@ -1473,7 +1473,7 @@ static const struct v4l2_subdev_core_ops cx25840_core_ops = { | |||
1473 | .s_ctrl = cx25840_s_ctrl, | 1473 | .s_ctrl = cx25840_s_ctrl, |
1474 | .queryctrl = cx25840_queryctrl, | 1474 | .queryctrl = cx25840_queryctrl, |
1475 | .reset = cx25840_reset, | 1475 | .reset = cx25840_reset, |
1476 | .init = cx25840_init, | 1476 | .load_fw = cx25840_load_fw, |
1477 | #ifdef CONFIG_VIDEO_ADV_DEBUG | 1477 | #ifdef CONFIG_VIDEO_ADV_DEBUG |
1478 | .g_register = cx25840_g_register, | 1478 | .g_register = cx25840_g_register, |
1479 | .s_register = cx25840_s_register, | 1479 | .s_register = cx25840_s_register, |