aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/telephony/ixj.c
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2011-01-13 01:06:28 -0500
committerPaul Mundt <lethal@linux-sh.org>2011-01-13 01:06:28 -0500
commitf43dc23d5ea91fca257be02138a255f02d98e806 (patch)
treeb29722f6e965316e90ac97abf79923ced250dc21 /drivers/telephony/ixj.c
parentf8e53553f452dcbf67cb89c8cba63a1cd6eb4cc0 (diff)
parent4162cf64973df51fc885825bc9ca4d055891c49f (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into common/serial-rework
Conflicts: arch/sh/kernel/cpu/sh2/setup-sh7619.c arch/sh/kernel/cpu/sh2a/setup-mxg.c arch/sh/kernel/cpu/sh2a/setup-sh7201.c arch/sh/kernel/cpu/sh2a/setup-sh7203.c arch/sh/kernel/cpu/sh2a/setup-sh7206.c arch/sh/kernel/cpu/sh3/setup-sh7705.c arch/sh/kernel/cpu/sh3/setup-sh770x.c arch/sh/kernel/cpu/sh3/setup-sh7710.c arch/sh/kernel/cpu/sh3/setup-sh7720.c arch/sh/kernel/cpu/sh4/setup-sh4-202.c arch/sh/kernel/cpu/sh4/setup-sh7750.c arch/sh/kernel/cpu/sh4/setup-sh7760.c arch/sh/kernel/cpu/sh4a/setup-sh7343.c arch/sh/kernel/cpu/sh4a/setup-sh7366.c arch/sh/kernel/cpu/sh4a/setup-sh7722.c arch/sh/kernel/cpu/sh4a/setup-sh7723.c arch/sh/kernel/cpu/sh4a/setup-sh7724.c arch/sh/kernel/cpu/sh4a/setup-sh7763.c arch/sh/kernel/cpu/sh4a/setup-sh7770.c arch/sh/kernel/cpu/sh4a/setup-sh7780.c arch/sh/kernel/cpu/sh4a/setup-sh7785.c arch/sh/kernel/cpu/sh4a/setup-sh7786.c arch/sh/kernel/cpu/sh4a/setup-shx3.c arch/sh/kernel/cpu/sh5/setup-sh5.c drivers/serial/sh-sci.c drivers/serial/sh-sci.h include/linux/serial_sci.h
Diffstat (limited to 'drivers/telephony/ixj.c')
-rw-r--r--drivers/telephony/ixj.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/telephony/ixj.c b/drivers/telephony/ixj.c
index a913efc69669..0d236f4bb8c2 100644
--- a/drivers/telephony/ixj.c
+++ b/drivers/telephony/ixj.c
@@ -257,6 +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/mutex.h>
260#include <linux/mm.h> 261#include <linux/mm.h>
261#include <linux/ioport.h> 262#include <linux/ioport.h>
262#include <linux/interrupt.h> 263#include <linux/interrupt.h>
@@ -276,6 +277,7 @@
276#define TYPE(inode) (iminor(inode) >> 4) 277#define TYPE(inode) (iminor(inode) >> 4)
277#define NUM(inode) (iminor(inode) & 0xf) 278#define NUM(inode) (iminor(inode) & 0xf)
278 279
280static DEFINE_MUTEX(ixj_mutex);
279static int ixjdebug; 281static int ixjdebug;
280static int hertz = HZ; 282static int hertz = HZ;
281static int samplerate = 100; 283static int samplerate = 100;
@@ -4189,7 +4191,7 @@ static void ixj_aec_start(IXJ *j, int level)
4189 ixj_WriteDSPCommand(0x1224, j); 4191 ixj_WriteDSPCommand(0x1224, j);
4190 4192
4191 ixj_WriteDSPCommand(0xE014, j); 4193 ixj_WriteDSPCommand(0xE014, j);
4192 ixj_WriteDSPCommand(0x0003, j); /* Lock threashold at 3dB */ 4194 ixj_WriteDSPCommand(0x0003, j); /* Lock threshold at 3dB */
4193 4195
4194 ixj_WriteDSPCommand(0xE338, j); /* Set Echo Suppresser Attenuation to 0dB */ 4196 ixj_WriteDSPCommand(0xE338, j); /* Set Echo Suppresser Attenuation to 0dB */
4195 4197
@@ -4234,7 +4236,7 @@ static void ixj_aec_start(IXJ *j, int level)
4234 ixj_WriteDSPCommand(0x1224, j); 4236 ixj_WriteDSPCommand(0x1224, j);
4235 4237
4236 ixj_WriteDSPCommand(0xE014, j); 4238 ixj_WriteDSPCommand(0xE014, j);
4237 ixj_WriteDSPCommand(0x0003, j); /* Lock threashold at 3dB */ 4239 ixj_WriteDSPCommand(0x0003, j); /* Lock threshold at 3dB */
4238 4240
4239 ixj_WriteDSPCommand(0xE338, j); /* Set Echo Suppresser Attenuation to 0dB */ 4241 ixj_WriteDSPCommand(0xE338, j); /* Set Echo Suppresser Attenuation to 0dB */
4240 4242
@@ -5878,20 +5880,13 @@ out:
5878static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE __user * cp) 5880static int ixj_build_filter_cadence(IXJ *j, IXJ_FILTER_CADENCE __user * cp)
5879{ 5881{
5880 IXJ_FILTER_CADENCE *lcp; 5882 IXJ_FILTER_CADENCE *lcp;
5881 lcp = kmalloc(sizeof(IXJ_FILTER_CADENCE), GFP_KERNEL); 5883 lcp = memdup_user(cp, sizeof(IXJ_FILTER_CADENCE));
5882 if (lcp == NULL) { 5884 if (IS_ERR(lcp)) {
5883 if(ixjdebug & 0x0001) { 5885 if(ixjdebug & 0x0001) {
5884 printk(KERN_INFO "Could not allocate memory for cadence\n"); 5886 printk(KERN_INFO "Could not allocate memory for cadence or could not copy cadence to kernel\n");
5885 } 5887 }
5886 return -ENOMEM; 5888 return PTR_ERR(lcp);
5887 } 5889 }
5888 if (copy_from_user(lcp, cp, sizeof(IXJ_FILTER_CADENCE))) {
5889 if(ixjdebug & 0x0001) {
5890 printk(KERN_INFO "Could not copy cadence to kernel\n");
5891 }
5892 kfree(lcp);
5893 return -EFAULT;
5894 }
5895 if (lcp->filter > 5) { 5890 if (lcp->filter > 5) {
5896 if(ixjdebug & 0x0001) { 5891 if(ixjdebug & 0x0001) {
5897 printk(KERN_INFO "Cadence out of range\n"); 5892 printk(KERN_INFO "Cadence out of range\n");
@@ -6661,9 +6656,9 @@ static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long ar
6661static 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)
6662{ 6657{
6663 long ret; 6658 long ret;
6664 lock_kernel(); 6659 mutex_lock(&ixj_mutex);
6665 ret = do_ixj_ioctl(file_p, cmd, arg); 6660 ret = do_ixj_ioctl(file_p, cmd, arg);
6666 unlock_kernel(); 6661 mutex_unlock(&ixj_mutex);
6667 return ret; 6662 return ret;
6668} 6663}
6669 6664
@@ -6682,7 +6677,8 @@ static const struct file_operations ixj_fops =
6682 .poll = ixj_poll, 6677 .poll = ixj_poll,
6683 .unlocked_ioctl = ixj_ioctl, 6678 .unlocked_ioctl = ixj_ioctl,
6684 .release = ixj_release, 6679 .release = ixj_release,
6685 .fasync = ixj_fasync 6680 .fasync = ixj_fasync,
6681 .llseek = default_llseek,
6686}; 6682};
6687 6683
6688static int ixj_linetest(IXJ *j) 6684static int ixj_linetest(IXJ *j)