aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2008-08-02 10:12:00 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2008-08-22 19:22:52 -0400
commitad913c11928f51abb6174f165db8d8d205b22e21 (patch)
treea8542c846afb4950a12f46b16c1eacfa2280971a /drivers/bluetooth
parent8e2fc39ddea7fe8c6798837da282db88a09af793 (diff)
pcmcia: pcmcia_config_loop() improvement by passing vcc
By passing the current Vcc setting to the pcmcia_config_loop callback function, we can remove pcmcia_get_configuration_info() calls from many drivers. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/bt3c_cs.c2
-rw-r--r--drivers/bluetooth/btuart_cs.c11
-rw-r--r--drivers/bluetooth/dtl1_cs.c1
3 files changed, 9 insertions, 5 deletions
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 794a5ef9ea22..3fd8022a6351 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -681,6 +681,7 @@ static void bt3c_detach(struct pcmcia_device *link)
681static int bt3c_check_config(struct pcmcia_device *p_dev, 681static int bt3c_check_config(struct pcmcia_device *p_dev,
682 cistpl_cftable_entry_t *cf, 682 cistpl_cftable_entry_t *cf,
683 cistpl_cftable_entry_t *dflt, 683 cistpl_cftable_entry_t *dflt,
684 unsigned int vcc,
684 void *priv_data) 685 void *priv_data)
685{ 686{
686 unsigned long try = (unsigned long) priv_data; 687 unsigned long try = (unsigned long) priv_data;
@@ -701,6 +702,7 @@ static int bt3c_check_config(struct pcmcia_device *p_dev,
701static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev, 702static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
702 cistpl_cftable_entry_t *cf, 703 cistpl_cftable_entry_t *cf,
703 cistpl_cftable_entry_t *dflt, 704 cistpl_cftable_entry_t *dflt,
705 unsigned int vcc,
704 void *priv_data) 706 void *priv_data)
705{ 707{
706 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 708 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
index 32017f96067c..17183125434f 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
@@ -610,16 +610,17 @@ static void btuart_detach(struct pcmcia_device *link)
610static int btuart_check_config(struct pcmcia_device *p_dev, 610static int btuart_check_config(struct pcmcia_device *p_dev,
611 cistpl_cftable_entry_t *cf, 611 cistpl_cftable_entry_t *cf,
612 cistpl_cftable_entry_t *dflt, 612 cistpl_cftable_entry_t *dflt,
613 unsigned int vcc,
613 void *priv_data) 614 void *priv_data)
614{ 615{
615 unsigned long try = (unsigned long) priv_data; 616 int *try = priv_data;
616 617
617 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) 618 if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
618 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 619 p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
619 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && 620 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
620 (cf->io.win[0].base != 0)) { 621 (cf->io.win[0].base != 0)) {
621 p_dev->io.BasePort1 = cf->io.win[0].base; 622 p_dev->io.BasePort1 = cf->io.win[0].base;
622 p_dev->io.IOAddrLines = (try == 0) ? 16 : 623 p_dev->io.IOAddrLines = (*try == 0) ? 16 :
623 cf->io.flags & CISTPL_IO_LINES_MASK; 624 cf->io.flags & CISTPL_IO_LINES_MASK;
624 if (!pcmcia_request_io(p_dev, &p_dev->io)) 625 if (!pcmcia_request_io(p_dev, &p_dev->io))
625 return 0; 626 return 0;
@@ -630,6 +631,7 @@ static int btuart_check_config(struct pcmcia_device *p_dev,
630static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, 631static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
631 cistpl_cftable_entry_t *cf, 632 cistpl_cftable_entry_t *cf,
632 cistpl_cftable_entry_t *dflt, 633 cistpl_cftable_entry_t *dflt,
634 unsigned int vcc,
633 void *priv_data) 635 void *priv_data)
634{ 636{
635 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; 637 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
@@ -650,13 +652,12 @@ static int btuart_config(struct pcmcia_device *link)
650{ 652{
651 btuart_info_t *info = link->priv; 653 btuart_info_t *info = link->priv;
652 int i; 654 int i;
653 unsigned long try; 655 int try;
654 656
655 /* First pass: look for a config entry that looks normal. 657 /* First pass: look for a config entry that looks normal.
656 Two tries: without IO aliases, then with aliases */ 658 Two tries: without IO aliases, then with aliases */
657 for (try = 0; try < 2; try++) 659 for (try = 0; try < 2; try++)
658 if (!pcmcia_loop_config(link, btuart_check_config, 660 if (!pcmcia_loop_config(link, btuart_check_config, &try))
659 (void *) try))
660 goto found_port; 661 goto found_port;
661 662
662 /* Second pass: try to find an entry that isn't picky about 663 /* Second pass: try to find an entry that isn't picky about
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index 1830ebd6ca7b..ec12560e0342 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -593,6 +593,7 @@ static void dtl1_detach(struct pcmcia_device *link)
593static int dtl1_confcheck(struct pcmcia_device *p_dev, 593static int dtl1_confcheck(struct pcmcia_device *p_dev,
594 cistpl_cftable_entry_t *cf, 594 cistpl_cftable_entry_t *cf,
595 cistpl_cftable_entry_t *dflt, 595 cistpl_cftable_entry_t *dflt,
596 unsigned int vcc,
596 void *priv_data) 597 void *priv_data)
597{ 598{
598 if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) { 599 if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) {