aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/vrc4171_card.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/vrc4171_card.c')
-rw-r--r--drivers/pcmcia/vrc4171_card.c70
1 files changed, 0 insertions, 70 deletions
diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c
index 38a028c725d4..24c547ef512b 100644
--- a/drivers/pcmcia/vrc4171_card.c
+++ b/drivers/pcmcia/vrc4171_card.c
@@ -301,75 +301,6 @@ static int pccard_get_status(struct pcmcia_socket *sock, u_int *value)
301 return 0; 301 return 0;
302} 302}
303 303
304static inline u_char get_Vcc_value(uint8_t voltage)
305{
306 switch (voltage) {
307 case VCC_STATUS_3V:
308 return 33;
309 case VCC_STATUS_5V:
310 return 50;
311 default:
312 break;
313 }
314
315 return 0;
316}
317
318static inline u_char get_Vpp_value(uint8_t power, u_char Vcc)
319{
320 if ((power & 0x03) == 0x01 || (power & 0x03) == 0x02)
321 return Vcc;
322
323 return 0;
324}
325
326static int pccard_get_socket(struct pcmcia_socket *sock, socket_state_t *state)
327{
328 unsigned int slot;
329 uint8_t power, voltage, control, cscint;
330
331 if (sock == NULL || sock->sock >= CARD_MAX_SLOTS || state == NULL)
332 return -EINVAL;
333
334 slot = sock->sock;
335
336 power = exca_read_byte(slot, I365_POWER);
337 voltage = exca_read_byte(slot, CARD_VOLTAGE_SELECT);
338
339 state->Vcc = get_Vcc_value(voltage);
340 state->Vpp = get_Vpp_value(power, state->Vcc);
341
342 state->flags = 0;
343 if (power & POWER_ENABLE)
344 state->flags |= SS_PWR_AUTO;
345 if (power & I365_PWR_OUT)
346 state->flags |= SS_OUTPUT_ENA;
347
348 control = exca_read_byte(slot, I365_INTCTL);
349 if (control & I365_PC_IOCARD)
350 state->flags |= SS_IOCARD;
351 if (!(control & I365_PC_RESET))
352 state->flags |= SS_RESET;
353
354 cscint = exca_read_byte(slot, I365_CSCINT);
355 state->csc_mask = 0;
356 if (state->flags & SS_IOCARD) {
357 if (cscint & I365_CSC_STSCHG)
358 state->flags |= SS_STSCHG;
359 } else {
360 if (cscint & I365_CSC_BVD1)
361 state->csc_mask |= SS_BATDEAD;
362 if (cscint & I365_CSC_BVD2)
363 state->csc_mask |= SS_BATWARN;
364 }
365 if (cscint & I365_CSC_READY)
366 state->csc_mask |= SS_READY;
367 if (cscint & I365_CSC_DETECT)
368 state->csc_mask |= SS_DETECT;
369
370 return 0;
371}
372
373static inline uint8_t set_Vcc_value(u_char Vcc) 304static inline uint8_t set_Vcc_value(u_char Vcc)
374{ 305{
375 switch (Vcc) { 306 switch (Vcc) {
@@ -551,7 +482,6 @@ static int pccard_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map
551static struct pccard_operations vrc4171_pccard_operations = { 482static struct pccard_operations vrc4171_pccard_operations = {
552 .init = pccard_init, 483 .init = pccard_init,
553 .get_status = pccard_get_status, 484 .get_status = pccard_get_status,
554 .get_socket = pccard_get_socket,
555 .set_socket = pccard_set_socket, 485 .set_socket = pccard_set_socket,
556 .set_io_map = pccard_set_io_map, 486 .set_io_map = pccard_set_io_map,
557 .set_mem_map = pccard_set_mem_map, 487 .set_mem_map = pccard_set_mem_map,