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/isdn/hisax | |
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/isdn/hisax')
-rw-r--r-- | drivers/isdn/hisax/avma1_cs.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hisax/elsa_cs.c | 1 | ||||
-rw-r--r-- | drivers/isdn/hisax/sedlbauer_cs.c | 25 | ||||
-rw-r--r-- | drivers/isdn/hisax/teles_cs.c | 1 |
4 files changed, 3 insertions, 25 deletions
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c index 5dd47ad6ecc9..2f2b0005f07b 100644 --- a/drivers/isdn/hisax/avma1_cs.c +++ b/drivers/isdn/hisax/avma1_cs.c | |||
@@ -117,7 +117,6 @@ static void __devexit avma1cs_detach(struct pcmcia_device *link) | |||
117 | static int avma1cs_configcheck(struct pcmcia_device *p_dev, | 117 | static int avma1cs_configcheck(struct pcmcia_device *p_dev, |
118 | cistpl_cftable_entry_t *cf, | 118 | cistpl_cftable_entry_t *cf, |
119 | cistpl_cftable_entry_t *dflt, | 119 | cistpl_cftable_entry_t *dflt, |
120 | unsigned int vcc, | ||
121 | void *priv_data) | 120 | void *priv_data) |
122 | { | 121 | { |
123 | if (cf->io.nwin <= 0) | 122 | if (cf->io.nwin <= 0) |
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index 368c8a213f0b..0a65280be8d5 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c | |||
@@ -163,7 +163,6 @@ static void __devexit elsa_cs_detach(struct pcmcia_device *link) | |||
163 | static int elsa_cs_configcheck(struct pcmcia_device *p_dev, | 163 | static int elsa_cs_configcheck(struct pcmcia_device *p_dev, |
164 | cistpl_cftable_entry_t *cf, | 164 | cistpl_cftable_entry_t *cf, |
165 | cistpl_cftable_entry_t *dflt, | 165 | cistpl_cftable_entry_t *dflt, |
166 | unsigned int vcc, | ||
167 | void *priv_data) | 166 | void *priv_data) |
168 | { | 167 | { |
169 | int j; | 168 | int j; |
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index 791e23a75f78..b69eccfdbb05 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c | |||
@@ -164,33 +164,11 @@ static void __devexit sedlbauer_detach(struct pcmcia_device *link) | |||
164 | static int sedlbauer_config_check(struct pcmcia_device *p_dev, | 164 | static int sedlbauer_config_check(struct pcmcia_device *p_dev, |
165 | cistpl_cftable_entry_t *cfg, | 165 | cistpl_cftable_entry_t *cfg, |
166 | cistpl_cftable_entry_t *dflt, | 166 | cistpl_cftable_entry_t *dflt, |
167 | unsigned int vcc, | ||
168 | void *priv_data) | 167 | void *priv_data) |
169 | { | 168 | { |
170 | if (cfg->index == 0) | 169 | if (cfg->index == 0) |
171 | return -ENODEV; | 170 | return -ENODEV; |
172 | 171 | ||
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 | |||
194 | /* IO window settings */ | 172 | /* IO window settings */ |
195 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; | 173 | p_dev->resource[0]->end = p_dev->resource[1]->end = 0; |
196 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 174 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
@@ -223,6 +201,9 @@ static int __devinit sedlbauer_config(struct pcmcia_device *link) | |||
223 | 201 | ||
224 | dev_dbg(&link->dev, "sedlbauer_config(0x%p)\n", link); | 202 | dev_dbg(&link->dev, "sedlbauer_config(0x%p)\n", link); |
225 | 203 | ||
204 | link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_CHECK_VCC | | ||
205 | CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO; | ||
206 | |||
226 | /* | 207 | /* |
227 | In this loop, we scan the CIS for configuration table entries, | 208 | In this loop, we scan the CIS for configuration table entries, |
228 | each of which describes a valid card configuration, including | 209 | each of which describes a valid card configuration, including |
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index 2ae71e3297ba..6605480aa37f 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c | |||
@@ -145,7 +145,6 @@ static void __devexit teles_detach(struct pcmcia_device *link) | |||
145 | static int teles_cs_configcheck(struct pcmcia_device *p_dev, | 145 | static int teles_cs_configcheck(struct pcmcia_device *p_dev, |
146 | cistpl_cftable_entry_t *cf, | 146 | cistpl_cftable_entry_t *cf, |
147 | cistpl_cftable_entry_t *dflt, | 147 | cistpl_cftable_entry_t *dflt, |
148 | unsigned int vcc, | ||
149 | void *priv_data) | 148 | void *priv_data) |
150 | { | 149 | { |
151 | int j; | 150 | int j; |