提交 c9a750c9 编写于 作者: M Manu Abraham 提交者: Mauro Carvalho Chehab

V4L/DVB (13742): [Mantis] Implement PCMCIA I/O Rd/Wr operations

Signed-off-by: NManu Abraham <manu@linuxtv.org>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 d8b14f8a
......@@ -111,6 +111,60 @@ int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data)
return 0;
}
int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr, u32 count, u32 *data)
{
struct mantis_pci *mantis = ca->ca_priv;
u32 hif_addr = 0;
hif_addr &= ~MANTIS_GPIF_PCMCIAREG;
hif_addr |= MANTIS_GPIF_HIFRDWRN;
hif_addr |= MANTIS_GPIF_PCMCIAIOM;
hif_addr |= addr;
mmwrite(hif_addr, MANTIS_GPIF_HIFADDR);
ca->hif_job_queue = MANTIS_HIF_IOMRD;
if (mantis_hif_sbuf_opdone_wait(ca) != 0) {
ca->hif_job_queue &= ~MANTIS_HIF_IOMRD;
dprintk(verbose, MANTIS_ERROR, 1, "Adapter(%d) Slot(0): HIF Smart Buffer operation failed", mantis->num);
return -EREMOTEIO;
}
udelay(50);
ca->hif_job_queue &= ~MANTIS_HIF_IOMRD;
*data = mmread(MANTIS_GPIF_HIFDIN);
hif_addr |= MANTIS_GPIF_PCMCIAREG;
mmwrite(hif_addr, MANTIS_GPIF_HIFADDR);
return 0;
}
int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u32 data)
{
struct mantis_pci *mantis = ca->ca_priv;
u32 hif_addr = 0;
hif_addr &= ~MANTIS_GPIF_PCMCIAREG;
hif_addr &= ~MANTIS_GPIF_HIFRDWRN;
hif_addr |= MANTIS_GPIF_PCMCIAIOM;
hif_addr |= addr;
mmwrite(hif_addr, MANTIS_GPIF_HIFADDR);
mmwrite(data, MANTIS_GPIF_HIFDOUT);
ca->hif_job_queue = MANTIS_HIF_IOMWR;
if (mantis_hif_sbuf_opdone_wait(ca) != 0) {
ca->hif_job_queue &= ~MANTIS_HIF_IOMWR;
dprintk(verbose, MANTIS_ERROR, 1, "Adapter(%d) Slot(0): HIF Smart Buffer operation failed", mantis->num);
return -EREMOTEIO;
}
udelay(50);
ca->hif_job_queue &= ~MANTIS_HIF_IOMWR;
hif_addr |= MANTIS_GPIF_PCMCIAREG;
mmwrite(hif_addr, MANTIS_GPIF_HIFADDR);
return 0;
}
int mantis_hif_init(struct mantis_ca *ca)
{
struct mantis_pci *mantis = ca->ca_priv;
......
......@@ -73,5 +73,7 @@ extern int mantis_hif_init(struct mantis_ca *ca);
extern void mantis_hif_exit(struct mantis_ca *ca);
extern int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr);
extern int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data);
extern int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr, u32 count, u32 *data);
extern int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u32 data);
#endif // __MANTIS_LINK_H
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册