From f37097db4c2acf80ca104250d60535bba9da4dbd Mon Sep 17 00:00:00 2001 From: Manu Abraham Date: Fri, 4 Dec 2009 05:15:38 -0300 Subject: [PATCH 052/120] V4L/DVB (13750): [Mantis] GPIO_CONTROL: Cache a given GPIO Bit Setup for a given event MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab (cherry picked from commit 4d5a28efda3ce12529e4b90832184f62c7a50848) Signed-off-by: Bjørn Mork --- drivers/media/dvb/mantis/mantis_common.h | 2 +- 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 0aa4001..75f0773 100644 --- a/drivers/media/dvb/mantis/mantis_common.h +++ b/drivers/media/dvb/mantis/mantis_common.h @@ -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; }; diff --git a/drivers/media/dvb/mantis/mantis_core.c b/drivers/media/dvb/mantis/mantis_core.c index b94d051..3fd3b08 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) // 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); } -- 1.7.1