forked from Minki/linux
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>
This commit is contained in:
parent
77557abef0
commit
f8e26cdec5
@ -172,25 +172,23 @@ int mantis_core_exit(struct mantis_pci *mantis)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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 reg;
|
u32 currVal, newVal;
|
||||||
|
|
||||||
|
currVal = mmread(MANTIS_GPIF_ADDR);
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
reg = 0x0000;
|
newVal = currVal | (1 << bitpos);
|
||||||
else
|
else
|
||||||
reg = 0xffff;
|
newVal = currVal & (~(1 << bitpos));
|
||||||
|
|
||||||
reg = (value << bitpos);
|
mmwrite(newVal, MANTIS_GPIF_ADDR);
|
||||||
|
|
||||||
mmwrite(mmread(MANTIS_GPIF_ADDR) | reg, MANTIS_GPIF_ADDR);
|
|
||||||
mmwrite(0x00, MANTIS_GPIF_DOUT);
|
mmwrite(0x00, MANTIS_GPIF_DOUT);
|
||||||
udelay(100);
|
udelay(100);
|
||||||
mmwrite(mmread(MANTIS_GPIF_ADDR) | reg, MANTIS_GPIF_ADDR);
|
|
||||||
mmwrite(0x00, MANTIS_GPIF_DOUT);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//direction = 0 , no CI passthrough ; 1 , CI passthrough
|
//direction = 0 , no CI passthrough ; 1 , CI passthrough
|
||||||
void mantis_set_direction(struct mantis_pci *mantis, int direction)
|
void mantis_set_direction(struct mantis_pci *mantis, int direction)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user