aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/btuart_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/bluetooth/btuart_cs.c')
-rw-r--r--drivers/bluetooth/btuart_cs.c51
1 files changed, 26 insertions, 25 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 8a6864fc8c3..9f9bb69dc0a 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -585,10 +585,8 @@ static int btuart_probe(struct pcmcia_device *link)
585 info->p_dev = link; 585 info->p_dev = link;
586 link->priv = info; 586 link->priv = info;
587 587
588 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; 588 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP |
589 link->resource[0]->end = 8; 589 CONF_AUTO_SET_IO;
590
591 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP;
592 590
593 return btuart_config(link); 591 return btuart_config(link);
594} 592}
@@ -602,38 +600,41 @@ static void btuart_detach(struct pcmcia_device *link)
602 kfree(info); 600 kfree(info);
603} 601}
604 602
605static int btuart_check_config(struct pcmcia_device *p_dev, 603static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data)
606 cistpl_cftable_entry_t *cf,
607 cistpl_cftable_entry_t *dflt,
608 void *priv_data)
609{ 604{
610 int *try = priv_data; 605 int *try = priv_data;
611 p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
612 606
613 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && 607 if (try == 0)
614 (cf->io.win[0].base != 0)) { 608 p_dev->io_lines = 16;
615 p_dev->resource[0]->start = cf->io.win[0].base; 609
616 if (!pcmcia_request_io(p_dev)) 610 if ((p_dev->resource[0]->end != 8) || (p_dev->resource[0]->start == 0))
617 return 0; 611 return -EINVAL;
618 } 612
619 return -ENODEV; 613 p_dev->resource[0]->end = 8;
614 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
615 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
616
617 return pcmcia_request_io(p_dev);
620} 618}
621 619
622static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, 620static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
623 cistpl_cftable_entry_t *cf,
624 cistpl_cftable_entry_t *dflt,
625 void *priv_data) 621 void *priv_data)
626{ 622{
627 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 623 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
628 int j; 624 int j;
629 625
630 if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { 626 if (p_dev->io_lines > 3)
631 for (j = 0; j < 5; j++) { 627 return -ENODEV;
632 p_dev->resource[0]->start = base[j]; 628
633 p_dev->io_lines = base[j] ? 16 : 3; 629 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
634 if (!pcmcia_request_io(p_dev)) 630 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
635 return 0; 631 p_dev->resource[0]->end = 8;
636 } 632
633 for (j = 0; j < 5; j++) {
634 p_dev->resource[0]->start = base[j];
635 p_dev->io_lines = base[j] ? 16 : 3;
636 if (!pcmcia_request_io(p_dev))
637 return 0;
637 } 638 }
638 return -ENODEV; 639 return -ENODEV;
639} 640}