aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/telephony
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/telephony')
-rw-r--r--drivers/telephony/ixj.c10
-rw-r--r--drivers/telephony/ixj_pcmcia.c41
-rw-r--r--drivers/telephony/phonedev.c1
3 files changed, 20 insertions, 32 deletions
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index b53deee25d74..0d236f4bb8c2 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -257,7 +257,7 @@
257#include <linux/fs.h> /* everything... */ 257#include <linux/fs.h> /* everything... */
258#include <linux/errno.h> /* error codes */ 258#include <linux/errno.h> /* error codes */
259#include <linux/slab.h> 259#include <linux/slab.h>
260#include <linux/smp_lock.h> 260#include <linux/mutex.h>
261#include <linux/mm.h> 261#include <linux/mm.h>
262#include <linux/ioport.h> 262#include <linux/ioport.h>
263#include <linux/interrupt.h> 263#include <linux/interrupt.h>
@@ -277,6 +277,7 @@
277#define TYPE(inode) (iminor(inode) >> 4) 277#define TYPE(inode) (iminor(inode) >> 4)
278#define NUM(inode) (iminor(inode) & 0xf) 278#define NUM(inode) (iminor(inode) & 0xf)
279 279
280static DEFINE_MUTEX(ixj_mutex);
280static int ixjdebug; 281static int ixjdebug;
281static int hertz = HZ; 282static int hertz = HZ;
282static int samplerate = 100; 283static int samplerate = 100;
@@ -6655,9 +6656,9 @@ static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long ar
6655static long ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long arg) 6656static long ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long arg)
6656{ 6657{
6657 long ret; 6658 long ret;
6658 lock_kernel(); 6659 mutex_lock(&ixj_mutex);
6659 ret = do_ixj_ioctl(file_p, cmd, arg); 6660 ret = do_ixj_ioctl(file_p, cmd, arg);
6660 unlock_kernel(); 6661 mutex_unlock(&ixj_mutex);
6661 return ret; 6662 return ret;
6662} 6663}
6663 6664
@@ -6676,7 +6677,8 @@ static const struct file_operations ixj_fops =
6676 .poll = ixj_poll, 6677 .poll = ixj_poll,
6677 .unlocked_ioctl = ixj_ioctl, 6678 .unlocked_ioctl = ixj_ioctl,
6678 .release = ixj_release, 6679 .release = ixj_release,
6679 .fasync = ixj_fasync 6680 .fasync = ixj_fasync,
6681 .llseek = default_llseek,
6680}; 6682};
6681 6683
6682static int ixj_linetest(IXJ *j) 6684static int ixj_linetest(IXJ *j)
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,
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c
index f3873f650bb4..1915af201175 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -130,6 +130,7 @@ static const struct file_operations phone_fops =
130{ 130{
131 .owner = THIS_MODULE, 131 .owner = THIS_MODULE,
132 .open = phone_open, 132 .open = phone_open,
133 .llseek = noop_llseek,
133}; 134};
134 135
135/* 136/*