aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
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/ide
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/ide')
-rw-r--r--drivers/ide/ide-cs.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c
index 6be0e5f108b5..2a4cb9c18f01 100644
--- a/drivers/ide/ide-cs.c
+++ b/drivers/ide/ide-cs.c
@@ -97,9 +97,8 @@ static int ide_probe(struct pcmcia_device *link)
97 info->p_dev = link; 97 info->p_dev = link;
98 link->priv = info; 98 link->priv = info;
99 99
100 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 100 link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
101 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 101 link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
102 link->io.IOAddrLines = 3;
103 link->conf.Attributes = CONF_ENABLE_IRQ; 102 link->conf.Attributes = CONF_ENABLE_IRQ;
104 link->conf.IntType = INT_MEMORY_AND_IO; 103 link->conf.IntType = INT_MEMORY_AND_IO;
105 104
@@ -228,22 +227,25 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev,
228 227
229 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 228 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
230 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 229 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
230 pdev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
231
231 pdev->conf.ConfigIndex = cfg->index; 232 pdev->conf.ConfigIndex = cfg->index;
232 pdev->io.BasePort1 = io->win[0].base; 233 pdev->resource[0]->start = io->win[0].base;
233 pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; 234 if (!(io->flags & CISTPL_IO_16BIT)) {
234 if (!(io->flags & CISTPL_IO_16BIT)) 235 pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
235 pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 236 pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
237 }
236 if (io->nwin == 2) { 238 if (io->nwin == 2) {
237 pdev->io.NumPorts1 = 8; 239 pdev->resource[0]->end = 8;
238 pdev->io.BasePort2 = io->win[1].base; 240 pdev->resource[1]->start = io->win[1].base;
239 pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1; 241 pdev->resource[1]->end = (stk->is_kme) ? 2 : 1;
240 if (pcmcia_request_io(pdev, &pdev->io) != 0) 242 if (pcmcia_request_io(pdev) != 0)
241 return -ENODEV; 243 return -ENODEV;
242 stk->ctl_base = pdev->resource[1]->start; 244 stk->ctl_base = pdev->resource[1]->start;
243 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { 245 } else if ((io->nwin == 1) && (io->win[0].len >= 16)) {
244 pdev->io.NumPorts1 = io->win[0].len; 246 pdev->resource[0]->end = io->win[0].len;
245 pdev->io.NumPorts2 = 0; 247 pdev->resource[1]->end = 0;
246 if (pcmcia_request_io(pdev, &pdev->io) != 0) 248 if (pcmcia_request_io(pdev) != 0)
247 return -ENODEV; 249 return -ENODEV;
248 stk->ctl_base = pdev->resource[0]->start + 0x0e; 250 stk->ctl_base = pdev->resource[0]->start + 0x0e;
249 } else 251 } else