Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pcmcia: introduce autoconfiguration feature

Introduce an autoconfiguration feature to set certain values in
pcmcia_loop_config(), instead of copying the same code over and over
in each PCMCIA driver. At first, introduce the following options:

CONF_AUTO_CHECK_VCC check or matching Vcc entry
CONF_AUTO_SET_VPP set Vpp
CONF_AUTO_AUDIO enable the speaker line

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Jiri Kosina <jkosina@suse.cz>
CC: linux-scsi@vger.kernel.org
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> (for drivers/bluetooth)
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

+122 -331
+3 -20
drivers/ata/pata_pcmcia.c
··· 169 169 170 170 struct pcmcia_config_check { 171 171 unsigned long ctl_base; 172 - int skip_vcc; 173 172 int is_kme; 174 173 }; 175 174 176 175 static int pcmcia_check_one_config(struct pcmcia_device *pdev, 177 176 cistpl_cftable_entry_t *cfg, 178 177 cistpl_cftable_entry_t *dflt, 179 - unsigned int vcc, 180 178 void *priv_data) 181 179 { 182 180 struct pcmcia_config_check *stk = priv_data; 183 - 184 - /* Check for matching Vcc, unless we're desperate */ 185 - if (!stk->skip_vcc) { 186 - if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { 187 - if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) 188 - return -ENODEV; 189 - } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { 190 - if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) 191 - return -ENODEV; 192 - } 193 - } 194 - 195 - if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) 196 - pdev->vpp = cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; 197 - else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) 198 - pdev->vpp = dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; 199 181 200 182 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 201 183 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; ··· 231 249 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; 232 250 pdev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; 233 251 pdev->config_flags |= CONF_ENABLE_IRQ; 252 + pdev->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC; 234 253 235 254 /* See if we have a manufacturer identifier. Use it to set is_kme for 236 255 vendor quirks */ ··· 245 262 if (!stk) 246 263 goto out1; 247 264 stk->is_kme = is_kme; 248 - stk->skip_vcc = io_base = ctl_base = 0; 265 + io_base = ctl_base = 0; 249 266 250 267 if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk)) { 251 - stk->skip_vcc = 1; 268 + pdev->config_flags &= ~CONF_AUTO_CHECK_VCC; 252 269 if (pcmcia_loop_config(pdev, pcmcia_check_one_config, stk)) 253 270 goto failed; /* No suitable config found */ 254 271 }
+1 -6
drivers/bluetooth/bt3c_cs.c
··· 659 659 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; 660 660 link->resource[0]->end = 8; 661 661 662 - link->config_flags |= CONF_ENABLE_IRQ; 662 + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP; 663 663 664 664 return bt3c_config(link); 665 665 } ··· 676 676 static int bt3c_check_config(struct pcmcia_device *p_dev, 677 677 cistpl_cftable_entry_t *cf, 678 678 cistpl_cftable_entry_t *dflt, 679 - unsigned int vcc, 680 679 void *priv_data) 681 680 { 682 681 unsigned long try = (unsigned long) priv_data; 683 - 684 682 p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; 685 683 686 - if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) 687 - p_dev->vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 688 684 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && 689 685 (cf->io.win[0].base != 0)) { 690 686 p_dev->resource[0]->start = cf->io.win[0].base; ··· 693 697 static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev, 694 698 cistpl_cftable_entry_t *cf, 695 699 cistpl_cftable_entry_t *dflt, 696 - unsigned int vcc, 697 700 void *priv_data) 698 701 { 699 702 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
+1 -6
drivers/bluetooth/btuart_cs.c
··· 588 588 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; 589 589 link->resource[0]->end = 8; 590 590 591 - link->config_flags |= CONF_ENABLE_IRQ; 591 + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP; 592 592 593 593 return btuart_config(link); 594 594 } ··· 605 605 static int btuart_check_config(struct pcmcia_device *p_dev, 606 606 cistpl_cftable_entry_t *cf, 607 607 cistpl_cftable_entry_t *dflt, 608 - unsigned int vcc, 609 608 void *priv_data) 610 609 { 611 610 int *try = priv_data; 612 - 613 611 p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; 614 612 615 - if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) 616 - p_dev->vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 617 613 if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && 618 614 (cf->io.win[0].base != 0)) { 619 615 p_dev->resource[0]->start = cf->io.win[0].base; ··· 622 626 static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, 623 627 cistpl_cftable_entry_t *cf, 624 628 cistpl_cftable_entry_t *dflt, 625 - unsigned int vcc, 626 629 void *priv_data) 627 630 { 628 631 static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
-1
drivers/bluetooth/dtl1_cs.c
··· 592 592 static int dtl1_confcheck(struct pcmcia_device *p_dev, 593 593 cistpl_cftable_entry_t *cf, 594 594 cistpl_cftable_entry_t *dflt, 595 - unsigned int vcc, 596 595 void *priv_data) 597 596 { 598 597 if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
-1
drivers/char/pcmcia/cm4000_cs.c
··· 1744 1744 static int cm4000_config_check(struct pcmcia_device *p_dev, 1745 1745 cistpl_cftable_entry_t *cfg, 1746 1746 cistpl_cftable_entry_t *dflt, 1747 - unsigned int vcc, 1748 1747 void *priv_data) 1749 1748 { 1750 1749 if (!cfg->io.nwin)
-1
drivers/char/pcmcia/cm4040_cs.c
··· 518 518 static int cm4040_config_check(struct pcmcia_device *p_dev, 519 519 cistpl_cftable_entry_t *cfg, 520 520 cistpl_cftable_entry_t *dflt, 521 - unsigned int vcc, 522 521 void *priv_data) 523 522 { 524 523 int rc;
-1
drivers/char/pcmcia/ipwireless/main.c
··· 78 78 static int ipwireless_probe(struct pcmcia_device *p_dev, 79 79 cistpl_cftable_entry_t *cfg, 80 80 cistpl_cftable_entry_t *dflt, 81 - unsigned int vcc, 82 81 void *priv_data) 83 82 { 84 83 struct ipw_dev *ipw = priv_data;
+3 -20
drivers/ide/ide-cs.c
··· 99 99 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; 100 100 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; 101 101 link->config_flags |= CONF_ENABLE_IRQ; 102 + link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC; 102 103 103 104 return ide_config(link); 104 105 } /* ide_attach */ ··· 196 195 197 196 struct pcmcia_config_check { 198 197 unsigned long ctl_base; 199 - int skip_vcc; 200 198 int is_kme; 201 199 }; 202 200 203 201 static int pcmcia_check_one_config(struct pcmcia_device *pdev, 204 202 cistpl_cftable_entry_t *cfg, 205 203 cistpl_cftable_entry_t *dflt, 206 - unsigned int vcc, 207 204 void *priv_data) 208 205 { 209 206 struct pcmcia_config_check *stk = priv_data; 210 - 211 - /* Check for matching Vcc, unless we're desperate */ 212 - if (!stk->skip_vcc) { 213 - if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { 214 - if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) 215 - return -ENODEV; 216 - } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { 217 - if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) 218 - return -ENODEV; 219 - } 220 - } 221 - 222 - if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) 223 - pdev->vpp = cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; 224 - else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) 225 - pdev->vpp = dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; 226 207 227 208 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 228 209 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; ··· 254 271 if (!stk) 255 272 goto err_mem; 256 273 stk->is_kme = is_kme; 257 - stk->skip_vcc = io_base = ctl_base = 0; 274 + io_base = ctl_base = 0; 258 275 259 276 if (pcmcia_loop_config(link, pcmcia_check_one_config, stk)) { 260 - stk->skip_vcc = 1; 277 + link->config_flags &= ~CONF_AUTO_CHECK_VCC; 261 278 if (pcmcia_loop_config(link, pcmcia_check_one_config, stk)) 262 279 goto failed; /* No suitable config found */ 263 280 }
-1
drivers/isdn/hardware/avm/avm_cs.c
··· 110 110 static int avmcs_configcheck(struct pcmcia_device *p_dev, 111 111 cistpl_cftable_entry_t *cf, 112 112 cistpl_cftable_entry_t *dflt, 113 - unsigned int vcc, 114 113 void *priv_data) 115 114 { 116 115 if (cf->io.nwin <= 0)
-1
drivers/isdn/hisax/avma1_cs.c
··· 117 117 static int avma1cs_configcheck(struct pcmcia_device *p_dev, 118 118 cistpl_cftable_entry_t *cf, 119 119 cistpl_cftable_entry_t *dflt, 120 - unsigned int vcc, 121 120 void *priv_data) 122 121 { 123 122 if (cf->io.nwin <= 0)
-1
drivers/isdn/hisax/elsa_cs.c
··· 163 163 static int elsa_cs_configcheck(struct pcmcia_device *p_dev, 164 164 cistpl_cftable_entry_t *cf, 165 165 cistpl_cftable_entry_t *dflt, 166 - unsigned int vcc, 167 166 void *priv_data) 168 167 { 169 168 int j;
+3 -22
drivers/isdn/hisax/sedlbauer_cs.c
··· 164 164 static int sedlbauer_config_check(struct pcmcia_device *p_dev, 165 165 cistpl_cftable_entry_t *cfg, 166 166 cistpl_cftable_entry_t *dflt, 167 - unsigned int vcc, 168 167 void *priv_data) 169 168 { 170 169 if (cfg->index == 0) 171 170 return -ENODEV; 172 - 173 - /* Does this card need audio output? */ 174 - if (cfg->flags & CISTPL_CFTABLE_AUDIO) 175 - p_dev->config_flags |= CONF_ENABLE_SPKR; 176 - 177 - /* Use power settings for Vcc and Vpp if present */ 178 - /* Note that the CIS values need to be rescaled */ 179 - if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM)) { 180 - if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM]/10000) 181 - return -ENODEV; 182 - } else if (dflt->vcc.present & (1<<CISTPL_POWER_VNOM)) { 183 - if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM]/10000) 184 - return -ENODEV; 185 - } 186 - 187 - if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM)) 188 - p_dev->vpp = cfg->vpp1.param[CISTPL_POWER_VNOM]/10000; 189 - else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM)) 190 - p_dev->vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; 191 - 192 - p_dev->config_flags |= CONF_ENABLE_IRQ; 193 171 194 172 /* IO window settings */ 195 173 p_dev->resource[0]->end = p_dev->resource[1]->end = 0; ··· 200 222 IsdnCard_t icard; 201 223 202 224 dev_dbg(&link->dev, "sedlbauer_config(0x%p)\n", link); 225 + 226 + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_CHECK_VCC | 227 + CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO; 203 228 204 229 /* 205 230 In this loop, we scan the CIS for configuration table entries,
-1
drivers/isdn/hisax/teles_cs.c
··· 145 145 static int teles_cs_configcheck(struct pcmcia_device *p_dev, 146 146 cistpl_cftable_entry_t *cf, 147 147 cistpl_cftable_entry_t *dflt, 148 - unsigned int vcc, 149 148 void *priv_data) 150 149 { 151 150 int j;
-1
drivers/net/pcmcia/axnet_cs.c
··· 287 287 static int axnet_configcheck(struct pcmcia_device *p_dev, 288 288 cistpl_cftable_entry_t *cfg, 289 289 cistpl_cftable_entry_t *dflt, 290 - unsigned int vcc, 291 290 void *priv_data) 292 291 { 293 292 int i;
-1
drivers/net/pcmcia/fmvj18x_cs.c
··· 322 322 static int fmvj18x_ioprobe(struct pcmcia_device *p_dev, 323 323 cistpl_cftable_entry_t *cfg, 324 324 cistpl_cftable_entry_t *dflt, 325 - unsigned int vcc, 326 325 void *priv_data) 327 326 { 328 327 return 0; /* strange, but that's what the code did already before... */
-1
drivers/net/pcmcia/pcnet_cs.c
··· 503 503 static int pcnet_confcheck(struct pcmcia_device *p_dev, 504 504 cistpl_cftable_entry_t *cfg, 505 505 cistpl_cftable_entry_t *dflt, 506 - unsigned int vcc, 507 506 void *priv_data) 508 507 { 509 508 int *priv = priv_data;
-2
drivers/net/pcmcia/smc91c92_cs.c
··· 420 420 static int mhz_mfc_config_check(struct pcmcia_device *p_dev, 421 421 cistpl_cftable_entry_t *cf, 422 422 cistpl_cftable_entry_t *dflt, 423 - unsigned int vcc, 424 423 void *priv_data) 425 424 { 426 425 int k; ··· 589 590 static int smc_configcheck(struct pcmcia_device *p_dev, 590 591 cistpl_cftable_entry_t *cf, 591 592 cistpl_cftable_entry_t *dflt, 592 - unsigned int vcc, 593 593 void *priv_data) 594 594 { 595 595 p_dev->resource[0]->start = cf->io.win[0].base;
+2 -3
drivers/net/pcmcia/xirc2ps_cs.c
··· 668 668 xirc2ps_config_modem(struct pcmcia_device *p_dev, 669 669 cistpl_cftable_entry_t *cf, 670 670 cistpl_cftable_entry_t *dflt, 671 - unsigned int vcc, 672 671 void *priv_data) 673 672 { 674 673 unsigned int ioaddr; ··· 687 688 xirc2ps_config_check(struct pcmcia_device *p_dev, 688 689 cistpl_cftable_entry_t *cf, 689 690 cistpl_cftable_entry_t *dflt, 690 - unsigned int vcc, 691 691 void *priv_data) 692 692 { 693 693 int *pass = priv_data; ··· 824 826 * the Mako if (on the first pass) the COR bit 5 is set. 825 827 */ 826 828 for (pass=0; pass < 2; pass++) 827 - if (!pcmcia_loop_config(link, xirc2ps_config_check, &pass)) 829 + if (!pcmcia_loop_config(link, xirc2ps_config_check, 830 + &pass)) 828 831 goto port_found; 829 832 /* if special option: 830 833 * try to configure as Ethernet only.
+3 -14
drivers/net/wireless/airo_cs.c
··· 140 140 static int airo_cs_config_check(struct pcmcia_device *p_dev, 141 141 cistpl_cftable_entry_t *cfg, 142 142 cistpl_cftable_entry_t *dflt, 143 - unsigned int vcc, 144 143 void *priv_data) 145 144 { 146 145 if (cfg->index == 0) 147 146 return -ENODEV; 148 - 149 - /* Does this card need audio output? */ 150 - if (cfg->flags & CISTPL_CFTABLE_AUDIO) 151 - p_dev->config_flags |= CONF_ENABLE_SPKR; 152 - 153 - /* Use power settings for Vcc and Vpp if present */ 154 - /* Note that the CIS values need to be rescaled */ 155 - if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM)) 156 - p_dev->vpp = cfg->vpp1.param[CISTPL_POWER_VNOM]/10000; 157 - else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM)) 158 - p_dev->vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; 159 - 160 - p_dev->config_flags |= CONF_ENABLE_IRQ; 161 147 162 148 /* IO window settings */ 163 149 p_dev->resource[0]->end = p_dev->resource[1]->end = 0; ··· 178 192 dev = link->priv; 179 193 180 194 dev_dbg(&link->dev, "airo_config\n"); 195 + 196 + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | 197 + CONF_AUTO_AUDIO; 181 198 182 199 /* 183 200 * In this loop, we scan the CIS for configuration table
+3 -14
drivers/net/wireless/atmel_cs.c
··· 157 157 static int atmel_config_check(struct pcmcia_device *p_dev, 158 158 cistpl_cftable_entry_t *cfg, 159 159 cistpl_cftable_entry_t *dflt, 160 - unsigned int vcc, 161 160 void *priv_data) 162 161 { 163 162 if (cfg->index == 0) 164 163 return -ENODEV; 165 - 166 - /* Does this card need audio output? */ 167 - if (cfg->flags & CISTPL_CFTABLE_AUDIO) 168 - p_dev->config_flags |= CONF_ENABLE_SPKR; 169 - 170 - /* Use power settings for Vcc and Vpp if present */ 171 - /* Note that the CIS values need to be rescaled */ 172 - if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM)) 173 - p_dev->vpp = cfg->vpp1.param[CISTPL_POWER_VNOM]/10000; 174 - else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM)) 175 - p_dev->vpp = dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; 176 - 177 - p_dev->config_flags |= CONF_ENABLE_IRQ; 178 164 179 165 /* IO window settings */ 180 166 p_dev->resource[0]->end = p_dev->resource[1]->end = 0; ··· 192 206 did = dev_get_drvdata(&link->dev); 193 207 194 208 dev_dbg(&link->dev, "atmel_config\n"); 209 + 210 + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | 211 + CONF_AUTO_AUDIO; 195 212 196 213 /* 197 214 In this loop, we scan the CIS for configuration table entries,
+4 -23
drivers/net/wireless/hostap/hostap_cs.c
··· 472 472 static int prism2_config_check(struct pcmcia_device *p_dev, 473 473 cistpl_cftable_entry_t *cfg, 474 474 cistpl_cftable_entry_t *dflt, 475 - unsigned int vcc, 476 475 void *priv_data) 477 476 { 478 477 if (cfg->index == 0) ··· 479 480 480 481 PDEBUG(DEBUG_EXTRA, "Checking CFTABLE_ENTRY 0x%02X " 481 482 "(default 0x%02X)\n", cfg->index, dflt->index); 482 - 483 - /* Does this card need audio output? */ 484 - if (cfg->flags & CISTPL_CFTABLE_AUDIO) 485 - p_dev->config_flags |= CONF_ENABLE_SPKR; 486 - 487 - /* Use power settings for Vcc and Vpp if present */ 488 - /* Note that the CIS values need to be rescaled */ 489 - if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { 490 - if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 491 - 10000 && !ignore_cis_vcc) { 492 - PDEBUG(DEBUG_EXTRA, " Vcc mismatch - skipping" 493 - " this entry\n"); 494 - return -ENODEV; 495 - } 496 - } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { 497 - if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 498 - 10000 && !ignore_cis_vcc) { 499 - PDEBUG(DEBUG_EXTRA, " Vcc (default) mismatch " 500 - "- skipping this entry\n"); 501 - return -ENODEV; 502 - } 503 - } 504 483 505 484 if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) 506 485 p_dev->vpp = cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; ··· 530 553 } 531 554 532 555 /* Look for an appropriate configuration table entry in the CIS */ 556 + link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO | 557 + CONF_AUTO_CHECK_VCC; 558 + if (ignore_cis_vcc) 559 + link->config_flags &= ~CONF_AUTO_CHECK_VCC; 533 560 ret = pcmcia_loop_config(link, prism2_config_check, NULL); 534 561 if (ret) { 535 562 if (!ignore_cis_vcc)
-1
drivers/net/wireless/libertas/if_cs.c
··· 797 797 static int if_cs_ioprobe(struct pcmcia_device *p_dev, 798 798 cistpl_cftable_entry_t *cfg, 799 799 cistpl_cftable_entry_t *dflt, 800 - unsigned int vcc, 801 800 void *priv_data) 802 801 { 803 802 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
+3 -28
drivers/net/wireless/orinoco/orinoco_cs.c
··· 145 145 static int orinoco_cs_config_check(struct pcmcia_device *p_dev, 146 146 cistpl_cftable_entry_t *cfg, 147 147 cistpl_cftable_entry_t *dflt, 148 - unsigned int vcc, 149 148 void *priv_data) 150 149 { 151 150 if (cfg->index == 0) 152 151 goto next_entry; 153 - 154 - /* Use power settings for Vcc and Vpp if present */ 155 - /* Note that the CIS values need to be rescaled */ 156 - if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { 157 - if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { 158 - DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", 159 - __func__, vcc, 160 - cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); 161 - if (!ignore_cis_vcc) 162 - goto next_entry; 163 - } 164 - } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { 165 - if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { 166 - DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", 167 - __func__, vcc, 168 - dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); 169 - if (!ignore_cis_vcc) 170 - goto next_entry; 171 - } 172 - } 173 - 174 - if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) 175 - p_dev->vpp = 176 - cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; 177 - else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) 178 - p_dev->vpp = 179 - dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; 180 152 181 153 /* Do we need to allocate an interrupt? */ 182 154 p_dev->config_flags |= CONF_ENABLE_IRQ; ··· 202 230 * and most client drivers will only use the CIS to fill in 203 231 * implementation-defined details. 204 232 */ 233 + link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC; 234 + if (ignore_cis_vcc) 235 + link->config_flags &= ~CONF_AUTO_CHECK_VCC; 205 236 ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL); 206 237 if (ret) { 207 238 if (!ignore_cis_vcc)
+3 -21
drivers/net/wireless/orinoco/spectrum_cs.c
··· 207 207 static int spectrum_cs_config_check(struct pcmcia_device *p_dev, 208 208 cistpl_cftable_entry_t *cfg, 209 209 cistpl_cftable_entry_t *dflt, 210 - unsigned int vcc, 211 210 void *priv_data) 212 211 { 213 212 if (cfg->index == 0) 214 213 goto next_entry; 215 - 216 - /* Use power settings for Vcc and Vpp if present */ 217 - /* Note that the CIS values need to be rescaled */ 218 - if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { 219 - if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) { 220 - DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", 221 - __func__, vcc, 222 - cfg->vcc.param[CISTPL_POWER_VNOM] / 10000); 223 - if (!ignore_cis_vcc) 224 - goto next_entry; 225 - } 226 - } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { 227 - if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) { 228 - DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n", 229 - __func__, vcc, 230 - dflt->vcc.param[CISTPL_POWER_VNOM] / 10000); 231 - if (!ignore_cis_vcc) 232 - goto next_entry; 233 - } 234 - } 235 214 236 215 if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) 237 216 p_dev->vpp = ··· 271 292 * and most client drivers will only use the CIS to fill in 272 293 * implementation-defined details. 273 294 */ 295 + link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC; 296 + if (ignore_cis_vcc) 297 + link->config_flags &= ~CONF_AUTO_CHECK_VCC; 274 298 ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL); 275 299 if (ret) { 276 300 if (!ignore_cis_vcc)
-1
drivers/parport/parport_cs.c
··· 136 136 static int parport_config_check(struct pcmcia_device *p_dev, 137 137 cistpl_cftable_entry_t *cfg, 138 138 cistpl_cftable_entry_t *dflt, 139 - unsigned int vcc, 140 139 void *priv_data) 141 140 { 142 141 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+32 -4
drivers/pcmcia/pcmcia_cis.c
··· 131 131 int (*conf_check) (struct pcmcia_device *p_dev, 132 132 cistpl_cftable_entry_t *cfg, 133 133 cistpl_cftable_entry_t *dflt, 134 - unsigned int vcc, 135 134 void *priv_data); 136 135 cisparse_t parse; 137 136 cistpl_cftable_entry_t dflt; ··· 145 146 */ 146 147 static int pcmcia_do_loop_config(tuple_t *tuple, cisparse_t *parse, void *priv) 147 148 { 148 - cistpl_cftable_entry_t *cfg = &parse->cftable_entry; 149 149 struct pcmcia_cfg_mem *cfg_mem = priv; 150 + struct pcmcia_device *p_dev = cfg_mem->p_dev; 151 + cistpl_cftable_entry_t *cfg = &parse->cftable_entry; 152 + cistpl_cftable_entry_t *dflt = &cfg_mem->dflt; 153 + unsigned int flags = p_dev->config_flags; 154 + unsigned int vcc = p_dev->socket->socket.Vcc; 155 + 156 + dev_dbg(&p_dev->dev, "testing configuration %x, autoconf %x\n", 157 + cfg->index, flags); 150 158 151 159 /* default values */ 152 160 cfg_mem->p_dev->config_index = cfg->index; 153 161 if (cfg->flags & CISTPL_CFTABLE_DEFAULT) 154 162 cfg_mem->dflt = *cfg; 155 163 164 + /* check for matching Vcc? */ 165 + if (flags & CONF_AUTO_CHECK_VCC) { 166 + if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) { 167 + if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) 168 + return -ENODEV; 169 + } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) { 170 + if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) 171 + return -ENODEV; 172 + } 173 + } 174 + 175 + /* set Vpp? */ 176 + if (flags & CONF_AUTO_SET_VPP) { 177 + if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) 178 + p_dev->vpp = cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; 179 + else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) 180 + p_dev->vpp = 181 + dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; 182 + } 183 + 184 + /* enable audio? */ 185 + if ((flags & CONF_AUTO_AUDIO) && (cfg->flags & CISTPL_CFTABLE_AUDIO)) 186 + p_dev->config_flags |= CONF_ENABLE_SPKR; 187 + 156 188 return cfg_mem->conf_check(cfg_mem->p_dev, cfg, &cfg_mem->dflt, 157 - cfg_mem->p_dev->socket->socket.Vcc, 158 189 cfg_mem->priv_data); 159 190 } 160 191 ··· 205 176 int (*conf_check) (struct pcmcia_device *p_dev, 206 177 cistpl_cftable_entry_t *cfg, 207 178 cistpl_cftable_entry_t *dflt, 208 - unsigned int vcc, 209 179 void *priv_data), 210 180 void *priv_data) 211 181 {
-1
drivers/scsi/pcmcia/aha152x_stub.c
··· 124 124 static int aha152x_config_check(struct pcmcia_device *p_dev, 125 125 cistpl_cftable_entry_t *cfg, 126 126 cistpl_cftable_entry_t *dflt, 127 - unsigned int vcc, 128 127 void *priv_data) 129 128 { 130 129 p_dev->io_lines = 10;
-1
drivers/scsi/pcmcia/fdomain_stub.c
··· 106 106 static int fdomain_config_check(struct pcmcia_device *p_dev, 107 107 cistpl_cftable_entry_t *cfg, 108 108 cistpl_cftable_entry_t *dflt, 109 - unsigned int vcc, 110 109 void *priv_data) 111 110 { 112 111 p_dev->io_lines = 10;
+44 -70
drivers/scsi/pcmcia/nsp_cs.c
··· 1597 1597 static int nsp_cs_config_check(struct pcmcia_device *p_dev, 1598 1598 cistpl_cftable_entry_t *cfg, 1599 1599 cistpl_cftable_entry_t *dflt, 1600 - unsigned int vcc, 1601 1600 void *priv_data) 1602 1601 { 1603 1602 nsp_hw_data *data = priv_data; ··· 1604 1605 if (cfg->index == 0) 1605 1606 return -ENODEV; 1606 1607 1607 - /* Does this card need audio output? */ 1608 - if (cfg->flags & CISTPL_CFTABLE_AUDIO) 1609 - p_dev->config_flags |= CONF_ENABLE_SPKR; 1610 - 1611 - /* Use power settings for Vcc and Vpp if present */ 1612 - /* Note that the CIS values need to be rescaled */ 1613 - if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM)) { 1614 - if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM]/10000) 1615 - return -ENODEV; 1616 - else if (dflt->vcc.present & (1<<CISTPL_POWER_VNOM)) { 1617 - if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM]/10000) 1618 - return -ENODEV; 1608 + /* IO window settings */ 1609 + p_dev->resource[0]->end = p_dev->resource[1]->end = 0; 1610 + if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 1611 + cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 1612 + p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; 1613 + p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; 1614 + p_dev->resource[0]->flags |= 1615 + pcmcia_io_cfg_data_width(io->flags); 1616 + p_dev->resource[0]->start = io->win[0].base; 1617 + p_dev->resource[0]->end = io->win[0].len; 1618 + if (io->nwin > 1) { 1619 + p_dev->resource[1]->flags = p_dev->resource[0]->flags; 1620 + p_dev->resource[1]->start = io->win[1].base; 1621 + p_dev->resource[1]->end = io->win[1].len; 1619 1622 } 1620 - 1621 - if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM)) { 1622 - p_dev->vpp = 1623 - cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000; 1624 - } else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM)) { 1625 - p_dev->vpp = 1626 - dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000; 1627 - } 1628 - 1629 - /* Do we need to allocate an interrupt? */ 1630 - p_dev->config_flags |= CONF_ENABLE_IRQ; 1631 - 1632 - /* IO window settings */ 1633 - p_dev->resource[0]->end = p_dev->resource[1]->end = 0; 1634 - if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 1635 - cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 1636 - p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK; 1637 - p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; 1638 - p_dev->resource[0]->flags |= 1639 - pcmcia_io_cfg_data_width(io->flags); 1640 - p_dev->resource[0]->start = io->win[0].base; 1641 - p_dev->resource[0]->end = io->win[0].len; 1642 - if (io->nwin > 1) { 1643 - p_dev->resource[1]->flags = 1644 - p_dev->resource[0]->flags; 1645 - p_dev->resource[1]->start = io->win[1].base; 1646 - p_dev->resource[1]->end = io->win[1].len; 1647 - } 1648 - /* This reserves IO space but doesn't actually enable it */ 1649 - if (pcmcia_request_io(p_dev) != 0) 1650 - goto next_entry; 1651 - } 1652 - 1653 - if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { 1654 - cistpl_mem_t *mem = 1655 - (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; 1656 - p_dev->resource[2]->flags |= (WIN_DATA_WIDTH_16 | 1657 - WIN_MEMORY_TYPE_CM | 1658 - WIN_ENABLE); 1659 - p_dev->resource[2]->start = mem->win[0].host_addr; 1660 - p_dev->resource[2]->end = mem->win[0].len; 1661 - if (p_dev->resource[2]->end < 0x1000) 1662 - p_dev->resource[2]->end = 0x1000; 1663 - if (pcmcia_request_window(p_dev, p_dev->resource[2], 1664 - 0) != 0) 1665 - goto next_entry; 1666 - if (pcmcia_map_mem_page(p_dev, p_dev->resource[2], 1667 - mem->win[0].card_addr) != 0) 1668 - goto next_entry; 1669 - 1670 - data->MmioAddress = (unsigned long) 1671 - ioremap_nocache(p_dev->resource[2]->start, 1672 - resource_size(p_dev->resource[2])); 1673 - data->MmioLength = resource_size(p_dev->resource[2]); 1674 - } 1675 - /* If we got this far, we're cool! */ 1676 - return 0; 1623 + /* This reserves IO space but doesn't actually enable it */ 1624 + if (pcmcia_request_io(p_dev) != 0) 1625 + goto next_entry; 1677 1626 } 1627 + 1628 + if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { 1629 + cistpl_mem_t *mem = 1630 + (cfg->mem.nwin) ? &cfg->mem : &dflt->mem; 1631 + p_dev->resource[2]->flags |= (WIN_DATA_WIDTH_16 | 1632 + WIN_MEMORY_TYPE_CM | 1633 + WIN_ENABLE); 1634 + p_dev->resource[2]->start = mem->win[0].host_addr; 1635 + p_dev->resource[2]->end = mem->win[0].len; 1636 + if (p_dev->resource[2]->end < 0x1000) 1637 + p_dev->resource[2]->end = 0x1000; 1638 + if (pcmcia_request_window(p_dev, p_dev->resource[2], 0) != 0) 1639 + goto next_entry; 1640 + if (pcmcia_map_mem_page(p_dev, p_dev->resource[2], 1641 + mem->win[0].card_addr) != 0) 1642 + goto next_entry; 1643 + 1644 + data->MmioAddress = (unsigned long) 1645 + ioremap_nocache(p_dev->resource[2]->start, 1646 + resource_size(p_dev->resource[2])); 1647 + data->MmioLength = resource_size(p_dev->resource[2]); 1648 + } 1649 + /* If we got this far, we're cool! */ 1650 + return 0; 1678 1651 1679 1652 next_entry: 1680 1653 nsp_dbg(NSP_DEBUG_INIT, "next"); ··· 1662 1691 nsp_hw_data *data = &nsp_data_base; 1663 1692 1664 1693 nsp_dbg(NSP_DEBUG_INIT, "in"); 1694 + 1695 + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_CHECK_VCC | 1696 + CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO; 1665 1697 1666 1698 ret = pcmcia_loop_config(link, nsp_cs_config_check, data); 1667 1699 if (ret)
-1
drivers/scsi/pcmcia/qlogic_stub.c
··· 179 179 static int qlogic_config_check(struct pcmcia_device *p_dev, 180 180 cistpl_cftable_entry_t *cfg, 181 181 cistpl_cftable_entry_t *dflt, 182 - unsigned int vcc, 183 182 void *priv_data) 184 183 { 185 184 p_dev->io_lines = 10;
-1
drivers/scsi/pcmcia/sym53c500_cs.c
··· 686 686 static int SYM53C500_config_check(struct pcmcia_device *p_dev, 687 687 cistpl_cftable_entry_t *cfg, 688 688 cistpl_cftable_entry_t *dflt, 689 - unsigned int vcc, 690 689 void *priv_data) 691 690 { 692 691 p_dev->io_lines = 10;
+1 -9
drivers/serial/serial_cs.c
··· 427 427 static int simple_config_check(struct pcmcia_device *p_dev, 428 428 cistpl_cftable_entry_t *cf, 429 429 cistpl_cftable_entry_t *dflt, 430 - unsigned int vcc, 431 430 void *priv_data) 432 431 { 433 432 static const int size_table[2] = { 8, 16 }; 434 433 int *try = priv_data; 435 - 436 - if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM)) 437 - p_dev->vpp = 438 - cf->vpp1.param[CISTPL_POWER_VNOM] / 10000; 439 434 440 435 p_dev->io_lines = ((*try & 0x1) == 0) ? 441 436 16 : cf->io.flags & CISTPL_IO_LINES_MASK; ··· 447 452 static int simple_config_check_notpicky(struct pcmcia_device *p_dev, 448 453 cistpl_cftable_entry_t *cf, 449 454 cistpl_cftable_entry_t *dflt, 450 - unsigned int vcc, 451 455 void *priv_data) 452 456 { 453 457 static const unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; ··· 473 479 474 480 /* First pass: look for a config entry that looks normal. 475 481 * Two tries: without IO aliases, then with aliases */ 482 + link->config_flags |= CONF_AUTO_SET_VPP; 476 483 for (try = 0; try < 4; try++) 477 484 if (!pcmcia_loop_config(link, simple_config_check, &try)) 478 485 goto found_port; ··· 506 511 static int multi_config_check(struct pcmcia_device *p_dev, 507 512 cistpl_cftable_entry_t *cf, 508 513 cistpl_cftable_entry_t *dflt, 509 - unsigned int vcc, 510 514 void *priv_data) 511 515 { 512 516 int *base2 = priv_data; ··· 526 532 static int multi_config_check_notpicky(struct pcmcia_device *p_dev, 527 533 cistpl_cftable_entry_t *cf, 528 534 cistpl_cftable_entry_t *dflt, 529 - unsigned int vcc, 530 535 void *priv_data) 531 536 { 532 537 int *base2 = priv_data; ··· 614 621 static int serial_check_for_multi(struct pcmcia_device *p_dev, 615 622 cistpl_cftable_entry_t *cf, 616 623 cistpl_cftable_entry_t *dflt, 617 - unsigned int vcc, 618 624 void *priv_data) 619 625 { 620 626 struct serial_info *info = p_dev->priv;
-1
drivers/staging/comedi/drivers/cb_das16_cs.c
··· 712 712 static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev, 713 713 cistpl_cftable_entry_t *cfg, 714 714 cistpl_cftable_entry_t *dflt, 715 - unsigned int vcc, 716 715 void *priv_data) 717 716 { 718 717 if (cfg->index == 0)
-1
drivers/staging/comedi/drivers/das08_cs.c
··· 194 194 static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev, 195 195 cistpl_cftable_entry_t *cfg, 196 196 cistpl_cftable_entry_t *dflt, 197 - unsigned int vcc, 198 197 void *priv_data) 199 198 { 200 199 if (cfg->index == 0)
+2 -8
drivers/staging/comedi/drivers/ni_daq_700.c
··· 532 532 static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev, 533 533 cistpl_cftable_entry_t *cfg, 534 534 cistpl_cftable_entry_t *dflt, 535 - unsigned int vcc, 536 535 void *priv_data) 537 536 { 538 537 if (cfg->index == 0) 539 538 return -ENODEV; 540 - 541 - /* Does this card need audio output? */ 542 - if (cfg->flags & CISTPL_CFTABLE_AUDIO) 543 - p_dev->config_flags |= CONF_ENABLE_SPKR; 544 - 545 - /* Do we need to allocate an interrupt? */ 546 - p_dev->config_flags |= CONF_ENABLE_IRQ; 547 539 548 540 /* IO window settings */ 549 541 p_dev->resource[0]->end = p_dev->resource[1]->end = 0; ··· 569 577 printk(KERN_INFO "ni_daq_700: cs-config\n"); 570 578 571 579 dev_dbg(&link->dev, "dio700_config\n"); 580 + 581 + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_AUDIO; 572 582 573 583 ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop, NULL); 574 584 if (ret) {
+2 -8
drivers/staging/comedi/drivers/ni_daq_dio24.c
··· 284 284 static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev, 285 285 cistpl_cftable_entry_t *cfg, 286 286 cistpl_cftable_entry_t *dflt, 287 - unsigned int vcc, 288 287 void *priv_data) 289 288 { 290 289 if (cfg->index == 0) 291 290 return -ENODEV; 292 - 293 - /* Does this card need audio output? */ 294 - if (cfg->flags & CISTPL_CFTABLE_AUDIO) 295 - p_dev->config_flags |= CONF_ENABLE_SPKR; 296 - 297 - /* Do we need to allocate an interrupt? */ 298 - p_dev->config_flags |= CONF_ENABLE_IRQ; 299 291 300 292 /* IO window settings */ 301 293 p_dev->resource[0]->end = p_dev->resource[1]->end = 0; ··· 320 328 printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO! - config\n"); 321 329 322 330 dev_dbg(&link->dev, "dio24_config\n"); 331 + 332 + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_AUDIO; 323 333 324 334 ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, NULL); 325 335 if (ret) {
+3 -8
drivers/staging/comedi/drivers/ni_labpc_cs.c
··· 263 263 static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev, 264 264 cistpl_cftable_entry_t *cfg, 265 265 cistpl_cftable_entry_t *dflt, 266 - unsigned int vcc, 267 266 void *priv_data) 268 267 { 269 268 if (cfg->index == 0) 270 269 return -ENODEV; 271 - 272 - /* Does this card need audio output? */ 273 - if (cfg->flags & CISTPL_CFTABLE_AUDIO) 274 - p_dev->config_flags |= CONF_ENABLE_SPKR; 275 - 276 - /* Do we need to allocate an interrupt? */ 277 - p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ; 278 270 279 271 /* IO window settings */ 280 272 p_dev->resource[0]->end = p_dev->resource[1]->end = 0; ··· 298 306 int ret; 299 307 300 308 dev_dbg(&link->dev, "labpc_config\n"); 309 + 310 + link->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ | 311 + CONF_AUTO_AUDIO; 301 312 302 313 ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, NULL); 303 314 if (ret) {
-1
drivers/staging/comedi/drivers/ni_mio_cs.c
··· 302 302 static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev, 303 303 cistpl_cftable_entry_t *cfg, 304 304 cistpl_cftable_entry_t *dflt, 305 - unsigned int vcc, 306 305 void *priv_data) 307 306 { 308 307 int base, ret;
-1
drivers/staging/comedi/drivers/quatech_daqp_cs.c
··· 1071 1071 static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev, 1072 1072 cistpl_cftable_entry_t *cfg, 1073 1073 cistpl_cftable_entry_t *dflt, 1074 - unsigned int vcc, 1075 1074 void *priv_data) 1076 1075 { 1077 1076 if (cfg->index == 0)
-1
drivers/telephony/ixj_pcmcia.c
··· 112 112 static int ixj_config_check(struct pcmcia_device *p_dev, 113 113 cistpl_cftable_entry_t *cfg, 114 114 cistpl_cftable_entry_t *dflt, 115 - unsigned int vcc, 116 115 void *priv_data) 117 116 { 118 117 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+3 -21
drivers/usb/host/sl811_cs.c
··· 134 134 static int sl811_cs_config_check(struct pcmcia_device *p_dev, 135 135 cistpl_cftable_entry_t *cfg, 136 136 cistpl_cftable_entry_t *dflt, 137 - unsigned int vcc, 138 137 void *priv_data) 139 138 { 140 139 if (cfg->index == 0) 141 140 return -ENODEV; 142 - 143 - /* Use power settings for Vcc and Vpp if present */ 144 - /* Note that the CIS values need to be rescaled */ 145 - if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM)) { 146 - if (cfg->vcc.param[CISTPL_POWER_VNOM]/10000 != vcc) 147 - return -ENODEV; 148 - } else if (dflt->vcc.present & (1<<CISTPL_POWER_VNOM)) { 149 - if (dflt->vcc.param[CISTPL_POWER_VNOM]/10000 != vcc) 150 - return -ENODEV; 151 - } 152 - 153 - if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM)) 154 - p_dev->vpp = 155 - cfg->vpp1.param[CISTPL_POWER_VNOM]/10000; 156 - else if (dflt->vpp1.present & (1<<CISTPL_POWER_VNOM)) 157 - p_dev->vpp = 158 - dflt->vpp1.param[CISTPL_POWER_VNOM]/10000; 159 - 160 - /* we need an interrupt */ 161 - p_dev->config_flags |= CONF_ENABLE_IRQ; 162 141 163 142 /* IO window settings */ 164 143 p_dev->resource[0]->end = p_dev->resource[1]->end = 0; ··· 162 183 int ret; 163 184 164 185 dev_dbg(&link->dev, "sl811_cs_config\n"); 186 + 187 + link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | 188 + CONF_AUTO_CHECK_VCC; 165 189 166 190 if (pcmcia_loop_config(link, sl811_cs_config_check, NULL)) 167 191 goto failed;
+6 -1
include/pcmcia/ds.h
··· 177 177 int (*conf_check) (struct pcmcia_device *p_dev, 178 178 cistpl_cftable_entry_t *cf, 179 179 cistpl_cftable_entry_t *dflt, 180 - unsigned int vcc, 181 180 void *priv_data), 182 181 void *priv_data); 183 182 ··· 268 269 #define CONF_ENABLE_SPKR 0x02 269 270 #define CONF_ENABLE_PULSE_IRQ 0x04 270 271 #define CONF_ENABLE_ESR 0x08 272 + 273 + /* flags used by pcmcia_loop_config() autoconfiguration */ 274 + #define CONF_AUTO_CHECK_VCC 0x10 /* check for matching Vcc? */ 275 + #define CONF_AUTO_SET_VPP 0x20 /* set Vpp? */ 276 + #define CONF_AUTO_AUDIO 0x40 /* enable audio line? */ 277 + 271 278 272 279 #endif /* __KERNEL__ */ 273 280