[PATCH] pcmcia: remove unneeded Vcc pseudo setting

As we do not allow setting Vcc in the pcmcia core, and Vpp1 and
Vpp2 can only be set to the same value, a lot of code can be
streamlined.

Signed-off-by: Dominik Brodowski <[email protected]>
This commit is contained in:
Dominik Brodowski 2006-01-15 12:43:16 +01:00
commit 70294b4683
46 changed files with 64 additions and 207 deletions

View file

@ -280,7 +280,6 @@ static int tc574_attach(struct pcmcia_device *p_dev)
link->irq.Handler = &el3_interrupt;
link->irq.Instance = dev;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;

View file

@ -194,7 +194,6 @@ static int tc589_attach(struct pcmcia_device *p_dev)
link->irq.Handler = &el3_interrupt;
link->irq.Instance = dev;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;

View file

@ -302,7 +302,6 @@ static void axnet_config(dev_link_t *link)
cisparse_t parse;
int i, j, last_ret, last_fn;
u_short buf[64];
config_info_t conf;
DEBUG(0, "axnet_config(0x%p)\n", link);
@ -321,10 +320,6 @@ static void axnet_config(dev_link_t *link)
/* Configure card */
link->state |= DEV_CONFIG;
/* Look up current Vcc */
CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
link->conf.Vcc = conf.Vcc;
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
tuple.Attributes = 0;
CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple));

View file

@ -178,7 +178,6 @@ static int com20020_attach(struct pcmcia_device *p_dev)
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.Present = PRESENT_OPTION;

View file

@ -257,7 +257,6 @@ static int fmvj18x_attach(struct pcmcia_device *p_dev)
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
/* The FMVJ18x specific entries in the device structure. */
@ -396,12 +395,7 @@ static void fmvj18x_config(dev_link_t *link)
switch (le16_to_cpu(buf[0])) {
case MANFID_TDK:
cardtype = TDK;
if (le16_to_cpu(buf[1]) == PRODID_TDK_CF010) {
cs_status_t status;
pcmcia_get_status(handle, &status);
if (status.CardState & CS_EVENT_3VCARD)
link->conf.Vcc = 33; /* inserted in 3.3V slot */
} else if (le16_to_cpu(buf[1]) == PRODID_TDK_GN3410
if (le16_to_cpu(buf[1]) == PRODID_TDK_GN3410
|| le16_to_cpu(buf[1]) == PRODID_TDK_NP9610
|| le16_to_cpu(buf[1]) == PRODID_TDK_MN3200) {
/* MultiFunction Card */

View file

@ -167,7 +167,6 @@ static int ibmtr_attach(struct pcmcia_device *p_dev)
link->irq.IRQInfo1 = IRQ_LEVEL_ID;
link->irq.Handler = &tok_interrupt;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.Present = PRESENT_OPTION;

View file

@ -469,7 +469,6 @@ static int nmclan_attach(struct pcmcia_device *p_dev)
link->irq.Handler = &mace_interrupt;
link->irq.Instance = dev;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;

View file

@ -531,7 +531,6 @@ static void pcnet_config(dev_link_t *link)
int i, last_ret, last_fn, start_pg, stop_pg, cm_offset;
int manfid = 0, prodid = 0, has_shmem = 0;
u_short buf[64];
config_info_t conf;
hw_info_t *hw_info;
DEBUG(0, "pcnet_config(0x%p)\n", link);
@ -550,10 +549,6 @@ static void pcnet_config(dev_link_t *link)
/* Configure card */
link->state |= DEV_CONFIG;
/* Look up current Vcc */
CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf));
link->conf.Vcc = conf.Vcc;
tuple.DesiredTuple = CISTPL_MANFID;
tuple.Attributes = TUPLE_RETURN_COMMON;
if ((pcmcia_get_first_tuple(handle, &tuple) == CS_SUCCESS) &&

View file

@ -334,7 +334,6 @@ static int smc91c92_attach(struct pcmcia_device *p_dev)
link->irq.Handler = &smc_interrupt;
link->irq.Instance = dev;
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
/* The SMC91c92-specific entries in the device structure. */

View file

@ -571,7 +571,6 @@ xirc2ps_attach(struct pcmcia_device *p_dev)
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;

View file

@ -168,7 +168,6 @@ static int airo_attach(struct pcmcia_device *p_dev)
device, and can be hard-wired here.
*/
link->conf.Attributes = 0;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
/* Allocate space for private device-specific data */
@ -294,16 +293,11 @@ static void airo_config(dev_link_t *link)
/* Use power settings for Vcc and Vpp if present */
/* Note that the CIS values need to be rescaled */
if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM))
link->conf.Vcc = cfg->vcc.param[CISTPL_POWER_VNOM]/10000;
else if (dflt.vcc.present & (1<<CISTPL_POWER_VNOM))
link->conf.Vcc = dflt.vcc.param[CISTPL_POWER_VNOM]/10000;
if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
cfg->vpp1.param[CISTPL_POWER_VNOM]/10000;
else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
dflt.vpp1.param[CISTPL_POWER_VNOM]/10000;
/* Do we need to allocate an interrupt? */
@ -391,11 +385,10 @@ static void airo_config(dev_link_t *link)
link->dev = &dev->node;
/* Finally, report what we've done */
printk(KERN_INFO "%s: index 0x%02x: Vcc %d.%d",
dev->node.dev_name, link->conf.ConfigIndex,
link->conf.Vcc/10, link->conf.Vcc%10);
if (link->conf.Vpp1)
printk(", Vpp %d.%d", link->conf.Vpp1/10, link->conf.Vpp1%10);
printk(KERN_INFO "%s: index 0x%02x: ",
dev->node.dev_name, link->conf.ConfigIndex);
if (link->conf.Vpp)
printk(", Vpp %d.%d", link->conf.Vpp/10, link->conf.Vpp%10);
if (link->conf.Attributes & CONF_ENABLE_IRQ)
printk(", irq %d", link->irq.AssignedIRQ);
if (link->io.NumPorts1)

