aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hisax/avma1_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-30 07:13:46 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-09-29 11:20:24 -0400
commit00990e7ce0b0e596fe41d9c64d6933ea70084003 (patch)
tree189e0dd92860feba84231c66955749574cac5d6d /drivers/isdn/hisax/avma1_cs.c
parent440eed43e2a95bb842488755683716814da10f2b (diff)
pcmcia: use autoconfiguration feature for ioports and iomem
When CONF_AUTO_SET_IO or CONF_AUTO_SET_IOMEM are set, the corresponding fields in struct pcmcia_device *p_dev->resource[0,1,2] are set accordinly. Drivers wishing to override certain settings may do so in the callback function, but they no longer need to parse the CIS entries stored in cistpl_cftable_entry_t themselves. 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: linux-bluetooth@vger.kernel.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 Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/isdn/hisax/avma1_cs.c')
-rw-r--r--drivers/isdn/hisax/avma1_cs.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 2f2b0005f07b..cb09f0cacd12 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -76,14 +76,8 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
76{ 76{
77 dev_dbg(&p_dev->dev, "avma1cs_attach()\n"); 77 dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
78 78
79 /* The io structure describes IO port mapping */
80 p_dev->resource[0]->end = 16;
81 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
82 p_dev->resource[1]->end = 16;
83 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
84
85 /* General socket configuration */ 79 /* General socket configuration */
86 p_dev->config_flags |= CONF_ENABLE_IRQ; 80 p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
87 p_dev->config_index = 1; 81 p_dev->config_index = 1;
88 p_dev->config_regs = PRESENT_OPTION; 82 p_dev->config_regs = PRESENT_OPTION;
89 83
@@ -114,17 +108,13 @@ static void __devexit avma1cs_detach(struct pcmcia_device *link)
114 108
115======================================================================*/ 109======================================================================*/
116 110
117static int avma1cs_configcheck(struct pcmcia_device *p_dev, 111static int avma1cs_configcheck(struct pcmcia_device *p_dev, void *priv_data)
118 cistpl_cftable_entry_t *cf,
119 cistpl_cftable_entry_t *dflt,
120 void *priv_data)
121{ 112{
122 if (cf->io.nwin <= 0) 113 p_dev->resource[0]->end = 16;
123 return -ENODEV; 114 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
124 115 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
125 p_dev->resource[0]->start = cf->io.win[0].base;
126 p_dev->resource[0]->end = cf->io.win[0].len;
127 p_dev->io_lines = 5; 116 p_dev->io_lines = 5;
117
128 return pcmcia_request_io(p_dev); 118 return pcmcia_request_io(p_dev);
129} 119}
130 120