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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
ac23f4c86c
commit
4d5a28efda
@@ -137,7 +137,7 @@ struct mantis_pci {
|
|||||||
u32 sub_device_id;
|
u32 sub_device_id;
|
||||||
|
|
||||||
/* A12 A13 A14 */
|
/* A12 A13 A14 */
|
||||||
int gpio_status;
|
u32 gpio_status;
|
||||||
|
|
||||||
struct mantis_ca *mantis_ca;
|
struct mantis_ca *mantis_ca;
|
||||||
};
|
};
|
||||||
|
@@ -185,16 +185,15 @@ int mantis_core_exit(struct mantis_pci *mantis)
|
|||||||
// Turn the given bit on or off.
|
// Turn the given bit on or off.
|
||||||
void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value)
|
void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value)
|
||||||
{
|
{
|
||||||
u32 currVal, newVal;
|
u32 cur;
|
||||||
|
|
||||||
currVal = mmread(MANTIS_GPIF_ADDR);
|
|
||||||
|
|
||||||
|
cur = mmread(MANTIS_GPIF_ADDR);
|
||||||
if (value)
|
if (value)
|
||||||
newVal = currVal | (1 << bitpos);
|
mantis->gpio_status = cur | (1 << bitpos);
|
||||||
else
|
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);
|
mmwrite(0x00, MANTIS_GPIF_DOUT);
|
||||||
udelay(100);
|
udelay(100);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user