]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
V4L/DVB (13750): [Mantis] GPIO_CONTROL: Cache a given GPIO Bit Setup for a given...
authorManu Abraham <abraham.manu@gmail.com>
Fri, 4 Dec 2009 08:15:38 +0000 (05:15 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 17 Jan 2010 13:55:35 +0000 (11:55 -0200)
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/mantis/mantis_common.h
drivers/media/dvb/mantis/mantis_core.c

index 0aa4001dea9c2befeea3a0be7f1d2781eb9d8f47..75f07736e001e7bd9f35d6b23559d2dfb12e8537 100644 (file)
@@ -137,7 +137,7 @@ struct mantis_pci {
        u32                     sub_device_id;
 
         /*     A12 A13 A14             */
-       int                     gpio_status;
+       u32                     gpio_status;
 
        struct mantis_ca        *mantis_ca;
 };
index b94d0515de4b6679a58e8c705bc806536e1d955c..3fd3b0801cf47be05b44f82fb6dd92ee7e2bf176 100644 (file)
@@ -185,16 +185,15 @@ int mantis_core_exit(struct mantis_pci *mantis)
 // Turn the given bit on or off.
 void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value)
 {
-       u32 currVal, newVal;
-
-       currVal = mmread(MANTIS_GPIF_ADDR);
+       u32 cur;
 
+       cur = mmread(MANTIS_GPIF_ADDR);
        if (value)
-               newVal = currVal | (1 << bitpos);
+               mantis->gpio_status = cur | (1 << bitpos);
        else
-               newVal = currVal & (~(1 << bitpos));
+               mantis->gpio_status = cur & (~(1 << bitpos));
 
-       mmwrite(newVal, MANTIS_GPIF_ADDR);
+       mmwrite(mantis->gpio_status, MANTIS_GPIF_ADDR);
        mmwrite(0x00, MANTIS_GPIF_DOUT);
        udelay(100);
 }