diff options
author | Marko Ristola <marko.ristola@kolumbus.fi> | 2009-12-04 02:35:35 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-01-17 08:55:30 -0500 |
commit | f8e26cdec5ac25ae8d73e278e21033292de5430b (patch) | |
tree | 3e8255b12283da67776fd2bcfca00c4c0aadfe57 /drivers/media/dvb/mantis | |
parent | 77557abef0de3f1f1e8f563db6df8710a9e930fe (diff) |
V4L/DVB (13718): [Mantis] Use gpio_set_bits to turn OFF the bits as well
Signed-off-by: Marko Ristola <marko.ristola@kolumbus.fi>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/mantis')
-rw-r--r-- | drivers/media/dvb/mantis/mantis_core.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/media/dvb/mantis/mantis_core.c b/drivers/media/dvb/mantis/mantis_core.c index d159ad6fc321..16d693eeb29e 100644 --- a/drivers/media/dvb/mantis/mantis_core.c +++ b/drivers/media/dvb/mantis/mantis_core.c | |||
@@ -172,25 +172,23 @@ int mantis_core_exit(struct mantis_pci *mantis) | |||
172 | return 0; | 172 | return 0; |
173 | } | 173 | } |
174 | 174 | ||
175 | // Turn the given bit on or off. | ||
175 | void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) | 176 | void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) |
176 | { | 177 | { |
177 | u32 reg; | 178 | u32 currVal, newVal; |
179 | |||
180 | currVal = mmread(MANTIS_GPIF_ADDR); | ||
178 | 181 | ||
179 | if (value) | 182 | if (value) |
180 | reg = 0x0000; | 183 | newVal = currVal | (1 << bitpos); |
181 | else | 184 | else |
182 | reg = 0xffff; | 185 | newVal = currVal & (~(1 << bitpos)); |
183 | |||
184 | reg = (value << bitpos); | ||
185 | 186 | ||
186 | mmwrite(mmread(MANTIS_GPIF_ADDR) | reg, MANTIS_GPIF_ADDR); | 187 | mmwrite(newVal, MANTIS_GPIF_ADDR); |
187 | mmwrite(0x00, MANTIS_GPIF_DOUT); | 188 | mmwrite(0x00, MANTIS_GPIF_DOUT); |
188 | udelay(100); | 189 | udelay(100); |
189 | mmwrite(mmread(MANTIS_GPIF_ADDR) | reg, MANTIS_GPIF_ADDR); | ||
190 | mmwrite(0x00, MANTIS_GPIF_DOUT); | ||
191 | } | 190 | } |
192 | 191 | ||
193 | |||
194 | //direction = 0 , no CI passthrough ; 1 , CI passthrough | 192 | //direction = 0 , no CI passthrough ; 1 , CI passthrough |
195 | void mantis_set_direction(struct mantis_pci *mantis, int direction) | 193 | void mantis_set_direction(struct mantis_pci *mantis, int direction) |
196 | { | 194 | { |