summaryrefslogtreecommitdiff
path: root/drivers/staging/intel_sst/intel_sst_app_interface.c
AgeCommit message (Collapse)Author
2010-12-07Staging: Merge 2.6.37-rc5 into staging-nextGreg Kroah-Hartman
This was done to handle a number of conflicts in the batman-adv and winbond drivers properly. It also now allows us to fix up the sysfs attributes properly that were not in the .37 release due to them being only in this tree at the time. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-29Staging: sst: add ioctls for post processing algorithm interfaceVinod Koul
This patch adds two new ioctls to intel_sst_ctrl device. This i/f can be used by application to send algorithm parameters Signed-off-by: Vinod Koul <vinod.koul@intel.com> [This will need further discussion in the context of the final ALSA interface but is fine for staging, ie anyone who relies on it should expect changes Also fixed a missing kmalloc fail check] Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-29Staging: sst: Add runtime PM supportVinod Koul
This adds runtime PM support for audio driver. This also fixes LPA audio mode for moorestown platform Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-20sst: Change the SST driver PCM interfaceVinod Koul
The PCM interface in SST driver is cmds only, this patch changes the interface to open, close and cmd interface. This allows SST driver to keep easy track of handles open Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-17BKL: remove extraneous #include <smp_lock.h>Arnd Bergmann
The big kernel lock has been removed from all these files at some point, leaving only the #include. Remove this too as a cleanup. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-11-16Staging: Merge 2.6.37-rc2 into staging-nextGreg Kroah-Hartman
This was necessary in order to resolve some conflicts that happened between -rc1 and -rc2 with the following files: drivers/staging/bcm/Bcmchar.c drivers/staging/intel_sst/intel_sst_app_interface.c All should be resolved now. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09Staging: intel_sst: Use pr_fmt, fix misspellingsJoe Perches
Remove leading "sst: " from format strings. Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Prefix is changed from "sst: " to "snd_intel_sst: " Add missing newlines Trim trailing spaces after newlines Fix several different misspellings Signed-off-by: Joe Perches <joe@perches.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09Staging: sst: add some __user anotationsDan Carpenter
This silences all the sparse warnings in intel_sst_app_interface.c. It was just a matter of adding __user annotations, I didn't find any real bugs here. Quite a few of these were needed for stuff I added earlier, sorry about that. I removed a couple casts to (void *) that caused a warning like: drivers/staging/intel_sst/intel_sst_app_interface.c:606:27: warning: cast removes address space of expression For example sst_drv_ctx->mailbox is already declared as "void __iomem *mailbox" so casting it to void pointer isn't necessary and it makes sparse complain because it removes the __user attribute. Signed-off-by: Dan Carpenter <error27@gmail.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09Staging: sst: user pointers in intel_sst_mmap_play_capture()Dan Carpenter
There were some places in intel_sst_mmap_play_capture() that dereferenced user pointers instead of copying the data to the kernel. I removed the BUG_ON(!mmap_buf) and BUG_ON(!buf_entry) since those are never possible in the current code. Signed-off-by: Dan Carpenter <error27@gmail.com> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09Staging: sst: fixups in SNDRV_SST_STREAM_DECODEDan Carpenter
This is another patch about copying data to the kernel before using it. SNDRV_SST_STREAM_DECODE is sort of tricky because we need to do a copy_from_user() that gives us another two pointers and we have copy those. Those again give us some more pointers that we have to copy. Besides those problems, the code had a stack overflow: - struct snd_sst_buff_entry ibuf_temp[param->ibufs->entries], - obuf_temp[param->obufs->entries]; param->ibufs->entries comes from the user. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09Staging: sst: more dereferencing user pointersDan Carpenter
This is another patch about making a copy of the data into kernel space before using it. It is easy to trigger a kernel oops in the original code. If you passed a NULL to SNDRV_SST_SET_TARGET_DEVICE then it called BUG_ON(). And SNDRV_SST_DRIVER_INFO would let you write the information to arbitrary memory locations which is a security violation. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-09Staging: sst: dereferencing user pointersDan Carpenter
This code dereferences user supplied pointers directly instead of doing a copy_from_user(). Some kernel configs put user and kernel memory in different address spaces so this code isn't portable. Also the user memory could be swapped out or in this case the pointer could just be NULL leading to an oops. Another thing is that it makes permission tests like this sort of meaningless. if (minor == STREAM_MODULE && rec_mute->stream_id == 0) { retval = -EPERM; break; } The user could set stream_id to 1 for the test and then change it later. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15Staging: sst: more copy_to_user() changesDan Carpenter
Vinod wanted the copy_to_user() calls in this format: if (copy_to_user()) retval = -EFAULT; instead of this: retval = copy_to_user(); if (retval) retval = -EFAULt; I've done that for the whole intel_sst_app_interface.c file. In the process I noticed a couple more places that returned -EBUSY or -EAGAIN instead of -EFAULT. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15Staging: intel_sst: return -EFAULT if copy_to_user() failsDan Carpenter
copy_to_user() returns the number of bytes remaining to be copied but we want to return an error code. And that error code is -EFAULT not -EIO. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-15Staging: intel_sst: cleanup naming a littleDan Carpenter
&sst_drv_ctx->streams[str_id].lock and &stream->lock are the same. The mutex_lock() uses &stream->lock so this makes things consistent and it's nicer to read as well. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-14staging: sst: remove the kernel locking in ioctlVinod Koul
kernel locking in ioctl was introduced when ioctl function was moved from ioctl to unlocked ioctl This is no longer required hence removed Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-10staging: intel_sst: use signed int for error codesVasiliy Kulikov
As retval stores error code, it should be signed int. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-05Staging: sst: Intel SST audio driverVinod Koul
This is the Intel SST audio driver. As compared to the previous versions it has all the printks and other stuff noted cleaned up and more hardware support. The Aava support is disabled in this patch (is_aava resolves to 0) because the Aava board detection logic is not yet upstream. The driver itself is a combination of a traditional ALSA driver and a hardware assisted offload driver which can play audio while the processor is asleep but which can't do all the more interactive stuff. In the general case most software would use the ALSA interface, but the other interface is needed for certain classes of use such as music playback on highly power consumption sensitive devices. This is going to staging primarily because it depends upon the staging memrar driver. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> [Merged together and tweaked for -next] Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>