aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/pcmcia/nsp_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/pcmcia/nsp_cs.c')
-rw-r--r--drivers/scsi/pcmcia/nsp_cs.c47
1 files changed, 9 insertions, 38 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c
index 344d49900b4c..3b90ad9d1956 100644
--- a/drivers/scsi/pcmcia/nsp_cs.c
+++ b/drivers/scsi/pcmcia/nsp_cs.c
@@ -1556,13 +1556,6 @@ static int nsp_cs_probe(struct pcmcia_device *link)
1556 1556
1557 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info); 1557 nsp_dbg(NSP_DEBUG_INIT, "info=0x%p", info);
1558 1558
1559 /* The io structure describes IO port mapping */
1560 link->resource[0]->end = 0x10;
1561 link->resource[0]->flags = IO_DATA_PATH_WIDTH_AUTO;
1562
1563 /* General socket configuration */
1564 link->config_flags |= CONF_ENABLE_IRQ;
1565
1566 ret = nsp_cs_config(link); 1559 ret = nsp_cs_config(link);
1567 1560
1568 nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link); 1561 nsp_dbg(NSP_DEBUG_INIT, "link=0x%p", link);
@@ -1594,50 +1587,27 @@ static void nsp_cs_detach(struct pcmcia_device *link)
1594 ethernet device available to the system. 1587 ethernet device available to the system.
1595======================================================================*/ 1588======================================================================*/
1596 1589
1597static int nsp_cs_config_check(struct pcmcia_device *p_dev, 1590static int nsp_cs_config_check(struct pcmcia_device *p_dev, void *priv_data)
1598 cistpl_cftable_entry_t *cfg,
1599 cistpl_cftable_entry_t *dflt,
1600 void *priv_data)
1601{ 1591{
1602 nsp_hw_data *data = priv_data; 1592 nsp_hw_data *data = priv_data;
1603 1593
1604 if (cfg->index == 0) 1594 if (p_dev->config_index == 0)
1605 return -ENODEV; 1595 return -ENODEV;
1606 1596
1607 /* IO window settings */ 1597 /* This reserves IO space but doesn't actually enable it */
1608 p_dev->resource[0]->end = p_dev->resource[1]->end = 0; 1598 if (pcmcia_request_io(p_dev) != 0)
1609 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 1599 goto next_entry;
1610 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
1611 p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
1612 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
1613 p_dev->resource[0]->flags |=
1614 pcmcia_io_cfg_data_width(io->flags);
1615 p_dev->resource[0]->start = io->win[0].base;
1616 p_dev->resource[0]->end = io->win[0].len;
1617 if (io->nwin > 1) {
1618 p_dev->resource[1]->flags = p_dev->resource[0]->flags;
1619 p_dev->resource[1]->start = io->win[1].base;
1620 p_dev->resource[1]->end = io->win[1].len;
1621 }
1622 /* This reserves IO space but doesn't actually enable it */
1623 if (pcmcia_request_io(p_dev) != 0)
1624 goto next_entry;
1625 }
1626 1600
1627 if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) { 1601 if (resource_size(p_dev->resource[2])) {
1628 cistpl_mem_t *mem =
1629 (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
1630 p_dev->resource[2]->flags |= (WIN_DATA_WIDTH_16 | 1602 p_dev->resource[2]->flags |= (WIN_DATA_WIDTH_16 |
1631 WIN_MEMORY_TYPE_CM | 1603 WIN_MEMORY_TYPE_CM |
1632 WIN_ENABLE); 1604 WIN_ENABLE);
1633 p_dev->resource[2]->start = mem->win[0].host_addr;
1634 p_dev->resource[2]->end = mem->win[0].len;
1635 if (p_dev->resource[2]->end < 0x1000) 1605 if (p_dev->resource[2]->end < 0x1000)
1636 p_dev->resource[2]->end = 0x1000; 1606 p_dev->resource[2]->end = 0x1000;
1637 if (pcmcia_request_window(p_dev, p_dev->resource[2], 0) != 0) 1607 if (pcmcia_request_window(p_dev, p_dev->resource[2], 0) != 0)
1638 goto next_entry; 1608 goto next_entry;
1639 if (pcmcia_map_mem_page(p_dev, p_dev->resource[2], 1609 if (pcmcia_map_mem_page(p_dev, p_dev->resource[2],
1640 mem->win[0].card_addr) != 0) 1610 p_dev->card_addr) != 0)
1641 goto next_entry; 1611 goto next_entry;
1642 1612
1643 data->MmioAddress = (unsigned long) 1613 data->MmioAddress = (unsigned long)
@@ -1664,7 +1634,8 @@ static int nsp_cs_config(struct pcmcia_device *link)
1664 nsp_dbg(NSP_DEBUG_INIT, "in"); 1634 nsp_dbg(NSP_DEBUG_INIT, "in");
1665 1635
1666 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_CHECK_VCC | 1636 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_CHECK_VCC |
1667 CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO; 1637 CONF_AUTO_SET_VPP | CONF_AUTO_AUDIO | CONF_AUTO_SET_IOMEM |
1638 CONF_AUTO_SET_IO;
1668 1639
1669 ret = pcmcia_loop_config(link, nsp_cs_config_check, data); 1640 ret = pcmcia_loop_config(link, nsp_cs_config_check, data);
1670 if (ret) 1641 if (ret)