View file

@ -179,7 +179,6 @@ static int atmel_attach(struct pcmcia_device *p_dev)
device, and can be hard-wired here.
*/
link->conf.Attributes = 0;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
/* Allocate space for private device-specific data */
@ -314,16 +313,11 @@ static void atmel_config(dev_link_t *link)
/* Use power settings for Vcc and Vpp if present */
/* Note that the CIS values need to be rescaled */
if (cfg->vcc.present & (1<<CISTPL_POWER_VNOM))
link->conf.Vcc = cfg->vcc.param[CISTPL_POWER_VNOM]/10000;
else if (dflt.vcc.present & (1<<CISTPL_POWER_VNOM))
link->conf.Vcc = dflt.vcc.param[CISTPL_POWER_VNOM]/10000;
if (cfg->vpp1.present & (1<<CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
cfg->vpp1.param[CISTPL_POWER_VNOM]/10000;
else if (dflt.vpp1.present & (1<<CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
dflt.vpp1.param[CISTPL_POWER_VNOM]/10000;
/* Do we need to allocate an interrupt? */

View file

@ -512,7 +512,6 @@ static int prism2_attach(struct pcmcia_device *p_dev)
memset(link, 0, sizeof(dev_link_t));
PDEBUG(DEBUG_HW, "%s: setting Vcc=33 (constant)\n", dev_info);
link->conf.Vcc = 33;
link->conf.IntType = INT_MEMORY_AND_IO;
link->handle = p_dev;
@ -603,9 +602,6 @@ static int prism2_config(dev_link_t *link)
CS_CHECK(GetConfigurationInfo,
pcmcia_get_configuration_info(link->handle, &conf));
PDEBUG(DEBUG_HW, "%s: %s Vcc=%d (from config)\n", dev_info,
ignore_cis_vcc ? "ignoring" : "setting", conf.Vcc);
link->conf.Vcc = conf.Vcc;
/* Look for an appropriate configuration table entry in the CIS */
tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
@ -650,10 +646,10 @@ static int prism2_config(dev_link_t *link)
}
if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000;
else if (dflt.vpp1.present & (1 << CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
dflt.vpp1.param[CISTPL_POWER_VNOM] / 10000;
/* Do we need to allocate an interrupt? */
@ -745,12 +741,11 @@ static int prism2_config(dev_link_t *link)
dev->base_addr = link->io.BasePort1;
/* Finally, report what we've done */
printk(KERN_INFO "%s: index 0x%02x: Vcc %d.%d",
dev_info, link->conf.ConfigIndex,
link->conf.Vcc / 10, link->conf.Vcc % 10);
if (link->conf.Vpp1)
printk(", Vpp %d.%d", link->conf.Vpp1 / 10,
link->conf.Vpp1 % 10);
printk(KERN_INFO "%s: index 0x%02x: ",
dev_info, link->conf.ConfigIndex);
if (link->conf.Vpp)
printk(", Vpp %d.%d", link->conf.Vpp / 10,
link->conf.Vpp % 10);
if (link->conf.Attributes & CONF_ENABLE_IRQ)
printk(", irq %d", link->irq.AssignedIRQ);
if (link->io.NumPorts1)

View file

@ -406,7 +406,6 @@ static int netwave_attach(struct pcmcia_device *p_dev)
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;

View file

@ -218,8 +218,7 @@ orinoco_cs_config(dev_link_t *link)
/* Look up the current Vcc */
CS_CHECK(GetConfigurationInfo,
pcmcia_get_configuration_info(handle, &conf));
link->conf.Vcc = conf.Vcc;
pcmcia_get_configuration_info(link->handle, &conf));
/*
* In this loop, we scan the CIS for configuration table
@ -274,10 +273,10 @@ orinoco_cs_config(dev_link_t *link)
}
if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000;
else if (dflt.vpp1.present & (1 << CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
dflt.vpp1.param[CISTPL_POWER_VNOM] / 10000;
/* Do we need to allocate an interrupt? */
@ -373,12 +372,11 @@ orinoco_cs_config(dev_link_t *link)
link->state &= ~DEV_CONFIG_PENDING;
/* Finally, report what we've done */
printk(KERN_DEBUG "%s: index 0x%02x: Vcc %d.%d",
dev->name, link->conf.ConfigIndex,
link->conf.Vcc / 10, link->conf.Vcc % 10);
if (link->conf.Vpp1)
printk(", Vpp %d.%d", link->conf.Vpp1 / 10,
link->conf.Vpp1 % 10);
printk(KERN_DEBUG "%s: index 0x%02x: ",
dev->name, link->conf.ConfigIndex);
if (link->conf.Vpp)
printk(", Vpp %d.%d", link->conf.Vpp / 10,
link->conf.Vpp % 10);
printk(", irq %d", link->irq.AssignedIRQ);
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,

View file

@ -342,7 +342,6 @@ static int ray_attach(struct pcmcia_device *p_dev)
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;

View file

@ -692,7 +692,6 @@ spectrum_cs_config(dev_link_t *link)
/* Look up the current Vcc */
CS_CHECK(GetConfigurationInfo,
pcmcia_get_configuration_info(handle, &conf));
link->conf.Vcc = conf.Vcc;
/*
* In this loop, we scan the CIS for configuration table
@ -747,10 +746,10 @@ spectrum_cs_config(dev_link_t *link)
}
if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000;
else if (dflt.vpp1.present & (1 << CISTPL_POWER_VNOM))
link->conf.Vpp1 = link->conf.Vpp2 =
link->conf.Vpp =
dflt.vpp1.param[CISTPL_POWER_VNOM] / 10000;
/* Do we need to allocate an interrupt? */
@ -851,12 +850,11 @@ spectrum_cs_config(dev_link_t *link)
link->state &= ~DEV_CONFIG_PENDING;
/* Finally, report what we've done */
printk(KERN_DEBUG "%s: index 0x%02x: Vcc %d.%d",
dev->name, link->conf.ConfigIndex,
link->conf.Vcc / 10, link->conf.Vcc % 10);
if (link->conf.Vpp1)
printk(", Vpp %d.%d", link->conf.Vpp1 / 10,
link->conf.Vpp1 % 10);
printk(KERN_DEBUG "%s: index 0x%02x: ",
dev->name, link->conf.ConfigIndex);
if (link->conf.Vpp)
printk(", Vpp %d.%d", link->conf.Vpp / 10,
link->conf.Vpp % 10);
printk(", irq %d", link->irq.AssignedIRQ);
if (link->io.NumPorts1)
printk(", io 0x%04x-0x%04x", link->io.BasePort1,

View file

@ -4607,7 +4607,6 @@ wavelan_attach(struct pcmcia_device *p_dev)
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
/* Chain drivers */

View file

@ -1976,7 +1976,6 @@ static int wl3501_attach(struct pcmcia_device *p_dev)
/* General socket configuration */
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.Vcc = 50;
link->conf.IntType = INT_MEMORY_AND_IO;
link->conf.ConfigIndex = 1;
link->conf.Present = PRESENT_OPTION;