diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2009-12-04 03:10:25 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-01-17 08:55:34 -0500 |
commit | c9a750c909cbde15ecd0f8545f48e051bfee6271 (patch) | |
tree | d83c678ca986d9175925eacb611a410c0972cc20 /drivers | |
parent | d8b14f8a76d71c84622a211f57baf15f61cc9703 (diff) |
V4L/DVB (13742): [Mantis] Implement PCMCIA I/O Rd/Wr operations
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/mantis/mantis_hif.c | 54 | ||||
-rw-r--r-- | drivers/media/dvb/mantis/mantis_link.h | 2 |
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) | |||
111 | return 0; | 111 | return 0; |
112 | } | 112 | } |
113 | 113 | ||
114 | int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr, u32 count, u32 *data) | ||
115 | { | ||
116 | struct mantis_pci *mantis = ca->ca_priv; | ||
117 | u32 hif_addr = 0; | ||
118 | |||
119 | hif_addr &= ~MANTIS_GPIF_PCMCIAREG; | ||
120 | hif_addr |= MANTIS_GPIF_HIFRDWRN; | ||
121 | hif_addr |= MANTIS_GPIF_PCMCIAIOM; | ||
122 | hif_addr |= addr; | ||
123 | |||
124 | mmwrite(hif_addr, MANTIS_GPIF_HIFADDR); | ||
125 | ca->hif_job_queue = MANTIS_HIF_IOMRD; | ||
126 | |||
127 | if (mantis_hif_sbuf_opdone_wait(ca) != 0) { | ||
128 | ca->hif_job_queue &= ~MANTIS_HIF_IOMRD; | ||
129 | dprintk(verbose, MANTIS_ERROR, 1, "Adapter(%d) Slot(0): HIF Smart Buffer operation failed", mantis->num); | ||
130 | return -EREMOTEIO; | ||
131 | } | ||
132 | udelay(50); | ||
133 | ca->hif_job_queue &= ~MANTIS_HIF_IOMRD; | ||
134 | *data = mmread(MANTIS_GPIF_HIFDIN); | ||
135 | hif_addr |= MANTIS_GPIF_PCMCIAREG; | ||
136 | mmwrite(hif_addr, MANTIS_GPIF_HIFADDR); | ||
137 | |||
138 | return 0; | ||
139 | } | ||
140 | |||
141 | int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u32 data) | ||
142 | { | ||
143 | struct mantis_pci *mantis = ca->ca_priv; | ||
144 | u32 hif_addr = 0; | ||
145 | |||
146 | hif_addr &= ~MANTIS_GPIF_PCMCIAREG; | ||
147 | hif_addr &= ~MANTIS_GPIF_HIFRDWRN; | ||
148 | hif_addr |= MANTIS_GPIF_PCMCIAIOM; | ||
149 | hif_addr |= addr; | ||
150 | |||
151 | mmwrite(hif_addr, MANTIS_GPIF_HIFADDR); | ||
152 | mmwrite(data, MANTIS_GPIF_HIFDOUT); | ||
153 | |||
154 | ca->hif_job_queue = MANTIS_HIF_IOMWR; | ||
155 | if (mantis_hif_sbuf_opdone_wait(ca) != 0) { | ||
156 | ca->hif_job_queue &= ~MANTIS_HIF_IOMWR; | ||
157 | dprintk(verbose, MANTIS_ERROR, 1, "Adapter(%d) Slot(0): HIF Smart Buffer operation failed", mantis->num); | ||
158 | return -EREMOTEIO; | ||
159 | } | ||
160 | udelay(50); | ||
161 | ca->hif_job_queue &= ~MANTIS_HIF_IOMWR; | ||
162 | hif_addr |= MANTIS_GPIF_PCMCIAREG; | ||
163 | mmwrite(hif_addr, MANTIS_GPIF_HIFADDR); | ||
164 | |||
165 | return 0; | ||
166 | } | ||
167 | |||
114 | int mantis_hif_init(struct mantis_ca *ca) | 168 | int mantis_hif_init(struct mantis_ca *ca) |
115 | { | 169 | { |
116 | struct mantis_pci *mantis = ca->ca_priv; | 170 | 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); | |||
73 | extern void mantis_hif_exit(struct mantis_ca *ca); | 73 | extern void mantis_hif_exit(struct mantis_ca *ca); |
74 | extern int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr); | 74 | extern int mantis_hif_read_mem(struct mantis_ca *ca, u32 addr); |
75 | extern int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data); | 75 | extern int mantis_hif_write_mem(struct mantis_ca *ca, u32 addr, u8 data); |
76 | extern int mantis_hif_read_iom(struct mantis_ca *ca, u32 addr, u32 count, u32 *data); | ||
77 | extern int mantis_hif_write_iom(struct mantis_ca *ca, u32 addr, u32 data); | ||
76 | 78 | ||
77 | #endif // __MANTIS_LINK_H | 79 | #endif // __MANTIS_LINK_H |