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/net/wireless/airo_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/net/wireless/airo_cs.c')
-rw-r--r-- | drivers/net/wireless/airo_cs.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c index 5939d0c7a5c8..63bf662e9c7f 100644 --- a/drivers/net/wireless/airo_cs.c +++ b/drivers/net/wireless/airo_cs.c | |||
@@ -140,25 +140,11 @@ static void airo_detach(struct pcmcia_device *link) | |||
140 | static int airo_cs_config_check(struct pcmcia_device *p_dev, | 140 | static int airo_cs_config_check(struct pcmcia_device *p_dev, |
141 | cistpl_cftable_entry_t *cfg, | 141 | cistpl_cftable_entry_t *cfg, |
142 | cistpl_cftable_entry_t *dflt, | 142 | cistpl_cftable_entry_t *dflt, |
143 | unsigned int vcc, | ||
144 | void *priv_data) | 143 | void *priv_data) |
145 | { | 144 | { |
146 | if (cfg->index == 0) | 145 | if (cfg->index == 0) |
147 | return -ENODEV; | 146 | return -ENODEV; |
148 | 147 | ||
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 | |||
162 | /* IO window settings */ | 148 | /* IO window settings */ |
163 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; | 149 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
164 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 150 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
@@ -193,6 +179,9 @@ static int airo_config(struct pcmcia_device *link) | |||
193 | 179 | ||
194 | dev_dbg(&link->dev, "airo_config\n"); | 180 | dev_dbg(&link->dev, "airo_config\n"); |
195 | 181 | ||
182 | link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP | | ||
183 | CONF_AUTO_AUDIO; | ||
184 | |||
196 | /* | 185 | /* |
197 | * In this loop, we scan the CIS for configuration table | 186 | * In this loop, we scan the CIS for configuration table |
198 | * entries, each of which describes a valid card | 187 | * entries, each of which describes a valid card |