aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2009-12-04 03:31:21 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-01-17 08:55:40 -0500
commitb29f6ac248e49d8425aa91afb1b53d1f6d47ebe3 (patch)
tree6296c2dbdfc9549aaa5396ae67e93827aa0aaef8 /drivers/media/dvb
parentc63e507346c042af7fe26d49bbbdce9898ea3eea (diff)
V4L/DVB (13781): [Mantis CA] Bug: Fix wrong usage of HIFRDWRN
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/mantis/mantis_hif.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/media/dvb/mantis/mantis_hif.c b/drivers/media/dvb/mantis/mantis_hif.c
index 323d1fb0a55e..3368253aea6c 100644
--- a/drivers/media/dvb/mantis/mantis_hif.c
+++ b/drivers/media/dvb/mantis/mantis_hif.c
@@ -53,7 +53,6 @@ static int mantis_hif_sbuf_opdone_wait(struct mantis_ca *ca)
53 } 53 }
54 dprintk(verbose, MANTIS_DEBUG, 1, "Smart Buffer Operation complete"); 54 dprintk(verbose, MANTIS_DEBUG, 1, "Smart Buffer Operation complete");
55 ca->hif_event &= ~MANTIS_SBUF_OPDONE; 55 ca->hif_event &= ~MANTIS_SBUF_OPDONE;
56 udelay(5);
57 return rc; 56 return rc;
58} 57}
59 58
@@ -93,17 +92,16 @@ int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr)
93 u32 hif_addr = 0, data, count = 4; 92 u32 hif_addr = 0, data, count = 4;
94 93
95 dprintk(verbose, MANTIS_DEBUG, 1, "Adapter(%d) Slot(0): Request HIF Mem Read", mantis->num); 94 dprintk(verbose, MANTIS_DEBUG, 1, "Adapter(%d) Slot(0): Request HIF Mem Read", mantis->num);
96 hif_addr |= MANTIS_GPIF_HIFRDWRN;
97 hif_addr &= ~MANTIS_GPIF_PCMCIAREG; 95 hif_addr &= ~MANTIS_GPIF_PCMCIAREG;
98 hif_addr &= ~MANTIS_GPIF_PCMCIAIOM; 96 hif_addr &= ~MANTIS_GPIF_PCMCIAIOM;
97 hif_addr |= MANTIS_HIF_STATUS;
99 hif_addr |= addr; 98 hif_addr |= addr;
100 99
101 mmwrite(hif_addr | MANTIS_HIF_STATUS, MANTIS_GPIF_BRADDR); 100 mmwrite(hif_addr, MANTIS_GPIF_BRADDR);
102 mmwrite(count, MANTIS_GPIF_BRBYTES); 101 mmwrite(count, MANTIS_GPIF_BRBYTES);
103
104 udelay(20); 102 udelay(20);
103 mmwrite(hif_addr | MANTIS_GPIF_HIFRDWRN, MANTIS_GPIF_ADDR);
105 104
106 mmwrite(hif_addr, MANTIS_GPIF_ADDR);
107 if (mantis_hif_sbuf_opdone_wait(ca) != 0) { 105 if (mantis_hif_sbuf_opdone_wait(ca) != 0) {
108 dprintk(verbose, MANTIS_ERROR, 1, "Adapter(%d) Slot(0): GPIF Smart Buffer operation failed", mantis->num); 106 dprintk(verbose, MANTIS_ERROR, 1, "Adapter(%d) Slot(0): GPIF Smart Buffer operation failed", mantis->num);
109 return -EREMOTEIO; 107 return -EREMOTEIO;
@@ -123,10 +121,11 @@ int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data)
123 hif_addr &= ~MANTIS_GPIF_HIFRDWRN; 121 hif_addr &= ~MANTIS_GPIF_HIFRDWRN;
124 hif_addr &= ~MANTIS_GPIF_PCMCIAREG; 122 hif_addr &= ~MANTIS_GPIF_PCMCIAREG;
125 hif_addr &= ~MANTIS_GPIF_PCMCIAIOM; 123 hif_addr &= ~MANTIS_GPIF_PCMCIAIOM;
126 hif_addr |= addr; 124 hif_addr |= MANTIS_HIF_STATUS;
125 hif_addr |= addr;
127 126
128 mmwrite(slot->slave_cfg, MANTIS_GPIF_CFGSLA); /* Slot0 alone for now */ 127 mmwrite(slot->slave_cfg, MANTIS_GPIF_CFGSLA); /* Slot0 alone for now */
129 mmwrite(hif_addr | MANTIS_HIF_STATUS, MANTIS_GPIF_ADDR); 128 mmwrite(hif_addr, MANTIS_GPIF_ADDR);
130 mmwrite(data, MANTIS_GPIF_DOUT); 129 mmwrite(data, MANTIS_GPIF_DOUT);
131 130
132 if (mantis_hif_write_wait(ca) != 0) { 131 if (mantis_hif_write_wait(ca) != 0) {
@@ -145,16 +144,14 @@ int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr)
145 144
146 dprintk(verbose, MANTIS_DEBUG, 1, "Adapter(%d) Slot(0): Request HIF I/O Read", mantis->num); 145 dprintk(verbose, MANTIS_DEBUG, 1, "Adapter(%d) Slot(0): Request HIF I/O Read", mantis->num);
147 hif_addr &= ~MANTIS_GPIF_PCMCIAREG; 146 hif_addr &= ~MANTIS_GPIF_PCMCIAREG;
148 hif_addr |= MANTIS_GPIF_HIFRDWRN;
149 hif_addr |= MANTIS_GPIF_PCMCIAIOM; 147 hif_addr |= MANTIS_GPIF_PCMCIAIOM;
148 hif_addr |= MANTIS_HIF_STATUS;
150 hif_addr |= addr; 149 hif_addr |= addr;
151 150
152 mmwrite(hif_addr | MANTIS_HIF_STATUS, MANTIS_GPIF_BRADDR); 151 mmwrite(hif_addr, MANTIS_GPIF_BRADDR);
153 mmwrite(1, MANTIS_GPIF_BRBYTES); 152 mmwrite(1, MANTIS_GPIF_BRBYTES);
154
155 udelay(20); 153 udelay(20);
156 154 mmwrite(hif_addr | MANTIS_GPIF_HIFRDWRN, MANTIS_GPIF_ADDR);
157 mmwrite(hif_addr | MANTIS_HIF_STATUS, MANTIS_GPIF_ADDR);
158 155
159 if (mantis_hif_sbuf_opdone_wait(ca) != 0) { 156 if (mantis_hif_sbuf_opdone_wait(ca) != 0) {
160 dprintk(verbose, MANTIS_ERROR, 1, "Adapter(%d) Slot(0): HIF Smart Buffer operation failed", mantis->num); 157 dprintk(verbose, MANTIS_ERROR, 1, "Adapter(%d) Slot(0): HIF Smart Buffer operation failed", mantis->num);
@@ -176,9 +173,10 @@ int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u8 data)
176 hif_addr &= ~MANTIS_GPIF_PCMCIAREG; 173 hif_addr &= ~MANTIS_GPIF_PCMCIAREG;
177 hif_addr &= ~MANTIS_GPIF_HIFRDWRN; 174 hif_addr &= ~MANTIS_GPIF_HIFRDWRN;
178 hif_addr |= MANTIS_GPIF_PCMCIAIOM; 175 hif_addr |= MANTIS_GPIF_PCMCIAIOM;
176 hif_addr |= MANTIS_HIF_STATUS;
179 hif_addr |= addr; 177 hif_addr |= addr;
180 178
181 mmwrite(hif_addr | MANTIS_HIF_STATUS, MANTIS_GPIF_ADDR); 179 mmwrite(hif_addr, MANTIS_GPIF_ADDR);
182 mmwrite(data, MANTIS_GPIF_DOUT); 180 mmwrite(data, MANTIS_GPIF_DOUT);
183 181
184 if (mantis_hif_write_wait(ca) != 0) { 182 if (mantis_hif_write_wait(ca) != 0) {