aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-06-20 07:24:31 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-06-24 09:33:44 -0400
commit4aeba0134f1e54cfd881e118b039ab6ed8b99126 (patch)
tree6e289b39fe5d0592334ceb5a3e45d05864bb5e9e /drivers/pcmcia
parent6351a71cfae2839cf6e63329d3d85eb46a4bc2c7 (diff)
pcmcia: (re)move {pcmcia,pccard}_get_status
Except for one debug message in a driver marked BROKEN, pcmcia_get_status is only used by the ioctl. Therefore, move it to pcmcia_ioctl.c and unexport it. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/pcmcia')
-rw-r--r--drivers/pcmcia/cs_internal.h1
-rw-r--r--drivers/pcmcia/pcmcia_ioctl.c61
-rw-r--r--drivers/pcmcia/pcmcia_resource.c68
3 files changed, 61 insertions, 69 deletions
diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index 0a9e420defda..63dc1a28bda2 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -118,7 +118,6 @@ extern struct list_head pcmcia_socket_list;
118int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle, int idx, win_req_t *req); 118int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle, int idx, win_req_t *req);
119int pccard_get_configuration_info(struct pcmcia_socket *s, struct pcmcia_device *p_dev, config_info_t *config); 119int pccard_get_configuration_info(struct pcmcia_socket *s, struct pcmcia_device *p_dev, config_info_t *config);
120int pccard_reset_card(struct pcmcia_socket *skt); 120int pccard_reset_card(struct pcmcia_socket *skt);
121int pccard_get_status(struct pcmcia_socket *s, struct pcmcia_device *p_dev, cs_status_t *status);
122 121
123 122
124struct pcmcia_callback{ 123struct pcmcia_callback{
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c
index 2d0521019536..afd00e7bbbef 100644
--- a/drivers/pcmcia/pcmcia_ioctl.c
+++ b/drivers/pcmcia/pcmcia_ioctl.c
@@ -32,6 +32,7 @@
32#include <pcmcia/cs_types.h> 32#include <pcmcia/cs_types.h>
33#include <pcmcia/cs.h> 33#include <pcmcia/cs.h>
34#include <pcmcia/cistpl.h> 34#include <pcmcia/cistpl.h>
35#include <pcmcia/cisreg.h>
35#include <pcmcia/ds.h> 36#include <pcmcia/ds.h>
36#include <pcmcia/ss.h> 37#include <pcmcia/ss.h>
37 38
@@ -224,6 +225,66 @@ static int pcmcia_adjust_resource_info(adjust_t *adj)
224 return (ret); 225 return (ret);
225} 226}
226 227
228/** pccard_get_status
229 *
230 * Get the current socket state bits. We don't support the latched
231 * SocketState yet: I haven't seen any point for it.
232 */
233
234static int pccard_get_status(struct pcmcia_socket *s,
235 struct pcmcia_device *p_dev,
236 cs_status_t *status)
237{
238 config_t *c;
239 int val;
240
241 s->ops->get_status(s, &val);
242 status->CardState = status->SocketState = 0;
243 status->CardState |= (val & SS_DETECT) ? CS_EVENT_CARD_DETECT : 0;
244 status->CardState |= (val & SS_CARDBUS) ? CS_EVENT_CB_DETECT : 0;
245 status->CardState |= (val & SS_3VCARD) ? CS_EVENT_3VCARD : 0;
246 status->CardState |= (val & SS_XVCARD) ? CS_EVENT_XVCARD : 0;
247 if (s->state & SOCKET_SUSPEND)
248 status->CardState |= CS_EVENT_PM_SUSPEND;
249 if (!(s->state & SOCKET_PRESENT))
250 return CS_NO_CARD;
251
252 c = (p_dev) ? p_dev->function_config : NULL;
253
254 if ((c != NULL) && (c->state & CONFIG_LOCKED) &&
255 (c->IntType & (INT_MEMORY_AND_IO | INT_ZOOMED_VIDEO))) {
256 u_char reg;
257 if (c->CardValues & PRESENT_PIN_REPLACE) {
258 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_PRR)>>1, 1, &reg);
259 status->CardState |=
260 (reg & PRR_WP_STATUS) ? CS_EVENT_WRITE_PROTECT : 0;
261 status->CardState |=
262 (reg & PRR_READY_STATUS) ? CS_EVENT_READY_CHANGE : 0;
263 status->CardState |=
264 (reg & PRR_BVD2_STATUS) ? CS_EVENT_BATTERY_LOW : 0;
265 status->CardState |=
266 (reg & PRR_BVD1_STATUS) ? CS_EVENT_BATTERY_DEAD : 0;
267 } else {
268 /* No PRR? Then assume we're always ready */
269 status->CardState |= CS_EVENT_READY_CHANGE;
270 }
271 if (c->CardValues & PRESENT_EXT_STATUS) {
272 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_ESR)>>1, 1, &reg);
273 status->CardState |=
274 (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0;
275 }
276 return CS_SUCCESS;
277 }
278 status->CardState |=
279 (val & SS_WRPROT) ? CS_EVENT_WRITE_PROTECT : 0;
280 status->CardState |=
281 (val & SS_BATDEAD) ? CS_EVENT_BATTERY_DEAD : 0;
282 status->CardState |=
283 (val & SS_BATWARN) ? CS_EVENT_BATTERY_LOW : 0;
284 status->CardState |=
285 (val & SS_READY) ? CS_EVENT_READY_CHANGE : 0;
286 return CS_SUCCESS;
287} /* pccard_get_status */
227 288
228/*====================================================================== 289/*======================================================================
229 290
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index cb6b5da3f29a..4884a18cf9e6 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -309,74 +309,6 @@ int pcmcia_get_window(struct pcmcia_socket *s, window_handle_t *handle,
309EXPORT_SYMBOL(pcmcia_get_window); 309EXPORT_SYMBOL(pcmcia_get_window);
310 310
311 311
312/** pccard_get_status
313 *
314 * Get the current socket state bits. We don't support the latched
315 * SocketState yet: I haven't seen any point for it.
316 */
317
318int pccard_get_status(struct pcmcia_socket *s, struct pcmcia_device *p_dev,
319 cs_status_t *status)
320{
321 config_t *c;
322 int val;
323
324 s->ops->get_status(s, &val);
325 status->CardState = status->SocketState = 0;
326 status->CardState |= (val & SS_DETECT) ? CS_EVENT_CARD_DETECT : 0;
327 status->CardState |= (val & SS_CARDBUS) ? CS_EVENT_CB_DETECT : 0;
328 status->CardState |= (val & SS_3VCARD) ? CS_EVENT_3VCARD : 0;
329 status->CardState |= (val & SS_XVCARD) ? CS_EVENT_XVCARD : 0;
330 if (s->state & SOCKET_SUSPEND)
331 status->CardState |= CS_EVENT_PM_SUSPEND;
332 if (!(s->state & SOCKET_PRESENT))
333 return CS_NO_CARD;
334
335 c = (p_dev) ? p_dev->function_config : NULL;
336
337 if ((c != NULL) && (c->state & CONFIG_LOCKED) &&
338 (c->IntType & (INT_MEMORY_AND_IO | INT_ZOOMED_VIDEO))) {
339 u_char reg;
340 if (c->CardValues & PRESENT_PIN_REPLACE) {
341 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_PRR)>>1, 1, &reg);
342 status->CardState |=
343 (reg & PRR_WP_STATUS) ? CS_EVENT_WRITE_PROTECT : 0;
344 status->CardState |=
345 (reg & PRR_READY_STATUS) ? CS_EVENT_READY_CHANGE : 0;
346 status->CardState |=
347 (reg & PRR_BVD2_STATUS) ? CS_EVENT_BATTERY_LOW : 0;
348 status->CardState |=
349 (reg & PRR_BVD1_STATUS) ? CS_EVENT_BATTERY_DEAD : 0;
350 } else {
351 /* No PRR? Then assume we're always ready */
352 status->CardState |= CS_EVENT_READY_CHANGE;
353 }
354 if (c->CardValues & PRESENT_EXT_STATUS) {
355 pcmcia_read_cis_mem(s, 1, (c->ConfigBase+CISREG_ESR)>>1, 1, &reg);
356 status->CardState |=
357 (reg & ESR_REQ_ATTN) ? CS_EVENT_REQUEST_ATTENTION : 0;
358 }
359 return CS_SUCCESS;
360 }
361 status->CardState |=
362 (val & SS_WRPROT) ? CS_EVENT_WRITE_PROTECT : 0;
363 status->CardState |=
364 (val & SS_BATDEAD) ? CS_EVENT_BATTERY_DEAD : 0;
365 status->CardState |=
366 (val & SS_BATWARN) ? CS_EVENT_BATTERY_LOW : 0;
367 status->CardState |=
368 (val & SS_READY) ? CS_EVENT_READY_CHANGE : 0;
369 return CS_SUCCESS;
370} /* pccard_get_status */
371
372int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status)
373{
374 return pccard_get_status(p_dev->socket, p_dev, status);
375}
376EXPORT_SYMBOL(pcmcia_get_status);
377
378
379
380/** pcmcia_get_mem_page 312/** pcmcia_get_mem_page
381 * 313 *
382 * Change the card address of an already open memory window. 314 * Change the card address of an already open memory window.