diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2009-12-04 03:15:38 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-01-17 08:55:35 -0500 |
commit | 4d5a28efda3ce12529e4b90832184f62c7a50848 (patch) | |
tree | 20708b6bb6cc1822e73e7d0f33af7926a6089e57 | |
parent | ac23f4c86c3c901f95d72fc2262b22e6230d4feb (diff) |
V4L/DVB (13750): [Mantis] GPIO_CONTROL: Cache a given GPIO Bit Setup for a given event
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/mantis/mantis_common.h | 2 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_core.c | 11 |
2 files changed, 6 insertions, 7 deletions
diff --git a/drivers/media/dvb/mantis/mantis_common.h b/drivers/media/dvb/mantis/mantis_common.h index 0aa4001dea9c..75f07736e001 100644 --- a/drivers/media/dvb/mantis/mantis_common.h +++ b/drivers/media/dvb/mantis/mantis_common.h | |||
@@ -137,7 +137,7 @@ struct mantis_pci { | |||
137 | u32 sub_device_id; | 137 | u32 sub_device_id; |
138 | 138 | ||
139 | /* A12 A13 A14 */ | 139 | /* A12 A13 A14 */ |
140 | int gpio_status; | 140 | u32 gpio_status; |
141 | 141 | ||
142 | struct mantis_ca *mantis_ca; | 142 | struct mantis_ca *mantis_ca; |
143 | }; | 143 | }; |
diff --git a/drivers/media/dvb/mantis/mantis_core.c b/drivers/media/dvb/mantis/mantis_core.c index b94d0515de4b..3fd3b0801cf4 100644 --- a/drivers/media/dvb/mantis/mantis_core.c +++ b/drivers/media/dvb/mantis/mantis_core.c | |||
@@ -185,16 +185,15 @@ int mantis_core_exit(struct mantis_pci *mantis) | |||
185 | // Turn the given bit on or off. | 185 | // Turn the given bit on or off. |
186 | void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) | 186 | void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) |
187 | { | 187 | { |
188 | u32 currVal, newVal; | 188 | u32 cur; |
189 | |||
190 | currVal = mmread(MANTIS_GPIF_ADDR); | ||
191 | 189 | ||
190 | cur = mmread(MANTIS_GPIF_ADDR); | ||
192 | if (value) | 191 | if (value) |
193 | newVal = currVal | (1 << bitpos); | 192 | mantis->gpio_status = cur | (1 << bitpos); |
194 | else | 193 | else |
195 | newVal = currVal & (~(1 << bitpos)); | 194 | mantis->gpio_status = cur & (~(1 << bitpos)); |
196 | 195 | ||
197 | mmwrite(newVal, MANTIS_GPIF_ADDR); | 196 | mmwrite(mantis->gpio_status, MANTIS_GPIF_ADDR); |
198 | mmwrite(0x00, MANTIS_GPIF_DOUT); | 197 | mmwrite(0x00, MANTIS_GPIF_DOUT); |
199 | udelay(100); | 198 | udelay(100); |
200 | } | 199 | } |