diff options
author | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-07-30 03:51:52 -0400 |
---|---|---|
committer | Dominik Brodowski <linux@dominikbrodowski.net> | 2010-09-29 11:20:23 -0400 |
commit | 440eed43e2a95bb842488755683716814da10f2b (patch) | |
tree | 45c49181a077f845cd366cfa7dc07f259fd01078 /drivers/bluetooth/btuart_cs.c | |
parent | 9485ee14e143c7076e88deea1e87ca3eb0b2f94e (diff) |
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>
Diffstat (limited to 'drivers/bluetooth/btuart_cs.c')
-rw-r--r-- | drivers/bluetooth/btuart_cs.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c index c5c43594ae0e..8a6864fc8c38 100644 --- a/drivers/bluetooth/btuart_cs.c +++ b/drivers/bluetooth/btuart_cs.c | |||
@@ -588,7 +588,7 @@ static int btuart_probe(struct pcmcia_device *link) | |||
588 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; | 588 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
589 | link->resource[0]->end = 8; | 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 | return btuart_config(link); | 593 | return btuart_config(link); |
594 | } | 594 | } |
@@ -605,15 +605,11 @@ static void btuart_detach(struct pcmcia_device *link) | |||
605 | static int btuart_check_config(struct pcmcia_device *p_dev, | 605 | static int btuart_check_config(struct pcmcia_device *p_dev, |
606 | cistpl_cftable_entry_t *cf, | 606 | cistpl_cftable_entry_t *cf, |
607 | cistpl_cftable_entry_t *dflt, | 607 | cistpl_cftable_entry_t *dflt, |
608 | unsigned int vcc, | ||
609 | void *priv_data) | 608 | void *priv_data) |
610 | { | 609 | { |
611 | int *try = priv_data; | 610 | int *try = priv_data; |
612 | |||
613 | p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK; | 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 | if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && | 613 | if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) && |
618 | (cf->io.win[0].base != 0)) { | 614 | (cf->io.win[0].base != 0)) { |
619 | p_dev->resource[0]->start = cf->io.win[0].base; | 615 | p_dev->resource[0]->start = cf->io.win[0].base; |
@@ -626,7 +622,6 @@ static int btuart_check_config(struct pcmcia_device *p_dev, | |||
626 | static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, | 622 | static int btuart_check_config_notpicky(struct pcmcia_device *p_dev, |
627 | cistpl_cftable_entry_t *cf, | 623 | cistpl_cftable_entry_t *cf, |
628 | cistpl_cftable_entry_t *dflt, | 624 | cistpl_cftable_entry_t *dflt, |
629 | unsigned int vcc, | ||
630 | void *priv_data) | 625 | void *priv_data) |
631 | { | 626 | { |
632 | static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; | 627 | static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 }; |