diff options
author | Abylay Ospan <aospan@netup.ru> | 2011-01-02 09:14:00 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-03-22 04:54:11 -0300 |
commit | 8af81ddb12cf34e2f6eab7e130f1e55e1911ab8f (patch) | |
tree | b23fa04b362eae3e9e922897d8d2ce30af03d11a /drivers/media/video/cx23885 | |
parent | 78db66e5b2b4ef48eeede17a7159cb0622c7f03d (diff) | |
download | linux-8af81ddb12cf34e2f6eab7e130f1e55e1911ab8f.tar.bz2 |
[media] Fix CI code for NetUP Dual DVB-T/C CI RF card
CI reset takes several seconds on some CAM,
so there is no need to lock mutex all that time.
Also we need not to preserve CI's reset bits in
CIBUSCTRL register, they are handled automatically by FPGA.
Set it to 0 explicitly in order to not reset wrong CAM.
Signed-off-by: Abylay Ospan <aospan@netup.ru>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885')
-rw-r--r-- | drivers/media/video/cx23885/altera-ci.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/media/video/cx23885/altera-ci.c b/drivers/media/video/cx23885/altera-ci.c index 4269e053830c..678539b2acfa 100644 --- a/drivers/media/video/cx23885/altera-ci.c +++ b/drivers/media/video/cx23885/altera-ci.c @@ -283,7 +283,7 @@ int altera_ci_op_cam(struct dvb_ca_en50221 *en50221, int slot, netup_fpga_op_rw(inter, NETUP_CI_ADDR1, ((addr >> 7) & 0x7f), 0); store = netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, 0, NETUP_CI_FLG_RD); - store &= 0x3f; + store &= 0x0f; store |= ((state->nr << 7) | (flag << 6)); netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, store, 0); @@ -340,19 +340,25 @@ int altera_ci_slot_reset(struct dvb_ca_en50221 *en50221, int slot) ret = netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, 0, NETUP_CI_FLG_RD); netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, - ret | (1 << (5 - state->nr)), 0); + (ret & 0xcf) | (1 << (5 - state->nr)), 0); + + mutex_unlock(&inter->fpga_mutex); for (;;) { mdelay(50); + + mutex_lock(&inter->fpga_mutex); + ret = netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, 0, NETUP_CI_FLG_RD); + mutex_unlock(&inter->fpga_mutex); + if ((ret & (1 << (5 - state->nr))) == 0) break; if (time_after(jiffies, t_out)) break; } - mutex_unlock(&inter->fpga_mutex); ci_dbg_print("%s: %d msecs\n", __func__, jiffies_to_msecs(jiffies + msecs_to_jiffies(9999) - t_out)); @@ -381,7 +387,7 @@ int altera_ci_slot_ts_ctl(struct dvb_ca_en50221 *en50221, int slot) ret = netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, 0, NETUP_CI_FLG_RD); netup_fpga_op_rw(inter, NETUP_CI_BUSCTRL, - ret | (1 << (3 - state->nr)), 0); + (ret & 0x0f) | (1 << (3 - state->nr)), 0); mutex_unlock(&inter->fpga_mutex); |