aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-24 11:23:51 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-08-03 03:04:11 -0400
commit90abdc3b973229bae98dd96649d9f7106cc177a4 (patch)
tree5c1a7a131b65560dd73b5103118d8c7631bd76a4 /drivers/isdn
parent9a017a910346afd88ec2e065989903bf211a7d37 (diff)
pcmcia: do not use io_req_t when calling pcmcia_request_io()
Instead of io_req_t, drivers are now requested to fill out struct pcmcia_device *p_dev->resource[0,1] for up to two ioport ranges. After a call to pcmcia_request_io(), the ports found there are reserved, after calling pcmcia_request_configuration(), they may be used. 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: Michael Buesch <mb@bu3sch.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/) Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/hardware/avm/avm_cs.c15
-rw-r--r--drivers/isdn/hisax/avma1_cs.c20
-rw-r--r--drivers/isdn/hisax/elsa_cs.c15
-rw-r--r--drivers/isdn/hisax/sedlbauer_cs.c28
-rw-r--r--drivers/isdn/hisax/teles_cs.c15
5 files changed, 42 insertions, 51 deletions
diff --git a/drivers/isdn/hardware/avm/avm_cs.c b/drivers/isdn/hardware/avm/avm_cs.c
index 7c8c51f22003..09b1795516f4 100644
--- a/drivers/isdn/hardware/avm/avm_cs.c
+++ b/drivers/isdn/hardware/avm/avm_cs.c
@@ -75,9 +75,8 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
75{ 75{
76 76
77 /* The io structure describes IO port mapping */ 77 /* The io structure describes IO port mapping */
78 p_dev->io.NumPorts1 = 16; 78 p_dev->resource[0]->end = 16;
79 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 79 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
80 p_dev->io.NumPorts2 = 0;
81 80
82 /* General socket configuration */ 81 /* General socket configuration */
83 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 82 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -119,13 +118,9 @@ static int avmcs_configcheck(struct pcmcia_device *p_dev,
119 if (cf->io.nwin <= 0) 118 if (cf->io.nwin <= 0)
120 return -ENODEV; 119 return -ENODEV;
121 120
122 p_dev->io.BasePort1 = cf->io.win[0].base; 121 p_dev->resource[0]->start = cf->io.win[0].base;
123 p_dev->io.NumPorts1 = cf->io.win[0].len; 122 p_dev->resource[0]->end = cf->io.win[0].len;
124 p_dev->io.NumPorts2 = 0; 123 return pcmcia_request_io(p_dev);
125 printk(KERN_INFO "avm_cs: testing i/o %#x-%#x\n",
126 p_dev->io.BasePort1,
127 p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
128 return pcmcia_request_io(p_dev, &p_dev->io);
129} 124}
130 125
131static int avmcs_config(struct pcmcia_device *link) 126static int avmcs_config(struct pcmcia_device *link)
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
index 88899638f835..94263c22b874 100644
--- a/drivers/isdn/hisax/avma1_cs.c
+++ b/drivers/isdn/hisax/avma1_cs.c
@@ -78,11 +78,10 @@ static int __devinit avma1cs_probe(struct pcmcia_device *p_dev)
78 dev_dbg(&p_dev->dev, "avma1cs_attach()\n"); 78 dev_dbg(&p_dev->dev, "avma1cs_attach()\n");
79 79
80 /* The io structure describes IO port mapping */ 80 /* The io structure describes IO port mapping */
81 p_dev->io.NumPorts1 = 16; 81 p_dev->resource[0]->end = 16;
82 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 82 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
83 p_dev->io.NumPorts2 = 16; 83 p_dev->resource[1]->end = 16;
84 p_dev->io.Attributes2 = IO_DATA_PATH_WIDTH_16; 84 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_16;
85 p_dev->io.IOAddrLines = 5;
86 85
87 /* General socket configuration */ 86 /* General socket configuration */
88 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 87 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@ -126,13 +125,10 @@ static int avma1cs_configcheck(struct pcmcia_device *p_dev,
126 if (cf->io.nwin <= 0) 125 if (cf->io.nwin <= 0)
127 return -ENODEV; 126 return -ENODEV;
128 127
129 p_dev->io.BasePort1 = cf->io.win[0].base; 128 p_dev->resource[0]->start = cf->io.win[0].base;
130 p_dev->io.NumPorts1 = cf->io.win[0].len; 129 p_dev->resource[0]->end = cf->io.win[0].len;
131 p_dev->io.NumPorts2 = 0; 130 p_dev->io_lines = 5;
132 printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n", 131 return pcmcia_request_io(p_dev);
133 p_dev->io.BasePort1,
134 p_dev->io.BasePort1+p_dev->io.NumPorts1-1);
135 return pcmcia_request_io(p_dev, &p_dev->io);
136} 132}
137 133
138 134
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c
index c10bfd3f4588..b3c08aaf41c4 100644
--- a/drivers/isdn/hisax/elsa_cs.c
+++ b/drivers/isdn/hisax/elsa_cs.c
@@ -126,9 +126,8 @@ static int __devinit elsa_cs_probe(struct pcmcia_device *link)
126 and attributes of IO windows) are fixed by the nature of the 126 and attributes of IO windows) are fixed by the nature of the
127 device, and can be hard-wired here. 127 device, and can be hard-wired here.
128 */ 128 */
129 link->io.NumPorts1 = 8; 129 link->resource[0]->end = 8;
130 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 130 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
131 link->io.IOAddrLines = 3;
132 131
133 link->conf.Attributes = CONF_ENABLE_IRQ; 132 link->conf.Attributes = CONF_ENABLE_IRQ;
134 link->conf.IntType = INT_MEMORY_AND_IO; 133 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -173,16 +172,18 @@ static int elsa_cs_configcheck(struct pcmcia_device *p_dev,
173{ 172{
174 int j; 173 int j;
175 174
175 p_dev->io_lines = 3;
176
176 if ((cf->io.nwin > 0) && cf->io.win[0].base) { 177 if ((cf->io.nwin > 0) && cf->io.win[0].base) {
177 printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n"); 178 printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n");
178 p_dev->io.BasePort1 = cf->io.win[0].base; 179 p_dev->resource[0]->start = cf->io.win[0].base;
179 if (!pcmcia_request_io(p_dev, &p_dev->io)) 180 if (!pcmcia_request_io(p_dev))
180 return 0; 181 return 0;
181 } else { 182 } else {
182 printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n"); 183 printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n");
183 for (j = 0x2f0; j > 0x100; j -= 0x10) { 184 for (j = 0x2f0; j > 0x100; j -= 0x10) {
184 p_dev->io.BasePort1 = j; 185 p_dev->resource[0]->start = j;
185 if (!pcmcia_request_io(p_dev, &p_dev->io)) 186 if (!pcmcia_request_io(p_dev))
186 return 0; 187 return 0;
187 } 188 }
188 } 189 }
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c
index cecb35ab9d3d..4755eb440f7e 100644
--- a/drivers/isdn/hisax/sedlbauer_cs.c
+++ b/drivers/isdn/hisax/sedlbauer_cs.c
@@ -129,9 +129,8 @@ static int __devinit sedlbauer_probe(struct pcmcia_device *link)
129 /* from old sedl_cs 129 /* from old sedl_cs
130 */ 130 */
131 /* The io structure describes IO port mapping */ 131 /* The io structure describes IO port mapping */
132 link->io.NumPorts1 = 8; 132 link->resource[0]->end = 8;
133 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 133 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
134 link->io.IOAddrLines = 3;
135 134
136 link->conf.Attributes = 0; 135 link->conf.Attributes = 0;
137 link->conf.IntType = INT_MEMORY_AND_IO; 136 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -201,23 +200,22 @@ static int sedlbauer_config_check(struct pcmcia_device *p_dev,
201 p_dev->conf.Attributes |= CONF_ENABLE_IRQ; 200 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
202 201
203 /* IO window settings */ 202 /* IO window settings */
204 p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0; 203 p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
205 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 204 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
206 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 205 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
207 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 206 p_dev->resource[0]->start = io->win[0].base;
208 if (!(io->flags & CISTPL_IO_8BIT)) 207 p_dev->resource[0]->end = io->win[0].len;
209 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 208 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
210 if (!(io->flags & CISTPL_IO_16BIT)) 209 p_dev->resource[0]->flags |=
211 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 210 pcmcia_io_cfg_data_width(io->flags);
212 p_dev->io.BasePort1 = io->win[0].base;
213 p_dev->io.NumPorts1 = io->win[0].len;
214 if (io->nwin > 1) { 211 if (io->nwin > 1) {
215 p_dev->io.Attributes2 = p_dev->io.Attributes1; 212 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
216 p_dev->io.BasePort2 = io->win[1].base; 213 p_dev->resource[1]->start = io->win[1].base;
217 p_dev->io.NumPorts2 = io->win[1].len; 214 p_dev->resource[1]->end = io->win[1].len;
218 } 215 }
219 /* This reserves IO space but doesn't actually enable it */ 216 /* This reserves IO space but doesn't actually enable it */
220 if (pcmcia_request_io(p_dev, &p_dev->io) != 0) 217 p_dev->io_lines = 3;
218 if (pcmcia_request_io(p_dev) != 0)
221 return -ENODEV; 219 return -ENODEV;
222 } 220 }
223 221
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c
index 3787fc70cf8f..7296102ca255 100644
--- a/drivers/isdn/hisax/teles_cs.c
+++ b/drivers/isdn/hisax/teles_cs.c
@@ -106,9 +106,8 @@ static int __devinit teles_probe(struct pcmcia_device *link)
106 and attributes of IO windows) are fixed by the nature of the 106 and attributes of IO windows) are fixed by the nature of the
107 device, and can be hard-wired here. 107 device, and can be hard-wired here.
108 */ 108 */
109 link->io.NumPorts1 = 96; 109 link->resource[0]->end = 96;
110 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 110 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
111 link->io.IOAddrLines = 5;
112 111
113 link->conf.Attributes = CONF_ENABLE_IRQ; 112 link->conf.Attributes = CONF_ENABLE_IRQ;
114 link->conf.IntType = INT_MEMORY_AND_IO; 113 link->conf.IntType = INT_MEMORY_AND_IO;
@@ -153,16 +152,18 @@ static int teles_cs_configcheck(struct pcmcia_device *p_dev,
153{ 152{
154 int j; 153 int j;
155 154
155 p_dev->io_lines = 5;
156
156 if ((cf->io.nwin > 0) && cf->io.win[0].base) { 157 if ((cf->io.nwin > 0) && cf->io.win[0].base) {
157 printk(KERN_INFO "(teles_cs: looks like the 96 model)\n"); 158 printk(KERN_INFO "(teles_cs: looks like the 96 model)\n");
158 p_dev->io.BasePort1 = cf->io.win[0].base; 159 p_dev->resource[0]->start = cf->io.win[0].base;
159 if (!pcmcia_request_io(p_dev, &p_dev->io)) 160 if (!pcmcia_request_io(p_dev))
160 return 0; 161 return 0;
161 } else { 162 } else {
162 printk(KERN_INFO "(teles_cs: looks like the 97 model)\n"); 163 printk(KERN_INFO "(teles_cs: looks like the 97 model)\n");
163 for (j = 0x2f0; j > 0x100; j -= 0x10) { 164 for (j = 0x2f0; j > 0x100; j -= 0x10) {
164 p_dev->io.BasePort1 = j; 165 p_dev->resource[0]->start = j;
165 if (!pcmcia_request_io(p_dev, &p_dev->io)) 166 if (!pcmcia_request_io(p_dev))
166 return 0; 167 return 0;
167 } 168 }
168 } 169 }