diff options
Diffstat (limited to 'drivers/ide/ide-cs.c')
-rw-r--r-- | drivers/ide/ide-cs.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c index 0b7815d2581c..2a4cb9c18f01 100644 --- a/drivers/ide/ide-cs.c +++ b/drivers/ide/ide-cs.c | |||
@@ -43,7 +43,6 @@ | |||
43 | #include <asm/io.h> | 43 | #include <asm/io.h> |
44 | #include <asm/system.h> | 44 | #include <asm/system.h> |
45 | 45 | ||
46 | #include <pcmcia/cs_types.h> | ||
47 | #include <pcmcia/cs.h> | 46 | #include <pcmcia/cs.h> |
48 | #include <pcmcia/cistpl.h> | 47 | #include <pcmcia/cistpl.h> |
49 | #include <pcmcia/ds.h> | 48 | #include <pcmcia/ds.h> |
@@ -98,9 +97,8 @@ static int ide_probe(struct pcmcia_device *link) | |||
98 | info->p_dev = link; | 97 | info->p_dev = link; |
99 | link->priv = info; | 98 | link->priv = info; |
100 | 99 | ||
101 | link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | 100 | link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
102 | link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; | 101 | link->resource[1]->flags |= IO_DATA_PATH_WIDTH_8; |
103 | link->io.IOAddrLines = 3; | ||
104 | link->conf.Attributes = CONF_ENABLE_IRQ; | 102 | link->conf.Attributes = CONF_ENABLE_IRQ; |
105 | link->conf.IntType = INT_MEMORY_AND_IO; | 103 | link->conf.IntType = INT_MEMORY_AND_IO; |
106 | 104 | ||
@@ -229,24 +227,27 @@ static int pcmcia_check_one_config(struct pcmcia_device *pdev, | |||
229 | 227 | ||
230 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { | 228 | if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { |
231 | 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 | |||
232 | pdev->conf.ConfigIndex = cfg->index; | 232 | pdev->conf.ConfigIndex = cfg->index; |
233 | pdev->io.BasePort1 = io->win[0].base; | 233 | pdev->resource[0]->start = io->win[0].base; |
234 | pdev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK; | 234 | if (!(io->flags & CISTPL_IO_16BIT)) { |
235 | if (!(io->flags & CISTPL_IO_16BIT)) | 235 | pdev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; |
236 | pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_8; | 236 | pdev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; |
237 | } | ||
237 | if (io->nwin == 2) { | 238 | if (io->nwin == 2) { |
238 | pdev->io.NumPorts1 = 8; | 239 | pdev->resource[0]->end = 8; |
239 | pdev->io.BasePort2 = io->win[1].base; | 240 | pdev->resource[1]->start = io->win[1].base; |
240 | pdev->io.NumPorts2 = (stk->is_kme) ? 2 : 1; | 241 | pdev->resource[1]->end = (stk->is_kme) ? 2 : 1; |
241 | if (pcmcia_request_io(pdev, &pdev->io) != 0) | 242 | if (pcmcia_request_io(pdev) != 0) |
242 | return -ENODEV; | 243 | return -ENODEV; |
243 | stk->ctl_base = pdev->io.BasePort2; | 244 | stk->ctl_base = pdev->resource[1]->start; |
244 | } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { | 245 | } else if ((io->nwin == 1) && (io->win[0].len >= 16)) { |
245 | pdev->io.NumPorts1 = io->win[0].len; | 246 | pdev->resource[0]->end = io->win[0].len; |
246 | pdev->io.NumPorts2 = 0; | 247 | pdev->resource[1]->end = 0; |
247 | if (pcmcia_request_io(pdev, &pdev->io) != 0) | 248 | if (pcmcia_request_io(pdev) != 0) |
248 | return -ENODEV; | 249 | return -ENODEV; |
249 | stk->ctl_base = pdev->io.BasePort1 + 0x0e; | 250 | stk->ctl_base = pdev->resource[0]->start + 0x0e; |
250 | } else | 251 | } else |
251 | return -ENODEV; | 252 | return -ENODEV; |
252 | /* If we've got this far, we're done */ | 253 | /* If we've got this far, we're done */ |
@@ -280,7 +281,7 @@ static int ide_config(struct pcmcia_device *link) | |||
280 | if (pcmcia_loop_config(link, pcmcia_check_one_config, stk)) | 281 | if (pcmcia_loop_config(link, pcmcia_check_one_config, stk)) |
281 | goto failed; /* No suitable config found */ | 282 | goto failed; /* No suitable config found */ |
282 | } | 283 | } |
283 | io_base = link->io.BasePort1; | 284 | io_base = link->resource[0]->start; |
284 | ctl_base = stk->ctl_base; | 285 | ctl_base = stk->ctl_base; |
285 | 286 | ||
286 | if (!link->irq) | 287 | if (!link->irq) |
@@ -297,7 +298,7 @@ static int ide_config(struct pcmcia_device *link) | |||
297 | outb(0x81, ctl_base+1); | 298 | outb(0x81, ctl_base+1); |
298 | 299 | ||
299 | host = idecs_register(io_base, ctl_base, link->irq, link); | 300 | host = idecs_register(io_base, ctl_base, link->irq, link); |
300 | if (host == NULL && link->io.NumPorts1 == 0x20) { | 301 | if (host == NULL && resource_size(link->resource[0]) == 0x20) { |
301 | outb(0x02, ctl_base + 0x10); | 302 | outb(0x02, ctl_base + 0x10); |
302 | host = idecs_register(io_base + 0x10, ctl_base + 0x10, | 303 | host = idecs_register(io_base + 0x10, ctl_base + 0x10, |
303 | link->irq, link); | 304 | link->irq, link); |