Fix for CAMs on Typhoon DVB-S, where it would constantly reset itself.
(Kenneth Aafloy)

Signed-off-by: Johannes Stezenbach <[EMAIL PROTECTED]>

 dvb-core/dvb_ca_en50221.c |    2 +-
 ttpci/budget-av.c         |   13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

Index: linux-2.6.12-rc1-mm1/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
===================================================================
--- linux-2.6.12-rc1-mm1.orig/drivers/media/dvb/dvb-core/dvb_ca_en50221.c       
2005-03-21 23:27:57.000000000 +0100
+++ linux-2.6.12-rc1-mm1/drivers/media/dvb/dvb-core/dvb_ca_en50221.c    
2005-03-22 00:23:49.000000000 +0100
@@ -974,7 +974,7 @@ static void dvb_ca_en50221_thread_update
                        if (ca->open) {
                                if ((!ca->slot_info[slot].da_irq_supported) ||
                                    (!(ca->flags & 
DVB_CA_EN50221_FLAG_IRQ_DA))) {
-                                       delay = HZ / 100;
+                                       delay = HZ / 10;
                                }
                        }
                        break;
Index: linux-2.6.12-rc1-mm1/drivers/media/dvb/ttpci/budget-av.c
===================================================================
--- linux-2.6.12-rc1-mm1.orig/drivers/media/dvb/ttpci/budget-av.c       
2005-03-22 00:16:28.000000000 +0100
+++ linux-2.6.12-rc1-mm1/drivers/media/dvb/ttpci/budget-av.c    2005-03-22 
00:23:49.000000000 +0100
@@ -121,6 +121,8 @@ static int ciintf_read_attribute_mem(str
                return -EINVAL;
 
        saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTHI);
+       udelay(1);
+
        result = ttpci_budget_debiread(&budget_av->budget, DEBICICAM, address & 
0xfff, 1, 0, 0);
 
        if (result == -ETIMEDOUT)
@@ -137,6 +139,8 @@ static int ciintf_write_attribute_mem(st
                return -EINVAL;
 
        saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTHI);
+       udelay(1);
+
        result = ttpci_budget_debiwrite(&budget_av->budget, DEBICICAM, address 
& 0xfff, 1, value, 0, 0);
 
        if (result == -ETIMEDOUT)
@@ -153,6 +157,8 @@ static int ciintf_read_cam_control(struc
                return -EINVAL;
 
        saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTLO);
+       udelay(1);
+
        result = ttpci_budget_debiread(&budget_av->budget, DEBICICAM, address & 
3, 1, 0, 0);
 
        if (result == -ETIMEDOUT)
@@ -169,6 +175,8 @@ static int ciintf_write_cam_control(stru
                return -EINVAL;
 
        saa7146_setgpio(budget_av->budget.dev, 1, SAA7146_GPIO_OUTLO);
+       udelay(1);
+
        result = ttpci_budget_debiwrite(&budget_av->budget, DEBICICAM, address 
& 3, 1, value, 0, 0);
 
        if (result == -ETIMEDOUT)
@@ -190,7 +198,10 @@ static int ciintf_slot_reset(struct dvb_
        saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTHI);
        msleep(100);
        saa7146_setgpio(saa, 0, SAA7146_GPIO_OUTLO);
-       msleep(2000);           /* horrendous I know, but its the only way to 
be absolutely sure without an IRQ line! */
+
+       int max = 20;
+       while (--max > 0 && ciintf_read_attribute_mem(ca, slot, 0) != 0x1d)
+               msleep(100);
 
        ttpci_budget_set_video_port(saa, BUDGET_VIDEO_PORTB);
        return 0;

--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to