diff options
Diffstat (limited to 'drivers/bluetooth/btuart_cs.c')
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 64 |
1 files changed, 28 insertions, 36 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index 1c4f5e863b03..526b61807d94 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <asm/system.h> | 41 | #include <asm/system.h> |
42 | #include <asm/io.h> | 42 | #include <asm/io.h> |
43 | 43 | ||
44 | #include <pcmcia/cs.h> | ||
45 | #include <pcmcia/cistpl.h> | 44 | #include <pcmcia/cistpl.h> |
46 | #include <pcmcia/ciscode.h> | 45 | #include <pcmcia/ciscode.h> |
47 | #include <pcmcia/ds.h> | 46 | #include <pcmcia/ds.h> |
@@ -586,11 +585,8 @@ static int btuart_probe(struct pcmcia_device *link) | |||
586 | info->p_dev = link; | 585 | info->p_dev = link; |
587 | link->priv = info; | 586 | link->priv = info; |
588 | 587 | ||
589 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; | 588 | link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | |
590 | link->resource[0]->end = 8; | 589 | CONF_AUTO_SET_IO; |
591 | |||
592 | link->conf.Attributes = CONF_ENABLE_IRQ; | ||
593 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
594 | 590 | ||
595 | return btuart_config(link); | 591 | return btuart_config(link); |
596 | } | 592 | } |
@@ -604,43 +600,41 @@ static void btuart_detach(struct pcmcia_device *link) | |||
604 | kfree(info); | 600 | kfree(info); |
605 | } | 601 | } |
606 | 602 | ||
607 | static int btuart_check_config(struct pcmcia_device *p_dev, | 603 | static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data) |
608 | cistpl_cftable_entry_t *cf, | ||
609 | cistpl_cftable_entry_t *dflt, | ||
610 | unsigned int vcc, | ||
611 | void *priv_data) | ||
612 | { | 604 | { |
613 | int *try = priv_data; | 605 | int *try = priv_data; |
614 | 606 | ||
615 | p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; | 607 | if (try == 0) |
608 | p_dev->io_lines = 16; | ||
616 | 609 | ||
617 | if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) | 610 | if ((p_dev->resource[0]->end != 8) || (p_dev->resource[0]->start == 0)) |
618 | p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; | 611 | return -EINVAL; |
619 | if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && | 612 | |
620 | (cf->io.win[0].base != 0)) { | 613 | p_dev->resource[0]->end = 8; |
621 | p_dev->resource[0]->start = cf->io.win[0].base; | 614 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
622 | if (!pcmcia_request_io(p_dev)) | 615 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
623 | return 0; | 616 | |
624 | } | 617 | return pcmcia_request_io(p_dev); |
625 | return -ENODEV; | ||
626 | } | 618 | } |
627 | 619 | ||
628 | static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, | 620 | static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, |
629 | cistpl_cftable_entry_t *cf, | ||
630 | cistpl_cftable_entry_t *dflt, | ||
631 | unsigned int vcc, | ||
632 | void *priv_data) | 621 | void *priv_data) |
633 | { | 622 | { |
634 | static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 623 | static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |
635 | int j; | 624 | int j; |
636 | 625 | ||
637 | if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) { | 626 | if (p_dev->io_lines > 3) |
638 | for (j = 0; j < 5; j++) { | 627 | return -ENODEV; |
639 | p_dev->resource[0]->start = base[j]; | 628 | |
640 | p_dev->io_lines = base[j] ? 16 : 3; | 629 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
641 | if (!pcmcia_request_io(p_dev)) | 630 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
642 | return 0; | 631 | p_dev->resource[0]->end = 8; |
643 | } | 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; | ||
644 | } | 638 | } |
645 | return -ENODEV; | 639 | return -ENODEV; |
646 | } | 640 | } |
@@ -671,7 +665,7 @@ found_port: | |||
671 | if (i != 0) | 665 | if (i != 0) |
672 | goto failed; | 666 | goto failed; |
673 | 667 | ||
674 | i = pcmcia_request_configuration(link, &link->conf); | 668 | i = pcmcia_enable_device(link); |
675 | if (i != 0) | 669 | if (i != 0) |
676 | goto failed; | 670 | goto failed; |
677 | 671 | ||
@@ -695,7 +689,7 @@ static void btuart_release(struct pcmcia_device *link) | |||
695 | pcmcia_disable_device(link); | 689 | pcmcia_disable_device(link); |
696 | } | 690 | } |
697 | 691 | ||
698 | static struct pcmcia_device_id btuart_ids[] = { | 692 | static const struct pcmcia_device_id btuart_ids[] = { |
699 | /* don't use this driver. Use serial_cs + hci_uart instead */ | 693 | /* don't use this driver. Use serial_cs + hci_uart instead */ |
700 | PCMCIA_DEVICE_NULL | 694 | PCMCIA_DEVICE_NULL |
701 | }; | 695 | }; |
@@ -703,9 +697,7 @@ MODULE_DEVICE_TABLE(pcmcia, btuart_ids); | |||
703 | 697 | ||
704 | static struct pcmcia_driver btuart_driver = { | 698 | static struct pcmcia_driver btuart_driver = { |
705 | .owner = THIS_MODULE, | 699 | .owner = THIS_MODULE, |
706 | .drv = { | 700 | .name = "btuart_cs", |
707 | .name = "btuart_cs", | ||
708 | }, | ||
709 | .probe = btuart_probe, | 701 | .probe = btuart_probe, |
710 | .remove = btuart_detach, | 702 | .remove = btuart_detach, |
711 | .id_table = btuart_ids, | 703 | .id_table = btuart_ids, |