diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-02 15:01:15 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-10-02 16:15:16 -0400 |
commit | 8e30783b0b3270736b2cff6415c68b894bc411df (patch) | |
tree | 0b409be3cff1bc39831f10b62a594832e3013387 | |
parent | 6ae5e060840589f567c1837613e8a9d34fc9188a (diff) |
drxk: allow loading firmware synchrousnously
Due to udev-182, the firmware load was changed to be async, as
otherwise udev would give up of loading a firmware.
Add an option to return to the previous behaviour, async firmware
loads cause failures with the tda18271 driver.
Antti tested it with the following hardware:
Hauppauge WinTV HVR 930C
MaxMedia UB425-TC
PCTV QuatroStick nano (520e)
Tested-by: Antti Palosaari <crope@iki.fi>
Cc: stable@kernel.org # for Kernel 3.6 - please note that driver location has changed
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb-frontends/drxk.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb-frontends/drxk_hard.c | 20 |
2 files changed, 17 insertions, 5 deletions
diff --git a/drivers/media/dvb-frontends/drxk.h b/drivers/media/dvb-frontends/drxk.h index d615d7d055a2..94fecfbf14c1 100644 --- a/drivers/media/dvb-frontends/drxk.h +++ b/drivers/media/dvb-frontends/drxk.h | |||
@@ -28,6 +28,7 @@ | |||
28 | * A value of 0 (default) or lower indicates that | 28 | * A value of 0 (default) or lower indicates that |
29 | * the correct number of parameters will be | 29 | * the correct number of parameters will be |
30 | * automatically detected. | 30 | * automatically detected. |
31 | * @load_firmware_sync: Force the firmware load to be synchronous. | ||
31 | * | 32 | * |
32 | * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is | 33 | * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is |
33 | * UIO-3. | 34 | * UIO-3. |
@@ -39,6 +40,7 @@ struct drxk_config { | |||
39 | bool parallel_ts; | 40 | bool parallel_ts; |
40 | bool dynamic_clk; | 41 | bool dynamic_clk; |
41 | bool enable_merr_cfg; | 42 | bool enable_merr_cfg; |
43 | bool load_firmware_sync; | ||
42 | 44 | ||
43 | bool antenna_dvbt; | 45 | bool antenna_dvbt; |
44 | u16 antenna_gpio; | 46 | u16 antenna_gpio; |
diff --git a/drivers/media/dvb-frontends/drxk_hard.c b/drivers/media/dvb-frontends/drxk_hard.c index 1ab8154542da..8b4c6d5f8f36 100644 --- a/drivers/media/dvb-frontends/drxk_hard.c +++ b/drivers/media/dvb-frontends/drxk_hard.c | |||
@@ -6609,15 +6609,25 @@ struct dvb_frontend *drxk_attach(const struct drxk_config *config, | |||
6609 | 6609 | ||
6610 | /* Load firmware and initialize DRX-K */ | 6610 | /* Load firmware and initialize DRX-K */ |
6611 | if (state->microcode_name) { | 6611 | if (state->microcode_name) { |
6612 | status = request_firmware_nowait(THIS_MODULE, 1, | 6612 | if (config->load_firmware_sync) { |
6613 | const struct firmware *fw = NULL; | ||
6614 | |||
6615 | status = request_firmware(&fw, state->microcode_name, | ||
6616 | state->i2c->dev.parent); | ||
6617 | if (status < 0) | ||
6618 | fw = NULL; | ||
6619 | load_firmware_cb(fw, state); | ||
6620 | } else { | ||
6621 | status = request_firmware_nowait(THIS_MODULE, 1, | ||
6613 | state->microcode_name, | 6622 | state->microcode_name, |
6614 | state->i2c->dev.parent, | 6623 | state->i2c->dev.parent, |
6615 | GFP_KERNEL, | 6624 | GFP_KERNEL, |
6616 | state, load_firmware_cb); | 6625 | state, load_firmware_cb); |
6617 | if (status < 0) { | 6626 | if (status < 0) { |
6618 | printk(KERN_ERR | 6627 | printk(KERN_ERR |
6619 | "drxk: failed to request a firmware\n"); | 6628 | "drxk: failed to request a firmware\n"); |
6620 | return NULL; | 6629 | return NULL; |
6630 | } | ||
6621 | } | 6631 | } |
6622 | } else if (init_drxk(state) < 0) | 6632 | } else if (init_drxk(state) < 0) |
6623 | goto error; | 6633 | goto error; |