summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/dvb/mantis/mantis_hif.c54
-rw-r--r--drivers/media/dvb/mantis/mantis_link.h2
2 files changed, 56 insertions, 0 deletions
diff --git a/drivers/media/dvb/mantis/mantis_hif.c b/drivers/media/dvb/mantis/mantis_hif.c
index 1472008e257e..42aedf7a0147 100644
--- a/drivers/media/dvb/mantis/mantis_hif.c
+++ b/drivers/media/dvb/mantis/mantis_hif.c
@@ -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;
diff --git a/drivers/media/dvb/mantis/mantis_link.h b/drivers/media/dvb/mantis/mantis_link.h
index 8862502866c5..478900ea184d 100644
--- a/drivers/media/dvb/mantis/mantis_link.h
+++ b/drivers/media/dvb/mantis/mantis_link.h
@@ -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