aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/telephony/ixj_pcmcia.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/telephony/ixj_pcmcia.c')
-rw-r--r--drivers/telephony/ixj_pcmcia.c41
1 files changed, 13 insertions, 28 deletions
diff --git a/drivers/telephony/ixj_pcmcia.c b/drivers/telephony/ixj_pcmcia.c
index a1900e502518..d005b9eeebbc 100644
--- a/drivers/telephony/ixj_pcmcia.c
+++ b/drivers/telephony/ixj_pcmcia.c
@@ -8,7 +8,6 @@
8#include <linux/errno.h> /* error codes */ 8#include <linux/errno.h> /* error codes */
9#include <linux/slab.h> 9#include <linux/slab.h>
10 10
11#include <pcmcia/cs.h>
12#include <pcmcia/cistpl.h> 11#include <pcmcia/cistpl.h>
13#include <pcmcia/ds.h> 12#include <pcmcia/ds.h>
14 13
@@ -32,9 +31,6 @@ static int ixj_probe(struct pcmcia_device *p_dev)
32{ 31{
33 dev_dbg(&p_dev->dev, "ixj_attach()\n"); 32 dev_dbg(&p_dev->dev, "ixj_attach()\n");
34 /* Create new ixj device */ 33 /* Create new ixj device */
35 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
36 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
37 p_dev->conf.IntType = INT_MEMORY_AND_IO;
38 p_dev->priv = kzalloc(sizeof(struct ixj_info_t), GFP_KERNEL); 34 p_dev->priv = kzalloc(sizeof(struct ixj_info_t), GFP_KERNEL);
39 if (!p_dev->priv) { 35 if (!p_dev->priv) {
40 return -ENOMEM; 36 return -ENOMEM;
@@ -111,40 +107,31 @@ failed:
111 return; 107 return;
112} 108}
113 109
114static int ixj_config_check(struct pcmcia_device *p_dev, 110static int ixj_config_check(struct pcmcia_device *p_dev, void *priv_data)
115 cistpl_cftable_entry_t *cfg,
116 cistpl_cftable_entry_t *dflt,
117 unsigned int vcc,
118 void *priv_data)
119{ 111{
120 if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) { 112 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
121 cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io; 113 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
122 p_dev->resource[0]->start = io->win[0].base; 114 p_dev->resource[1]->flags &= ~IO_DATA_PATH_WIDTH;
123 p_dev->resource[0]->end = io->win[0].len; 115 p_dev->resource[1]->flags |= IO_DATA_PATH_WIDTH_8;
124 p_dev->io_lines = 3; 116 p_dev->io_lines = 3;
125 if (io->nwin == 2) { 117
126 p_dev->resource[1]->start = io->win[1].base; 118 return pcmcia_request_io(p_dev);
127 p_dev->resource[1]->end = io->win[1].len;
128 }
129 if (!pcmcia_request_io(p_dev))
130 return 0;
131 }
132 return -ENODEV;
133} 119}
134 120
135static int ixj_config(struct pcmcia_device * link) 121static int ixj_config(struct pcmcia_device * link)
136{ 122{
137 IXJ *j; 123 IXJ *j;
138 ixj_info_t *info; 124 ixj_info_t *info;
139 cistpl_cftable_entry_t dflt = { 0 };
140 125
141 info = link->priv; 126 info = link->priv;
142 dev_dbg(&link->dev, "ixj_config\n"); 127 dev_dbg(&link->dev, "ixj_config\n");
143 128
144 if (pcmcia_loop_config(link, ixj_config_check, &dflt)) 129 link->config_flags = CONF_AUTO_SET_IO;
130
131 if (pcmcia_loop_config(link, ixj_config_check, NULL))
145 goto failed; 132 goto failed;
146 133
147 if (pcmcia_request_configuration(link, &link->conf)) 134 if (pcmcia_enable_device(link))
148 goto failed; 135 goto failed;
149 136
150 /* 137 /*
@@ -178,9 +165,7 @@ MODULE_DEVICE_TABLE(pcmcia, ixj_ids);
178 165
179static struct pcmcia_driver ixj_driver = { 166static struct pcmcia_driver ixj_driver = {
180 .owner = THIS_MODULE, 167 .owner = THIS_MODULE,
181 .drv = { 168 .name = "ixj_cs",
182 .name = "ixj_cs",
183 },
184 .probe = ixj_probe, 169 .probe = ixj_probe,
185 .remove = ixj_detach, 170 .remove = ixj_detach,
186 .id_table = ixj_ids, 171 .id_table = ixj_ids,